diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 22c479f8..ab098670 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 38254260-287a-40b6-9ac5-c2fcb654c9cc management: - docChecksum: 4ebd66f6415f48e48d4ff856025bbc34 - docVersion: 10.18.1 - speakeasyVersion: 1.580.0 - generationVersion: 2.654.2 - releaseVersion: 0.17.0 - configChecksum: 42a88858ca56be2168e476dbf46b7468 + docChecksum: 4b13b0469dc398831faaf2ccad969e02 + docVersion: 10.18.2 + speakeasyVersion: 1.580.1 + generationVersion: 2.656.3 + releaseVersion: 0.18.0 + configChecksum: ad5c4a18e09ee741fa2b3fe2c78e40a9 repoURL: https://github.com/apideck-libraries/sdk-java.git published: true features: @@ -14,7 +14,7 @@ features: acceptHeaders: 2.81.2 additionalDependencies: 0.1.0 constsAndDefaults: 0.1.1 - core: 3.43.0 + core: 3.44.0 deprecations: 2.81.1 downloadStreams: 0.1.1 errors: 0.5.0 @@ -120,8 +120,11 @@ generatedFiles: - docs/models/components/Branch.md - docs/models/components/By.md - docs/models/components/Categories.md + - docs/models/components/CategoriesFilter.md + - docs/models/components/CategoriesFilterType.md - docs/models/components/Category.md - docs/models/components/CategoryStatus.md + - docs/models/components/CategoryType.md - docs/models/components/Classification.md - docs/models/components/Collection.md - docs/models/components/CollectionTag.md @@ -1686,8 +1689,11 @@ generatedFiles: - src/main/java/com/apideck/unify/models/components/Branch.java - src/main/java/com/apideck/unify/models/components/By.java - src/main/java/com/apideck/unify/models/components/Categories.java + - src/main/java/com/apideck/unify/models/components/CategoriesFilter.java + - src/main/java/com/apideck/unify/models/components/CategoriesFilterType.java - src/main/java/com/apideck/unify/models/components/Category.java - src/main/java/com/apideck/unify/models/components/CategoryStatus.java + - src/main/java/com/apideck/unify/models/components/CategoryType.java - src/main/java/com/apideck/unify/models/components/Classification.java - src/main/java/com/apideck/unify/models/components/Collection.java - src/main/java/com/apideck/unify/models/components/CollectionTag.java @@ -6094,7 +6100,7 @@ examples: parameters: query: pass_through: {"search": "San Francisco"} - filter: {"start_date": "2021-01-01", "end_date": "2021-12-31", "period_count": 3, "period_type": "month"} + filter: {"start_date": "2021-01-01", "end_date": "2021-12-31", "period_count": 3, "period_type": "month", "location_id": "123"} raw: false header: x-apideck-consumer-id: "test-consumer" @@ -6146,7 +6152,7 @@ examples: parameters: query: raw: false - filter: {"customer_id": "123abc", "start_date": "2021-01-01", "end_date": "2021-12-31"} + filter: {"customer_id": "123abc", "start_date": "2021-01-01", "end_date": "2021-12-31", "location_id": "123"} pass_through: {"search": "San Francisco"} fields: "id,updated_at" header: @@ -18555,6 +18561,7 @@ examples: raw: false limit: 20 fields: "id,updated_at" + filter: {"type": "expense"} header: x-apideck-consumer-id: "test-consumer" x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" @@ -18582,13 +18589,14 @@ examples: query: raw: false fields: "id,updated_at" + filter: {"type": "expense"} header: x-apideck-consumer-id: "test-consumer" x-apideck-app-id: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX" x-apideck-service-id: "salesforce" responses: "200": - application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "categories", "operation": "one", "data": {"id": "12345", "name": "Insurance", "status": "active", "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} + application/json: {"status_code": 200, "status": "OK", "service": "xero", "resource": "categories", "operation": "one", "data": {"id": "12345", "name": "Insurance", "type": "expense", "status": "active", "row_version": "1-12345", "updated_by": "12345", "created_by": "12345", "updated_at": "2020-09-30T07:43:32.000Z", "created_at": "2020-09-30T07:43:32.000Z", "pass_through": [{"service_id": "", "extend_paths": [{"path": "$.nested.property", "value": {"TaxClassificationRef": {"value": "EUC-99990201-V1-00020000"}}}]}]}} "400": application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestValidationError", "message": "Invalid Params", "detail": "Missing property foobar", "ref": "https://developers.apideck.com/errors#requestvalidationerror"} "401": diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 182f1b78..13fbfbd8 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -21,7 +21,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false java: - version: 0.17.0 + version: 0.18.0 additionalDependencies: [] additionalPlugins: [] artifactID: unify @@ -49,7 +49,7 @@ java: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html maxMethodParams: 4 - nullFriendlyParameters: false + nullFriendlyParameters: true outputModelSuffix: output projectName: Apideck templateVersion: v2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f167532d..7dcc5787 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.580.0 +speakeasyVersion: 1.580.1 sources: Apideck-OAS: sourceNamespace: apideck-oas @@ -14,8 +14,6 @@ targets: sourceNamespace: apideck-oas sourceRevisionDigest: sha256:4e5ea980efa2d844788144660b93b76802a197d99468a03154daa316091eefdd sourceBlobDigest: sha256:275db019e800ca2644dd66201d8dc33648dcf5a2bd807a3b52c6c78675f8be2e - codeSamplesNamespace: apideck-oas-java-code-samples - codeSamplesRevisionDigest: sha256:b1525a6d983818787567be56dcb71c183ae6d93dc0d4717ac12ccdaa2ac4456d workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 58912365..e3a9498f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ For more information about the API: [Apideck Developer Docs](https://developers. * [Error Handling](#error-handling) * [Server Selection](#server-selection) * [Authentication](#authentication) + * [Debugging](#debugging) * [Development](#development) * [Maturity](#maturity) * [Contributions](#contributions) @@ -47,7 +48,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.apideck:unify:0.17.0' +implementation 'com.apideck:unify:0.18.0' ``` Maven: @@ -55,7 +56,7 @@ Maven: com.apideck unify - 0.17.0 + 0.18.0 ``` @@ -72,33 +73,6 @@ On Windows: ```bash gradlew.bat publishToMavenLocal -Pskip.signing ``` - -### Logging -A logging framework/facade has not yet been adopted but is under consideration. - -For request and response logging (especially json bodies), call `enableHTTPDebugLogging(boolean)` on the SDK builder like so: -```java -SDK.builder() - .enableHTTPDebugLogging(true) - .build(); -``` -Example output: -``` -Sending request: http://localhost:35123/bearer#global GET -Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]} -Received response: (GET http://localhost:35123/bearer#global) 200 -Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]} -Response body: -{ - "authenticated": true, - "token": "global" -} -``` -__WARNING__: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. Authorization headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`. - -__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting. - -Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies. @@ -1140,6 +1114,37 @@ public class Application { ``` + +## Debugging + +### Debug +You can setup your SDK to emit debug logs for SDK requests and responses. + +For request and response logging (especially json bodies), call `enableHTTPDebugLogging(boolean)` on the SDK builder like so: +```java +SDK.builder() + .enableHTTPDebugLogging(true) + .build(); +``` +Example output: +``` +Sending request: http://localhost:35123/bearer#global GET +Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]} +Received response: (GET http://localhost:35123/bearer#global) 200 +Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]} +Response body: +{ + "authenticated": true, + "token": "global" +} +``` +__WARNING__: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. Authorization headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`. + +__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting. + +Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies. + + # Development diff --git a/build.gradle b/build.gradle index bc5f5f87..c8fe97d2 100644 --- a/build.gradle +++ b/build.gradle @@ -105,7 +105,7 @@ publishing { // https://github.com/gradle/gradle/issues/18619 groupId = "com.apideck" artifactId = "unify" - version = "0.17.0" + version = "0.18.0" from components.java @@ -162,6 +162,7 @@ dependencies { api('org.openapitools:jackson-databind-nullable:0.2.6') {exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'} implementation 'commons-io:commons-io:2.18.0' implementation 'com.jayway.jsonpath:json-path:2.9.0' + implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0' } apply from: 'build-extras.gradle' \ No newline at end of file diff --git a/docs/models/components/BalanceSheetFilter.md b/docs/models/components/BalanceSheetFilter.md index d9a8e91a..e4a5e504 100644 --- a/docs/models/components/BalanceSheetFilter.md +++ b/docs/models/components/BalanceSheetFilter.md @@ -8,4 +8,5 @@ | ~~`startDate`~~ | *Optional\* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

The start date of the period to include in the resource. | 2021-01-01 | | `endDate` | *Optional\* | :heavy_minus_sign: | The end date of the period to include in the resource. | 2021-12-31 | | `periodCount` | *Optional\* | :heavy_minus_sign: | The number of periods to include in the resource. | 3 | -| `periodType` | [Optional\](../../models/components/PeriodType.md) | :heavy_minus_sign: | The type of period to include in the resource: month, quarter, year. | month | \ No newline at end of file +| `periodType` | [Optional\](../../models/components/PeriodType.md) | :heavy_minus_sign: | The type of period to include in the resource: month, quarter, year. | month | +| `locationId` | *Optional\* | :heavy_minus_sign: | The ID of the location to include in the resource. | 123 | \ No newline at end of file diff --git a/docs/models/components/CategoriesFilter.md b/docs/models/components/CategoriesFilter.md new file mode 100644 index 00000000..676b15da --- /dev/null +++ b/docs/models/components/CategoriesFilter.md @@ -0,0 +1,8 @@ +# CategoriesFilter + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `type` | [Optional\](../../models/components/CategoriesFilterType.md) | :heavy_minus_sign: | The type of the category. | expense | \ No newline at end of file diff --git a/docs/models/components/CategoriesFilterType.md b/docs/models/components/CategoriesFilterType.md new file mode 100644 index 00000000..db485144 --- /dev/null +++ b/docs/models/components/CategoriesFilterType.md @@ -0,0 +1,12 @@ +# CategoriesFilterType + +The type of the category. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SUPPLIER` | supplier | +| `EXPENSE` | expense | +| `REVENUE` | revenue | \ No newline at end of file diff --git a/docs/models/components/Category.md b/docs/models/components/Category.md index 3b83447b..43f5828e 100644 --- a/docs/models/components/Category.md +++ b/docs/models/components/Category.md @@ -7,6 +7,7 @@ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *Optional\* | :heavy_minus_sign: | A unique identifier for an object. | 12345 | | `name` | *Optional\* | :heavy_minus_sign: | The name of the category. | Insurance | +| `type` | [Optional\](../../models/components/CategoryType.md) | :heavy_minus_sign: | The type of the category. | expense | | `status` | [Optional\](../../models/components/CategoryStatus.md) | :heavy_minus_sign: | Based on the status some functionality is enabled or disabled. | active | | `customMappings` | Map\ | :heavy_minus_sign: | When custom mappings are configured on the resource, the result is included here. | | | `rowVersion` | *JsonNullable\* | :heavy_minus_sign: | A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. | 1-12345 | diff --git a/docs/models/components/CategoryType.md b/docs/models/components/CategoryType.md new file mode 100644 index 00000000..28a41347 --- /dev/null +++ b/docs/models/components/CategoryType.md @@ -0,0 +1,12 @@ +# CategoryType + +The type of the category. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SUPPLIER` | supplier | +| `EXPENSE` | expense | +| `REVENUE` | revenue | \ No newline at end of file diff --git a/docs/models/components/InvoiceLineItem.md b/docs/models/components/InvoiceLineItem.md index 849d83b9..141e1550 100644 --- a/docs/models/components/InvoiceLineItem.md +++ b/docs/models/components/InvoiceLineItem.md @@ -18,6 +18,7 @@ | `unitOfMeasure` | *JsonNullable\* | :heavy_minus_sign: | Description of the unit type the item is sold as, ie: kg, hour. | pc. | | `discountPercentage` | *JsonNullable\* | :heavy_minus_sign: | Discount percentage applied to the line item when supported downstream. | 0.01 | | `discountAmount` | *JsonNullable\* | :heavy_minus_sign: | Discount amount applied to the line item when supported downstream. | 19.99 | +| `categoryId` | *JsonNullable\* | :heavy_minus_sign: | ID of the category of the line item | 12345 | | `locationId` | *JsonNullable\* | :heavy_minus_sign: | The ID of the location | 12345 | | `departmentId` | *JsonNullable\* | :heavy_minus_sign: | The ID of the department | 12345 | | `item` | [Optional\](../../models/components/LinkedInvoiceItem.md) | :heavy_minus_sign: | N/A | | diff --git a/docs/models/components/InvoiceLineItemInput.md b/docs/models/components/InvoiceLineItemInput.md index fed98954..0e733d65 100644 --- a/docs/models/components/InvoiceLineItemInput.md +++ b/docs/models/components/InvoiceLineItemInput.md @@ -18,6 +18,7 @@ | `unitOfMeasure` | *JsonNullable\* | :heavy_minus_sign: | Description of the unit type the item is sold as, ie: kg, hour. | pc. | | `discountPercentage` | *JsonNullable\* | :heavy_minus_sign: | Discount percentage applied to the line item when supported downstream. | 0.01 | | `discountAmount` | *JsonNullable\* | :heavy_minus_sign: | Discount amount applied to the line item when supported downstream. | 19.99 | +| `categoryId` | *JsonNullable\* | :heavy_minus_sign: | ID of the category of the line item | 12345 | | `locationId` | *JsonNullable\* | :heavy_minus_sign: | The ID of the location | 12345 | | `departmentId` | *JsonNullable\* | :heavy_minus_sign: | The ID of the department | 12345 | | `item` | [Optional\](../../models/components/LinkedInvoiceItem.md) | :heavy_minus_sign: | N/A | | diff --git a/docs/models/components/ProfitAndLossFilter.md b/docs/models/components/ProfitAndLossFilter.md index 934cc1a1..53ac3d78 100644 --- a/docs/models/components/ProfitAndLossFilter.md +++ b/docs/models/components/ProfitAndLossFilter.md @@ -7,4 +7,5 @@ | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | | `customerId` | *Optional\* | :heavy_minus_sign: | Filter by customer id | 123abc | | `startDate` | *Optional\* | :heavy_minus_sign: | Filter by start date. If start date is given, end date is required. | 2021-01-01 | -| `endDate` | *Optional\* | :heavy_minus_sign: | Filter by end date. If end date is given, start date is required. | 2021-12-31 | \ No newline at end of file +| `endDate` | *Optional\* | :heavy_minus_sign: | Filter by end date. If end date is given, start date is required. | 2021-12-31 | +| `locationId` | *Optional\* | :heavy_minus_sign: | Filter by location id | 123 | \ No newline at end of file diff --git a/docs/models/operations/AccountingBalanceSheetOneRequest.md b/docs/models/operations/AccountingBalanceSheetOneRequest.md index 3433b9ba..1771a52d 100644 --- a/docs/models/operations/AccountingBalanceSheetOneRequest.md +++ b/docs/models/operations/AccountingBalanceSheetOneRequest.md @@ -9,5 +9,5 @@ | `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | | `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | | `passThrough` | Map\ | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | -| `filter` | [Optional\](../../models/components/BalanceSheetFilter.md) | :heavy_minus_sign: | Apply filters | {
"start_date": "2021-01-01",
"end_date": "2021-12-31",
"period_count": 3,
"period_type": "month"
} | +| `filter` | [Optional\](../../models/components/BalanceSheetFilter.md) | :heavy_minus_sign: | Apply filters | {
"start_date": "2021-01-01",
"end_date": "2021-12-31",
"period_count": 3,
"period_type": "month",
"location_id": "123"
} | | `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | \ No newline at end of file diff --git a/docs/models/operations/AccountingCategoriesAllRequest.md b/docs/models/operations/AccountingCategoriesAllRequest.md index 7e511798..f869e3a8 100644 --- a/docs/models/operations/AccountingCategoriesAllRequest.md +++ b/docs/models/operations/AccountingCategoriesAllRequest.md @@ -11,4 +11,5 @@ | `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | | `cursor` | *JsonNullable\* | :heavy_minus_sign: | Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. | | | `limit` | *Optional\* | :heavy_minus_sign: | Number of results to return. Minimum 1, Maximum 200, Default 20 | | -| `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | \ No newline at end of file +| `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `filter` | [Optional\](../../models/components/CategoriesFilter.md) | :heavy_minus_sign: | Apply filters | {
"type": "expense"
} | \ No newline at end of file diff --git a/docs/models/operations/AccountingCategoriesOneRequest.md b/docs/models/operations/AccountingCategoriesOneRequest.md index 1f758df2..41bbe995 100644 --- a/docs/models/operations/AccountingCategoriesOneRequest.md +++ b/docs/models/operations/AccountingCategoriesOneRequest.md @@ -10,4 +10,5 @@ | `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | | `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | | `raw` | *Optional\* | :heavy_minus_sign: | Include raw response. Mostly used for debugging purposes | | -| `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | \ No newline at end of file +| `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | +| `filter` | [Optional\](../../models/components/CategoriesFilter.md) | :heavy_minus_sign: | Apply filters | {
"type": "expense"
} | \ No newline at end of file diff --git a/docs/models/operations/AccountingProfitAndLossOneRequest.md b/docs/models/operations/AccountingProfitAndLossOneRequest.md index d2e0cd89..b3c342c1 100644 --- a/docs/models/operations/AccountingProfitAndLossOneRequest.md +++ b/docs/models/operations/AccountingProfitAndLossOneRequest.md @@ -9,6 +9,6 @@ | `consumerId` | *Optional\* | :heavy_minus_sign: | ID of the consumer which you want to get or push data from | test-consumer | | `appId` | *Optional\* | :heavy_minus_sign: | The ID of your Unify application | dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX | | `serviceId` | *Optional\* | :heavy_minus_sign: | Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. | salesforce | -| `filter` | [Optional\](../../models/components/ProfitAndLossFilter.md) | :heavy_minus_sign: | Apply filters | {
"customer_id": "123abc",
"start_date": "2021-01-01",
"end_date": "2021-12-31"
} | +| `filter` | [Optional\](../../models/components/ProfitAndLossFilter.md) | :heavy_minus_sign: | Apply filters | {
"customer_id": "123abc",
"start_date": "2021-01-01",
"end_date": "2021-12-31",
"location_id": "123"
} | | `passThrough` | Map\ | :heavy_minus_sign: | Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads | {
"search": "San Francisco"
} | | `fields` | *JsonNullable\* | :heavy_minus_sign: | The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation.

Example: `fields=name,email,addresses.city`

In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. | id,updated_at | \ No newline at end of file diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index a50ca776..e6030a67 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -102,7 +102,6 @@ import com.apideck.unify.models.operations.CrmActivitiesAddResponse; import java.lang.Exception; import java.util.List; import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; public class Application { @@ -187,7 +186,7 @@ public class Application { .id("2389328923893298") .name("employee_level") .description("Employee Level") - .value(JsonNullable.of(null)) + .value(null) .build())) .attendees(List.of( ActivityAttendeeInput.builder() diff --git a/docs/sdks/billpayments/README.md b/docs/sdks/billpayments/README.md index 885c35d3..39082e55 100644 --- a/docs/sdks/billpayments/README.md +++ b/docs/sdks/billpayments/README.md @@ -351,7 +351,6 @@ import java.lang.Exception; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; public class Application { @@ -434,7 +433,7 @@ public class Application { .build())) .note("Some notes about this transaction") .number("123456") - .trackingCategories(JsonNullable.of(null)) + .trackingCategories(null) .customFields(List.of( CustomField.builder() .id("2389328923893298") diff --git a/docs/sdks/bills/README.md b/docs/sdks/bills/README.md index b0e70222..198ce692 100644 --- a/docs/sdks/bills/README.md +++ b/docs/sdks/bills/README.md @@ -103,7 +103,6 @@ import java.lang.Exception; import java.time.LocalDate; import java.util.List; import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; public class Application { @@ -235,7 +234,7 @@ public class Application { .build()) .discountPercentage(5.5) .sourceDocumentUrl("https://www.invoicesolution.com/bill/123456") - .trackingCategories(JsonNullable.of(null)) + .trackingCategories(null) .rowVersion("1-12345") .customFields(List.of( CustomField.builder() diff --git a/docs/sdks/categories/README.md b/docs/sdks/categories/README.md index d244aa8c..248c9c42 100644 --- a/docs/sdks/categories/README.md +++ b/docs/sdks/categories/README.md @@ -18,6 +18,8 @@ List Categories package hello.world; import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.CategoriesFilter; +import com.apideck.unify.models.components.CategoriesFilterType; import com.apideck.unify.models.errors.*; import com.apideck.unify.models.operations.AccountingCategoriesAllRequest; import com.apideck.unify.models.operations.AccountingCategoriesAllResponse; @@ -36,6 +38,9 @@ public class Application { AccountingCategoriesAllRequest req = AccountingCategoriesAllRequest.builder() .serviceId("salesforce") .fields("id,updated_at") + .filter(CategoriesFilter.builder() + .type(CategoriesFilterType.EXPENSE) + .build()) .build(); sdk.accounting().categories().list() @@ -80,6 +85,8 @@ Get Category package hello.world; import com.apideck.unify.Apideck; +import com.apideck.unify.models.components.CategoriesFilter; +import com.apideck.unify.models.components.CategoriesFilterType; import com.apideck.unify.models.errors.*; import com.apideck.unify.models.operations.AccountingCategoriesOneRequest; import com.apideck.unify.models.operations.AccountingCategoriesOneResponse; @@ -99,6 +106,9 @@ public class Application { .id("") .serviceId("salesforce") .fields("id,updated_at") + .filter(CategoriesFilter.builder() + .type(CategoriesFilterType.EXPENSE) + .build()) .build(); AccountingCategoriesOneResponse res = sdk.accounting().categories().get() diff --git a/docs/sdks/customers/README.md b/docs/sdks/customers/README.md index 52d72df1..3e3be12a 100644 --- a/docs/sdks/customers/README.md +++ b/docs/sdks/customers/README.md @@ -109,7 +109,6 @@ import com.apideck.unify.models.operations.AccountingCustomersAddResponse; import java.lang.Exception; import java.util.List; import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; public class Application { @@ -243,19 +242,19 @@ public class Application { .id("2389328923893298") .name("employee_level") .description("Employee Level") - .value(JsonNullable.of(null)) + .value(null) .build(), CustomField.builder() .id("2389328923893298") .name("employee_level") .description("Employee Level") - .value(JsonNullable.of(null)) + .value(null) .build(), CustomField.builder() .id("2389328923893298") .name("employee_level") .description("Employee Level") - .value(JsonNullable.of(null)) + .value(null) .build())) .rowVersion("1-12345") .passThrough(List.of( diff --git a/docs/sdks/invoiceitems/README.md b/docs/sdks/invoiceitems/README.md index 8132386c..0f0afdc9 100644 --- a/docs/sdks/invoiceitems/README.md +++ b/docs/sdks/invoiceitems/README.md @@ -103,7 +103,6 @@ import java.lang.Exception; import java.time.LocalDate; import java.util.List; import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; public class Application { @@ -161,7 +160,7 @@ public class Application { .nominalCode("N091") .code("453") .build()) - .trackingCategories(JsonNullable.of(null)) + .trackingCategories(null) .active(true) .departmentId("12345") .locationId("12345") @@ -307,7 +306,6 @@ import java.lang.Exception; import java.time.LocalDate; import java.util.List; import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; public class Application { @@ -356,7 +354,7 @@ public class Application { .nominalCode("N091") .code("453") .build()) - .incomeAccount(JsonNullable.of(null)) + .incomeAccount(null) .expenseAccount(LinkedLedgerAccountInput.builder() .id("123456") .nominalCode("N091") diff --git a/docs/sdks/invoices/README.md b/docs/sdks/invoices/README.md index fe1734a7..6247405e 100644 --- a/docs/sdks/invoices/README.md +++ b/docs/sdks/invoices/README.md @@ -106,7 +106,6 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; public class Application { @@ -183,7 +182,7 @@ public class Application { .id("123456") .name("New York") .build())) - .ledgerAccount(JsonNullable.of(null)) + .ledgerAccount(null) .customFields(List.of( CustomField.builder() .id("2389328923893298") @@ -436,7 +435,6 @@ import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; public class Application { @@ -532,19 +530,19 @@ public class Application { .id("2389328923893298") .name("employee_level") .description("Employee Level") - .value(JsonNullable.of(null)) + .value(null) .build(), CustomField.builder() .id("2389328923893298") .name("employee_level") .description("Employee Level") - .value(JsonNullable.of(null)) + .value(null) .build(), CustomField.builder() .id("2389328923893298") .name("employee_level") .description("Employee Level") - .value(JsonNullable.of(null)) + .value(null) .build())) .rowVersion("1-12345") .build())) @@ -640,7 +638,7 @@ public class Application { .id("2389328923893298") .name("employee_level") .description("Employee Level") - .value(JsonNullable.of(null)) + .value(null) .build())) .rowVersion("1-12345") .passThrough(List.of( diff --git a/docs/sdks/journalentries/README.md b/docs/sdks/journalentries/README.md index db3545d6..e81807b7 100644 --- a/docs/sdks/journalentries/README.md +++ b/docs/sdks/journalentries/README.md @@ -103,7 +103,6 @@ import java.lang.Exception; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; public class Application { @@ -196,7 +195,7 @@ public class Application { .taxType("sales") .taxCode("1234") .number("OIT00546") - .trackingCategories(JsonNullable.of(null)) + .trackingCategories(null) .accountingPeriod("01-24") .rowVersion("1-12345") .customFields(List.of( diff --git a/docs/sdks/purchaseorders/README.md b/docs/sdks/purchaseorders/README.md index 032877a4..6d3442a0 100644 --- a/docs/sdks/purchaseorders/README.md +++ b/docs/sdks/purchaseorders/README.md @@ -523,7 +523,6 @@ import java.lang.Exception; import java.time.LocalDate; import java.util.List; import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; public class Application { @@ -608,7 +607,7 @@ public class Application { .id("123456") .rate(10d) .build()) - .trackingCategories(JsonNullable.of(null)) + .trackingCategories(null) .ledgerAccount(LinkedLedgerAccountInput.builder() .id("123456") .nominalCode("N091") @@ -660,7 +659,7 @@ public class Application { .id("123456") .rate(10d) .build()) - .trackingCategories(JsonNullable.of(null)) + .trackingCategories(null) .ledgerAccount(LinkedLedgerAccountInput.builder() .id("123456") .nominalCode("N091") diff --git a/gradle.properties b/gradle.properties index 1ead0551..0ee30dd0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ groupId=com.apideck artifactId=unify -version=0.17.0 \ No newline at end of file +version=0.18.0 \ No newline at end of file diff --git a/src/main/java/com/apideck/unify/Activities.java b/src/main/java/com/apideck/unify/Activities.java index bfe3741b..8321fdf8 100644 --- a/src/main/java/com/apideck/unify/Activities.java +++ b/src/main/java/com/apideck/unify/Activities.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.CrmActivitiesOneOperation; import com.apideck.unify.operations.CrmActivitiesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public CrmActivitiesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmActivitiesAllResponse list(CrmActivitiesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public CrmActivitiesAllResponse list(@Nonnull CrmActivitiesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public CrmActivitiesAllResponse list(CrmActivitiesAllRequest request) throws Exc * @throws Exception if the API call fails */ public CrmActivitiesAllResponse list( - CrmActivitiesAllRequest request, - Optional options) throws Exception { + @Nonnull CrmActivitiesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmActivitiesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public CrmActivitiesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmActivitiesAddResponse create(CrmActivitiesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public CrmActivitiesAddResponse create(@Nonnull CrmActivitiesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public CrmActivitiesAddResponse create(CrmActivitiesAddRequest request) throws E * @throws Exception if the API call fails */ public CrmActivitiesAddResponse create( - CrmActivitiesAddRequest request, - Optional options) throws Exception { + @Nonnull CrmActivitiesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmActivitiesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public CrmActivitiesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmActivitiesOneResponse get(CrmActivitiesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public CrmActivitiesOneResponse get(@Nonnull CrmActivitiesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public CrmActivitiesOneResponse get(CrmActivitiesOneRequest request) throws Exce * @throws Exception if the API call fails */ public CrmActivitiesOneResponse get( - CrmActivitiesOneRequest request, - Optional options) throws Exception { + @Nonnull CrmActivitiesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmActivitiesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public CrmActivitiesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmActivitiesUpdateResponse update(CrmActivitiesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public CrmActivitiesUpdateResponse update(@Nonnull CrmActivitiesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public CrmActivitiesUpdateResponse update(CrmActivitiesUpdateRequest request) th * @throws Exception if the API call fails */ public CrmActivitiesUpdateResponse update( - CrmActivitiesUpdateRequest request, - Optional options) throws Exception { + @Nonnull CrmActivitiesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmActivitiesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public CrmActivitiesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmActivitiesDeleteResponse delete(CrmActivitiesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public CrmActivitiesDeleteResponse delete(@Nonnull CrmActivitiesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public CrmActivitiesDeleteResponse delete(CrmActivitiesDeleteRequest request) th * @throws Exception if the API call fails */ public CrmActivitiesDeleteResponse delete( - CrmActivitiesDeleteRequest request, - Optional options) throws Exception { + @Nonnull CrmActivitiesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmActivitiesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/AgedCreditors.java b/src/main/java/com/apideck/unify/AgedCreditors.java index 807d0620..64b48c80 100644 --- a/src/main/java/com/apideck/unify/AgedCreditors.java +++ b/src/main/java/com/apideck/unify/AgedCreditors.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.AccountingAgedCreditorsOneResponse; import com.apideck.unify.operations.AccountingAgedCreditorsOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public AccountingAgedCreditorsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingAgedCreditorsOneResponse get(AccountingAgedCreditorsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingAgedCreditorsOneResponse get(@Nonnull AccountingAgedCreditorsOneRequest request) throws Exception { + return get(request, null); } /** @@ -56,8 +58,8 @@ public AccountingAgedCreditorsOneResponse get(AccountingAgedCreditorsOneRequest * @throws Exception if the API call fails */ public AccountingAgedCreditorsOneResponse get( - AccountingAgedCreditorsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingAgedCreditorsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingAgedCreditorsOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/AgedDebtors.java b/src/main/java/com/apideck/unify/AgedDebtors.java index b2375db3..0171b69f 100644 --- a/src/main/java/com/apideck/unify/AgedDebtors.java +++ b/src/main/java/com/apideck/unify/AgedDebtors.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.AccountingAgedDebtorsOneResponse; import com.apideck.unify.operations.AccountingAgedDebtorsOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public AccountingAgedDebtorsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingAgedDebtorsOneResponse get(AccountingAgedDebtorsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingAgedDebtorsOneResponse get(@Nonnull AccountingAgedDebtorsOneRequest request) throws Exception { + return get(request, null); } /** @@ -56,8 +58,8 @@ public AccountingAgedDebtorsOneResponse get(AccountingAgedDebtorsOneRequest requ * @throws Exception if the API call fails */ public AccountingAgedDebtorsOneResponse get( - AccountingAgedDebtorsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingAgedDebtorsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingAgedDebtorsOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ApiResourceCoverage.java b/src/main/java/com/apideck/unify/ApiResourceCoverage.java index e0fbb656..72bf03b5 100644 --- a/src/main/java/com/apideck/unify/ApiResourceCoverage.java +++ b/src/main/java/com/apideck/unify/ApiResourceCoverage.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.ConnectorApiResourceCoverageOneResponse; import com.apideck.unify.operations.ConnectorApiResourceCoverageOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; import java.util.List; @@ -44,10 +46,10 @@ public ConnectorApiResourceCoverageOneRequestBuilder get() { * @throws Exception if the API call fails */ public ConnectorApiResourceCoverageOneResponse get( - String id, - String resourceId) throws Exception { - return get(Optional.empty(), id, resourceId, - Optional.empty()); + @Nonnull String id, + @Nonnull String resourceId) throws Exception { + return get(null, id, resourceId, + null); } /** @@ -63,17 +65,14 @@ public ConnectorApiResourceCoverageOneResponse get( * @throws Exception if the API call fails */ public ConnectorApiResourceCoverageOneResponse get( - Optional appId, - String id, - String resourceId, - Optional options) throws Exception { - ConnectorApiResourceCoverageOneRequest request = - ConnectorApiResourceCoverageOneRequest - .builder() - .appId(appId) - .id(id) - .resourceId(resourceId) - .build(); + @Nullable String appId, + @Nonnull String id, + @Nonnull String resourceId, + @Nullable Options options) throws Exception { + ConnectorApiResourceCoverageOneRequest request = new ConnectorApiResourceCoverageOneRequest( + appId, + id, + resourceId); RequestOperation operation = new ConnectorApiResourceCoverageOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ApiResources.java b/src/main/java/com/apideck/unify/ApiResources.java index 85b5751e..b3ba33a0 100644 --- a/src/main/java/com/apideck/unify/ApiResources.java +++ b/src/main/java/com/apideck/unify/ApiResources.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.ConnectorApiResourcesOneResponse; import com.apideck.unify.operations.ConnectorApiResourcesOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; import java.util.List; @@ -44,10 +46,10 @@ public ConnectorApiResourcesOneRequestBuilder get() { * @throws Exception if the API call fails */ public ConnectorApiResourcesOneResponse get( - String id, - String resourceId) throws Exception { - return get(Optional.empty(), id, resourceId, - Optional.empty()); + @Nonnull String id, + @Nonnull String resourceId) throws Exception { + return get(null, id, resourceId, + null); } /** @@ -63,17 +65,14 @@ public ConnectorApiResourcesOneResponse get( * @throws Exception if the API call fails */ public ConnectorApiResourcesOneResponse get( - Optional appId, - String id, - String resourceId, - Optional options) throws Exception { - ConnectorApiResourcesOneRequest request = - ConnectorApiResourcesOneRequest - .builder() - .appId(appId) - .id(id) - .resourceId(resourceId) - .build(); + @Nullable String appId, + @Nonnull String id, + @Nonnull String resourceId, + @Nullable Options options) throws Exception { + ConnectorApiResourcesOneRequest request = new ConnectorApiResourcesOneRequest( + appId, + id, + resourceId); RequestOperation operation = new ConnectorApiResourcesOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ApideckCompanies.java b/src/main/java/com/apideck/unify/ApideckCompanies.java index 003c53b5..47ae295b 100644 --- a/src/main/java/com/apideck/unify/ApideckCompanies.java +++ b/src/main/java/com/apideck/unify/ApideckCompanies.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.HrisCompaniesOneOperation; import com.apideck.unify.operations.HrisCompaniesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public HrisCompaniesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisCompaniesAllResponse list(HrisCompaniesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public HrisCompaniesAllResponse list(@Nonnull HrisCompaniesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public HrisCompaniesAllResponse list(HrisCompaniesAllRequest request) throws Exc * @throws Exception if the API call fails */ public HrisCompaniesAllResponse list( - HrisCompaniesAllRequest request, - Optional options) throws Exception { + @Nonnull HrisCompaniesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisCompaniesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public HrisCompaniesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisCompaniesAddResponse create(HrisCompaniesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public HrisCompaniesAddResponse create(@Nonnull HrisCompaniesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public HrisCompaniesAddResponse create(HrisCompaniesAddRequest request) throws E * @throws Exception if the API call fails */ public HrisCompaniesAddResponse create( - HrisCompaniesAddRequest request, - Optional options) throws Exception { + @Nonnull HrisCompaniesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisCompaniesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public HrisCompaniesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisCompaniesOneResponse get(HrisCompaniesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public HrisCompaniesOneResponse get(@Nonnull HrisCompaniesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public HrisCompaniesOneResponse get(HrisCompaniesOneRequest request) throws Exce * @throws Exception if the API call fails */ public HrisCompaniesOneResponse get( - HrisCompaniesOneRequest request, - Optional options) throws Exception { + @Nonnull HrisCompaniesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisCompaniesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public HrisCompaniesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisCompaniesUpdateResponse update(HrisCompaniesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public HrisCompaniesUpdateResponse update(@Nonnull HrisCompaniesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public HrisCompaniesUpdateResponse update(HrisCompaniesUpdateRequest request) th * @throws Exception if the API call fails */ public HrisCompaniesUpdateResponse update( - HrisCompaniesUpdateRequest request, - Optional options) throws Exception { + @Nonnull HrisCompaniesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisCompaniesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public HrisCompaniesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisCompaniesDeleteResponse delete(HrisCompaniesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public HrisCompaniesDeleteResponse delete(@Nonnull HrisCompaniesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public HrisCompaniesDeleteResponse delete(HrisCompaniesDeleteRequest request) th * @throws Exception if the API call fails */ public HrisCompaniesDeleteResponse delete( - HrisCompaniesDeleteRequest request, - Optional options) throws Exception { + @Nonnull HrisCompaniesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisCompaniesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ApideckCustomers.java b/src/main/java/com/apideck/unify/ApideckCustomers.java index f9f3e183..6e1300ec 100644 --- a/src/main/java/com/apideck/unify/ApideckCustomers.java +++ b/src/main/java/com/apideck/unify/ApideckCustomers.java @@ -14,6 +14,8 @@ import com.apideck.unify.operations.EcommerceCustomersAllOperation; import com.apideck.unify.operations.EcommerceCustomersOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -45,8 +47,8 @@ public EcommerceCustomersAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public EcommerceCustomersAllResponse list(EcommerceCustomersAllRequest request) throws Exception { - return list(request, Optional.empty()); + public EcommerceCustomersAllResponse list(@Nonnull EcommerceCustomersAllRequest request) throws Exception { + return list(request, null); } /** @@ -60,8 +62,8 @@ public EcommerceCustomersAllResponse list(EcommerceCustomersAllRequest request) * @throws Exception if the API call fails */ public EcommerceCustomersAllResponse list( - EcommerceCustomersAllRequest request, - Optional options) throws Exception { + @Nonnull EcommerceCustomersAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new EcommerceCustomersAllOperation( sdkConfiguration, @@ -89,8 +91,8 @@ public EcommerceCustomersOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public EcommerceCustomersOneResponse get(EcommerceCustomersOneRequest request) throws Exception { - return get(request, Optional.empty()); + public EcommerceCustomersOneResponse get(@Nonnull EcommerceCustomersOneRequest request) throws Exception { + return get(request, null); } /** @@ -104,8 +106,8 @@ public EcommerceCustomersOneResponse get(EcommerceCustomersOneRequest request) t * @throws Exception if the API call fails */ public EcommerceCustomersOneResponse get( - EcommerceCustomersOneRequest request, - Optional options) throws Exception { + @Nonnull EcommerceCustomersOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new EcommerceCustomersOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ApideckDepartments.java b/src/main/java/com/apideck/unify/ApideckDepartments.java index 12c14677..936898dd 100644 --- a/src/main/java/com/apideck/unify/ApideckDepartments.java +++ b/src/main/java/com/apideck/unify/ApideckDepartments.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.HrisDepartmentsOneOperation; import com.apideck.unify.operations.HrisDepartmentsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public HrisDepartmentsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisDepartmentsAllResponse list(HrisDepartmentsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public HrisDepartmentsAllResponse list(@Nonnull HrisDepartmentsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public HrisDepartmentsAllResponse list(HrisDepartmentsAllRequest request) throws * @throws Exception if the API call fails */ public HrisDepartmentsAllResponse list( - HrisDepartmentsAllRequest request, - Optional options) throws Exception { + @Nonnull HrisDepartmentsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisDepartmentsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public HrisDepartmentsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisDepartmentsAddResponse create(HrisDepartmentsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public HrisDepartmentsAddResponse create(@Nonnull HrisDepartmentsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public HrisDepartmentsAddResponse create(HrisDepartmentsAddRequest request) thro * @throws Exception if the API call fails */ public HrisDepartmentsAddResponse create( - HrisDepartmentsAddRequest request, - Optional options) throws Exception { + @Nonnull HrisDepartmentsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisDepartmentsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public HrisDepartmentsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisDepartmentsOneResponse get(HrisDepartmentsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public HrisDepartmentsOneResponse get(@Nonnull HrisDepartmentsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public HrisDepartmentsOneResponse get(HrisDepartmentsOneRequest request) throws * @throws Exception if the API call fails */ public HrisDepartmentsOneResponse get( - HrisDepartmentsOneRequest request, - Optional options) throws Exception { + @Nonnull HrisDepartmentsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisDepartmentsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public HrisDepartmentsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisDepartmentsUpdateResponse update(HrisDepartmentsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public HrisDepartmentsUpdateResponse update(@Nonnull HrisDepartmentsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public HrisDepartmentsUpdateResponse update(HrisDepartmentsUpdateRequest request * @throws Exception if the API call fails */ public HrisDepartmentsUpdateResponse update( - HrisDepartmentsUpdateRequest request, - Optional options) throws Exception { + @Nonnull HrisDepartmentsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisDepartmentsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public HrisDepartmentsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisDepartmentsDeleteResponse delete(HrisDepartmentsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public HrisDepartmentsDeleteResponse delete(@Nonnull HrisDepartmentsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public HrisDepartmentsDeleteResponse delete(HrisDepartmentsDeleteRequest request * @throws Exception if the API call fails */ public HrisDepartmentsDeleteResponse delete( - HrisDepartmentsDeleteRequest request, - Optional options) throws Exception { + @Nonnull HrisDepartmentsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisDepartmentsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Apis.java b/src/main/java/com/apideck/unify/Apis.java index 9896cd34..2749d1e3 100644 --- a/src/main/java/com/apideck/unify/Apis.java +++ b/src/main/java/com/apideck/unify/Apis.java @@ -15,6 +15,8 @@ import com.apideck.unify.operations.ConnectorApisAllOperation; import com.apideck.unify.operations.ConnectorApisOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.Long; import java.lang.String; @@ -49,8 +51,8 @@ public ConnectorApisAllRequestBuilder list() { * @throws Exception if the API call fails */ public ConnectorApisAllResponse listDirect() throws Exception { - return list(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty()); + return list(null, JsonNullable.undefined(), null, + null, null); } /** @@ -67,19 +69,16 @@ public ConnectorApisAllResponse listDirect() throws Exception { * @throws Exception if the API call fails */ public ConnectorApisAllResponse list( - Optional appId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional options) throws Exception { - ConnectorApisAllRequest request = - ConnectorApisAllRequest - .builder() - .appId(appId) - .cursor(cursor) - .limit(limit) - .filter(filter) - .build(); + @Nullable String appId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable ApisFilter filter, + @Nullable Options options) throws Exception { + ConnectorApisAllRequest request = new ConnectorApisAllRequest( + appId, + cursor, + limit, + filter); RequestOperation operation = new ConnectorApisAllOperation( sdkConfiguration, @@ -107,8 +106,8 @@ public ConnectorApisOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public ConnectorApisOneResponse get(String id) throws Exception { - return get(Optional.empty(), id, Optional.empty()); + public ConnectorApisOneResponse get(@Nonnull String id) throws Exception { + return get(null, id, null); } /** @@ -123,15 +122,12 @@ public ConnectorApisOneResponse get(String id) throws Exception { * @throws Exception if the API call fails */ public ConnectorApisOneResponse get( - Optional appId, - String id, - Optional options) throws Exception { - ConnectorApisOneRequest request = - ConnectorApisOneRequest - .builder() - .appId(appId) - .id(id) - .build(); + @Nullable String appId, + @Nonnull String id, + @Nullable Options options) throws Exception { + ConnectorApisOneRequest request = new ConnectorApisOneRequest( + appId, + id); RequestOperation operation = new ConnectorApisOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Applicants.java b/src/main/java/com/apideck/unify/Applicants.java index 113aa645..9a8fbc1d 100644 --- a/src/main/java/com/apideck/unify/Applicants.java +++ b/src/main/java/com/apideck/unify/Applicants.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AtsApplicantsOneOperation; import com.apideck.unify.operations.AtsApplicantsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AtsApplicantsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsApplicantsAllResponse list(AtsApplicantsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AtsApplicantsAllResponse list(@Nonnull AtsApplicantsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AtsApplicantsAllResponse list(AtsApplicantsAllRequest request) throws Exc * @throws Exception if the API call fails */ public AtsApplicantsAllResponse list( - AtsApplicantsAllRequest request, - Optional options) throws Exception { + @Nonnull AtsApplicantsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsApplicantsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AtsApplicantsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsApplicantsAddResponse create(AtsApplicantsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AtsApplicantsAddResponse create(@Nonnull AtsApplicantsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AtsApplicantsAddResponse create(AtsApplicantsAddRequest request) throws E * @throws Exception if the API call fails */ public AtsApplicantsAddResponse create( - AtsApplicantsAddRequest request, - Optional options) throws Exception { + @Nonnull AtsApplicantsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsApplicantsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AtsApplicantsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsApplicantsOneResponse get(AtsApplicantsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AtsApplicantsOneResponse get(@Nonnull AtsApplicantsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AtsApplicantsOneResponse get(AtsApplicantsOneRequest request) throws Exce * @throws Exception if the API call fails */ public AtsApplicantsOneResponse get( - AtsApplicantsOneRequest request, - Optional options) throws Exception { + @Nonnull AtsApplicantsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsApplicantsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AtsApplicantsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsApplicantsUpdateResponse update(AtsApplicantsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AtsApplicantsUpdateResponse update(@Nonnull AtsApplicantsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AtsApplicantsUpdateResponse update(AtsApplicantsUpdateRequest request) th * @throws Exception if the API call fails */ public AtsApplicantsUpdateResponse update( - AtsApplicantsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AtsApplicantsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsApplicantsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AtsApplicantsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsApplicantsDeleteResponse delete(AtsApplicantsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AtsApplicantsDeleteResponse delete(@Nonnull AtsApplicantsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AtsApplicantsDeleteResponse delete(AtsApplicantsDeleteRequest request) th * @throws Exception if the API call fails */ public AtsApplicantsDeleteResponse delete( - AtsApplicantsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AtsApplicantsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsApplicantsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Applications.java b/src/main/java/com/apideck/unify/Applications.java index e95010dd..1a31cf6f 100644 --- a/src/main/java/com/apideck/unify/Applications.java +++ b/src/main/java/com/apideck/unify/Applications.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AtsApplicationsOneOperation; import com.apideck.unify.operations.AtsApplicationsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AtsApplicationsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsApplicationsAllResponse list(AtsApplicationsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AtsApplicationsAllResponse list(@Nonnull AtsApplicationsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AtsApplicationsAllResponse list(AtsApplicationsAllRequest request) throws * @throws Exception if the API call fails */ public AtsApplicationsAllResponse list( - AtsApplicationsAllRequest request, - Optional options) throws Exception { + @Nonnull AtsApplicationsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsApplicationsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AtsApplicationsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsApplicationsAddResponse create(AtsApplicationsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AtsApplicationsAddResponse create(@Nonnull AtsApplicationsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AtsApplicationsAddResponse create(AtsApplicationsAddRequest request) thro * @throws Exception if the API call fails */ public AtsApplicationsAddResponse create( - AtsApplicationsAddRequest request, - Optional options) throws Exception { + @Nonnull AtsApplicationsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsApplicationsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AtsApplicationsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsApplicationsOneResponse get(AtsApplicationsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AtsApplicationsOneResponse get(@Nonnull AtsApplicationsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AtsApplicationsOneResponse get(AtsApplicationsOneRequest request) throws * @throws Exception if the API call fails */ public AtsApplicationsOneResponse get( - AtsApplicationsOneRequest request, - Optional options) throws Exception { + @Nonnull AtsApplicationsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsApplicationsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AtsApplicationsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsApplicationsUpdateResponse update(AtsApplicationsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AtsApplicationsUpdateResponse update(@Nonnull AtsApplicationsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AtsApplicationsUpdateResponse update(AtsApplicationsUpdateRequest request * @throws Exception if the API call fails */ public AtsApplicationsUpdateResponse update( - AtsApplicationsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AtsApplicationsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsApplicationsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AtsApplicationsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsApplicationsDeleteResponse delete(AtsApplicationsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AtsApplicationsDeleteResponse delete(@Nonnull AtsApplicationsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AtsApplicationsDeleteResponse delete(AtsApplicationsDeleteRequest request * @throws Exception if the API call fails */ public AtsApplicationsDeleteResponse delete( - AtsApplicationsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AtsApplicationsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsApplicationsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Attachments.java b/src/main/java/com/apideck/unify/Attachments.java index 63911d05..8324d489 100644 --- a/src/main/java/com/apideck/unify/Attachments.java +++ b/src/main/java/com/apideck/unify/Attachments.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingAttachmentsOneOperation; import com.apideck.unify.operations.AccountingAttachmentsUploadOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; import java.util.List; @@ -58,8 +60,8 @@ public AccountingAttachmentsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingAttachmentsAllResponse list(AccountingAttachmentsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingAttachmentsAllResponse list(@Nonnull AccountingAttachmentsAllRequest request) throws Exception { + return list(request, null); } /** @@ -73,8 +75,8 @@ public AccountingAttachmentsAllResponse list(AccountingAttachmentsAllRequest req * @throws Exception if the API call fails */ public AccountingAttachmentsAllResponse list( - AccountingAttachmentsAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingAttachmentsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingAttachmentsAllOperation( sdkConfiguration, @@ -102,8 +104,8 @@ public AccountingAttachmentsUploadRequestBuilder upload() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingAttachmentsUploadResponse upload(AccountingAttachmentsUploadRequest request) throws Exception { - return upload(request, Optional.empty(), Optional.empty()); + public AccountingAttachmentsUploadResponse upload(@Nonnull AccountingAttachmentsUploadRequest request) throws Exception { + return upload(request, null, null); } /** @@ -118,9 +120,9 @@ public AccountingAttachmentsUploadResponse upload(AccountingAttachmentsUploadReq * @throws Exception if the API call fails */ public AccountingAttachmentsUploadResponse upload( - AccountingAttachmentsUploadRequest request, - Optional serverURL, - Optional options) throws Exception { + @Nonnull AccountingAttachmentsUploadRequest request, + @Nullable String serverURL, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingAttachmentsUploadOperation( sdkConfiguration, @@ -149,8 +151,8 @@ public AccountingAttachmentsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingAttachmentsOneResponse get(AccountingAttachmentsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingAttachmentsOneResponse get(@Nonnull AccountingAttachmentsOneRequest request) throws Exception { + return get(request, null); } /** @@ -164,8 +166,8 @@ public AccountingAttachmentsOneResponse get(AccountingAttachmentsOneRequest requ * @throws Exception if the API call fails */ public AccountingAttachmentsOneResponse get( - AccountingAttachmentsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingAttachmentsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingAttachmentsOneOperation( sdkConfiguration, @@ -193,8 +195,8 @@ public AccountingAttachmentsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingAttachmentsDeleteResponse delete(AccountingAttachmentsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingAttachmentsDeleteResponse delete(@Nonnull AccountingAttachmentsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -208,8 +210,8 @@ public AccountingAttachmentsDeleteResponse delete(AccountingAttachmentsDeleteReq * @throws Exception if the API call fails */ public AccountingAttachmentsDeleteResponse delete( - AccountingAttachmentsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingAttachmentsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingAttachmentsDeleteOperation( sdkConfiguration, @@ -237,8 +239,8 @@ public AccountingAttachmentsDownloadRequestBuilder download() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingAttachmentsDownloadResponse download(AccountingAttachmentsDownloadRequest request) throws Exception { - return download(request, Optional.empty()); + public AccountingAttachmentsDownloadResponse download(@Nonnull AccountingAttachmentsDownloadRequest request) throws Exception { + return download(request, null); } /** @@ -252,8 +254,8 @@ public AccountingAttachmentsDownloadResponse download(AccountingAttachmentsDownl * @throws Exception if the API call fails */ public AccountingAttachmentsDownloadResponse download( - AccountingAttachmentsDownloadRequest request, - Optional options) throws Exception { + @Nonnull AccountingAttachmentsDownloadRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingAttachmentsDownloadOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/BalanceSheet.java b/src/main/java/com/apideck/unify/BalanceSheet.java index ca4d2e88..521f7de5 100644 --- a/src/main/java/com/apideck/unify/BalanceSheet.java +++ b/src/main/java/com/apideck/unify/BalanceSheet.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.AccountingBalanceSheetOneResponse; import com.apideck.unify.operations.AccountingBalanceSheetOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public AccountingBalanceSheetOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBalanceSheetOneResponse get(AccountingBalanceSheetOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingBalanceSheetOneResponse get(@Nonnull AccountingBalanceSheetOneRequest request) throws Exception { + return get(request, null); } /** @@ -56,8 +58,8 @@ public AccountingBalanceSheetOneResponse get(AccountingBalanceSheetOneRequest re * @throws Exception if the API call fails */ public AccountingBalanceSheetOneResponse get( - AccountingBalanceSheetOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingBalanceSheetOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBalanceSheetOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/BankFeedAccounts.java b/src/main/java/com/apideck/unify/BankFeedAccounts.java index e165a9ee..c4441863 100644 --- a/src/main/java/com/apideck/unify/BankFeedAccounts.java +++ b/src/main/java/com/apideck/unify/BankFeedAccounts.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingBankFeedAccountsOneOperation; import com.apideck.unify.operations.AccountingBankFeedAccountsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingBankFeedAccountsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBankFeedAccountsAllResponse list(AccountingBankFeedAccountsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingBankFeedAccountsAllResponse list(@Nonnull AccountingBankFeedAccountsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingBankFeedAccountsAllResponse list(AccountingBankFeedAccountsAllR * @throws Exception if the API call fails */ public AccountingBankFeedAccountsAllResponse list( - AccountingBankFeedAccountsAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingBankFeedAccountsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBankFeedAccountsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingBankFeedAccountsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBankFeedAccountsAddResponse create(AccountingBankFeedAccountsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingBankFeedAccountsAddResponse create(@Nonnull AccountingBankFeedAccountsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingBankFeedAccountsAddResponse create(AccountingBankFeedAccountsAd * @throws Exception if the API call fails */ public AccountingBankFeedAccountsAddResponse create( - AccountingBankFeedAccountsAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingBankFeedAccountsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBankFeedAccountsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingBankFeedAccountsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBankFeedAccountsOneResponse get(AccountingBankFeedAccountsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingBankFeedAccountsOneResponse get(@Nonnull AccountingBankFeedAccountsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingBankFeedAccountsOneResponse get(AccountingBankFeedAccountsOneRe * @throws Exception if the API call fails */ public AccountingBankFeedAccountsOneResponse get( - AccountingBankFeedAccountsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingBankFeedAccountsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBankFeedAccountsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingBankFeedAccountsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBankFeedAccountsUpdateResponse update(AccountingBankFeedAccountsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingBankFeedAccountsUpdateResponse update(@Nonnull AccountingBankFeedAccountsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingBankFeedAccountsUpdateResponse update(AccountingBankFeedAccount * @throws Exception if the API call fails */ public AccountingBankFeedAccountsUpdateResponse update( - AccountingBankFeedAccountsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingBankFeedAccountsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBankFeedAccountsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingBankFeedAccountsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBankFeedAccountsDeleteResponse delete(AccountingBankFeedAccountsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingBankFeedAccountsDeleteResponse delete(@Nonnull AccountingBankFeedAccountsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingBankFeedAccountsDeleteResponse delete(AccountingBankFeedAccount * @throws Exception if the API call fails */ public AccountingBankFeedAccountsDeleteResponse delete( - AccountingBankFeedAccountsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingBankFeedAccountsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBankFeedAccountsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/BankFeedStatements.java b/src/main/java/com/apideck/unify/BankFeedStatements.java index 0b3bb819..a4f01796 100644 --- a/src/main/java/com/apideck/unify/BankFeedStatements.java +++ b/src/main/java/com/apideck/unify/BankFeedStatements.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingBankFeedStatementsOneOperation; import com.apideck.unify.operations.AccountingBankFeedStatementsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingBankFeedStatementsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBankFeedStatementsAllResponse list(AccountingBankFeedStatementsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingBankFeedStatementsAllResponse list(@Nonnull AccountingBankFeedStatementsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingBankFeedStatementsAllResponse list(AccountingBankFeedStatements * @throws Exception if the API call fails */ public AccountingBankFeedStatementsAllResponse list( - AccountingBankFeedStatementsAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingBankFeedStatementsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBankFeedStatementsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingBankFeedStatementsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBankFeedStatementsAddResponse create(AccountingBankFeedStatementsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingBankFeedStatementsAddResponse create(@Nonnull AccountingBankFeedStatementsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingBankFeedStatementsAddResponse create(AccountingBankFeedStatemen * @throws Exception if the API call fails */ public AccountingBankFeedStatementsAddResponse create( - AccountingBankFeedStatementsAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingBankFeedStatementsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBankFeedStatementsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingBankFeedStatementsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBankFeedStatementsOneResponse get(AccountingBankFeedStatementsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingBankFeedStatementsOneResponse get(@Nonnull AccountingBankFeedStatementsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingBankFeedStatementsOneResponse get(AccountingBankFeedStatementsO * @throws Exception if the API call fails */ public AccountingBankFeedStatementsOneResponse get( - AccountingBankFeedStatementsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingBankFeedStatementsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBankFeedStatementsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingBankFeedStatementsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBankFeedStatementsUpdateResponse update(AccountingBankFeedStatementsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingBankFeedStatementsUpdateResponse update(@Nonnull AccountingBankFeedStatementsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingBankFeedStatementsUpdateResponse update(AccountingBankFeedState * @throws Exception if the API call fails */ public AccountingBankFeedStatementsUpdateResponse update( - AccountingBankFeedStatementsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingBankFeedStatementsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBankFeedStatementsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingBankFeedStatementsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBankFeedStatementsDeleteResponse delete(AccountingBankFeedStatementsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingBankFeedStatementsDeleteResponse delete(@Nonnull AccountingBankFeedStatementsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingBankFeedStatementsDeleteResponse delete(AccountingBankFeedState * @throws Exception if the API call fails */ public AccountingBankFeedStatementsDeleteResponse delete( - AccountingBankFeedStatementsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingBankFeedStatementsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBankFeedStatementsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/BillPayments.java b/src/main/java/com/apideck/unify/BillPayments.java index f75988e5..9724563d 100644 --- a/src/main/java/com/apideck/unify/BillPayments.java +++ b/src/main/java/com/apideck/unify/BillPayments.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingBillPaymentsOneOperation; import com.apideck.unify.operations.AccountingBillPaymentsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingBillPaymentsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBillPaymentsAllResponse list(AccountingBillPaymentsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingBillPaymentsAllResponse list(@Nonnull AccountingBillPaymentsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingBillPaymentsAllResponse list(AccountingBillPaymentsAllRequest r * @throws Exception if the API call fails */ public AccountingBillPaymentsAllResponse list( - AccountingBillPaymentsAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingBillPaymentsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBillPaymentsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingBillPaymentsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBillPaymentsAddResponse create(AccountingBillPaymentsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingBillPaymentsAddResponse create(@Nonnull AccountingBillPaymentsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingBillPaymentsAddResponse create(AccountingBillPaymentsAddRequest * @throws Exception if the API call fails */ public AccountingBillPaymentsAddResponse create( - AccountingBillPaymentsAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingBillPaymentsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBillPaymentsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingBillPaymentsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBillPaymentsOneResponse get(AccountingBillPaymentsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingBillPaymentsOneResponse get(@Nonnull AccountingBillPaymentsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingBillPaymentsOneResponse get(AccountingBillPaymentsOneRequest re * @throws Exception if the API call fails */ public AccountingBillPaymentsOneResponse get( - AccountingBillPaymentsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingBillPaymentsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBillPaymentsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingBillPaymentsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBillPaymentsUpdateResponse update(AccountingBillPaymentsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingBillPaymentsUpdateResponse update(@Nonnull AccountingBillPaymentsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingBillPaymentsUpdateResponse update(AccountingBillPaymentsUpdateR * @throws Exception if the API call fails */ public AccountingBillPaymentsUpdateResponse update( - AccountingBillPaymentsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingBillPaymentsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBillPaymentsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingBillPaymentsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBillPaymentsDeleteResponse delete(AccountingBillPaymentsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingBillPaymentsDeleteResponse delete(@Nonnull AccountingBillPaymentsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingBillPaymentsDeleteResponse delete(AccountingBillPaymentsDeleteR * @throws Exception if the API call fails */ public AccountingBillPaymentsDeleteResponse delete( - AccountingBillPaymentsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingBillPaymentsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBillPaymentsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Bills.java b/src/main/java/com/apideck/unify/Bills.java index ff8cfe4f..52e15490 100644 --- a/src/main/java/com/apideck/unify/Bills.java +++ b/src/main/java/com/apideck/unify/Bills.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingBillsOneOperation; import com.apideck.unify.operations.AccountingBillsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingBillsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBillsAllResponse list(AccountingBillsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingBillsAllResponse list(@Nonnull AccountingBillsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingBillsAllResponse list(AccountingBillsAllRequest request) throws * @throws Exception if the API call fails */ public AccountingBillsAllResponse list( - AccountingBillsAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingBillsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBillsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingBillsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBillsAddResponse create(AccountingBillsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingBillsAddResponse create(@Nonnull AccountingBillsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingBillsAddResponse create(AccountingBillsAddRequest request) thro * @throws Exception if the API call fails */ public AccountingBillsAddResponse create( - AccountingBillsAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingBillsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBillsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingBillsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBillsOneResponse get(AccountingBillsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingBillsOneResponse get(@Nonnull AccountingBillsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingBillsOneResponse get(AccountingBillsOneRequest request) throws * @throws Exception if the API call fails */ public AccountingBillsOneResponse get( - AccountingBillsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingBillsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBillsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingBillsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBillsUpdateResponse update(AccountingBillsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingBillsUpdateResponse update(@Nonnull AccountingBillsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingBillsUpdateResponse update(AccountingBillsUpdateRequest request * @throws Exception if the API call fails */ public AccountingBillsUpdateResponse update( - AccountingBillsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingBillsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBillsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingBillsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingBillsDeleteResponse delete(AccountingBillsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingBillsDeleteResponse delete(@Nonnull AccountingBillsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingBillsDeleteResponse delete(AccountingBillsDeleteRequest request * @throws Exception if the API call fails */ public AccountingBillsDeleteResponse delete( - AccountingBillsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingBillsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingBillsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Categories.java b/src/main/java/com/apideck/unify/Categories.java index 1ed3bb85..09dc3a2b 100644 --- a/src/main/java/com/apideck/unify/Categories.java +++ b/src/main/java/com/apideck/unify/Categories.java @@ -14,6 +14,8 @@ import com.apideck.unify.operations.AccountingCategoriesAllOperation; import com.apideck.unify.operations.AccountingCategoriesOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -45,8 +47,8 @@ public AccountingCategoriesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCategoriesAllResponse list(AccountingCategoriesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingCategoriesAllResponse list(@Nonnull AccountingCategoriesAllRequest request) throws Exception { + return list(request, null); } /** @@ -60,8 +62,8 @@ public AccountingCategoriesAllResponse list(AccountingCategoriesAllRequest reque * @throws Exception if the API call fails */ public AccountingCategoriesAllResponse list( - AccountingCategoriesAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingCategoriesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCategoriesAllOperation( sdkConfiguration, @@ -89,8 +91,8 @@ public AccountingCategoriesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCategoriesOneResponse get(AccountingCategoriesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingCategoriesOneResponse get(@Nonnull AccountingCategoriesOneRequest request) throws Exception { + return get(request, null); } /** @@ -104,8 +106,8 @@ public AccountingCategoriesOneResponse get(AccountingCategoriesOneRequest reques * @throws Exception if the API call fails */ public AccountingCategoriesOneResponse get( - AccountingCategoriesOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingCategoriesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCategoriesOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CollectionTags.java b/src/main/java/com/apideck/unify/CollectionTags.java index 057f1af6..da9cd6ea 100644 --- a/src/main/java/com/apideck/unify/CollectionTags.java +++ b/src/main/java/com/apideck/unify/CollectionTags.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.IssueTrackingCollectionTagsAllResponse; import com.apideck.unify.operations.IssueTrackingCollectionTagsAllOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public IssueTrackingCollectionTagsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTagsAllResponse list(IssueTrackingCollectionTagsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public IssueTrackingCollectionTagsAllResponse list(@Nonnull IssueTrackingCollectionTagsAllRequest request) throws Exception { + return list(request, null); } /** @@ -56,8 +58,8 @@ public IssueTrackingCollectionTagsAllResponse list(IssueTrackingCollectionTagsAl * @throws Exception if the API call fails */ public IssueTrackingCollectionTagsAllResponse list( - IssueTrackingCollectionTagsAllRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTagsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTagsAllOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CollectionTicketComments.java b/src/main/java/com/apideck/unify/CollectionTicketComments.java index 74677a1f..420574e7 100644 --- a/src/main/java/com/apideck/unify/CollectionTicketComments.java +++ b/src/main/java/com/apideck/unify/CollectionTicketComments.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.IssueTrackingCollectionTicketCommentsOneOperation; import com.apideck.unify.operations.IssueTrackingCollectionTicketCommentsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public IssueTrackingCollectionTicketCommentsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTicketCommentsAllResponse list(IssueTrackingCollectionTicketCommentsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public IssueTrackingCollectionTicketCommentsAllResponse list(@Nonnull IssueTrackingCollectionTicketCommentsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public IssueTrackingCollectionTicketCommentsAllResponse list(IssueTrackingCollec * @throws Exception if the API call fails */ public IssueTrackingCollectionTicketCommentsAllResponse list( - IssueTrackingCollectionTicketCommentsAllRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTicketCommentsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTicketCommentsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public IssueTrackingCollectionTicketCommentsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTicketCommentsAddResponse create(IssueTrackingCollectionTicketCommentsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public IssueTrackingCollectionTicketCommentsAddResponse create(@Nonnull IssueTrackingCollectionTicketCommentsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public IssueTrackingCollectionTicketCommentsAddResponse create(IssueTrackingColl * @throws Exception if the API call fails */ public IssueTrackingCollectionTicketCommentsAddResponse create( - IssueTrackingCollectionTicketCommentsAddRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTicketCommentsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTicketCommentsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public IssueTrackingCollectionTicketCommentsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTicketCommentsOneResponse get(IssueTrackingCollectionTicketCommentsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public IssueTrackingCollectionTicketCommentsOneResponse get(@Nonnull IssueTrackingCollectionTicketCommentsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public IssueTrackingCollectionTicketCommentsOneResponse get(IssueTrackingCollect * @throws Exception if the API call fails */ public IssueTrackingCollectionTicketCommentsOneResponse get( - IssueTrackingCollectionTicketCommentsOneRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTicketCommentsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTicketCommentsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public IssueTrackingCollectionTicketCommentsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTicketCommentsUpdateResponse update(IssueTrackingCollectionTicketCommentsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public IssueTrackingCollectionTicketCommentsUpdateResponse update(@Nonnull IssueTrackingCollectionTicketCommentsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public IssueTrackingCollectionTicketCommentsUpdateResponse update(IssueTrackingC * @throws Exception if the API call fails */ public IssueTrackingCollectionTicketCommentsUpdateResponse update( - IssueTrackingCollectionTicketCommentsUpdateRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTicketCommentsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTicketCommentsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public IssueTrackingCollectionTicketCommentsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTicketCommentsDeleteResponse delete(IssueTrackingCollectionTicketCommentsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public IssueTrackingCollectionTicketCommentsDeleteResponse delete(@Nonnull IssueTrackingCollectionTicketCommentsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public IssueTrackingCollectionTicketCommentsDeleteResponse delete(IssueTrackingC * @throws Exception if the API call fails */ public IssueTrackingCollectionTicketCommentsDeleteResponse delete( - IssueTrackingCollectionTicketCommentsDeleteRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTicketCommentsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTicketCommentsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CollectionTickets.java b/src/main/java/com/apideck/unify/CollectionTickets.java index 3e4966fb..2f4b52ec 100644 --- a/src/main/java/com/apideck/unify/CollectionTickets.java +++ b/src/main/java/com/apideck/unify/CollectionTickets.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.IssueTrackingCollectionTicketsOneOperation; import com.apideck.unify.operations.IssueTrackingCollectionTicketsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public IssueTrackingCollectionTicketsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTicketsAllResponse list(IssueTrackingCollectionTicketsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public IssueTrackingCollectionTicketsAllResponse list(@Nonnull IssueTrackingCollectionTicketsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public IssueTrackingCollectionTicketsAllResponse list(IssueTrackingCollectionTic * @throws Exception if the API call fails */ public IssueTrackingCollectionTicketsAllResponse list( - IssueTrackingCollectionTicketsAllRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTicketsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTicketsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public IssueTrackingCollectionTicketsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTicketsAddResponse create(IssueTrackingCollectionTicketsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public IssueTrackingCollectionTicketsAddResponse create(@Nonnull IssueTrackingCollectionTicketsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public IssueTrackingCollectionTicketsAddResponse create(IssueTrackingCollectionT * @throws Exception if the API call fails */ public IssueTrackingCollectionTicketsAddResponse create( - IssueTrackingCollectionTicketsAddRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTicketsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTicketsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public IssueTrackingCollectionTicketsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTicketsOneResponse get(IssueTrackingCollectionTicketsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public IssueTrackingCollectionTicketsOneResponse get(@Nonnull IssueTrackingCollectionTicketsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public IssueTrackingCollectionTicketsOneResponse get(IssueTrackingCollectionTick * @throws Exception if the API call fails */ public IssueTrackingCollectionTicketsOneResponse get( - IssueTrackingCollectionTicketsOneRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTicketsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTicketsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public IssueTrackingCollectionTicketsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTicketsUpdateResponse update(IssueTrackingCollectionTicketsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public IssueTrackingCollectionTicketsUpdateResponse update(@Nonnull IssueTrackingCollectionTicketsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public IssueTrackingCollectionTicketsUpdateResponse update(IssueTrackingCollecti * @throws Exception if the API call fails */ public IssueTrackingCollectionTicketsUpdateResponse update( - IssueTrackingCollectionTicketsUpdateRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTicketsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTicketsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public IssueTrackingCollectionTicketsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionTicketsDeleteResponse delete(IssueTrackingCollectionTicketsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public IssueTrackingCollectionTicketsDeleteResponse delete(@Nonnull IssueTrackingCollectionTicketsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public IssueTrackingCollectionTicketsDeleteResponse delete(IssueTrackingCollecti * @throws Exception if the API call fails */ public IssueTrackingCollectionTicketsDeleteResponse delete( - IssueTrackingCollectionTicketsDeleteRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionTicketsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionTicketsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CollectionUsers.java b/src/main/java/com/apideck/unify/CollectionUsers.java index d153e78f..3970b0d5 100644 --- a/src/main/java/com/apideck/unify/CollectionUsers.java +++ b/src/main/java/com/apideck/unify/CollectionUsers.java @@ -14,6 +14,8 @@ import com.apideck.unify.operations.IssueTrackingCollectionUsersAllOperation; import com.apideck.unify.operations.IssueTrackingCollectionUsersOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -45,8 +47,8 @@ public IssueTrackingCollectionUsersAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionUsersAllResponse list(IssueTrackingCollectionUsersAllRequest request) throws Exception { - return list(request, Optional.empty()); + public IssueTrackingCollectionUsersAllResponse list(@Nonnull IssueTrackingCollectionUsersAllRequest request) throws Exception { + return list(request, null); } /** @@ -60,8 +62,8 @@ public IssueTrackingCollectionUsersAllResponse list(IssueTrackingCollectionUsers * @throws Exception if the API call fails */ public IssueTrackingCollectionUsersAllResponse list( - IssueTrackingCollectionUsersAllRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionUsersAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionUsersAllOperation( sdkConfiguration, @@ -89,8 +91,8 @@ public IssueTrackingCollectionUsersOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionUsersOneResponse get(IssueTrackingCollectionUsersOneRequest request) throws Exception { - return get(request, Optional.empty()); + public IssueTrackingCollectionUsersOneResponse get(@Nonnull IssueTrackingCollectionUsersOneRequest request) throws Exception { + return get(request, null); } /** @@ -104,8 +106,8 @@ public IssueTrackingCollectionUsersOneResponse get(IssueTrackingCollectionUsersO * @throws Exception if the API call fails */ public IssueTrackingCollectionUsersOneResponse get( - IssueTrackingCollectionUsersOneRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionUsersOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionUsersOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Collections.java b/src/main/java/com/apideck/unify/Collections.java index 265d5780..0d62ee5d 100644 --- a/src/main/java/com/apideck/unify/Collections.java +++ b/src/main/java/com/apideck/unify/Collections.java @@ -14,6 +14,8 @@ import com.apideck.unify.operations.IssueTrackingCollectionsAllOperation; import com.apideck.unify.operations.IssueTrackingCollectionsOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -45,8 +47,8 @@ public IssueTrackingCollectionsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionsAllResponse list(IssueTrackingCollectionsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public IssueTrackingCollectionsAllResponse list(@Nonnull IssueTrackingCollectionsAllRequest request) throws Exception { + return list(request, null); } /** @@ -60,8 +62,8 @@ public IssueTrackingCollectionsAllResponse list(IssueTrackingCollectionsAllReque * @throws Exception if the API call fails */ public IssueTrackingCollectionsAllResponse list( - IssueTrackingCollectionsAllRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionsAllOperation( sdkConfiguration, @@ -89,8 +91,8 @@ public IssueTrackingCollectionsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public IssueTrackingCollectionsOneResponse get(IssueTrackingCollectionsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public IssueTrackingCollectionsOneResponse get(@Nonnull IssueTrackingCollectionsOneRequest request) throws Exception { + return get(request, null); } /** @@ -104,8 +106,8 @@ public IssueTrackingCollectionsOneResponse get(IssueTrackingCollectionsOneReques * @throws Exception if the API call fails */ public IssueTrackingCollectionsOneResponse get( - IssueTrackingCollectionsOneRequest request, - Optional options) throws Exception { + @Nonnull IssueTrackingCollectionsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new IssueTrackingCollectionsOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Companies.java b/src/main/java/com/apideck/unify/Companies.java index 8c65332d..008b10ab 100644 --- a/src/main/java/com/apideck/unify/Companies.java +++ b/src/main/java/com/apideck/unify/Companies.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.CrmCompaniesOneOperation; import com.apideck.unify.operations.CrmCompaniesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public CrmCompaniesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCompaniesAllResponse list(CrmCompaniesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public CrmCompaniesAllResponse list(@Nonnull CrmCompaniesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public CrmCompaniesAllResponse list(CrmCompaniesAllRequest request) throws Excep * @throws Exception if the API call fails */ public CrmCompaniesAllResponse list( - CrmCompaniesAllRequest request, - Optional options) throws Exception { + @Nonnull CrmCompaniesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCompaniesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public CrmCompaniesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCompaniesAddResponse create(CrmCompaniesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public CrmCompaniesAddResponse create(@Nonnull CrmCompaniesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public CrmCompaniesAddResponse create(CrmCompaniesAddRequest request) throws Exc * @throws Exception if the API call fails */ public CrmCompaniesAddResponse create( - CrmCompaniesAddRequest request, - Optional options) throws Exception { + @Nonnull CrmCompaniesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCompaniesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public CrmCompaniesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCompaniesOneResponse get(CrmCompaniesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public CrmCompaniesOneResponse get(@Nonnull CrmCompaniesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public CrmCompaniesOneResponse get(CrmCompaniesOneRequest request) throws Except * @throws Exception if the API call fails */ public CrmCompaniesOneResponse get( - CrmCompaniesOneRequest request, - Optional options) throws Exception { + @Nonnull CrmCompaniesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCompaniesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public CrmCompaniesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCompaniesUpdateResponse update(CrmCompaniesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public CrmCompaniesUpdateResponse update(@Nonnull CrmCompaniesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public CrmCompaniesUpdateResponse update(CrmCompaniesUpdateRequest request) thro * @throws Exception if the API call fails */ public CrmCompaniesUpdateResponse update( - CrmCompaniesUpdateRequest request, - Optional options) throws Exception { + @Nonnull CrmCompaniesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCompaniesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public CrmCompaniesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCompaniesDeleteResponse delete(CrmCompaniesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public CrmCompaniesDeleteResponse delete(@Nonnull CrmCompaniesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public CrmCompaniesDeleteResponse delete(CrmCompaniesDeleteRequest request) thro * @throws Exception if the API call fails */ public CrmCompaniesDeleteResponse delete( - CrmCompaniesDeleteRequest request, - Optional options) throws Exception { + @Nonnull CrmCompaniesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCompaniesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CompanyInfo.java b/src/main/java/com/apideck/unify/CompanyInfo.java index eac90aee..95003068 100644 --- a/src/main/java/com/apideck/unify/CompanyInfo.java +++ b/src/main/java/com/apideck/unify/CompanyInfo.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.AccountingCompanyInfoOneResponse; import com.apideck.unify.operations.AccountingCompanyInfoOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public AccountingCompanyInfoOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCompanyInfoOneResponse get(AccountingCompanyInfoOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingCompanyInfoOneResponse get(@Nonnull AccountingCompanyInfoOneRequest request) throws Exception { + return get(request, null); } /** @@ -56,8 +58,8 @@ public AccountingCompanyInfoOneResponse get(AccountingCompanyInfoOneRequest requ * @throws Exception if the API call fails */ public AccountingCompanyInfoOneResponse get( - AccountingCompanyInfoOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingCompanyInfoOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCompanyInfoOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ConnectionCustomMappings.java b/src/main/java/com/apideck/unify/ConnectionCustomMappings.java index 001ec6b0..129dd007 100644 --- a/src/main/java/com/apideck/unify/ConnectionCustomMappings.java +++ b/src/main/java/com/apideck/unify/ConnectionCustomMappings.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.VaultConnectionCustomMappingsAllResponse; import com.apideck.unify.operations.VaultConnectionCustomMappingsAllOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public VaultConnectionCustomMappingsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultConnectionCustomMappingsAllResponse list(VaultConnectionCustomMappingsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public VaultConnectionCustomMappingsAllResponse list(@Nonnull VaultConnectionCustomMappingsAllRequest request) throws Exception { + return list(request, null); } /** @@ -56,8 +58,8 @@ public VaultConnectionCustomMappingsAllResponse list(VaultConnectionCustomMappin * @throws Exception if the API call fails */ public VaultConnectionCustomMappingsAllResponse list( - VaultConnectionCustomMappingsAllRequest request, - Optional options) throws Exception { + @Nonnull VaultConnectionCustomMappingsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new VaultConnectionCustomMappingsAllOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ConnectionSettings.java b/src/main/java/com/apideck/unify/ConnectionSettings.java index ca3efe50..0db212a8 100644 --- a/src/main/java/com/apideck/unify/ConnectionSettings.java +++ b/src/main/java/com/apideck/unify/ConnectionSettings.java @@ -14,6 +14,8 @@ import com.apideck.unify.operations.VaultConnectionSettingsAllOperation; import com.apideck.unify.operations.VaultConnectionSettingsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -45,8 +47,8 @@ public VaultConnectionSettingsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultConnectionSettingsAllResponse list(VaultConnectionSettingsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public VaultConnectionSettingsAllResponse list(@Nonnull VaultConnectionSettingsAllRequest request) throws Exception { + return list(request, null); } /** @@ -60,8 +62,8 @@ public VaultConnectionSettingsAllResponse list(VaultConnectionSettingsAllRequest * @throws Exception if the API call fails */ public VaultConnectionSettingsAllResponse list( - VaultConnectionSettingsAllRequest request, - Optional options) throws Exception { + @Nonnull VaultConnectionSettingsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new VaultConnectionSettingsAllOperation( sdkConfiguration, @@ -89,8 +91,8 @@ public VaultConnectionSettingsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultConnectionSettingsUpdateResponse update(VaultConnectionSettingsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public VaultConnectionSettingsUpdateResponse update(@Nonnull VaultConnectionSettingsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -104,8 +106,8 @@ public VaultConnectionSettingsUpdateResponse update(VaultConnectionSettingsUpdat * @throws Exception if the API call fails */ public VaultConnectionSettingsUpdateResponse update( - VaultConnectionSettingsUpdateRequest request, - Optional options) throws Exception { + @Nonnull VaultConnectionSettingsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new VaultConnectionSettingsUpdateOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Connections.java b/src/main/java/com/apideck/unify/Connections.java index 68e6b8c1..0ffa9fe9 100644 --- a/src/main/java/com/apideck/unify/Connections.java +++ b/src/main/java/com/apideck/unify/Connections.java @@ -30,6 +30,8 @@ import com.apideck.unify.operations.VaultConnectionsTokenOperation; import com.apideck.unify.operations.VaultConnectionsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Exception; import java.lang.String; @@ -67,8 +69,8 @@ public VaultConnectionsAllRequestBuilder list() { * @throws Exception if the API call fails */ public VaultConnectionsAllResponse listDirect() throws Exception { - return list(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + return list(null, null, null, + null, null); } /** @@ -87,19 +89,16 @@ public VaultConnectionsAllResponse listDirect() throws Exception { * @throws Exception if the API call fails */ public VaultConnectionsAllResponse list( - Optional consumerId, - Optional appId, - Optional api, - Optional configured, - Optional options) throws Exception { - VaultConnectionsAllRequest request = - VaultConnectionsAllRequest - .builder() - .consumerId(consumerId) - .appId(appId) - .api(api) - .configured(configured) - .build(); + @Nullable String consumerId, + @Nullable String appId, + @Nullable String api, + @Nullable Boolean configured, + @Nullable Options options) throws Exception { + VaultConnectionsAllRequest request = new VaultConnectionsAllRequest( + consumerId, + appId, + api, + configured); RequestOperation operation = new VaultConnectionsAllOperation( sdkConfiguration, @@ -129,10 +128,10 @@ public VaultConnectionsOneRequestBuilder get() { * @throws Exception if the API call fails */ public VaultConnectionsOneResponse get( - String serviceId, - String unifiedApi) throws Exception { - return get(Optional.empty(), Optional.empty(), serviceId, - unifiedApi, Optional.empty()); + @Nonnull String serviceId, + @Nonnull String unifiedApi) throws Exception { + return get(null, null, serviceId, + unifiedApi, null); } /** @@ -149,19 +148,16 @@ public VaultConnectionsOneResponse get( * @throws Exception if the API call fails */ public VaultConnectionsOneResponse get( - Optional consumerId, - Optional appId, - String serviceId, - String unifiedApi, - Optional options) throws Exception { - VaultConnectionsOneRequest request = - VaultConnectionsOneRequest - .builder() - .consumerId(consumerId) - .appId(appId) - .serviceId(serviceId) - .unifiedApi(unifiedApi) - .build(); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nullable Options options) throws Exception { + VaultConnectionsOneRequest request = new VaultConnectionsOneRequest( + consumerId, + appId, + serviceId, + unifiedApi); RequestOperation operation = new VaultConnectionsOneOperation( sdkConfiguration, @@ -189,8 +185,8 @@ public VaultConnectionsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultConnectionsUpdateResponse update(VaultConnectionsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public VaultConnectionsUpdateResponse update(@Nonnull VaultConnectionsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +200,8 @@ public VaultConnectionsUpdateResponse update(VaultConnectionsUpdateRequest reque * @throws Exception if the API call fails */ public VaultConnectionsUpdateResponse update( - VaultConnectionsUpdateRequest request, - Optional options) throws Exception { + @Nonnull VaultConnectionsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new VaultConnectionsUpdateOperation( sdkConfiguration, @@ -235,10 +231,10 @@ public VaultConnectionsDeleteRequestBuilder delete() { * @throws Exception if the API call fails */ public VaultConnectionsDeleteResponse delete( - String serviceId, - String unifiedApi) throws Exception { - return delete(Optional.empty(), Optional.empty(), serviceId, - unifiedApi, Optional.empty()); + @Nonnull String serviceId, + @Nonnull String unifiedApi) throws Exception { + return delete(null, null, serviceId, + unifiedApi, null); } /** @@ -255,19 +251,16 @@ public VaultConnectionsDeleteResponse delete( * @throws Exception if the API call fails */ public VaultConnectionsDeleteResponse delete( - Optional consumerId, - Optional appId, - String serviceId, - String unifiedApi, - Optional options) throws Exception { - VaultConnectionsDeleteRequest request = - VaultConnectionsDeleteRequest - .builder() - .consumerId(consumerId) - .appId(appId) - .serviceId(serviceId) - .unifiedApi(unifiedApi) - .build(); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nullable Options options) throws Exception { + VaultConnectionsDeleteRequest request = new VaultConnectionsDeleteRequest( + consumerId, + appId, + serviceId, + unifiedApi); RequestOperation operation = new VaultConnectionsDeleteOperation( sdkConfiguration, @@ -295,8 +288,8 @@ public VaultConnectionsImportRequestBuilder imports() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultConnectionsImportResponse imports(VaultConnectionsImportRequest request) throws Exception { - return imports(request, Optional.empty()); + public VaultConnectionsImportResponse imports(@Nonnull VaultConnectionsImportRequest request) throws Exception { + return imports(request, null); } /** @@ -310,8 +303,8 @@ public VaultConnectionsImportResponse imports(VaultConnectionsImportRequest requ * @throws Exception if the API call fails */ public VaultConnectionsImportResponse imports( - VaultConnectionsImportRequest request, - Optional options) throws Exception { + @Nonnull VaultConnectionsImportRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new VaultConnectionsImportOperation( sdkConfiguration, @@ -349,8 +342,8 @@ public VaultConnectionsTokenRequestBuilder token() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultConnectionsTokenResponse token(VaultConnectionsTokenRequest request) throws Exception { - return token(request, Optional.empty()); + public VaultConnectionsTokenResponse token(@Nonnull VaultConnectionsTokenRequest request) throws Exception { + return token(request, null); } /** @@ -369,8 +362,8 @@ public VaultConnectionsTokenResponse token(VaultConnectionsTokenRequest request) * @throws Exception if the API call fails */ public VaultConnectionsTokenResponse token( - VaultConnectionsTokenRequest request, - Optional options) throws Exception { + @Nonnull VaultConnectionsTokenRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new VaultConnectionsTokenOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ConnectorDocs.java b/src/main/java/com/apideck/unify/ConnectorDocs.java index 59d78294..a558e0bf 100644 --- a/src/main/java/com/apideck/unify/ConnectorDocs.java +++ b/src/main/java/com/apideck/unify/ConnectorDocs.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.ConnectorConnectorDocsOneResponse; import com.apideck.unify.operations.ConnectorConnectorDocsOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; import java.util.List; @@ -44,10 +46,10 @@ public ConnectorConnectorDocsOneRequestBuilder get() { * @throws Exception if the API call fails */ public ConnectorConnectorDocsOneResponse get( - String id, - String docId) throws Exception { - return get(Optional.empty(), id, docId, - Optional.empty()); + @Nonnull String id, + @Nonnull String docId) throws Exception { + return get(null, id, docId, + null); } /** @@ -63,17 +65,14 @@ public ConnectorConnectorDocsOneResponse get( * @throws Exception if the API call fails */ public ConnectorConnectorDocsOneResponse get( - Optional appId, - String id, - String docId, - Optional options) throws Exception { - ConnectorConnectorDocsOneRequest request = - ConnectorConnectorDocsOneRequest - .builder() - .appId(appId) - .id(id) - .docId(docId) - .build(); + @Nullable String appId, + @Nonnull String id, + @Nonnull String docId, + @Nullable Options options) throws Exception { + ConnectorConnectorDocsOneRequest request = new ConnectorConnectorDocsOneRequest( + appId, + id, + docId); RequestOperation operation = new ConnectorConnectorDocsOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ConnectorResources.java b/src/main/java/com/apideck/unify/ConnectorResources.java index 4bd0d5c9..8a4f423d 100644 --- a/src/main/java/com/apideck/unify/ConnectorResources.java +++ b/src/main/java/com/apideck/unify/ConnectorResources.java @@ -11,6 +11,8 @@ import com.apideck.unify.models.operations.ConnectorConnectorResourcesOneResponse; import com.apideck.unify.operations.ConnectorConnectorResourcesOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; import java.util.List; @@ -45,10 +47,10 @@ public ConnectorConnectorResourcesOneRequestBuilder get() { * @throws Exception if the API call fails */ public ConnectorConnectorResourcesOneResponse get( - String id, - String resourceId) throws Exception { - return get(Optional.empty(), id, resourceId, - Optional.empty(), Optional.empty()); + @Nonnull String id, + @Nonnull String resourceId) throws Exception { + return get(null, id, resourceId, + null, null); } /** @@ -65,19 +67,16 @@ public ConnectorConnectorResourcesOneResponse get( * @throws Exception if the API call fails */ public ConnectorConnectorResourcesOneResponse get( - Optional appId, - String id, - String resourceId, - Optional unifiedApi, - Optional options) throws Exception { - ConnectorConnectorResourcesOneRequest request = - ConnectorConnectorResourcesOneRequest - .builder() - .appId(appId) - .id(id) - .resourceId(resourceId) - .unifiedApi(unifiedApi) - .build(); + @Nullable String appId, + @Nonnull String id, + @Nonnull String resourceId, + @Nullable UnifiedApiId unifiedApi, + @Nullable Options options) throws Exception { + ConnectorConnectorResourcesOneRequest request = new ConnectorConnectorResourcesOneRequest( + appId, + id, + resourceId, + unifiedApi); RequestOperation operation = new ConnectorConnectorResourcesOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Connectors.java b/src/main/java/com/apideck/unify/Connectors.java index 9a4fe2ad..06f98f9a 100644 --- a/src/main/java/com/apideck/unify/Connectors.java +++ b/src/main/java/com/apideck/unify/Connectors.java @@ -15,6 +15,8 @@ import com.apideck.unify.operations.ConnectorConnectorsAllOperation; import com.apideck.unify.operations.ConnectorConnectorsOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.Long; import java.lang.String; @@ -49,8 +51,8 @@ public ConnectorConnectorsAllRequestBuilder list() { * @throws Exception if the API call fails */ public ConnectorConnectorsAllResponse listDirect() throws Exception { - return list(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty()); + return list(null, JsonNullable.undefined(), null, + null, null); } /** @@ -67,19 +69,16 @@ public ConnectorConnectorsAllResponse listDirect() throws Exception { * @throws Exception if the API call fails */ public ConnectorConnectorsAllResponse list( - Optional appId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional options) throws Exception { - ConnectorConnectorsAllRequest request = - ConnectorConnectorsAllRequest - .builder() - .appId(appId) - .cursor(cursor) - .limit(limit) - .filter(filter) - .build(); + @Nullable String appId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable ConnectorsFilter filter, + @Nullable Options options) throws Exception { + ConnectorConnectorsAllRequest request = new ConnectorConnectorsAllRequest( + appId, + cursor, + limit, + filter); RequestOperation operation = new ConnectorConnectorsAllOperation( sdkConfiguration, @@ -107,8 +106,8 @@ public ConnectorConnectorsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public ConnectorConnectorsOneResponse get(String id) throws Exception { - return get(Optional.empty(), id, Optional.empty()); + public ConnectorConnectorsOneResponse get(@Nonnull String id) throws Exception { + return get(null, id, null); } /** @@ -123,15 +122,12 @@ public ConnectorConnectorsOneResponse get(String id) throws Exception { * @throws Exception if the API call fails */ public ConnectorConnectorsOneResponse get( - Optional appId, - String id, - Optional options) throws Exception { - ConnectorConnectorsOneRequest request = - ConnectorConnectorsOneRequest - .builder() - .appId(appId) - .id(id) - .build(); + @Nullable String appId, + @Nonnull String id, + @Nullable Options options) throws Exception { + ConnectorConnectorsOneRequest request = new ConnectorConnectorsOneRequest( + appId, + id); RequestOperation operation = new ConnectorConnectorsOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ConsumerRequestCounts.java b/src/main/java/com/apideck/unify/ConsumerRequestCounts.java index 9f359d02..276222d1 100644 --- a/src/main/java/com/apideck/unify/ConsumerRequestCounts.java +++ b/src/main/java/com/apideck/unify/ConsumerRequestCounts.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.VaultConsumerRequestCountsAllResponse; import com.apideck.unify.operations.VaultConsumerRequestCountsAllOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; import java.util.List; @@ -45,11 +47,11 @@ public VaultConsumerRequestCountsAllRequestBuilder list() { * @throws Exception if the API call fails */ public VaultConsumerRequestCountsAllResponse list( - String consumerId, - String startDatetime, - String endDatetime) throws Exception { - return list(Optional.empty(), consumerId, startDatetime, - endDatetime, Optional.empty()); + @Nonnull String consumerId, + @Nonnull String startDatetime, + @Nonnull String endDatetime) throws Exception { + return list(null, consumerId, startDatetime, + endDatetime, null); } /** @@ -66,19 +68,16 @@ public VaultConsumerRequestCountsAllResponse list( * @throws Exception if the API call fails */ public VaultConsumerRequestCountsAllResponse list( - Optional appId, - String consumerId, - String startDatetime, - String endDatetime, - Optional options) throws Exception { - VaultConsumerRequestCountsAllRequest request = - VaultConsumerRequestCountsAllRequest - .builder() - .appId(appId) - .consumerId(consumerId) - .startDatetime(startDatetime) - .endDatetime(endDatetime) - .build(); + @Nullable String appId, + @Nonnull String consumerId, + @Nonnull String startDatetime, + @Nonnull String endDatetime, + @Nullable Options options) throws Exception { + VaultConsumerRequestCountsAllRequest request = new VaultConsumerRequestCountsAllRequest( + appId, + consumerId, + startDatetime, + endDatetime); RequestOperation operation = new VaultConsumerRequestCountsAllOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Consumers.java b/src/main/java/com/apideck/unify/Consumers.java index d340b1b3..20fb3094 100644 --- a/src/main/java/com/apideck/unify/Consumers.java +++ b/src/main/java/com/apideck/unify/Consumers.java @@ -28,6 +28,8 @@ import com.apideck.unify.operations.VaultConsumersOneOperation; import com.apideck.unify.operations.VaultConsumersUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.Long; import java.lang.String; @@ -62,8 +64,8 @@ public VaultConsumersAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultConsumersAddResponse create(ConsumerInput consumer) throws Exception { - return create(Optional.empty(), consumer, Optional.empty()); + public VaultConsumersAddResponse create(@Nonnull ConsumerInput consumer) throws Exception { + return create(null, consumer, null); } /** @@ -78,15 +80,12 @@ public VaultConsumersAddResponse create(ConsumerInput consumer) throws Exception * @throws Exception if the API call fails */ public VaultConsumersAddResponse create( - Optional appId, - ConsumerInput consumer, - Optional options) throws Exception { - VaultConsumersAddRequest request = - VaultConsumersAddRequest - .builder() - .appId(appId) - .consumer(consumer) - .build(); + @Nullable String appId, + @Nonnull ConsumerInput consumer, + @Nullable Options options) throws Exception { + VaultConsumersAddRequest request = new VaultConsumersAddRequest( + appId, + consumer); RequestOperation operation = new VaultConsumersAddOperation( sdkConfiguration, @@ -114,8 +113,8 @@ public VaultConsumersAllRequestBuilder list() { * @throws Exception if the API call fails */ public VaultConsumersAllResponse listDirect() throws Exception { - return list(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + return list(null, JsonNullable.undefined(), null, + null); } /** @@ -131,17 +130,14 @@ public VaultConsumersAllResponse listDirect() throws Exception { * @throws Exception if the API call fails */ public VaultConsumersAllResponse list( - Optional appId, - JsonNullable cursor, - Optional limit, - Optional options) throws Exception { - VaultConsumersAllRequest request = - VaultConsumersAllRequest - .builder() - .appId(appId) - .cursor(cursor) - .limit(limit) - .build(); + @Nullable String appId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Options options) throws Exception { + VaultConsumersAllRequest request = new VaultConsumersAllRequest( + appId, + cursor, + limit); RequestOperation operation = new VaultConsumersAllOperation( sdkConfiguration, @@ -169,8 +165,8 @@ public VaultConsumersOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultConsumersOneResponse get(String consumerId) throws Exception { - return get(Optional.empty(), consumerId, Optional.empty()); + public VaultConsumersOneResponse get(@Nonnull String consumerId) throws Exception { + return get(null, consumerId, null); } /** @@ -185,15 +181,12 @@ public VaultConsumersOneResponse get(String consumerId) throws Exception { * @throws Exception if the API call fails */ public VaultConsumersOneResponse get( - Optional appId, - String consumerId, - Optional options) throws Exception { - VaultConsumersOneRequest request = - VaultConsumersOneRequest - .builder() - .appId(appId) - .consumerId(consumerId) - .build(); + @Nullable String appId, + @Nonnull String consumerId, + @Nullable Options options) throws Exception { + VaultConsumersOneRequest request = new VaultConsumersOneRequest( + appId, + consumerId); RequestOperation operation = new VaultConsumersOneOperation( sdkConfiguration, @@ -223,10 +216,10 @@ public VaultConsumersUpdateRequestBuilder update() { * @throws Exception if the API call fails */ public VaultConsumersUpdateResponse update( - String consumerId, - UpdateConsumerRequest updateConsumerRequest) throws Exception { - return update(Optional.empty(), consumerId, updateConsumerRequest, - Optional.empty()); + @Nonnull String consumerId, + @Nonnull UpdateConsumerRequest updateConsumerRequest) throws Exception { + return update(null, consumerId, updateConsumerRequest, + null); } /** @@ -242,17 +235,14 @@ public VaultConsumersUpdateResponse update( * @throws Exception if the API call fails */ public VaultConsumersUpdateResponse update( - Optional appId, - String consumerId, - UpdateConsumerRequest updateConsumerRequest, - Optional options) throws Exception { - VaultConsumersUpdateRequest request = - VaultConsumersUpdateRequest - .builder() - .appId(appId) - .consumerId(consumerId) - .updateConsumerRequest(updateConsumerRequest) - .build(); + @Nullable String appId, + @Nonnull String consumerId, + @Nonnull UpdateConsumerRequest updateConsumerRequest, + @Nullable Options options) throws Exception { + VaultConsumersUpdateRequest request = new VaultConsumersUpdateRequest( + appId, + consumerId, + updateConsumerRequest); RequestOperation operation = new VaultConsumersUpdateOperation( sdkConfiguration, @@ -280,8 +270,8 @@ public VaultConsumersDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultConsumersDeleteResponse delete(String consumerId) throws Exception { - return delete(Optional.empty(), consumerId, Optional.empty()); + public VaultConsumersDeleteResponse delete(@Nonnull String consumerId) throws Exception { + return delete(null, consumerId, null); } /** @@ -296,15 +286,12 @@ public VaultConsumersDeleteResponse delete(String consumerId) throws Exception { * @throws Exception if the API call fails */ public VaultConsumersDeleteResponse delete( - Optional appId, - String consumerId, - Optional options) throws Exception { - VaultConsumersDeleteRequest request = - VaultConsumersDeleteRequest - .builder() - .appId(appId) - .consumerId(consumerId) - .build(); + @Nullable String appId, + @Nonnull String consumerId, + @Nullable Options options) throws Exception { + VaultConsumersDeleteRequest request = new VaultConsumersDeleteRequest( + appId, + consumerId); RequestOperation operation = new VaultConsumersDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Contacts.java b/src/main/java/com/apideck/unify/Contacts.java index 8765758b..baf8119f 100644 --- a/src/main/java/com/apideck/unify/Contacts.java +++ b/src/main/java/com/apideck/unify/Contacts.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.CrmContactsOneOperation; import com.apideck.unify.operations.CrmContactsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public CrmContactsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmContactsAllResponse list(CrmContactsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public CrmContactsAllResponse list(@Nonnull CrmContactsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public CrmContactsAllResponse list(CrmContactsAllRequest request) throws Excepti * @throws Exception if the API call fails */ public CrmContactsAllResponse list( - CrmContactsAllRequest request, - Optional options) throws Exception { + @Nonnull CrmContactsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmContactsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public CrmContactsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmContactsAddResponse create(CrmContactsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public CrmContactsAddResponse create(@Nonnull CrmContactsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public CrmContactsAddResponse create(CrmContactsAddRequest request) throws Excep * @throws Exception if the API call fails */ public CrmContactsAddResponse create( - CrmContactsAddRequest request, - Optional options) throws Exception { + @Nonnull CrmContactsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmContactsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public CrmContactsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmContactsOneResponse get(CrmContactsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public CrmContactsOneResponse get(@Nonnull CrmContactsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public CrmContactsOneResponse get(CrmContactsOneRequest request) throws Exceptio * @throws Exception if the API call fails */ public CrmContactsOneResponse get( - CrmContactsOneRequest request, - Optional options) throws Exception { + @Nonnull CrmContactsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmContactsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public CrmContactsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmContactsUpdateResponse update(CrmContactsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public CrmContactsUpdateResponse update(@Nonnull CrmContactsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public CrmContactsUpdateResponse update(CrmContactsUpdateRequest request) throws * @throws Exception if the API call fails */ public CrmContactsUpdateResponse update( - CrmContactsUpdateRequest request, - Optional options) throws Exception { + @Nonnull CrmContactsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmContactsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public CrmContactsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmContactsDeleteResponse delete(CrmContactsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public CrmContactsDeleteResponse delete(@Nonnull CrmContactsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public CrmContactsDeleteResponse delete(CrmContactsDeleteRequest request) throws * @throws Exception if the API call fails */ public CrmContactsDeleteResponse delete( - CrmContactsDeleteRequest request, - Optional options) throws Exception { + @Nonnull CrmContactsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmContactsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CreateCallback.java b/src/main/java/com/apideck/unify/CreateCallback.java index c0ce53de..1b139e66 100644 --- a/src/main/java/com/apideck/unify/CreateCallback.java +++ b/src/main/java/com/apideck/unify/CreateCallback.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.VaultCreateCallbackStateResponse; import com.apideck.unify.operations.VaultCreateCallbackStateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public VaultCreateCallbackStateRequestBuilder state() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultCreateCallbackStateResponse state(VaultCreateCallbackStateRequest request) throws Exception { - return state(request, Optional.empty()); + public VaultCreateCallbackStateResponse state(@Nonnull VaultCreateCallbackStateRequest request) throws Exception { + return state(request, null); } /** @@ -56,8 +58,8 @@ public VaultCreateCallbackStateResponse state(VaultCreateCallbackStateRequest re * @throws Exception if the API call fails */ public VaultCreateCallbackStateResponse state( - VaultCreateCallbackStateRequest request, - Optional options) throws Exception { + @Nonnull VaultCreateCallbackStateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new VaultCreateCallbackStateOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CreditNotes.java b/src/main/java/com/apideck/unify/CreditNotes.java index 367d9f74..2cc1f102 100644 --- a/src/main/java/com/apideck/unify/CreditNotes.java +++ b/src/main/java/com/apideck/unify/CreditNotes.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingCreditNotesOneOperation; import com.apideck.unify.operations.AccountingCreditNotesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingCreditNotesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCreditNotesAllResponse list(AccountingCreditNotesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingCreditNotesAllResponse list(@Nonnull AccountingCreditNotesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingCreditNotesAllResponse list(AccountingCreditNotesAllRequest req * @throws Exception if the API call fails */ public AccountingCreditNotesAllResponse list( - AccountingCreditNotesAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingCreditNotesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCreditNotesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingCreditNotesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCreditNotesAddResponse create(AccountingCreditNotesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingCreditNotesAddResponse create(@Nonnull AccountingCreditNotesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingCreditNotesAddResponse create(AccountingCreditNotesAddRequest r * @throws Exception if the API call fails */ public AccountingCreditNotesAddResponse create( - AccountingCreditNotesAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingCreditNotesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCreditNotesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingCreditNotesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCreditNotesOneResponse get(AccountingCreditNotesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingCreditNotesOneResponse get(@Nonnull AccountingCreditNotesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingCreditNotesOneResponse get(AccountingCreditNotesOneRequest requ * @throws Exception if the API call fails */ public AccountingCreditNotesOneResponse get( - AccountingCreditNotesOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingCreditNotesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCreditNotesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingCreditNotesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCreditNotesUpdateResponse update(AccountingCreditNotesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingCreditNotesUpdateResponse update(@Nonnull AccountingCreditNotesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingCreditNotesUpdateResponse update(AccountingCreditNotesUpdateReq * @throws Exception if the API call fails */ public AccountingCreditNotesUpdateResponse update( - AccountingCreditNotesUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingCreditNotesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCreditNotesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingCreditNotesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCreditNotesDeleteResponse delete(AccountingCreditNotesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingCreditNotesDeleteResponse delete(@Nonnull AccountingCreditNotesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingCreditNotesDeleteResponse delete(AccountingCreditNotesDeleteReq * @throws Exception if the API call fails */ public AccountingCreditNotesDeleteResponse delete( - AccountingCreditNotesDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingCreditNotesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCreditNotesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CustomFields.java b/src/main/java/com/apideck/unify/CustomFields.java index a7fef5f6..9a26171b 100644 --- a/src/main/java/com/apideck/unify/CustomFields.java +++ b/src/main/java/com/apideck/unify/CustomFields.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.VaultCustomFieldsAllResponse; import com.apideck.unify.operations.VaultCustomFieldsAllOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public VaultCustomFieldsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultCustomFieldsAllResponse list(VaultCustomFieldsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public VaultCustomFieldsAllResponse list(@Nonnull VaultCustomFieldsAllRequest request) throws Exception { + return list(request, null); } /** @@ -56,8 +58,8 @@ public VaultCustomFieldsAllResponse list(VaultCustomFieldsAllRequest request) th * @throws Exception if the API call fails */ public VaultCustomFieldsAllResponse list( - VaultCustomFieldsAllRequest request, - Optional options) throws Exception { + @Nonnull VaultCustomFieldsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new VaultCustomFieldsAllOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CustomMappings.java b/src/main/java/com/apideck/unify/CustomMappings.java index 80f5c337..09e458d5 100644 --- a/src/main/java/com/apideck/unify/CustomMappings.java +++ b/src/main/java/com/apideck/unify/CustomMappings.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.VaultCustomMappingsAllResponse; import com.apideck.unify.operations.VaultCustomMappingsAllOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; import java.util.List; @@ -44,10 +46,10 @@ public VaultCustomMappingsAllRequestBuilder list() { * @throws Exception if the API call fails */ public VaultCustomMappingsAllResponse list( - String unifiedApi, - String serviceId) throws Exception { - return list(Optional.empty(), Optional.empty(), unifiedApi, - serviceId, Optional.empty()); + @Nonnull String unifiedApi, + @Nonnull String serviceId) throws Exception { + return list(null, null, unifiedApi, + serviceId, null); } /** @@ -64,19 +66,16 @@ public VaultCustomMappingsAllResponse list( * @throws Exception if the API call fails */ public VaultCustomMappingsAllResponse list( - Optional consumerId, - Optional appId, - String unifiedApi, - String serviceId, - Optional options) throws Exception { - VaultCustomMappingsAllRequest request = - VaultCustomMappingsAllRequest - .builder() - .consumerId(consumerId) - .appId(appId) - .unifiedApi(unifiedApi) - .serviceId(serviceId) - .build(); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String unifiedApi, + @Nonnull String serviceId, + @Nullable Options options) throws Exception { + VaultCustomMappingsAllRequest request = new VaultCustomMappingsAllRequest( + consumerId, + appId, + unifiedApi, + serviceId); RequestOperation operation = new VaultCustomMappingsAllOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CustomObjectSchemas.java b/src/main/java/com/apideck/unify/CustomObjectSchemas.java index 53ac5a91..22fb0698 100644 --- a/src/main/java/com/apideck/unify/CustomObjectSchemas.java +++ b/src/main/java/com/apideck/unify/CustomObjectSchemas.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.CrmCustomObjectSchemasOneOperation; import com.apideck.unify.operations.CrmCustomObjectSchemasUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public CrmCustomObjectSchemasAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCustomObjectSchemasAllResponse list(CrmCustomObjectSchemasAllRequest request) throws Exception { - return list(request, Optional.empty()); + public CrmCustomObjectSchemasAllResponse list(@Nonnull CrmCustomObjectSchemasAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public CrmCustomObjectSchemasAllResponse list(CrmCustomObjectSchemasAllRequest r * @throws Exception if the API call fails */ public CrmCustomObjectSchemasAllResponse list( - CrmCustomObjectSchemasAllRequest request, - Optional options) throws Exception { + @Nonnull CrmCustomObjectSchemasAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCustomObjectSchemasAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public CrmCustomObjectSchemasAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCustomObjectSchemasAddResponse create(CrmCustomObjectSchemasAddRequest request) throws Exception { - return create(request, Optional.empty()); + public CrmCustomObjectSchemasAddResponse create(@Nonnull CrmCustomObjectSchemasAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public CrmCustomObjectSchemasAddResponse create(CrmCustomObjectSchemasAddRequest * @throws Exception if the API call fails */ public CrmCustomObjectSchemasAddResponse create( - CrmCustomObjectSchemasAddRequest request, - Optional options) throws Exception { + @Nonnull CrmCustomObjectSchemasAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCustomObjectSchemasAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public CrmCustomObjectSchemasOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCustomObjectSchemasOneResponse get(CrmCustomObjectSchemasOneRequest request) throws Exception { - return get(request, Optional.empty()); + public CrmCustomObjectSchemasOneResponse get(@Nonnull CrmCustomObjectSchemasOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public CrmCustomObjectSchemasOneResponse get(CrmCustomObjectSchemasOneRequest re * @throws Exception if the API call fails */ public CrmCustomObjectSchemasOneResponse get( - CrmCustomObjectSchemasOneRequest request, - Optional options) throws Exception { + @Nonnull CrmCustomObjectSchemasOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCustomObjectSchemasOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public CrmCustomObjectSchemasUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCustomObjectSchemasUpdateResponse update(CrmCustomObjectSchemasUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public CrmCustomObjectSchemasUpdateResponse update(@Nonnull CrmCustomObjectSchemasUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public CrmCustomObjectSchemasUpdateResponse update(CrmCustomObjectSchemasUpdateR * @throws Exception if the API call fails */ public CrmCustomObjectSchemasUpdateResponse update( - CrmCustomObjectSchemasUpdateRequest request, - Optional options) throws Exception { + @Nonnull CrmCustomObjectSchemasUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCustomObjectSchemasUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public CrmCustomObjectSchemasDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCustomObjectSchemasDeleteResponse delete(CrmCustomObjectSchemasDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public CrmCustomObjectSchemasDeleteResponse delete(@Nonnull CrmCustomObjectSchemasDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public CrmCustomObjectSchemasDeleteResponse delete(CrmCustomObjectSchemasDeleteR * @throws Exception if the API call fails */ public CrmCustomObjectSchemasDeleteResponse delete( - CrmCustomObjectSchemasDeleteRequest request, - Optional options) throws Exception { + @Nonnull CrmCustomObjectSchemasDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCustomObjectSchemasDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/CustomObjects.java b/src/main/java/com/apideck/unify/CustomObjects.java index d6485507..1414f2cf 100644 --- a/src/main/java/com/apideck/unify/CustomObjects.java +++ b/src/main/java/com/apideck/unify/CustomObjects.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.CrmCustomObjectsOneOperation; import com.apideck.unify.operations.CrmCustomObjectsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public CrmCustomObjectsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCustomObjectsAllResponse list(CrmCustomObjectsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public CrmCustomObjectsAllResponse list(@Nonnull CrmCustomObjectsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public CrmCustomObjectsAllResponse list(CrmCustomObjectsAllRequest request) thro * @throws Exception if the API call fails */ public CrmCustomObjectsAllResponse list( - CrmCustomObjectsAllRequest request, - Optional options) throws Exception { + @Nonnull CrmCustomObjectsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCustomObjectsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public CrmCustomObjectsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCustomObjectsAddResponse create(CrmCustomObjectsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public CrmCustomObjectsAddResponse create(@Nonnull CrmCustomObjectsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public CrmCustomObjectsAddResponse create(CrmCustomObjectsAddRequest request) th * @throws Exception if the API call fails */ public CrmCustomObjectsAddResponse create( - CrmCustomObjectsAddRequest request, - Optional options) throws Exception { + @Nonnull CrmCustomObjectsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCustomObjectsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public CrmCustomObjectsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCustomObjectsOneResponse get(CrmCustomObjectsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public CrmCustomObjectsOneResponse get(@Nonnull CrmCustomObjectsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public CrmCustomObjectsOneResponse get(CrmCustomObjectsOneRequest request) throw * @throws Exception if the API call fails */ public CrmCustomObjectsOneResponse get( - CrmCustomObjectsOneRequest request, - Optional options) throws Exception { + @Nonnull CrmCustomObjectsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCustomObjectsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public CrmCustomObjectsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCustomObjectsUpdateResponse update(CrmCustomObjectsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public CrmCustomObjectsUpdateResponse update(@Nonnull CrmCustomObjectsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public CrmCustomObjectsUpdateResponse update(CrmCustomObjectsUpdateRequest reque * @throws Exception if the API call fails */ public CrmCustomObjectsUpdateResponse update( - CrmCustomObjectsUpdateRequest request, - Optional options) throws Exception { + @Nonnull CrmCustomObjectsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCustomObjectsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public CrmCustomObjectsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmCustomObjectsDeleteResponse delete(CrmCustomObjectsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public CrmCustomObjectsDeleteResponse delete(@Nonnull CrmCustomObjectsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public CrmCustomObjectsDeleteResponse delete(CrmCustomObjectsDeleteRequest reque * @throws Exception if the API call fails */ public CrmCustomObjectsDeleteResponse delete( - CrmCustomObjectsDeleteRequest request, - Optional options) throws Exception { + @Nonnull CrmCustomObjectsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmCustomObjectsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Customers.java b/src/main/java/com/apideck/unify/Customers.java index 6d56c5ea..bbda0677 100644 --- a/src/main/java/com/apideck/unify/Customers.java +++ b/src/main/java/com/apideck/unify/Customers.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingCustomersOneOperation; import com.apideck.unify.operations.AccountingCustomersUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingCustomersAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCustomersAllResponse list(AccountingCustomersAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingCustomersAllResponse list(@Nonnull AccountingCustomersAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingCustomersAllResponse list(AccountingCustomersAllRequest request * @throws Exception if the API call fails */ public AccountingCustomersAllResponse list( - AccountingCustomersAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingCustomersAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCustomersAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingCustomersAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCustomersAddResponse create(AccountingCustomersAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingCustomersAddResponse create(@Nonnull AccountingCustomersAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingCustomersAddResponse create(AccountingCustomersAddRequest reque * @throws Exception if the API call fails */ public AccountingCustomersAddResponse create( - AccountingCustomersAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingCustomersAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCustomersAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingCustomersOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCustomersOneResponse get(AccountingCustomersOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingCustomersOneResponse get(@Nonnull AccountingCustomersOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingCustomersOneResponse get(AccountingCustomersOneRequest request) * @throws Exception if the API call fails */ public AccountingCustomersOneResponse get( - AccountingCustomersOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingCustomersOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCustomersOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingCustomersUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCustomersUpdateResponse update(AccountingCustomersUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingCustomersUpdateResponse update(@Nonnull AccountingCustomersUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingCustomersUpdateResponse update(AccountingCustomersUpdateRequest * @throws Exception if the API call fails */ public AccountingCustomersUpdateResponse update( - AccountingCustomersUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingCustomersUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCustomersUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingCustomersDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingCustomersDeleteResponse delete(AccountingCustomersDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingCustomersDeleteResponse delete(@Nonnull AccountingCustomersDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingCustomersDeleteResponse delete(AccountingCustomersDeleteRequest * @throws Exception if the API call fails */ public AccountingCustomersDeleteResponse delete( - AccountingCustomersDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingCustomersDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingCustomersDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Departments.java b/src/main/java/com/apideck/unify/Departments.java index 73b7be4c..5804484f 100644 --- a/src/main/java/com/apideck/unify/Departments.java +++ b/src/main/java/com/apideck/unify/Departments.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingDepartmentsOneOperation; import com.apideck.unify.operations.AccountingDepartmentsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingDepartmentsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingDepartmentsAllResponse list(AccountingDepartmentsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingDepartmentsAllResponse list(@Nonnull AccountingDepartmentsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingDepartmentsAllResponse list(AccountingDepartmentsAllRequest req * @throws Exception if the API call fails */ public AccountingDepartmentsAllResponse list( - AccountingDepartmentsAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingDepartmentsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingDepartmentsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingDepartmentsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingDepartmentsAddResponse create(AccountingDepartmentsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingDepartmentsAddResponse create(@Nonnull AccountingDepartmentsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingDepartmentsAddResponse create(AccountingDepartmentsAddRequest r * @throws Exception if the API call fails */ public AccountingDepartmentsAddResponse create( - AccountingDepartmentsAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingDepartmentsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingDepartmentsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingDepartmentsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingDepartmentsOneResponse get(AccountingDepartmentsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingDepartmentsOneResponse get(@Nonnull AccountingDepartmentsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingDepartmentsOneResponse get(AccountingDepartmentsOneRequest requ * @throws Exception if the API call fails */ public AccountingDepartmentsOneResponse get( - AccountingDepartmentsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingDepartmentsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingDepartmentsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingDepartmentsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingDepartmentsUpdateResponse update(AccountingDepartmentsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingDepartmentsUpdateResponse update(@Nonnull AccountingDepartmentsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingDepartmentsUpdateResponse update(AccountingDepartmentsUpdateReq * @throws Exception if the API call fails */ public AccountingDepartmentsUpdateResponse update( - AccountingDepartmentsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingDepartmentsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingDepartmentsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingDepartmentsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingDepartmentsDeleteResponse delete(AccountingDepartmentsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingDepartmentsDeleteResponse delete(@Nonnull AccountingDepartmentsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingDepartmentsDeleteResponse delete(AccountingDepartmentsDeleteReq * @throws Exception if the API call fails */ public AccountingDepartmentsDeleteResponse delete( - AccountingDepartmentsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingDepartmentsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingDepartmentsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/DriveGroups.java b/src/main/java/com/apideck/unify/DriveGroups.java index e8649b5f..fb5b76e0 100644 --- a/src/main/java/com/apideck/unify/DriveGroups.java +++ b/src/main/java/com/apideck/unify/DriveGroups.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.FileStorageDriveGroupsOneOperation; import com.apideck.unify.operations.FileStorageDriveGroupsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public FileStorageDriveGroupsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageDriveGroupsAllResponse list(FileStorageDriveGroupsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public FileStorageDriveGroupsAllResponse list(@Nonnull FileStorageDriveGroupsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public FileStorageDriveGroupsAllResponse list(FileStorageDriveGroupsAllRequest r * @throws Exception if the API call fails */ public FileStorageDriveGroupsAllResponse list( - FileStorageDriveGroupsAllRequest request, - Optional options) throws Exception { + @Nonnull FileStorageDriveGroupsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageDriveGroupsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public FileStorageDriveGroupsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageDriveGroupsAddResponse create(FileStorageDriveGroupsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public FileStorageDriveGroupsAddResponse create(@Nonnull FileStorageDriveGroupsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public FileStorageDriveGroupsAddResponse create(FileStorageDriveGroupsAddRequest * @throws Exception if the API call fails */ public FileStorageDriveGroupsAddResponse create( - FileStorageDriveGroupsAddRequest request, - Optional options) throws Exception { + @Nonnull FileStorageDriveGroupsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageDriveGroupsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public FileStorageDriveGroupsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageDriveGroupsOneResponse get(FileStorageDriveGroupsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public FileStorageDriveGroupsOneResponse get(@Nonnull FileStorageDriveGroupsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public FileStorageDriveGroupsOneResponse get(FileStorageDriveGroupsOneRequest re * @throws Exception if the API call fails */ public FileStorageDriveGroupsOneResponse get( - FileStorageDriveGroupsOneRequest request, - Optional options) throws Exception { + @Nonnull FileStorageDriveGroupsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageDriveGroupsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public FileStorageDriveGroupsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageDriveGroupsUpdateResponse update(FileStorageDriveGroupsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public FileStorageDriveGroupsUpdateResponse update(@Nonnull FileStorageDriveGroupsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public FileStorageDriveGroupsUpdateResponse update(FileStorageDriveGroupsUpdateR * @throws Exception if the API call fails */ public FileStorageDriveGroupsUpdateResponse update( - FileStorageDriveGroupsUpdateRequest request, - Optional options) throws Exception { + @Nonnull FileStorageDriveGroupsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageDriveGroupsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public FileStorageDriveGroupsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageDriveGroupsDeleteResponse delete(FileStorageDriveGroupsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public FileStorageDriveGroupsDeleteResponse delete(@Nonnull FileStorageDriveGroupsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public FileStorageDriveGroupsDeleteResponse delete(FileStorageDriveGroupsDeleteR * @throws Exception if the API call fails */ public FileStorageDriveGroupsDeleteResponse delete( - FileStorageDriveGroupsDeleteRequest request, - Optional options) throws Exception { + @Nonnull FileStorageDriveGroupsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageDriveGroupsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Drives.java b/src/main/java/com/apideck/unify/Drives.java index 6e42948d..9e66a0e0 100644 --- a/src/main/java/com/apideck/unify/Drives.java +++ b/src/main/java/com/apideck/unify/Drives.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.FileStorageDrivesOneOperation; import com.apideck.unify.operations.FileStorageDrivesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public FileStorageDrivesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageDrivesAllResponse list(FileStorageDrivesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public FileStorageDrivesAllResponse list(@Nonnull FileStorageDrivesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public FileStorageDrivesAllResponse list(FileStorageDrivesAllRequest request) th * @throws Exception if the API call fails */ public FileStorageDrivesAllResponse list( - FileStorageDrivesAllRequest request, - Optional options) throws Exception { + @Nonnull FileStorageDrivesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageDrivesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public FileStorageDrivesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageDrivesAddResponse create(FileStorageDrivesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public FileStorageDrivesAddResponse create(@Nonnull FileStorageDrivesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public FileStorageDrivesAddResponse create(FileStorageDrivesAddRequest request) * @throws Exception if the API call fails */ public FileStorageDrivesAddResponse create( - FileStorageDrivesAddRequest request, - Optional options) throws Exception { + @Nonnull FileStorageDrivesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageDrivesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public FileStorageDrivesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageDrivesOneResponse get(FileStorageDrivesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public FileStorageDrivesOneResponse get(@Nonnull FileStorageDrivesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public FileStorageDrivesOneResponse get(FileStorageDrivesOneRequest request) thr * @throws Exception if the API call fails */ public FileStorageDrivesOneResponse get( - FileStorageDrivesOneRequest request, - Optional options) throws Exception { + @Nonnull FileStorageDrivesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageDrivesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public FileStorageDrivesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageDrivesUpdateResponse update(FileStorageDrivesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public FileStorageDrivesUpdateResponse update(@Nonnull FileStorageDrivesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public FileStorageDrivesUpdateResponse update(FileStorageDrivesUpdateRequest req * @throws Exception if the API call fails */ public FileStorageDrivesUpdateResponse update( - FileStorageDrivesUpdateRequest request, - Optional options) throws Exception { + @Nonnull FileStorageDrivesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageDrivesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public FileStorageDrivesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageDrivesDeleteResponse delete(FileStorageDrivesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public FileStorageDrivesDeleteResponse delete(@Nonnull FileStorageDrivesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public FileStorageDrivesDeleteResponse delete(FileStorageDrivesDeleteRequest req * @throws Exception if the API call fails */ public FileStorageDrivesDeleteResponse delete( - FileStorageDrivesDeleteRequest request, - Optional options) throws Exception { + @Nonnull FileStorageDrivesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageDrivesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/EmployeePayrolls.java b/src/main/java/com/apideck/unify/EmployeePayrolls.java index 68f896d5..a690062c 100644 --- a/src/main/java/com/apideck/unify/EmployeePayrolls.java +++ b/src/main/java/com/apideck/unify/EmployeePayrolls.java @@ -14,6 +14,8 @@ import com.apideck.unify.operations.HrisEmployeePayrollsAllOperation; import com.apideck.unify.operations.HrisEmployeePayrollsOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -45,8 +47,8 @@ public HrisEmployeePayrollsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisEmployeePayrollsAllResponse list(HrisEmployeePayrollsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public HrisEmployeePayrollsAllResponse list(@Nonnull HrisEmployeePayrollsAllRequest request) throws Exception { + return list(request, null); } /** @@ -60,8 +62,8 @@ public HrisEmployeePayrollsAllResponse list(HrisEmployeePayrollsAllRequest reque * @throws Exception if the API call fails */ public HrisEmployeePayrollsAllResponse list( - HrisEmployeePayrollsAllRequest request, - Optional options) throws Exception { + @Nonnull HrisEmployeePayrollsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisEmployeePayrollsAllOperation( sdkConfiguration, @@ -89,8 +91,8 @@ public HrisEmployeePayrollsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisEmployeePayrollsOneResponse get(HrisEmployeePayrollsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public HrisEmployeePayrollsOneResponse get(@Nonnull HrisEmployeePayrollsOneRequest request) throws Exception { + return get(request, null); } /** @@ -104,8 +106,8 @@ public HrisEmployeePayrollsOneResponse get(HrisEmployeePayrollsOneRequest reques * @throws Exception if the API call fails */ public HrisEmployeePayrollsOneResponse get( - HrisEmployeePayrollsOneRequest request, - Optional options) throws Exception { + @Nonnull HrisEmployeePayrollsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisEmployeePayrollsOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/EmployeeSchedules.java b/src/main/java/com/apideck/unify/EmployeeSchedules.java index e3af8913..394c1756 100644 --- a/src/main/java/com/apideck/unify/EmployeeSchedules.java +++ b/src/main/java/com/apideck/unify/EmployeeSchedules.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.HrisEmployeeSchedulesAllResponse; import com.apideck.unify.operations.HrisEmployeeSchedulesAllOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public HrisEmployeeSchedulesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisEmployeeSchedulesAllResponse list(HrisEmployeeSchedulesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public HrisEmployeeSchedulesAllResponse list(@Nonnull HrisEmployeeSchedulesAllRequest request) throws Exception { + return list(request, null); } /** @@ -56,8 +58,8 @@ public HrisEmployeeSchedulesAllResponse list(HrisEmployeeSchedulesAllRequest req * @throws Exception if the API call fails */ public HrisEmployeeSchedulesAllResponse list( - HrisEmployeeSchedulesAllRequest request, - Optional options) throws Exception { + @Nonnull HrisEmployeeSchedulesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisEmployeeSchedulesAllOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Employees.java b/src/main/java/com/apideck/unify/Employees.java index 84426de9..a62edd91 100644 --- a/src/main/java/com/apideck/unify/Employees.java +++ b/src/main/java/com/apideck/unify/Employees.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.HrisEmployeesOneOperation; import com.apideck.unify.operations.HrisEmployeesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public HrisEmployeesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisEmployeesAllResponse list(HrisEmployeesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public HrisEmployeesAllResponse list(@Nonnull HrisEmployeesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public HrisEmployeesAllResponse list(HrisEmployeesAllRequest request) throws Exc * @throws Exception if the API call fails */ public HrisEmployeesAllResponse list( - HrisEmployeesAllRequest request, - Optional options) throws Exception { + @Nonnull HrisEmployeesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisEmployeesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public HrisEmployeesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisEmployeesAddResponse create(HrisEmployeesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public HrisEmployeesAddResponse create(@Nonnull HrisEmployeesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public HrisEmployeesAddResponse create(HrisEmployeesAddRequest request) throws E * @throws Exception if the API call fails */ public HrisEmployeesAddResponse create( - HrisEmployeesAddRequest request, - Optional options) throws Exception { + @Nonnull HrisEmployeesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisEmployeesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public HrisEmployeesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisEmployeesOneResponse get(HrisEmployeesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public HrisEmployeesOneResponse get(@Nonnull HrisEmployeesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public HrisEmployeesOneResponse get(HrisEmployeesOneRequest request) throws Exce * @throws Exception if the API call fails */ public HrisEmployeesOneResponse get( - HrisEmployeesOneRequest request, - Optional options) throws Exception { + @Nonnull HrisEmployeesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisEmployeesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public HrisEmployeesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisEmployeesUpdateResponse update(HrisEmployeesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public HrisEmployeesUpdateResponse update(@Nonnull HrisEmployeesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public HrisEmployeesUpdateResponse update(HrisEmployeesUpdateRequest request) th * @throws Exception if the API call fails */ public HrisEmployeesUpdateResponse update( - HrisEmployeesUpdateRequest request, - Optional options) throws Exception { + @Nonnull HrisEmployeesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisEmployeesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public HrisEmployeesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisEmployeesDeleteResponse delete(HrisEmployeesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public HrisEmployeesDeleteResponse delete(@Nonnull HrisEmployeesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public HrisEmployeesDeleteResponse delete(HrisEmployeesDeleteRequest request) th * @throws Exception if the API call fails */ public HrisEmployeesDeleteResponse delete( - HrisEmployeesDeleteRequest request, - Optional options) throws Exception { + @Nonnull HrisEmployeesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisEmployeesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Expenses.java b/src/main/java/com/apideck/unify/Expenses.java index ce2cdb3b..99e7dd1b 100644 --- a/src/main/java/com/apideck/unify/Expenses.java +++ b/src/main/java/com/apideck/unify/Expenses.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingExpensesOneOperation; import com.apideck.unify.operations.AccountingExpensesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingExpensesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingExpensesAllResponse list(AccountingExpensesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingExpensesAllResponse list(@Nonnull AccountingExpensesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingExpensesAllResponse list(AccountingExpensesAllRequest request) * @throws Exception if the API call fails */ public AccountingExpensesAllResponse list( - AccountingExpensesAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingExpensesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingExpensesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingExpensesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingExpensesAddResponse create(AccountingExpensesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingExpensesAddResponse create(@Nonnull AccountingExpensesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingExpensesAddResponse create(AccountingExpensesAddRequest request * @throws Exception if the API call fails */ public AccountingExpensesAddResponse create( - AccountingExpensesAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingExpensesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingExpensesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingExpensesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingExpensesOneResponse get(AccountingExpensesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingExpensesOneResponse get(@Nonnull AccountingExpensesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingExpensesOneResponse get(AccountingExpensesOneRequest request) t * @throws Exception if the API call fails */ public AccountingExpensesOneResponse get( - AccountingExpensesOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingExpensesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingExpensesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingExpensesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingExpensesUpdateResponse update(AccountingExpensesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingExpensesUpdateResponse update(@Nonnull AccountingExpensesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingExpensesUpdateResponse update(AccountingExpensesUpdateRequest r * @throws Exception if the API call fails */ public AccountingExpensesUpdateResponse update( - AccountingExpensesUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingExpensesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingExpensesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingExpensesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingExpensesDeleteResponse delete(AccountingExpensesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingExpensesDeleteResponse delete(@Nonnull AccountingExpensesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingExpensesDeleteResponse delete(AccountingExpensesDeleteRequest r * @throws Exception if the API call fails */ public AccountingExpensesDeleteResponse delete( - AccountingExpensesDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingExpensesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingExpensesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Files.java b/src/main/java/com/apideck/unify/Files.java index d5f7e7c2..c86c4e51 100644 --- a/src/main/java/com/apideck/unify/Files.java +++ b/src/main/java/com/apideck/unify/Files.java @@ -34,6 +34,8 @@ import com.apideck.unify.operations.FileStorageFilesSearchOperation; import com.apideck.unify.operations.FileStorageFilesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -65,8 +67,8 @@ public FileStorageFilesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFilesAllResponse list(FileStorageFilesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public FileStorageFilesAllResponse list(@Nonnull FileStorageFilesAllRequest request) throws Exception { + return list(request, null); } /** @@ -80,8 +82,8 @@ public FileStorageFilesAllResponse list(FileStorageFilesAllRequest request) thro * @throws Exception if the API call fails */ public FileStorageFilesAllResponse list( - FileStorageFilesAllRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFilesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFilesAllOperation( sdkConfiguration, @@ -109,8 +111,8 @@ public FileStorageFilesSearchRequestBuilder search() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFilesSearchResponse search(FileStorageFilesSearchRequest request) throws Exception { - return search(request, Optional.empty()); + public FileStorageFilesSearchResponse search(@Nonnull FileStorageFilesSearchRequest request) throws Exception { + return search(request, null); } /** @@ -124,8 +126,8 @@ public FileStorageFilesSearchResponse search(FileStorageFilesSearchRequest reque * @throws Exception if the API call fails */ public FileStorageFilesSearchResponse search( - FileStorageFilesSearchRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFilesSearchRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFilesSearchOperation( sdkConfiguration, @@ -153,8 +155,8 @@ public FileStorageFilesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFilesOneResponse get(FileStorageFilesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public FileStorageFilesOneResponse get(@Nonnull FileStorageFilesOneRequest request) throws Exception { + return get(request, null); } /** @@ -168,8 +170,8 @@ public FileStorageFilesOneResponse get(FileStorageFilesOneRequest request) throw * @throws Exception if the API call fails */ public FileStorageFilesOneResponse get( - FileStorageFilesOneRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFilesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFilesOneOperation( sdkConfiguration, @@ -197,8 +199,8 @@ public FileStorageFilesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFilesUpdateResponse update(FileStorageFilesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public FileStorageFilesUpdateResponse update(@Nonnull FileStorageFilesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -212,8 +214,8 @@ public FileStorageFilesUpdateResponse update(FileStorageFilesUpdateRequest reque * @throws Exception if the API call fails */ public FileStorageFilesUpdateResponse update( - FileStorageFilesUpdateRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFilesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFilesUpdateOperation( sdkConfiguration, @@ -241,8 +243,8 @@ public FileStorageFilesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFilesDeleteResponse delete(FileStorageFilesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public FileStorageFilesDeleteResponse delete(@Nonnull FileStorageFilesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -256,8 +258,8 @@ public FileStorageFilesDeleteResponse delete(FileStorageFilesDeleteRequest reque * @throws Exception if the API call fails */ public FileStorageFilesDeleteResponse delete( - FileStorageFilesDeleteRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFilesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFilesDeleteOperation( sdkConfiguration, @@ -285,8 +287,8 @@ public FileStorageFilesDownloadRequestBuilder download() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFilesDownloadResponse download(FileStorageFilesDownloadRequest request) throws Exception { - return download(request, Optional.empty()); + public FileStorageFilesDownloadResponse download(@Nonnull FileStorageFilesDownloadRequest request) throws Exception { + return download(request, null); } /** @@ -300,8 +302,8 @@ public FileStorageFilesDownloadResponse download(FileStorageFilesDownloadRequest * @throws Exception if the API call fails */ public FileStorageFilesDownloadResponse download( - FileStorageFilesDownloadRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFilesDownloadRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFilesDownloadOperation( sdkConfiguration, @@ -329,8 +331,8 @@ public FileStorageFilesExportRequestBuilder export() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFilesExportResponse export(FileStorageFilesExportRequest request) throws Exception { - return export(request, Optional.empty()); + public FileStorageFilesExportResponse export(@Nonnull FileStorageFilesExportRequest request) throws Exception { + return export(request, null); } /** @@ -344,8 +346,8 @@ public FileStorageFilesExportResponse export(FileStorageFilesExportRequest reque * @throws Exception if the API call fails */ public FileStorageFilesExportResponse export( - FileStorageFilesExportRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFilesExportRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFilesExportOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Folders.java b/src/main/java/com/apideck/unify/Folders.java index e8d1b500..7182f482 100644 --- a/src/main/java/com/apideck/unify/Folders.java +++ b/src/main/java/com/apideck/unify/Folders.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.FileStorageFoldersOneOperation; import com.apideck.unify.operations.FileStorageFoldersUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public FileStorageFoldersAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFoldersAddResponse create(FileStorageFoldersAddRequest request) throws Exception { - return create(request, Optional.empty()); + public FileStorageFoldersAddResponse create(@Nonnull FileStorageFoldersAddRequest request) throws Exception { + return create(request, null); } /** @@ -72,8 +74,8 @@ public FileStorageFoldersAddResponse create(FileStorageFoldersAddRequest request * @throws Exception if the API call fails */ public FileStorageFoldersAddResponse create( - FileStorageFoldersAddRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFoldersAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFoldersAddOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public FileStorageFoldersOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFoldersOneResponse get(FileStorageFoldersOneRequest request) throws Exception { - return get(request, Optional.empty()); + public FileStorageFoldersOneResponse get(@Nonnull FileStorageFoldersOneRequest request) throws Exception { + return get(request, null); } /** @@ -116,8 +118,8 @@ public FileStorageFoldersOneResponse get(FileStorageFoldersOneRequest request) t * @throws Exception if the API call fails */ public FileStorageFoldersOneResponse get( - FileStorageFoldersOneRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFoldersOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFoldersOneOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public FileStorageFoldersUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFoldersUpdateResponse update(FileStorageFoldersUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public FileStorageFoldersUpdateResponse update(@Nonnull FileStorageFoldersUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -160,8 +162,8 @@ public FileStorageFoldersUpdateResponse update(FileStorageFoldersUpdateRequest r * @throws Exception if the API call fails */ public FileStorageFoldersUpdateResponse update( - FileStorageFoldersUpdateRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFoldersUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFoldersUpdateOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public FileStorageFoldersDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFoldersDeleteResponse delete(FileStorageFoldersDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public FileStorageFoldersDeleteResponse delete(@Nonnull FileStorageFoldersDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -204,8 +206,8 @@ public FileStorageFoldersDeleteResponse delete(FileStorageFoldersDeleteRequest r * @throws Exception if the API call fails */ public FileStorageFoldersDeleteResponse delete( - FileStorageFoldersDeleteRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFoldersDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFoldersDeleteOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public FileStorageFoldersCopyRequestBuilder copy() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageFoldersCopyResponse copy(FileStorageFoldersCopyRequest request) throws Exception { - return copy(request, Optional.empty()); + public FileStorageFoldersCopyResponse copy(@Nonnull FileStorageFoldersCopyRequest request) throws Exception { + return copy(request, null); } /** @@ -248,8 +250,8 @@ public FileStorageFoldersCopyResponse copy(FileStorageFoldersCopyRequest request * @throws Exception if the API call fails */ public FileStorageFoldersCopyResponse copy( - FileStorageFoldersCopyRequest request, - Optional options) throws Exception { + @Nonnull FileStorageFoldersCopyRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageFoldersCopyOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/InvoiceItems.java b/src/main/java/com/apideck/unify/InvoiceItems.java index 329e252c..f63c5f88 100644 --- a/src/main/java/com/apideck/unify/InvoiceItems.java +++ b/src/main/java/com/apideck/unify/InvoiceItems.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingInvoiceItemsOneOperation; import com.apideck.unify.operations.AccountingInvoiceItemsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingInvoiceItemsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingInvoiceItemsAllResponse list(AccountingInvoiceItemsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingInvoiceItemsAllResponse list(@Nonnull AccountingInvoiceItemsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingInvoiceItemsAllResponse list(AccountingInvoiceItemsAllRequest r * @throws Exception if the API call fails */ public AccountingInvoiceItemsAllResponse list( - AccountingInvoiceItemsAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingInvoiceItemsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingInvoiceItemsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingInvoiceItemsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingInvoiceItemsAddResponse create(AccountingInvoiceItemsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingInvoiceItemsAddResponse create(@Nonnull AccountingInvoiceItemsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingInvoiceItemsAddResponse create(AccountingInvoiceItemsAddRequest * @throws Exception if the API call fails */ public AccountingInvoiceItemsAddResponse create( - AccountingInvoiceItemsAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingInvoiceItemsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingInvoiceItemsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingInvoiceItemsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingInvoiceItemsOneResponse get(AccountingInvoiceItemsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingInvoiceItemsOneResponse get(@Nonnull AccountingInvoiceItemsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingInvoiceItemsOneResponse get(AccountingInvoiceItemsOneRequest re * @throws Exception if the API call fails */ public AccountingInvoiceItemsOneResponse get( - AccountingInvoiceItemsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingInvoiceItemsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingInvoiceItemsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingInvoiceItemsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingInvoiceItemsUpdateResponse update(AccountingInvoiceItemsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingInvoiceItemsUpdateResponse update(@Nonnull AccountingInvoiceItemsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingInvoiceItemsUpdateResponse update(AccountingInvoiceItemsUpdateR * @throws Exception if the API call fails */ public AccountingInvoiceItemsUpdateResponse update( - AccountingInvoiceItemsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingInvoiceItemsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingInvoiceItemsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingInvoiceItemsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingInvoiceItemsDeleteResponse delete(AccountingInvoiceItemsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingInvoiceItemsDeleteResponse delete(@Nonnull AccountingInvoiceItemsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingInvoiceItemsDeleteResponse delete(AccountingInvoiceItemsDeleteR * @throws Exception if the API call fails */ public AccountingInvoiceItemsDeleteResponse delete( - AccountingInvoiceItemsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingInvoiceItemsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingInvoiceItemsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Invoices.java b/src/main/java/com/apideck/unify/Invoices.java index a0d9f9e3..697ab0ca 100644 --- a/src/main/java/com/apideck/unify/Invoices.java +++ b/src/main/java/com/apideck/unify/Invoices.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingInvoicesOneOperation; import com.apideck.unify.operations.AccountingInvoicesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingInvoicesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingInvoicesAllResponse list(AccountingInvoicesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingInvoicesAllResponse list(@Nonnull AccountingInvoicesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingInvoicesAllResponse list(AccountingInvoicesAllRequest request) * @throws Exception if the API call fails */ public AccountingInvoicesAllResponse list( - AccountingInvoicesAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingInvoicesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingInvoicesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingInvoicesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingInvoicesAddResponse create(AccountingInvoicesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingInvoicesAddResponse create(@Nonnull AccountingInvoicesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingInvoicesAddResponse create(AccountingInvoicesAddRequest request * @throws Exception if the API call fails */ public AccountingInvoicesAddResponse create( - AccountingInvoicesAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingInvoicesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingInvoicesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingInvoicesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingInvoicesOneResponse get(AccountingInvoicesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingInvoicesOneResponse get(@Nonnull AccountingInvoicesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingInvoicesOneResponse get(AccountingInvoicesOneRequest request) t * @throws Exception if the API call fails */ public AccountingInvoicesOneResponse get( - AccountingInvoicesOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingInvoicesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingInvoicesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingInvoicesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingInvoicesUpdateResponse update(AccountingInvoicesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingInvoicesUpdateResponse update(@Nonnull AccountingInvoicesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingInvoicesUpdateResponse update(AccountingInvoicesUpdateRequest r * @throws Exception if the API call fails */ public AccountingInvoicesUpdateResponse update( - AccountingInvoicesUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingInvoicesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingInvoicesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingInvoicesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingInvoicesDeleteResponse delete(AccountingInvoicesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingInvoicesDeleteResponse delete(@Nonnull AccountingInvoicesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingInvoicesDeleteResponse delete(AccountingInvoicesDeleteRequest r * @throws Exception if the API call fails */ public AccountingInvoicesDeleteResponse delete( - AccountingInvoicesDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingInvoicesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingInvoicesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Jobs.java b/src/main/java/com/apideck/unify/Jobs.java index 353bfe25..9a683892 100644 --- a/src/main/java/com/apideck/unify/Jobs.java +++ b/src/main/java/com/apideck/unify/Jobs.java @@ -14,6 +14,8 @@ import com.apideck.unify.operations.AtsJobsAllOperation; import com.apideck.unify.operations.AtsJobsOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -45,8 +47,8 @@ public AtsJobsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsJobsAllResponse list(AtsJobsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AtsJobsAllResponse list(@Nonnull AtsJobsAllRequest request) throws Exception { + return list(request, null); } /** @@ -60,8 +62,8 @@ public AtsJobsAllResponse list(AtsJobsAllRequest request) throws Exception { * @throws Exception if the API call fails */ public AtsJobsAllResponse list( - AtsJobsAllRequest request, - Optional options) throws Exception { + @Nonnull AtsJobsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsJobsAllOperation( sdkConfiguration, @@ -89,8 +91,8 @@ public AtsJobsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AtsJobsOneResponse get(AtsJobsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AtsJobsOneResponse get(@Nonnull AtsJobsOneRequest request) throws Exception { + return get(request, null); } /** @@ -104,8 +106,8 @@ public AtsJobsOneResponse get(AtsJobsOneRequest request) throws Exception { * @throws Exception if the API call fails */ public AtsJobsOneResponse get( - AtsJobsOneRequest request, - Optional options) throws Exception { + @Nonnull AtsJobsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AtsJobsOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/JournalEntries.java b/src/main/java/com/apideck/unify/JournalEntries.java index ed2a8dc1..606b84d4 100644 --- a/src/main/java/com/apideck/unify/JournalEntries.java +++ b/src/main/java/com/apideck/unify/JournalEntries.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingJournalEntriesOneOperation; import com.apideck.unify.operations.AccountingJournalEntriesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingJournalEntriesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingJournalEntriesAllResponse list(AccountingJournalEntriesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingJournalEntriesAllResponse list(@Nonnull AccountingJournalEntriesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingJournalEntriesAllResponse list(AccountingJournalEntriesAllReque * @throws Exception if the API call fails */ public AccountingJournalEntriesAllResponse list( - AccountingJournalEntriesAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingJournalEntriesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingJournalEntriesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingJournalEntriesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingJournalEntriesAddResponse create(AccountingJournalEntriesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingJournalEntriesAddResponse create(@Nonnull AccountingJournalEntriesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingJournalEntriesAddResponse create(AccountingJournalEntriesAddReq * @throws Exception if the API call fails */ public AccountingJournalEntriesAddResponse create( - AccountingJournalEntriesAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingJournalEntriesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingJournalEntriesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingJournalEntriesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingJournalEntriesOneResponse get(AccountingJournalEntriesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingJournalEntriesOneResponse get(@Nonnull AccountingJournalEntriesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingJournalEntriesOneResponse get(AccountingJournalEntriesOneReques * @throws Exception if the API call fails */ public AccountingJournalEntriesOneResponse get( - AccountingJournalEntriesOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingJournalEntriesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingJournalEntriesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingJournalEntriesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingJournalEntriesUpdateResponse update(AccountingJournalEntriesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingJournalEntriesUpdateResponse update(@Nonnull AccountingJournalEntriesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingJournalEntriesUpdateResponse update(AccountingJournalEntriesUpd * @throws Exception if the API call fails */ public AccountingJournalEntriesUpdateResponse update( - AccountingJournalEntriesUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingJournalEntriesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingJournalEntriesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingJournalEntriesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingJournalEntriesDeleteResponse delete(AccountingJournalEntriesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingJournalEntriesDeleteResponse delete(@Nonnull AccountingJournalEntriesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingJournalEntriesDeleteResponse delete(AccountingJournalEntriesDel * @throws Exception if the API call fails */ public AccountingJournalEntriesDeleteResponse delete( - AccountingJournalEntriesDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingJournalEntriesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingJournalEntriesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Leads.java b/src/main/java/com/apideck/unify/Leads.java index 4c013e8f..9673459a 100644 --- a/src/main/java/com/apideck/unify/Leads.java +++ b/src/main/java/com/apideck/unify/Leads.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.CrmLeadsOneOperation; import com.apideck.unify.operations.CrmLeadsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public CrmLeadsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmLeadsAllResponse list(CrmLeadsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public CrmLeadsAllResponse list(@Nonnull CrmLeadsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public CrmLeadsAllResponse list(CrmLeadsAllRequest request) throws Exception { * @throws Exception if the API call fails */ public CrmLeadsAllResponse list( - CrmLeadsAllRequest request, - Optional options) throws Exception { + @Nonnull CrmLeadsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmLeadsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public CrmLeadsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmLeadsAddResponse create(CrmLeadsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public CrmLeadsAddResponse create(@Nonnull CrmLeadsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public CrmLeadsAddResponse create(CrmLeadsAddRequest request) throws Exception { * @throws Exception if the API call fails */ public CrmLeadsAddResponse create( - CrmLeadsAddRequest request, - Optional options) throws Exception { + @Nonnull CrmLeadsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmLeadsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public CrmLeadsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmLeadsOneResponse get(CrmLeadsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public CrmLeadsOneResponse get(@Nonnull CrmLeadsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public CrmLeadsOneResponse get(CrmLeadsOneRequest request) throws Exception { * @throws Exception if the API call fails */ public CrmLeadsOneResponse get( - CrmLeadsOneRequest request, - Optional options) throws Exception { + @Nonnull CrmLeadsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmLeadsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public CrmLeadsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmLeadsUpdateResponse update(CrmLeadsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public CrmLeadsUpdateResponse update(@Nonnull CrmLeadsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public CrmLeadsUpdateResponse update(CrmLeadsUpdateRequest request) throws Excep * @throws Exception if the API call fails */ public CrmLeadsUpdateResponse update( - CrmLeadsUpdateRequest request, - Optional options) throws Exception { + @Nonnull CrmLeadsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmLeadsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public CrmLeadsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmLeadsDeleteResponse delete(CrmLeadsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public CrmLeadsDeleteResponse delete(@Nonnull CrmLeadsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public CrmLeadsDeleteResponse delete(CrmLeadsDeleteRequest request) throws Excep * @throws Exception if the API call fails */ public CrmLeadsDeleteResponse delete( - CrmLeadsDeleteRequest request, - Optional options) throws Exception { + @Nonnull CrmLeadsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmLeadsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/LedgerAccounts.java b/src/main/java/com/apideck/unify/LedgerAccounts.java index 5c2d6457..d0924e29 100644 --- a/src/main/java/com/apideck/unify/LedgerAccounts.java +++ b/src/main/java/com/apideck/unify/LedgerAccounts.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingLedgerAccountsOneOperation; import com.apideck.unify.operations.AccountingLedgerAccountsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingLedgerAccountsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingLedgerAccountsAllResponse list(AccountingLedgerAccountsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingLedgerAccountsAllResponse list(@Nonnull AccountingLedgerAccountsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingLedgerAccountsAllResponse list(AccountingLedgerAccountsAllReque * @throws Exception if the API call fails */ public AccountingLedgerAccountsAllResponse list( - AccountingLedgerAccountsAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingLedgerAccountsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingLedgerAccountsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingLedgerAccountsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingLedgerAccountsAddResponse create(AccountingLedgerAccountsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingLedgerAccountsAddResponse create(@Nonnull AccountingLedgerAccountsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingLedgerAccountsAddResponse create(AccountingLedgerAccountsAddReq * @throws Exception if the API call fails */ public AccountingLedgerAccountsAddResponse create( - AccountingLedgerAccountsAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingLedgerAccountsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingLedgerAccountsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingLedgerAccountsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingLedgerAccountsOneResponse get(AccountingLedgerAccountsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingLedgerAccountsOneResponse get(@Nonnull AccountingLedgerAccountsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingLedgerAccountsOneResponse get(AccountingLedgerAccountsOneReques * @throws Exception if the API call fails */ public AccountingLedgerAccountsOneResponse get( - AccountingLedgerAccountsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingLedgerAccountsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingLedgerAccountsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingLedgerAccountsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingLedgerAccountsUpdateResponse update(AccountingLedgerAccountsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingLedgerAccountsUpdateResponse update(@Nonnull AccountingLedgerAccountsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingLedgerAccountsUpdateResponse update(AccountingLedgerAccountsUpd * @throws Exception if the API call fails */ public AccountingLedgerAccountsUpdateResponse update( - AccountingLedgerAccountsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingLedgerAccountsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingLedgerAccountsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingLedgerAccountsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingLedgerAccountsDeleteResponse delete(AccountingLedgerAccountsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingLedgerAccountsDeleteResponse delete(@Nonnull AccountingLedgerAccountsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingLedgerAccountsDeleteResponse delete(AccountingLedgerAccountsDel * @throws Exception if the API call fails */ public AccountingLedgerAccountsDeleteResponse delete( - AccountingLedgerAccountsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingLedgerAccountsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingLedgerAccountsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Locations.java b/src/main/java/com/apideck/unify/Locations.java index 60cc3fd8..5af75c12 100644 --- a/src/main/java/com/apideck/unify/Locations.java +++ b/src/main/java/com/apideck/unify/Locations.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingLocationsOneOperation; import com.apideck.unify.operations.AccountingLocationsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingLocationsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingLocationsAllResponse list(AccountingLocationsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingLocationsAllResponse list(@Nonnull AccountingLocationsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingLocationsAllResponse list(AccountingLocationsAllRequest request * @throws Exception if the API call fails */ public AccountingLocationsAllResponse list( - AccountingLocationsAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingLocationsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingLocationsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingLocationsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingLocationsAddResponse create(AccountingLocationsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingLocationsAddResponse create(@Nonnull AccountingLocationsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingLocationsAddResponse create(AccountingLocationsAddRequest reque * @throws Exception if the API call fails */ public AccountingLocationsAddResponse create( - AccountingLocationsAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingLocationsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingLocationsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingLocationsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingLocationsOneResponse get(AccountingLocationsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingLocationsOneResponse get(@Nonnull AccountingLocationsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingLocationsOneResponse get(AccountingLocationsOneRequest request) * @throws Exception if the API call fails */ public AccountingLocationsOneResponse get( - AccountingLocationsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingLocationsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingLocationsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingLocationsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingLocationsUpdateResponse update(AccountingLocationsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingLocationsUpdateResponse update(@Nonnull AccountingLocationsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingLocationsUpdateResponse update(AccountingLocationsUpdateRequest * @throws Exception if the API call fails */ public AccountingLocationsUpdateResponse update( - AccountingLocationsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingLocationsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingLocationsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingLocationsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingLocationsDeleteResponse delete(AccountingLocationsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingLocationsDeleteResponse delete(@Nonnull AccountingLocationsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingLocationsDeleteResponse delete(AccountingLocationsDeleteRequest * @throws Exception if the API call fails */ public AccountingLocationsDeleteResponse delete( - AccountingLocationsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingLocationsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingLocationsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Logs.java b/src/main/java/com/apideck/unify/Logs.java index 452c40f3..811c2985 100644 --- a/src/main/java/com/apideck/unify/Logs.java +++ b/src/main/java/com/apideck/unify/Logs.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.VaultLogsAllResponse; import com.apideck.unify.operations.VaultLogsAllOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public VaultLogsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultLogsAllResponse list(VaultLogsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public VaultLogsAllResponse list(@Nonnull VaultLogsAllRequest request) throws Exception { + return list(request, null); } /** @@ -56,8 +58,8 @@ public VaultLogsAllResponse list(VaultLogsAllRequest request) throws Exception { * @throws Exception if the API call fails */ public VaultLogsAllResponse list( - VaultLogsAllRequest request, - Optional options) throws Exception { + @Nonnull VaultLogsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new VaultLogsAllOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Messages.java b/src/main/java/com/apideck/unify/Messages.java index a7489821..f4217f70 100644 --- a/src/main/java/com/apideck/unify/Messages.java +++ b/src/main/java/com/apideck/unify/Messages.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.SmsMessagesOneOperation; import com.apideck.unify.operations.SmsMessagesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public SmsMessagesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public SmsMessagesAllResponse list(SmsMessagesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public SmsMessagesAllResponse list(@Nonnull SmsMessagesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public SmsMessagesAllResponse list(SmsMessagesAllRequest request) throws Excepti * @throws Exception if the API call fails */ public SmsMessagesAllResponse list( - SmsMessagesAllRequest request, - Optional options) throws Exception { + @Nonnull SmsMessagesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new SmsMessagesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public SmsMessagesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public SmsMessagesAddResponse create(SmsMessagesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public SmsMessagesAddResponse create(@Nonnull SmsMessagesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public SmsMessagesAddResponse create(SmsMessagesAddRequest request) throws Excep * @throws Exception if the API call fails */ public SmsMessagesAddResponse create( - SmsMessagesAddRequest request, - Optional options) throws Exception { + @Nonnull SmsMessagesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new SmsMessagesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public SmsMessagesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public SmsMessagesOneResponse get(SmsMessagesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public SmsMessagesOneResponse get(@Nonnull SmsMessagesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public SmsMessagesOneResponse get(SmsMessagesOneRequest request) throws Exceptio * @throws Exception if the API call fails */ public SmsMessagesOneResponse get( - SmsMessagesOneRequest request, - Optional options) throws Exception { + @Nonnull SmsMessagesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new SmsMessagesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public SmsMessagesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public SmsMessagesUpdateResponse update(SmsMessagesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public SmsMessagesUpdateResponse update(@Nonnull SmsMessagesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public SmsMessagesUpdateResponse update(SmsMessagesUpdateRequest request) throws * @throws Exception if the API call fails */ public SmsMessagesUpdateResponse update( - SmsMessagesUpdateRequest request, - Optional options) throws Exception { + @Nonnull SmsMessagesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new SmsMessagesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public SmsMessagesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public SmsMessagesDeleteResponse delete(SmsMessagesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public SmsMessagesDeleteResponse delete(@Nonnull SmsMessagesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public SmsMessagesDeleteResponse delete(SmsMessagesDeleteRequest request) throws * @throws Exception if the API call fails */ public SmsMessagesDeleteResponse delete( - SmsMessagesDeleteRequest request, - Optional options) throws Exception { + @Nonnull SmsMessagesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new SmsMessagesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Notes.java b/src/main/java/com/apideck/unify/Notes.java index 2ff00be0..e638fa3d 100644 --- a/src/main/java/com/apideck/unify/Notes.java +++ b/src/main/java/com/apideck/unify/Notes.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.CrmNotesOneOperation; import com.apideck.unify.operations.CrmNotesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public CrmNotesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmNotesAllResponse list(CrmNotesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public CrmNotesAllResponse list(@Nonnull CrmNotesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public CrmNotesAllResponse list(CrmNotesAllRequest request) throws Exception { * @throws Exception if the API call fails */ public CrmNotesAllResponse list( - CrmNotesAllRequest request, - Optional options) throws Exception { + @Nonnull CrmNotesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmNotesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public CrmNotesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmNotesAddResponse create(CrmNotesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public CrmNotesAddResponse create(@Nonnull CrmNotesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public CrmNotesAddResponse create(CrmNotesAddRequest request) throws Exception { * @throws Exception if the API call fails */ public CrmNotesAddResponse create( - CrmNotesAddRequest request, - Optional options) throws Exception { + @Nonnull CrmNotesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmNotesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public CrmNotesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmNotesOneResponse get(CrmNotesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public CrmNotesOneResponse get(@Nonnull CrmNotesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public CrmNotesOneResponse get(CrmNotesOneRequest request) throws Exception { * @throws Exception if the API call fails */ public CrmNotesOneResponse get( - CrmNotesOneRequest request, - Optional options) throws Exception { + @Nonnull CrmNotesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmNotesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public CrmNotesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmNotesUpdateResponse update(CrmNotesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public CrmNotesUpdateResponse update(@Nonnull CrmNotesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public CrmNotesUpdateResponse update(CrmNotesUpdateRequest request) throws Excep * @throws Exception if the API call fails */ public CrmNotesUpdateResponse update( - CrmNotesUpdateRequest request, - Optional options) throws Exception { + @Nonnull CrmNotesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmNotesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public CrmNotesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmNotesDeleteResponse delete(CrmNotesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public CrmNotesDeleteResponse delete(@Nonnull CrmNotesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public CrmNotesDeleteResponse delete(CrmNotesDeleteRequest request) throws Excep * @throws Exception if the API call fails */ public CrmNotesDeleteResponse delete( - CrmNotesDeleteRequest request, - Optional options) throws Exception { + @Nonnull CrmNotesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmNotesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Opportunities.java b/src/main/java/com/apideck/unify/Opportunities.java index b591e4b8..666f0cac 100644 --- a/src/main/java/com/apideck/unify/Opportunities.java +++ b/src/main/java/com/apideck/unify/Opportunities.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.CrmOpportunitiesOneOperation; import com.apideck.unify.operations.CrmOpportunitiesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public CrmOpportunitiesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmOpportunitiesAllResponse list(CrmOpportunitiesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public CrmOpportunitiesAllResponse list(@Nonnull CrmOpportunitiesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public CrmOpportunitiesAllResponse list(CrmOpportunitiesAllRequest request) thro * @throws Exception if the API call fails */ public CrmOpportunitiesAllResponse list( - CrmOpportunitiesAllRequest request, - Optional options) throws Exception { + @Nonnull CrmOpportunitiesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmOpportunitiesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public CrmOpportunitiesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmOpportunitiesAddResponse create(CrmOpportunitiesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public CrmOpportunitiesAddResponse create(@Nonnull CrmOpportunitiesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public CrmOpportunitiesAddResponse create(CrmOpportunitiesAddRequest request) th * @throws Exception if the API call fails */ public CrmOpportunitiesAddResponse create( - CrmOpportunitiesAddRequest request, - Optional options) throws Exception { + @Nonnull CrmOpportunitiesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmOpportunitiesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public CrmOpportunitiesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmOpportunitiesOneResponse get(CrmOpportunitiesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public CrmOpportunitiesOneResponse get(@Nonnull CrmOpportunitiesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public CrmOpportunitiesOneResponse get(CrmOpportunitiesOneRequest request) throw * @throws Exception if the API call fails */ public CrmOpportunitiesOneResponse get( - CrmOpportunitiesOneRequest request, - Optional options) throws Exception { + @Nonnull CrmOpportunitiesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmOpportunitiesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public CrmOpportunitiesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmOpportunitiesUpdateResponse update(CrmOpportunitiesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public CrmOpportunitiesUpdateResponse update(@Nonnull CrmOpportunitiesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public CrmOpportunitiesUpdateResponse update(CrmOpportunitiesUpdateRequest reque * @throws Exception if the API call fails */ public CrmOpportunitiesUpdateResponse update( - CrmOpportunitiesUpdateRequest request, - Optional options) throws Exception { + @Nonnull CrmOpportunitiesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmOpportunitiesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public CrmOpportunitiesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmOpportunitiesDeleteResponse delete(CrmOpportunitiesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public CrmOpportunitiesDeleteResponse delete(@Nonnull CrmOpportunitiesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public CrmOpportunitiesDeleteResponse delete(CrmOpportunitiesDeleteRequest reque * @throws Exception if the API call fails */ public CrmOpportunitiesDeleteResponse delete( - CrmOpportunitiesDeleteRequest request, - Optional options) throws Exception { + @Nonnull CrmOpportunitiesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmOpportunitiesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Orders.java b/src/main/java/com/apideck/unify/Orders.java index 6d05eb81..6cb93330 100644 --- a/src/main/java/com/apideck/unify/Orders.java +++ b/src/main/java/com/apideck/unify/Orders.java @@ -14,6 +14,8 @@ import com.apideck.unify.operations.EcommerceOrdersAllOperation; import com.apideck.unify.operations.EcommerceOrdersOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -45,8 +47,8 @@ public EcommerceOrdersAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public EcommerceOrdersAllResponse list(EcommerceOrdersAllRequest request) throws Exception { - return list(request, Optional.empty()); + public EcommerceOrdersAllResponse list(@Nonnull EcommerceOrdersAllRequest request) throws Exception { + return list(request, null); } /** @@ -60,8 +62,8 @@ public EcommerceOrdersAllResponse list(EcommerceOrdersAllRequest request) throws * @throws Exception if the API call fails */ public EcommerceOrdersAllResponse list( - EcommerceOrdersAllRequest request, - Optional options) throws Exception { + @Nonnull EcommerceOrdersAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new EcommerceOrdersAllOperation( sdkConfiguration, @@ -89,8 +91,8 @@ public EcommerceOrdersOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public EcommerceOrdersOneResponse get(EcommerceOrdersOneRequest request) throws Exception { - return get(request, Optional.empty()); + public EcommerceOrdersOneResponse get(@Nonnull EcommerceOrdersOneRequest request) throws Exception { + return get(request, null); } /** @@ -104,8 +106,8 @@ public EcommerceOrdersOneResponse get(EcommerceOrdersOneRequest request) throws * @throws Exception if the API call fails */ public EcommerceOrdersOneResponse get( - EcommerceOrdersOneRequest request, - Optional options) throws Exception { + @Nonnull EcommerceOrdersOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new EcommerceOrdersOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Payments.java b/src/main/java/com/apideck/unify/Payments.java index 68b874fd..26afeb64 100644 --- a/src/main/java/com/apideck/unify/Payments.java +++ b/src/main/java/com/apideck/unify/Payments.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingPaymentsOneOperation; import com.apideck.unify.operations.AccountingPaymentsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingPaymentsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingPaymentsAllResponse list(AccountingPaymentsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingPaymentsAllResponse list(@Nonnull AccountingPaymentsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingPaymentsAllResponse list(AccountingPaymentsAllRequest request) * @throws Exception if the API call fails */ public AccountingPaymentsAllResponse list( - AccountingPaymentsAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingPaymentsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingPaymentsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingPaymentsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingPaymentsAddResponse create(AccountingPaymentsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingPaymentsAddResponse create(@Nonnull AccountingPaymentsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingPaymentsAddResponse create(AccountingPaymentsAddRequest request * @throws Exception if the API call fails */ public AccountingPaymentsAddResponse create( - AccountingPaymentsAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingPaymentsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingPaymentsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingPaymentsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingPaymentsOneResponse get(AccountingPaymentsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingPaymentsOneResponse get(@Nonnull AccountingPaymentsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingPaymentsOneResponse get(AccountingPaymentsOneRequest request) t * @throws Exception if the API call fails */ public AccountingPaymentsOneResponse get( - AccountingPaymentsOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingPaymentsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingPaymentsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingPaymentsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingPaymentsUpdateResponse update(AccountingPaymentsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingPaymentsUpdateResponse update(@Nonnull AccountingPaymentsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingPaymentsUpdateResponse update(AccountingPaymentsUpdateRequest r * @throws Exception if the API call fails */ public AccountingPaymentsUpdateResponse update( - AccountingPaymentsUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingPaymentsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingPaymentsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingPaymentsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingPaymentsDeleteResponse delete(AccountingPaymentsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingPaymentsDeleteResponse delete(@Nonnull AccountingPaymentsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingPaymentsDeleteResponse delete(AccountingPaymentsDeleteRequest r * @throws Exception if the API call fails */ public AccountingPaymentsDeleteResponse delete( - AccountingPaymentsDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingPaymentsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingPaymentsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Payrolls.java b/src/main/java/com/apideck/unify/Payrolls.java index 93662554..cc3e86fe 100644 --- a/src/main/java/com/apideck/unify/Payrolls.java +++ b/src/main/java/com/apideck/unify/Payrolls.java @@ -14,6 +14,8 @@ import com.apideck.unify.operations.HrisPayrollsAllOperation; import com.apideck.unify.operations.HrisPayrollsOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -45,8 +47,8 @@ public HrisPayrollsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisPayrollsAllResponse list(HrisPayrollsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public HrisPayrollsAllResponse list(@Nonnull HrisPayrollsAllRequest request) throws Exception { + return list(request, null); } /** @@ -60,8 +62,8 @@ public HrisPayrollsAllResponse list(HrisPayrollsAllRequest request) throws Excep * @throws Exception if the API call fails */ public HrisPayrollsAllResponse list( - HrisPayrollsAllRequest request, - Optional options) throws Exception { + @Nonnull HrisPayrollsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisPayrollsAllOperation( sdkConfiguration, @@ -89,8 +91,8 @@ public HrisPayrollsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisPayrollsOneResponse get(HrisPayrollsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public HrisPayrollsOneResponse get(@Nonnull HrisPayrollsOneRequest request) throws Exception { + return get(request, null); } /** @@ -104,8 +106,8 @@ public HrisPayrollsOneResponse get(HrisPayrollsOneRequest request) throws Except * @throws Exception if the API call fails */ public HrisPayrollsOneResponse get( - HrisPayrollsOneRequest request, - Optional options) throws Exception { + @Nonnull HrisPayrollsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisPayrollsOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Pipelines.java b/src/main/java/com/apideck/unify/Pipelines.java index 8f25208d..df505b16 100644 --- a/src/main/java/com/apideck/unify/Pipelines.java +++ b/src/main/java/com/apideck/unify/Pipelines.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.CrmPipelinesOneOperation; import com.apideck.unify.operations.CrmPipelinesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public CrmPipelinesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmPipelinesAllResponse list(CrmPipelinesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public CrmPipelinesAllResponse list(@Nonnull CrmPipelinesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public CrmPipelinesAllResponse list(CrmPipelinesAllRequest request) throws Excep * @throws Exception if the API call fails */ public CrmPipelinesAllResponse list( - CrmPipelinesAllRequest request, - Optional options) throws Exception { + @Nonnull CrmPipelinesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmPipelinesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public CrmPipelinesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmPipelinesAddResponse create(CrmPipelinesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public CrmPipelinesAddResponse create(@Nonnull CrmPipelinesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public CrmPipelinesAddResponse create(CrmPipelinesAddRequest request) throws Exc * @throws Exception if the API call fails */ public CrmPipelinesAddResponse create( - CrmPipelinesAddRequest request, - Optional options) throws Exception { + @Nonnull CrmPipelinesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmPipelinesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public CrmPipelinesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmPipelinesOneResponse get(CrmPipelinesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public CrmPipelinesOneResponse get(@Nonnull CrmPipelinesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public CrmPipelinesOneResponse get(CrmPipelinesOneRequest request) throws Except * @throws Exception if the API call fails */ public CrmPipelinesOneResponse get( - CrmPipelinesOneRequest request, - Optional options) throws Exception { + @Nonnull CrmPipelinesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmPipelinesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public CrmPipelinesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmPipelinesUpdateResponse update(CrmPipelinesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public CrmPipelinesUpdateResponse update(@Nonnull CrmPipelinesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public CrmPipelinesUpdateResponse update(CrmPipelinesUpdateRequest request) thro * @throws Exception if the API call fails */ public CrmPipelinesUpdateResponse update( - CrmPipelinesUpdateRequest request, - Optional options) throws Exception { + @Nonnull CrmPipelinesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmPipelinesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public CrmPipelinesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmPipelinesDeleteResponse delete(CrmPipelinesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public CrmPipelinesDeleteResponse delete(@Nonnull CrmPipelinesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public CrmPipelinesDeleteResponse delete(CrmPipelinesDeleteRequest request) thro * @throws Exception if the API call fails */ public CrmPipelinesDeleteResponse delete( - CrmPipelinesDeleteRequest request, - Optional options) throws Exception { + @Nonnull CrmPipelinesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmPipelinesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Products.java b/src/main/java/com/apideck/unify/Products.java index 3b498bc4..03448774 100644 --- a/src/main/java/com/apideck/unify/Products.java +++ b/src/main/java/com/apideck/unify/Products.java @@ -14,6 +14,8 @@ import com.apideck.unify.operations.EcommerceProductsAllOperation; import com.apideck.unify.operations.EcommerceProductsOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -45,8 +47,8 @@ public EcommerceProductsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public EcommerceProductsAllResponse list(EcommerceProductsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public EcommerceProductsAllResponse list(@Nonnull EcommerceProductsAllRequest request) throws Exception { + return list(request, null); } /** @@ -60,8 +62,8 @@ public EcommerceProductsAllResponse list(EcommerceProductsAllRequest request) th * @throws Exception if the API call fails */ public EcommerceProductsAllResponse list( - EcommerceProductsAllRequest request, - Optional options) throws Exception { + @Nonnull EcommerceProductsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new EcommerceProductsAllOperation( sdkConfiguration, @@ -89,8 +91,8 @@ public EcommerceProductsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public EcommerceProductsOneResponse get(EcommerceProductsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public EcommerceProductsOneResponse get(@Nonnull EcommerceProductsOneRequest request) throws Exception { + return get(request, null); } /** @@ -104,8 +106,8 @@ public EcommerceProductsOneResponse get(EcommerceProductsOneRequest request) thr * @throws Exception if the API call fails */ public EcommerceProductsOneResponse get( - EcommerceProductsOneRequest request, - Optional options) throws Exception { + @Nonnull EcommerceProductsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new EcommerceProductsOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ProfitAndLoss.java b/src/main/java/com/apideck/unify/ProfitAndLoss.java index 051ee311..5c3cc33b 100644 --- a/src/main/java/com/apideck/unify/ProfitAndLoss.java +++ b/src/main/java/com/apideck/unify/ProfitAndLoss.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.AccountingProfitAndLossOneResponse; import com.apideck.unify.operations.AccountingProfitAndLossOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public AccountingProfitAndLossOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingProfitAndLossOneResponse get(AccountingProfitAndLossOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingProfitAndLossOneResponse get(@Nonnull AccountingProfitAndLossOneRequest request) throws Exception { + return get(request, null); } /** @@ -56,8 +58,8 @@ public AccountingProfitAndLossOneResponse get(AccountingProfitAndLossOneRequest * @throws Exception if the API call fails */ public AccountingProfitAndLossOneResponse get( - AccountingProfitAndLossOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingProfitAndLossOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingProfitAndLossOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/PurchaseOrders.java b/src/main/java/com/apideck/unify/PurchaseOrders.java index 618dd71a..34eeced7 100644 --- a/src/main/java/com/apideck/unify/PurchaseOrders.java +++ b/src/main/java/com/apideck/unify/PurchaseOrders.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingPurchaseOrdersOneOperation; import com.apideck.unify.operations.AccountingPurchaseOrdersUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingPurchaseOrdersAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingPurchaseOrdersAllResponse list(AccountingPurchaseOrdersAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingPurchaseOrdersAllResponse list(@Nonnull AccountingPurchaseOrdersAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingPurchaseOrdersAllResponse list(AccountingPurchaseOrdersAllReque * @throws Exception if the API call fails */ public AccountingPurchaseOrdersAllResponse list( - AccountingPurchaseOrdersAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingPurchaseOrdersAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingPurchaseOrdersAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingPurchaseOrdersAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingPurchaseOrdersAddResponse create(AccountingPurchaseOrdersAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingPurchaseOrdersAddResponse create(@Nonnull AccountingPurchaseOrdersAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingPurchaseOrdersAddResponse create(AccountingPurchaseOrdersAddReq * @throws Exception if the API call fails */ public AccountingPurchaseOrdersAddResponse create( - AccountingPurchaseOrdersAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingPurchaseOrdersAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingPurchaseOrdersAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingPurchaseOrdersOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingPurchaseOrdersOneResponse get(AccountingPurchaseOrdersOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingPurchaseOrdersOneResponse get(@Nonnull AccountingPurchaseOrdersOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingPurchaseOrdersOneResponse get(AccountingPurchaseOrdersOneReques * @throws Exception if the API call fails */ public AccountingPurchaseOrdersOneResponse get( - AccountingPurchaseOrdersOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingPurchaseOrdersOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingPurchaseOrdersOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingPurchaseOrdersUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingPurchaseOrdersUpdateResponse update(AccountingPurchaseOrdersUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingPurchaseOrdersUpdateResponse update(@Nonnull AccountingPurchaseOrdersUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingPurchaseOrdersUpdateResponse update(AccountingPurchaseOrdersUpd * @throws Exception if the API call fails */ public AccountingPurchaseOrdersUpdateResponse update( - AccountingPurchaseOrdersUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingPurchaseOrdersUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingPurchaseOrdersUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingPurchaseOrdersDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingPurchaseOrdersDeleteResponse delete(AccountingPurchaseOrdersDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingPurchaseOrdersDeleteResponse delete(@Nonnull AccountingPurchaseOrdersDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingPurchaseOrdersDeleteResponse delete(AccountingPurchaseOrdersDel * @throws Exception if the API call fails */ public AccountingPurchaseOrdersDeleteResponse delete( - AccountingPurchaseOrdersDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingPurchaseOrdersDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingPurchaseOrdersDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/SDKConfiguration.java b/src/main/java/com/apideck/unify/SDKConfiguration.java index 9a385059..d1e8c698 100644 --- a/src/main/java/com/apideck/unify/SDKConfiguration.java +++ b/src/main/java/com/apideck/unify/SDKConfiguration.java @@ -17,9 +17,9 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; - public static final String OPENAPI_DOC_VERSION = "10.18.1"; - public static final String SDK_VERSION = "0.17.0"; - public static final String GEN_VERSION = "2.654.2"; + public static final String OPENAPI_DOC_VERSION = "10.18.2"; + public static final String SDK_VERSION = "0.18.0"; + public static final String GEN_VERSION = "2.656.3"; private static final String BASE_PACKAGE = "com.apideck.unify"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/com/apideck/unify/Sessions.java b/src/main/java/com/apideck/unify/Sessions.java index 55428b6a..8288e739 100644 --- a/src/main/java/com/apideck/unify/Sessions.java +++ b/src/main/java/com/apideck/unify/Sessions.java @@ -11,6 +11,7 @@ import com.apideck.unify.models.operations.VaultSessionsCreateResponse; import com.apideck.unify.operations.VaultSessionsCreateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; import java.util.List; @@ -49,8 +50,8 @@ public VaultSessionsCreateRequestBuilder create() { * @throws Exception if the API call fails */ public VaultSessionsCreateResponse createDirect() throws Exception { - return create(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + return create(null, null, null, + null); } /** @@ -69,17 +70,14 @@ public VaultSessionsCreateResponse createDirect() throws Exception { * @throws Exception if the API call fails */ public VaultSessionsCreateResponse create( - Optional consumerId, - Optional appId, - Optional session, - Optional options) throws Exception { - VaultSessionsCreateRequest request = - VaultSessionsCreateRequest - .builder() - .consumerId(consumerId) - .appId(appId) - .session(session) - .build(); + @Nullable String consumerId, + @Nullable String appId, + @Nullable Session session, + @Nullable Options options) throws Exception { + VaultSessionsCreateRequest request = new VaultSessionsCreateRequest( + consumerId, + appId, + session); RequestOperation operation = new VaultSessionsCreateOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/SharedLinks.java b/src/main/java/com/apideck/unify/SharedLinks.java index d938700d..092cffdd 100644 --- a/src/main/java/com/apideck/unify/SharedLinks.java +++ b/src/main/java/com/apideck/unify/SharedLinks.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.FileStorageSharedLinksOneOperation; import com.apideck.unify.operations.FileStorageSharedLinksUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public FileStorageSharedLinksAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageSharedLinksAllResponse list(FileStorageSharedLinksAllRequest request) throws Exception { - return list(request, Optional.empty()); + public FileStorageSharedLinksAllResponse list(@Nonnull FileStorageSharedLinksAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public FileStorageSharedLinksAllResponse list(FileStorageSharedLinksAllRequest r * @throws Exception if the API call fails */ public FileStorageSharedLinksAllResponse list( - FileStorageSharedLinksAllRequest request, - Optional options) throws Exception { + @Nonnull FileStorageSharedLinksAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageSharedLinksAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public FileStorageSharedLinksAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageSharedLinksAddResponse create(FileStorageSharedLinksAddRequest request) throws Exception { - return create(request, Optional.empty()); + public FileStorageSharedLinksAddResponse create(@Nonnull FileStorageSharedLinksAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public FileStorageSharedLinksAddResponse create(FileStorageSharedLinksAddRequest * @throws Exception if the API call fails */ public FileStorageSharedLinksAddResponse create( - FileStorageSharedLinksAddRequest request, - Optional options) throws Exception { + @Nonnull FileStorageSharedLinksAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageSharedLinksAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public FileStorageSharedLinksOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageSharedLinksOneResponse get(FileStorageSharedLinksOneRequest request) throws Exception { - return get(request, Optional.empty()); + public FileStorageSharedLinksOneResponse get(@Nonnull FileStorageSharedLinksOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public FileStorageSharedLinksOneResponse get(FileStorageSharedLinksOneRequest re * @throws Exception if the API call fails */ public FileStorageSharedLinksOneResponse get( - FileStorageSharedLinksOneRequest request, - Optional options) throws Exception { + @Nonnull FileStorageSharedLinksOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageSharedLinksOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public FileStorageSharedLinksUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageSharedLinksUpdateResponse update(FileStorageSharedLinksUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public FileStorageSharedLinksUpdateResponse update(@Nonnull FileStorageSharedLinksUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public FileStorageSharedLinksUpdateResponse update(FileStorageSharedLinksUpdateR * @throws Exception if the API call fails */ public FileStorageSharedLinksUpdateResponse update( - FileStorageSharedLinksUpdateRequest request, - Optional options) throws Exception { + @Nonnull FileStorageSharedLinksUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageSharedLinksUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public FileStorageSharedLinksDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageSharedLinksDeleteResponse delete(FileStorageSharedLinksDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public FileStorageSharedLinksDeleteResponse delete(@Nonnull FileStorageSharedLinksDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public FileStorageSharedLinksDeleteResponse delete(FileStorageSharedLinksDeleteR * @throws Exception if the API call fails */ public FileStorageSharedLinksDeleteResponse delete( - FileStorageSharedLinksDeleteRequest request, - Optional options) throws Exception { + @Nonnull FileStorageSharedLinksDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageSharedLinksDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Stores.java b/src/main/java/com/apideck/unify/Stores.java index c1e1a6f5..262763c7 100644 --- a/src/main/java/com/apideck/unify/Stores.java +++ b/src/main/java/com/apideck/unify/Stores.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.EcommerceStoresOneResponse; import com.apideck.unify.operations.EcommerceStoresOneOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -41,8 +43,8 @@ public EcommerceStoresOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public EcommerceStoresOneResponse get(EcommerceStoresOneRequest request) throws Exception { - return get(request, Optional.empty()); + public EcommerceStoresOneResponse get(@Nonnull EcommerceStoresOneRequest request) throws Exception { + return get(request, null); } /** @@ -56,8 +58,8 @@ public EcommerceStoresOneResponse get(EcommerceStoresOneRequest request) throws * @throws Exception if the API call fails */ public EcommerceStoresOneResponse get( - EcommerceStoresOneRequest request, - Optional options) throws Exception { + @Nonnull EcommerceStoresOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new EcommerceStoresOneOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Subsidiaries.java b/src/main/java/com/apideck/unify/Subsidiaries.java index 7fa48af2..58062bf7 100644 --- a/src/main/java/com/apideck/unify/Subsidiaries.java +++ b/src/main/java/com/apideck/unify/Subsidiaries.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingSubsidiariesOneOperation; import com.apideck.unify.operations.AccountingSubsidiariesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingSubsidiariesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingSubsidiariesAllResponse list(AccountingSubsidiariesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingSubsidiariesAllResponse list(@Nonnull AccountingSubsidiariesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingSubsidiariesAllResponse list(AccountingSubsidiariesAllRequest r * @throws Exception if the API call fails */ public AccountingSubsidiariesAllResponse list( - AccountingSubsidiariesAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingSubsidiariesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingSubsidiariesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingSubsidiariesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingSubsidiariesAddResponse create(AccountingSubsidiariesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingSubsidiariesAddResponse create(@Nonnull AccountingSubsidiariesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingSubsidiariesAddResponse create(AccountingSubsidiariesAddRequest * @throws Exception if the API call fails */ public AccountingSubsidiariesAddResponse create( - AccountingSubsidiariesAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingSubsidiariesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingSubsidiariesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingSubsidiariesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingSubsidiariesOneResponse get(AccountingSubsidiariesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingSubsidiariesOneResponse get(@Nonnull AccountingSubsidiariesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingSubsidiariesOneResponse get(AccountingSubsidiariesOneRequest re * @throws Exception if the API call fails */ public AccountingSubsidiariesOneResponse get( - AccountingSubsidiariesOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingSubsidiariesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingSubsidiariesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingSubsidiariesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingSubsidiariesUpdateResponse update(AccountingSubsidiariesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingSubsidiariesUpdateResponse update(@Nonnull AccountingSubsidiariesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingSubsidiariesUpdateResponse update(AccountingSubsidiariesUpdateR * @throws Exception if the API call fails */ public AccountingSubsidiariesUpdateResponse update( - AccountingSubsidiariesUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingSubsidiariesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingSubsidiariesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingSubsidiariesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingSubsidiariesDeleteResponse delete(AccountingSubsidiariesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingSubsidiariesDeleteResponse delete(@Nonnull AccountingSubsidiariesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingSubsidiariesDeleteResponse delete(AccountingSubsidiariesDeleteR * @throws Exception if the API call fails */ public AccountingSubsidiariesDeleteResponse delete( - AccountingSubsidiariesDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingSubsidiariesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingSubsidiariesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Suppliers.java b/src/main/java/com/apideck/unify/Suppliers.java index bd5e4835..d926d081 100644 --- a/src/main/java/com/apideck/unify/Suppliers.java +++ b/src/main/java/com/apideck/unify/Suppliers.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingSuppliersOneOperation; import com.apideck.unify.operations.AccountingSuppliersUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingSuppliersAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingSuppliersAllResponse list(AccountingSuppliersAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingSuppliersAllResponse list(@Nonnull AccountingSuppliersAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingSuppliersAllResponse list(AccountingSuppliersAllRequest request * @throws Exception if the API call fails */ public AccountingSuppliersAllResponse list( - AccountingSuppliersAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingSuppliersAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingSuppliersAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingSuppliersAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingSuppliersAddResponse create(AccountingSuppliersAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingSuppliersAddResponse create(@Nonnull AccountingSuppliersAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingSuppliersAddResponse create(AccountingSuppliersAddRequest reque * @throws Exception if the API call fails */ public AccountingSuppliersAddResponse create( - AccountingSuppliersAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingSuppliersAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingSuppliersAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingSuppliersOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingSuppliersOneResponse get(AccountingSuppliersOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingSuppliersOneResponse get(@Nonnull AccountingSuppliersOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingSuppliersOneResponse get(AccountingSuppliersOneRequest request) * @throws Exception if the API call fails */ public AccountingSuppliersOneResponse get( - AccountingSuppliersOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingSuppliersOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingSuppliersOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingSuppliersUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingSuppliersUpdateResponse update(AccountingSuppliersUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingSuppliersUpdateResponse update(@Nonnull AccountingSuppliersUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingSuppliersUpdateResponse update(AccountingSuppliersUpdateRequest * @throws Exception if the API call fails */ public AccountingSuppliersUpdateResponse update( - AccountingSuppliersUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingSuppliersUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingSuppliersUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingSuppliersDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingSuppliersDeleteResponse delete(AccountingSuppliersDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingSuppliersDeleteResponse delete(@Nonnull AccountingSuppliersDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingSuppliersDeleteResponse delete(AccountingSuppliersDeleteRequest * @throws Exception if the API call fails */ public AccountingSuppliersDeleteResponse delete( - AccountingSuppliersDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingSuppliersDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingSuppliersDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/TaxRates.java b/src/main/java/com/apideck/unify/TaxRates.java index a8c3ffe6..9fef4b5f 100644 --- a/src/main/java/com/apideck/unify/TaxRates.java +++ b/src/main/java/com/apideck/unify/TaxRates.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingTaxRatesOneOperation; import com.apideck.unify.operations.AccountingTaxRatesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingTaxRatesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingTaxRatesAllResponse list(AccountingTaxRatesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingTaxRatesAllResponse list(@Nonnull AccountingTaxRatesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingTaxRatesAllResponse list(AccountingTaxRatesAllRequest request) * @throws Exception if the API call fails */ public AccountingTaxRatesAllResponse list( - AccountingTaxRatesAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingTaxRatesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingTaxRatesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingTaxRatesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingTaxRatesAddResponse create(AccountingTaxRatesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingTaxRatesAddResponse create(@Nonnull AccountingTaxRatesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingTaxRatesAddResponse create(AccountingTaxRatesAddRequest request * @throws Exception if the API call fails */ public AccountingTaxRatesAddResponse create( - AccountingTaxRatesAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingTaxRatesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingTaxRatesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingTaxRatesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingTaxRatesOneResponse get(AccountingTaxRatesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingTaxRatesOneResponse get(@Nonnull AccountingTaxRatesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingTaxRatesOneResponse get(AccountingTaxRatesOneRequest request) t * @throws Exception if the API call fails */ public AccountingTaxRatesOneResponse get( - AccountingTaxRatesOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingTaxRatesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingTaxRatesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingTaxRatesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingTaxRatesUpdateResponse update(AccountingTaxRatesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingTaxRatesUpdateResponse update(@Nonnull AccountingTaxRatesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingTaxRatesUpdateResponse update(AccountingTaxRatesUpdateRequest r * @throws Exception if the API call fails */ public AccountingTaxRatesUpdateResponse update( - AccountingTaxRatesUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingTaxRatesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingTaxRatesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingTaxRatesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingTaxRatesDeleteResponse delete(AccountingTaxRatesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingTaxRatesDeleteResponse delete(@Nonnull AccountingTaxRatesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingTaxRatesDeleteResponse delete(AccountingTaxRatesDeleteRequest r * @throws Exception if the API call fails */ public AccountingTaxRatesDeleteResponse delete( - AccountingTaxRatesDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingTaxRatesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingTaxRatesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/TimeOffRequests.java b/src/main/java/com/apideck/unify/TimeOffRequests.java index 95da3f18..1ed26a51 100644 --- a/src/main/java/com/apideck/unify/TimeOffRequests.java +++ b/src/main/java/com/apideck/unify/TimeOffRequests.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.HrisTimeOffRequestsOneOperation; import com.apideck.unify.operations.HrisTimeOffRequestsUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public HrisTimeOffRequestsAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisTimeOffRequestsAllResponse list(HrisTimeOffRequestsAllRequest request) throws Exception { - return list(request, Optional.empty()); + public HrisTimeOffRequestsAllResponse list(@Nonnull HrisTimeOffRequestsAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public HrisTimeOffRequestsAllResponse list(HrisTimeOffRequestsAllRequest request * @throws Exception if the API call fails */ public HrisTimeOffRequestsAllResponse list( - HrisTimeOffRequestsAllRequest request, - Optional options) throws Exception { + @Nonnull HrisTimeOffRequestsAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisTimeOffRequestsAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public HrisTimeOffRequestsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisTimeOffRequestsAddResponse create(HrisTimeOffRequestsAddRequest request) throws Exception { - return create(request, Optional.empty()); + public HrisTimeOffRequestsAddResponse create(@Nonnull HrisTimeOffRequestsAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public HrisTimeOffRequestsAddResponse create(HrisTimeOffRequestsAddRequest reque * @throws Exception if the API call fails */ public HrisTimeOffRequestsAddResponse create( - HrisTimeOffRequestsAddRequest request, - Optional options) throws Exception { + @Nonnull HrisTimeOffRequestsAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisTimeOffRequestsAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public HrisTimeOffRequestsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisTimeOffRequestsOneResponse get(HrisTimeOffRequestsOneRequest request) throws Exception { - return get(request, Optional.empty()); + public HrisTimeOffRequestsOneResponse get(@Nonnull HrisTimeOffRequestsOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public HrisTimeOffRequestsOneResponse get(HrisTimeOffRequestsOneRequest request) * @throws Exception if the API call fails */ public HrisTimeOffRequestsOneResponse get( - HrisTimeOffRequestsOneRequest request, - Optional options) throws Exception { + @Nonnull HrisTimeOffRequestsOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisTimeOffRequestsOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public HrisTimeOffRequestsUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisTimeOffRequestsUpdateResponse update(HrisTimeOffRequestsUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public HrisTimeOffRequestsUpdateResponse update(@Nonnull HrisTimeOffRequestsUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public HrisTimeOffRequestsUpdateResponse update(HrisTimeOffRequestsUpdateRequest * @throws Exception if the API call fails */ public HrisTimeOffRequestsUpdateResponse update( - HrisTimeOffRequestsUpdateRequest request, - Optional options) throws Exception { + @Nonnull HrisTimeOffRequestsUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisTimeOffRequestsUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public HrisTimeOffRequestsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public HrisTimeOffRequestsDeleteResponse delete(HrisTimeOffRequestsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public HrisTimeOffRequestsDeleteResponse delete(@Nonnull HrisTimeOffRequestsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public HrisTimeOffRequestsDeleteResponse delete(HrisTimeOffRequestsDeleteRequest * @throws Exception if the API call fails */ public HrisTimeOffRequestsDeleteResponse delete( - HrisTimeOffRequestsDeleteRequest request, - Optional options) throws Exception { + @Nonnull HrisTimeOffRequestsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new HrisTimeOffRequestsDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/TrackingCategories.java b/src/main/java/com/apideck/unify/TrackingCategories.java index ba72822e..57df8c85 100644 --- a/src/main/java/com/apideck/unify/TrackingCategories.java +++ b/src/main/java/com/apideck/unify/TrackingCategories.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.AccountingTrackingCategoriesOneOperation; import com.apideck.unify.operations.AccountingTrackingCategoriesUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public AccountingTrackingCategoriesAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingTrackingCategoriesAllResponse list(AccountingTrackingCategoriesAllRequest request) throws Exception { - return list(request, Optional.empty()); + public AccountingTrackingCategoriesAllResponse list(@Nonnull AccountingTrackingCategoriesAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public AccountingTrackingCategoriesAllResponse list(AccountingTrackingCategories * @throws Exception if the API call fails */ public AccountingTrackingCategoriesAllResponse list( - AccountingTrackingCategoriesAllRequest request, - Optional options) throws Exception { + @Nonnull AccountingTrackingCategoriesAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingTrackingCategoriesAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public AccountingTrackingCategoriesAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingTrackingCategoriesAddResponse create(AccountingTrackingCategoriesAddRequest request) throws Exception { - return create(request, Optional.empty()); + public AccountingTrackingCategoriesAddResponse create(@Nonnull AccountingTrackingCategoriesAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public AccountingTrackingCategoriesAddResponse create(AccountingTrackingCategori * @throws Exception if the API call fails */ public AccountingTrackingCategoriesAddResponse create( - AccountingTrackingCategoriesAddRequest request, - Optional options) throws Exception { + @Nonnull AccountingTrackingCategoriesAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingTrackingCategoriesAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public AccountingTrackingCategoriesOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingTrackingCategoriesOneResponse get(AccountingTrackingCategoriesOneRequest request) throws Exception { - return get(request, Optional.empty()); + public AccountingTrackingCategoriesOneResponse get(@Nonnull AccountingTrackingCategoriesOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public AccountingTrackingCategoriesOneResponse get(AccountingTrackingCategoriesO * @throws Exception if the API call fails */ public AccountingTrackingCategoriesOneResponse get( - AccountingTrackingCategoriesOneRequest request, - Optional options) throws Exception { + @Nonnull AccountingTrackingCategoriesOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingTrackingCategoriesOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public AccountingTrackingCategoriesUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingTrackingCategoriesUpdateResponse update(AccountingTrackingCategoriesUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public AccountingTrackingCategoriesUpdateResponse update(@Nonnull AccountingTrackingCategoriesUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public AccountingTrackingCategoriesUpdateResponse update(AccountingTrackingCateg * @throws Exception if the API call fails */ public AccountingTrackingCategoriesUpdateResponse update( - AccountingTrackingCategoriesUpdateRequest request, - Optional options) throws Exception { + @Nonnull AccountingTrackingCategoriesUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingTrackingCategoriesUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public AccountingTrackingCategoriesDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public AccountingTrackingCategoriesDeleteResponse delete(AccountingTrackingCategoriesDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public AccountingTrackingCategoriesDeleteResponse delete(@Nonnull AccountingTrackingCategoriesDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public AccountingTrackingCategoriesDeleteResponse delete(AccountingTrackingCateg * @throws Exception if the API call fails */ public AccountingTrackingCategoriesDeleteResponse delete( - AccountingTrackingCategoriesDeleteRequest request, - Optional options) throws Exception { + @Nonnull AccountingTrackingCategoriesDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new AccountingTrackingCategoriesDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/UploadSessions.java b/src/main/java/com/apideck/unify/UploadSessions.java index 17b0478e..ebf567df 100644 --- a/src/main/java/com/apideck/unify/UploadSessions.java +++ b/src/main/java/com/apideck/unify/UploadSessions.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.FileStorageUploadSessionsOneOperation; import com.apideck.unify.operations.FileStorageUploadSessionsUploadOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; import java.util.List; @@ -58,8 +60,8 @@ public FileStorageUploadSessionsAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageUploadSessionsAddResponse create(FileStorageUploadSessionsAddRequest request) throws Exception { - return create(request, Optional.empty(), Optional.empty()); + public FileStorageUploadSessionsAddResponse create(@Nonnull FileStorageUploadSessionsAddRequest request) throws Exception { + return create(request, null, null); } /** @@ -74,9 +76,9 @@ public FileStorageUploadSessionsAddResponse create(FileStorageUploadSessionsAddR * @throws Exception if the API call fails */ public FileStorageUploadSessionsAddResponse create( - FileStorageUploadSessionsAddRequest request, - Optional serverURL, - Optional options) throws Exception { + @Nonnull FileStorageUploadSessionsAddRequest request, + @Nullable String serverURL, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageUploadSessionsAddOperation( sdkConfiguration, @@ -105,8 +107,8 @@ public FileStorageUploadSessionsOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageUploadSessionsOneResponse get(FileStorageUploadSessionsOneRequest request) throws Exception { - return get(request, Optional.empty(), Optional.empty()); + public FileStorageUploadSessionsOneResponse get(@Nonnull FileStorageUploadSessionsOneRequest request) throws Exception { + return get(request, null, null); } /** @@ -121,9 +123,9 @@ public FileStorageUploadSessionsOneResponse get(FileStorageUploadSessionsOneRequ * @throws Exception if the API call fails */ public FileStorageUploadSessionsOneResponse get( - FileStorageUploadSessionsOneRequest request, - Optional serverURL, - Optional options) throws Exception { + @Nonnull FileStorageUploadSessionsOneRequest request, + @Nullable String serverURL, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageUploadSessionsOneOperation( sdkConfiguration, @@ -152,8 +154,8 @@ public FileStorageUploadSessionsUploadRequestBuilder upload() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageUploadSessionsUploadResponse upload(FileStorageUploadSessionsUploadRequest request) throws Exception { - return upload(request, Optional.empty(), Optional.empty()); + public FileStorageUploadSessionsUploadResponse upload(@Nonnull FileStorageUploadSessionsUploadRequest request) throws Exception { + return upload(request, null, null); } /** @@ -168,9 +170,9 @@ public FileStorageUploadSessionsUploadResponse upload(FileStorageUploadSessionsU * @throws Exception if the API call fails */ public FileStorageUploadSessionsUploadResponse upload( - FileStorageUploadSessionsUploadRequest request, - Optional serverURL, - Optional options) throws Exception { + @Nonnull FileStorageUploadSessionsUploadRequest request, + @Nullable String serverURL, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageUploadSessionsUploadOperation( sdkConfiguration, @@ -199,8 +201,8 @@ public FileStorageUploadSessionsDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageUploadSessionsDeleteResponse delete(FileStorageUploadSessionsDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public FileStorageUploadSessionsDeleteResponse delete(@Nonnull FileStorageUploadSessionsDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -214,8 +216,8 @@ public FileStorageUploadSessionsDeleteResponse delete(FileStorageUploadSessionsD * @throws Exception if the API call fails */ public FileStorageUploadSessionsDeleteResponse delete( - FileStorageUploadSessionsDeleteRequest request, - Optional options) throws Exception { + @Nonnull FileStorageUploadSessionsDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageUploadSessionsDeleteOperation( sdkConfiguration, @@ -243,8 +245,8 @@ public FileStorageUploadSessionsFinishRequestBuilder finish() { * @return The response from the API call * @throws Exception if the API call fails */ - public FileStorageUploadSessionsFinishResponse finish(FileStorageUploadSessionsFinishRequest request) throws Exception { - return finish(request, Optional.empty(), Optional.empty()); + public FileStorageUploadSessionsFinishResponse finish(@Nonnull FileStorageUploadSessionsFinishRequest request) throws Exception { + return finish(request, null, null); } /** @@ -259,9 +261,9 @@ public FileStorageUploadSessionsFinishResponse finish(FileStorageUploadSessionsF * @throws Exception if the API call fails */ public FileStorageUploadSessionsFinishResponse finish( - FileStorageUploadSessionsFinishRequest request, - Optional serverURL, - Optional options) throws Exception { + @Nonnull FileStorageUploadSessionsFinishRequest request, + @Nullable String serverURL, + @Nullable Options options) throws Exception { RequestOperation operation = new FileStorageUploadSessionsFinishOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Users.java b/src/main/java/com/apideck/unify/Users.java index 51558f63..fa3a97bf 100644 --- a/src/main/java/com/apideck/unify/Users.java +++ b/src/main/java/com/apideck/unify/Users.java @@ -26,6 +26,8 @@ import com.apideck.unify.operations.CrmUsersOneOperation; import com.apideck.unify.operations.CrmUsersUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -57,8 +59,8 @@ public CrmUsersAllRequestBuilder list() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmUsersAllResponse list(CrmUsersAllRequest request) throws Exception { - return list(request, Optional.empty()); + public CrmUsersAllResponse list(@Nonnull CrmUsersAllRequest request) throws Exception { + return list(request, null); } /** @@ -72,8 +74,8 @@ public CrmUsersAllResponse list(CrmUsersAllRequest request) throws Exception { * @throws Exception if the API call fails */ public CrmUsersAllResponse list( - CrmUsersAllRequest request, - Optional options) throws Exception { + @Nonnull CrmUsersAllRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmUsersAllOperation( sdkConfiguration, @@ -101,8 +103,8 @@ public CrmUsersAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmUsersAddResponse create(CrmUsersAddRequest request) throws Exception { - return create(request, Optional.empty()); + public CrmUsersAddResponse create(@Nonnull CrmUsersAddRequest request) throws Exception { + return create(request, null); } /** @@ -116,8 +118,8 @@ public CrmUsersAddResponse create(CrmUsersAddRequest request) throws Exception { * @throws Exception if the API call fails */ public CrmUsersAddResponse create( - CrmUsersAddRequest request, - Optional options) throws Exception { + @Nonnull CrmUsersAddRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmUsersAddOperation( sdkConfiguration, @@ -145,8 +147,8 @@ public CrmUsersOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmUsersOneResponse get(CrmUsersOneRequest request) throws Exception { - return get(request, Optional.empty()); + public CrmUsersOneResponse get(@Nonnull CrmUsersOneRequest request) throws Exception { + return get(request, null); } /** @@ -160,8 +162,8 @@ public CrmUsersOneResponse get(CrmUsersOneRequest request) throws Exception { * @throws Exception if the API call fails */ public CrmUsersOneResponse get( - CrmUsersOneRequest request, - Optional options) throws Exception { + @Nonnull CrmUsersOneRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmUsersOneOperation( sdkConfiguration, @@ -189,8 +191,8 @@ public CrmUsersUpdateRequestBuilder update() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmUsersUpdateResponse update(CrmUsersUpdateRequest request) throws Exception { - return update(request, Optional.empty()); + public CrmUsersUpdateResponse update(@Nonnull CrmUsersUpdateRequest request) throws Exception { + return update(request, null); } /** @@ -204,8 +206,8 @@ public CrmUsersUpdateResponse update(CrmUsersUpdateRequest request) throws Excep * @throws Exception if the API call fails */ public CrmUsersUpdateResponse update( - CrmUsersUpdateRequest request, - Optional options) throws Exception { + @Nonnull CrmUsersUpdateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmUsersUpdateOperation( sdkConfiguration, @@ -233,8 +235,8 @@ public CrmUsersDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public CrmUsersDeleteResponse delete(CrmUsersDeleteRequest request) throws Exception { - return delete(request, Optional.empty()); + public CrmUsersDeleteResponse delete(@Nonnull CrmUsersDeleteRequest request) throws Exception { + return delete(request, null); } /** @@ -248,8 +250,8 @@ public CrmUsersDeleteResponse delete(CrmUsersDeleteRequest request) throws Excep * @throws Exception if the API call fails */ public CrmUsersDeleteResponse delete( - CrmUsersDeleteRequest request, - Optional options) throws Exception { + @Nonnull CrmUsersDeleteRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new CrmUsersDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/ValidateConnection.java b/src/main/java/com/apideck/unify/ValidateConnection.java index d8663f8d..9ecf5218 100644 --- a/src/main/java/com/apideck/unify/ValidateConnection.java +++ b/src/main/java/com/apideck/unify/ValidateConnection.java @@ -10,6 +10,8 @@ import com.apideck.unify.models.operations.VaultValidateConnectionStateResponse; import com.apideck.unify.operations.VaultValidateConnectionStateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.util.List; import java.util.Optional; @@ -51,8 +53,8 @@ public VaultValidateConnectionStateRequestBuilder state() { * @return The response from the API call * @throws Exception if the API call fails */ - public VaultValidateConnectionStateResponse state(VaultValidateConnectionStateRequest request) throws Exception { - return state(request, Optional.empty()); + public VaultValidateConnectionStateResponse state(@Nonnull VaultValidateConnectionStateRequest request) throws Exception { + return state(request, null); } /** @@ -71,8 +73,8 @@ public VaultValidateConnectionStateResponse state(VaultValidateConnectionStateRe * @throws Exception if the API call fails */ public VaultValidateConnectionStateResponse state( - VaultValidateConnectionStateRequest request, - Optional options) throws Exception { + @Nonnull VaultValidateConnectionStateRequest request, + @Nullable Options options) throws Exception { RequestOperation operation = new VaultValidateConnectionStateOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/Webhooks.java b/src/main/java/com/apideck/unify/Webhooks.java index d0881aab..6d02a61c 100644 --- a/src/main/java/com/apideck/unify/Webhooks.java +++ b/src/main/java/com/apideck/unify/Webhooks.java @@ -28,6 +28,8 @@ import com.apideck.unify.operations.WebhookWebhooksOneOperation; import com.apideck.unify.operations.WebhookWebhooksUpdateOperation; import com.apideck.unify.utils.Options; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.Long; import java.lang.String; @@ -62,8 +64,8 @@ public WebhookWebhooksAllRequestBuilder list() { * @throws Exception if the API call fails */ public WebhookWebhooksAllResponse listDirect() throws Exception { - return list(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + return list(null, JsonNullable.undefined(), null, + null); } /** @@ -79,17 +81,14 @@ public WebhookWebhooksAllResponse listDirect() throws Exception { * @throws Exception if the API call fails */ public WebhookWebhooksAllResponse list( - Optional appId, - JsonNullable cursor, - Optional limit, - Optional options) throws Exception { - WebhookWebhooksAllRequest request = - WebhookWebhooksAllRequest - .builder() - .appId(appId) - .cursor(cursor) - .limit(limit) - .build(); + @Nullable String appId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Options options) throws Exception { + WebhookWebhooksAllRequest request = new WebhookWebhooksAllRequest( + appId, + cursor, + limit); RequestOperation operation = new WebhookWebhooksAllOperation( sdkConfiguration, @@ -117,8 +116,8 @@ public WebhookWebhooksAddRequestBuilder create() { * @return The response from the API call * @throws Exception if the API call fails */ - public WebhookWebhooksAddResponse create(CreateWebhookRequest createWebhookRequest) throws Exception { - return create(Optional.empty(), createWebhookRequest, Optional.empty()); + public WebhookWebhooksAddResponse create(@Nonnull CreateWebhookRequest createWebhookRequest) throws Exception { + return create(null, createWebhookRequest, null); } /** @@ -133,15 +132,12 @@ public WebhookWebhooksAddResponse create(CreateWebhookRequest createWebhookReque * @throws Exception if the API call fails */ public WebhookWebhooksAddResponse create( - Optional appId, - CreateWebhookRequest createWebhookRequest, - Optional options) throws Exception { - WebhookWebhooksAddRequest request = - WebhookWebhooksAddRequest - .builder() - .appId(appId) - .createWebhookRequest(createWebhookRequest) - .build(); + @Nullable String appId, + @Nonnull CreateWebhookRequest createWebhookRequest, + @Nullable Options options) throws Exception { + WebhookWebhooksAddRequest request = new WebhookWebhooksAddRequest( + appId, + createWebhookRequest); RequestOperation operation = new WebhookWebhooksAddOperation( sdkConfiguration, @@ -169,8 +165,8 @@ public WebhookWebhooksOneRequestBuilder get() { * @return The response from the API call * @throws Exception if the API call fails */ - public WebhookWebhooksOneResponse get(String id) throws Exception { - return get(id, Optional.empty(), Optional.empty()); + public WebhookWebhooksOneResponse get(@Nonnull String id) throws Exception { + return get(id, null, null); } /** @@ -185,15 +181,12 @@ public WebhookWebhooksOneResponse get(String id) throws Exception { * @throws Exception if the API call fails */ public WebhookWebhooksOneResponse get( - String id, - Optional appId, - Optional options) throws Exception { - WebhookWebhooksOneRequest request = - WebhookWebhooksOneRequest - .builder() - .id(id) - .appId(appId) - .build(); + @Nonnull String id, + @Nullable String appId, + @Nullable Options options) throws Exception { + WebhookWebhooksOneRequest request = new WebhookWebhooksOneRequest( + id, + appId); RequestOperation operation = new WebhookWebhooksOneOperation( sdkConfiguration, @@ -223,10 +216,10 @@ public WebhookWebhooksUpdateRequestBuilder update() { * @throws Exception if the API call fails */ public WebhookWebhooksUpdateResponse update( - String id, - UpdateWebhookRequest updateWebhookRequest) throws Exception { - return update(id, Optional.empty(), updateWebhookRequest, - Optional.empty()); + @Nonnull String id, + @Nonnull UpdateWebhookRequest updateWebhookRequest) throws Exception { + return update(id, null, updateWebhookRequest, + null); } /** @@ -242,17 +235,14 @@ public WebhookWebhooksUpdateResponse update( * @throws Exception if the API call fails */ public WebhookWebhooksUpdateResponse update( - String id, - Optional appId, - UpdateWebhookRequest updateWebhookRequest, - Optional options) throws Exception { - WebhookWebhooksUpdateRequest request = - WebhookWebhooksUpdateRequest - .builder() - .id(id) - .appId(appId) - .updateWebhookRequest(updateWebhookRequest) - .build(); + @Nonnull String id, + @Nullable String appId, + @Nonnull UpdateWebhookRequest updateWebhookRequest, + @Nullable Options options) throws Exception { + WebhookWebhooksUpdateRequest request = new WebhookWebhooksUpdateRequest( + id, + appId, + updateWebhookRequest); RequestOperation operation = new WebhookWebhooksUpdateOperation( sdkConfiguration, @@ -280,8 +270,8 @@ public WebhookWebhooksDeleteRequestBuilder delete() { * @return The response from the API call * @throws Exception if the API call fails */ - public WebhookWebhooksDeleteResponse delete(String id) throws Exception { - return delete(id, Optional.empty(), Optional.empty()); + public WebhookWebhooksDeleteResponse delete(@Nonnull String id) throws Exception { + return delete(id, null, null); } /** @@ -296,15 +286,12 @@ public WebhookWebhooksDeleteResponse delete(String id) throws Exception { * @throws Exception if the API call fails */ public WebhookWebhooksDeleteResponse delete( - String id, - Optional appId, - Optional options) throws Exception { - WebhookWebhooksDeleteRequest request = - WebhookWebhooksDeleteRequest - .builder() - .id(id) - .appId(appId) - .build(); + @Nonnull String id, + @Nullable String appId, + @Nullable Options options) throws Exception { + WebhookWebhooksDeleteRequest request = new WebhookWebhooksDeleteRequest( + id, + appId); RequestOperation operation = new WebhookWebhooksDeleteOperation( sdkConfiguration, diff --git a/src/main/java/com/apideck/unify/models/components/AccountingDepartment.java b/src/main/java/com/apideck/unify/models/components/AccountingDepartment.java index a92fb7bb..663d39f6 100644 --- a/src/main/java/com/apideck/unify/models/components/AccountingDepartment.java +++ b/src/main/java/com/apideck/unify/models/components/AccountingDepartment.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -26,7 +25,7 @@ public class AccountingDepartment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * A unique identifier for an object. @@ -47,26 +46,26 @@ public class AccountingDepartment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private DepartmentStatus status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiaries") - private Optional> subsidiaries; + private List subsidiaries; /** * The code of the department. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -108,162 +107,140 @@ public class AccountingDepartment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public AccountingDepartment( - @JsonProperty("id") Optional id, - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("name") JsonNullable name, - @JsonProperty("status") Optional status, - @JsonProperty("subsidiaries") Optional> subsidiaries, - @JsonProperty("code") Optional code, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(subsidiaries, "subsidiaries"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("status") @Nullable DepartmentStatus status, + @JsonProperty("subsidiaries") @Nullable List subsidiaries, + @JsonProperty("code") @Nullable String code, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.parentId = parentId; - this.name = name; + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); this.status = status; this.subsidiaries = subsidiaries; this.code = code; - this.customMappings = customMappings; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public AccountingDepartment() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The name of the department. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * Based on the status some functionality is enabled or disabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subsidiaries() { - return (Optional>) subsidiaries; + return Optional.ofNullable(this.subsidiaries); } /** * The code of the department. */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -274,236 +251,117 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public AccountingDepartment withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public AccountingDepartment withId(Optional id) { - Utils.checkNotNull(id, "id"); + public AccountingDepartment withId(@Nullable String id) { this.id = id; return this; } + /** * A unique identifier for an object. */ - public AccountingDepartment withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public AccountingDepartment withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public AccountingDepartment withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The name of the department. */ - public AccountingDepartment withName(String name) { - Utils.checkNotNull(name, "name"); + public AccountingDepartment withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the department. - */ - public AccountingDepartment withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * Based on the status some functionality is enabled or disabled. */ - public AccountingDepartment withStatus(DepartmentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - - /** - * Based on the status some functionality is enabled or disabled. - */ - public AccountingDepartment withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public AccountingDepartment withStatus(@Nullable DepartmentStatus status) { this.status = status; return this; } - public AccountingDepartment withSubsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - public AccountingDepartment withSubsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public AccountingDepartment withSubsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - /** - * The code of the department. - */ - public AccountingDepartment withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The code of the department. */ - public AccountingDepartment withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public AccountingDepartment withCode(@Nullable String code) { this.code = code; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public AccountingDepartment withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public AccountingDepartment withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public AccountingDepartment withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public AccountingDepartment withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public AccountingDepartment withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public AccountingDepartment withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public AccountingDepartment withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public AccountingDepartment withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public AccountingDepartment withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public AccountingDepartment withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public AccountingDepartment withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public AccountingDepartment withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public AccountingDepartment withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public AccountingDepartment withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public AccountingDepartment withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public AccountingDepartment withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public AccountingDepartment withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public AccountingDepartment withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public AccountingDepartment withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public AccountingDepartment withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingDepartment withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -560,279 +418,138 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private Optional status = Optional.empty(); + private DepartmentStatus status; - private Optional> subsidiaries = Optional.empty(); + private List subsidiaries; - private Optional code = Optional.empty(); + private String code; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * A unique identifier for an object. */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The name of the department. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the department. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - - /** - * Based on the status some functionality is enabled or disabled. - */ - public Builder status(DepartmentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Based on the status some functionality is enabled or disabled. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable DepartmentStatus status) { this.status = status; return this; } - - public Builder subsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - public Builder subsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public Builder subsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - - /** - * The code of the department. - */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The code of the department. */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public AccountingDepartment build() { - return new AccountingDepartment( id, parentId, name, status, subsidiaries, code, diff --git a/src/main/java/com/apideck/unify/models/components/AccountingDepartmentInput.java b/src/main/java/com/apideck/unify/models/components/AccountingDepartmentInput.java index 4c3e9add..e7b252b9 100644 --- a/src/main/java/com/apideck/unify/models/components/AccountingDepartmentInput.java +++ b/src/main/java/com/apideck/unify/models/components/AccountingDepartmentInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -37,19 +36,19 @@ public class AccountingDepartmentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private DepartmentStatus status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiaries") - private Optional> subsidiaries; + private List subsidiaries; /** * The code of the department. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -63,93 +62,79 @@ public class AccountingDepartmentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public AccountingDepartmentInput( - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("name") JsonNullable name, - @JsonProperty("status") Optional status, - @JsonProperty("subsidiaries") Optional> subsidiaries, - @JsonProperty("code") Optional code, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(subsidiaries, "subsidiaries"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - this.parentId = parentId; - this.name = name; + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("status") @Nullable DepartmentStatus status, + @JsonProperty("subsidiaries") @Nullable List subsidiaries, + @JsonProperty("code") @Nullable String code, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); this.status = status; this.subsidiaries = subsidiaries; this.code = code; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public AccountingDepartmentInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The name of the department. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * Based on the status some functionality is enabled or disabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subsidiaries() { - return (Optional>) subsidiaries; + return Optional.ofNullable(this.subsidiaries); } /** * The code of the department. */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -160,114 +145,50 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public AccountingDepartmentInput withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public AccountingDepartmentInput withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public AccountingDepartmentInput withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The name of the department. */ - public AccountingDepartmentInput withName(String name) { - Utils.checkNotNull(name, "name"); + public AccountingDepartmentInput withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the department. - */ - public AccountingDepartmentInput withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public AccountingDepartmentInput withStatus(DepartmentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Based on the status some functionality is enabled or disabled. */ - public AccountingDepartmentInput withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public AccountingDepartmentInput withStatus(@Nullable DepartmentStatus status) { this.status = status; return this; } - public AccountingDepartmentInput withSubsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - public AccountingDepartmentInput withSubsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public AccountingDepartmentInput withSubsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - /** - * The code of the department. - */ - public AccountingDepartmentInput withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The code of the department. */ - public AccountingDepartmentInput withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public AccountingDepartmentInput withCode(@Nullable String code) { this.code = code; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public AccountingDepartmentInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public AccountingDepartmentInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public AccountingDepartmentInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public AccountingDepartmentInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -275,12 +196,12 @@ public AccountingDepartmentInput withPassThrough(List passThrou /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public AccountingDepartmentInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingDepartmentInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -323,153 +244,78 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private Optional status = Optional.empty(); + private DepartmentStatus status; - private Optional> subsidiaries = Optional.empty(); + private List subsidiaries; - private Optional code = Optional.empty(); + private String code; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The name of the department. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the department. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - - /** - * Based on the status some functionality is enabled or disabled. - */ - public Builder status(DepartmentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Based on the status some functionality is enabled or disabled. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable DepartmentStatus status) { this.status = status; return this; } - - public Builder subsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - public Builder subsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public Builder subsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - /** * The code of the department. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The code of the department. - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public AccountingDepartmentInput build() { - return new AccountingDepartmentInput( parentId, name, status, subsidiaries, code, rowVersion, diff --git a/src/main/java/com/apideck/unify/models/components/AccountingDepartmentsFilter.java b/src/main/java/com/apideck/unify/models/components/AccountingDepartmentsFilter.java index 1f0b264a..28bef713 100644 --- a/src/main/java/com/apideck/unify/models/components/AccountingDepartmentsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/AccountingDepartmentsFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,25 +17,23 @@ public class AccountingDepartmentsFilter { * Id of the subsidiary to search for */ @SpeakeasyMetadata("queryParam:name=subsidiary") - private Optional subsidiary; + private String subsidiary; @JsonCreator public AccountingDepartmentsFilter( - Optional subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); + @Nullable String subsidiary) { this.subsidiary = subsidiary; } public AccountingDepartmentsFilter() { - this(Optional.empty()); + this(null); } /** * Id of the subsidiary to search for */ - @JsonIgnore public Optional subsidiary() { - return subsidiary; + return Optional.ofNullable(this.subsidiary); } public static Builder builder() { @@ -46,22 +44,12 @@ public static Builder builder() { /** * Id of the subsidiary to search for */ - public AccountingDepartmentsFilter withSubsidiary(String subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); - this.subsidiary = Optional.ofNullable(subsidiary); - return this; - } - - - /** - * Id of the subsidiary to search for - */ - public AccountingDepartmentsFilter withSubsidiary(Optional subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); + public AccountingDepartmentsFilter withSubsidiary(@Nullable String subsidiary) { this.subsidiary = subsidiary; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,33 +78,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional subsidiary = Optional.empty(); + private String subsidiary; private Builder() { // force use of static builder() method } - - /** - * Id of the subsidiary to search for - */ - public Builder subsidiary(String subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); - this.subsidiary = Optional.ofNullable(subsidiary); - return this; - } - /** * Id of the subsidiary to search for */ - public Builder subsidiary(Optional subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); + public Builder subsidiary(@Nullable String subsidiary) { this.subsidiary = subsidiary; return this; } public AccountingDepartmentsFilter build() { - return new AccountingDepartmentsFilter( subsidiary); } diff --git a/src/main/java/com/apideck/unify/models/components/AccountingLocation.java b/src/main/java/com/apideck/unify/models/components/AccountingLocation.java index 3d61ace4..a9881fc4 100644 --- a/src/main/java/com/apideck/unify/models/components/AccountingLocation.java +++ b/src/main/java/com/apideck/unify/models/components/AccountingLocation.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -26,7 +25,7 @@ public class AccountingLocation { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * A unique identifier for an object. @@ -54,24 +53,24 @@ public class AccountingLocation { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private LocationStatus status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiaries") - private Optional> subsidiaries; + private List subsidiaries; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -113,171 +112,147 @@ public class AccountingLocation { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public AccountingLocation( - @JsonProperty("id") Optional id, - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("status") Optional status, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("subsidiaries") Optional> subsidiaries, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(subsidiaries, "subsidiaries"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("status") @Nullable LocationStatus status, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("subsidiaries") @Nullable List subsidiaries, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.parentId = parentId; - this.companyName = companyName; - this.displayName = displayName; + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); this.status = status; this.addresses = addresses; this.subsidiaries = subsidiaries; - this.customMappings = customMappings; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public AccountingLocation() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The display name of the location. */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * Based on the status some functionality is enabled or disabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subsidiaries() { - return (Optional>) subsidiaries; + return Optional.ofNullable(this.subsidiaries); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -288,248 +263,123 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public AccountingLocation withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public AccountingLocation withId(Optional id) { - Utils.checkNotNull(id, "id"); + public AccountingLocation withId(@Nullable String id) { this.id = id; return this; } + /** * A unique identifier for an object. */ - public AccountingLocation withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public AccountingLocation withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public AccountingLocation withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The name of the company. */ - public AccountingLocation withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public AccountingLocation withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public AccountingLocation withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The display name of the location. */ - public AccountingLocation withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public AccountingLocation withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the location. - */ - public AccountingLocation withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public AccountingLocation withStatus(LocationStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Based on the status some functionality is enabled or disabled. */ - public AccountingLocation withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public AccountingLocation withStatus(@Nullable LocationStatus status) { this.status = status; return this; } - public AccountingLocation withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public AccountingLocation withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public AccountingLocation withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public AccountingLocation withSubsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - public AccountingLocation withSubsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public AccountingLocation withSubsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public AccountingLocation withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public AccountingLocation withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public AccountingLocation withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public AccountingLocation withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public AccountingLocation withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public AccountingLocation withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public AccountingLocation withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public AccountingLocation withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public AccountingLocation withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public AccountingLocation withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public AccountingLocation withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public AccountingLocation withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public AccountingLocation withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public AccountingLocation withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public AccountingLocation withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public AccountingLocation withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public AccountingLocation withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public AccountingLocation withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public AccountingLocation withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public AccountingLocation withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingLocation withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -588,294 +438,145 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private Optional status = Optional.empty(); + private LocationStatus status; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> subsidiaries = Optional.empty(); + private List subsidiaries; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * A unique identifier for an object. */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The display name of the location. */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the location. - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - - /** - * Based on the status some functionality is enabled or disabled. - */ - public Builder status(LocationStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Based on the status some functionality is enabled or disabled. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable LocationStatus status) { this.status = status; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder subsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - public Builder subsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public Builder subsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public AccountingLocation build() { - return new AccountingLocation( id, parentId, companyName, displayName, status, addresses, diff --git a/src/main/java/com/apideck/unify/models/components/AccountingLocationInput.java b/src/main/java/com/apideck/unify/models/components/AccountingLocationInput.java index b0ee2f4d..1319a720 100644 --- a/src/main/java/com/apideck/unify/models/components/AccountingLocationInput.java +++ b/src/main/java/com/apideck/unify/models/components/AccountingLocationInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -44,17 +43,17 @@ public class AccountingLocationInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private LocationStatus status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiaries") - private Optional> subsidiaries; + private List subsidiaries; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -68,102 +67,86 @@ public class AccountingLocationInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public AccountingLocationInput( - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("status") Optional status, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("subsidiaries") Optional> subsidiaries, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(subsidiaries, "subsidiaries"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - this.parentId = parentId; - this.companyName = companyName; - this.displayName = displayName; + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("status") @Nullable LocationStatus status, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("subsidiaries") @Nullable List subsidiaries, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); this.status = status; this.addresses = addresses; this.subsidiaries = subsidiaries; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public AccountingLocationInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The display name of the location. */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * Based on the status some functionality is enabled or disabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subsidiaries() { - return (Optional>) subsidiaries; + return Optional.ofNullable(this.subsidiaries); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -174,126 +157,56 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public AccountingLocationInput withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public AccountingLocationInput withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public AccountingLocationInput withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The name of the company. */ - public AccountingLocationInput withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public AccountingLocationInput withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public AccountingLocationInput withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The display name of the location. */ - public AccountingLocationInput withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public AccountingLocationInput withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the location. - */ - public AccountingLocationInput withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public AccountingLocationInput withStatus(LocationStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Based on the status some functionality is enabled or disabled. */ - public AccountingLocationInput withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public AccountingLocationInput withStatus(@Nullable LocationStatus status) { this.status = status; return this; } - public AccountingLocationInput withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public AccountingLocationInput withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public AccountingLocationInput withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public AccountingLocationInput withSubsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - public AccountingLocationInput withSubsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public AccountingLocationInput withSubsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public AccountingLocationInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public AccountingLocationInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public AccountingLocationInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public AccountingLocationInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -301,12 +214,12 @@ public AccountingLocationInput withPassThrough(List passThrough /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public AccountingLocationInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingLocationInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -351,168 +264,85 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private Optional status = Optional.empty(); + private LocationStatus status; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> subsidiaries = Optional.empty(); + private List subsidiaries; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The display name of the location. */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the location. - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - - /** - * Based on the status some functionality is enabled or disabled. - */ - public Builder status(LocationStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Based on the status some functionality is enabled or disabled. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable LocationStatus status) { this.status = status; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder subsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - public Builder subsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public Builder subsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public AccountingLocationInput build() { - return new AccountingLocationInput( parentId, companyName, displayName, status, addresses, subsidiaries, diff --git a/src/main/java/com/apideck/unify/models/components/AccountingLocationsFilter.java b/src/main/java/com/apideck/unify/models/components/AccountingLocationsFilter.java index 65532410..564582f7 100644 --- a/src/main/java/com/apideck/unify/models/components/AccountingLocationsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/AccountingLocationsFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,25 +17,23 @@ public class AccountingLocationsFilter { * Id of the subsidiary to search for */ @SpeakeasyMetadata("queryParam:name=subsidiary") - private Optional subsidiary; + private String subsidiary; @JsonCreator public AccountingLocationsFilter( - Optional subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); + @Nullable String subsidiary) { this.subsidiary = subsidiary; } public AccountingLocationsFilter() { - this(Optional.empty()); + this(null); } /** * Id of the subsidiary to search for */ - @JsonIgnore public Optional subsidiary() { - return subsidiary; + return Optional.ofNullable(this.subsidiary); } public static Builder builder() { @@ -46,22 +44,12 @@ public static Builder builder() { /** * Id of the subsidiary to search for */ - public AccountingLocationsFilter withSubsidiary(String subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); - this.subsidiary = Optional.ofNullable(subsidiary); - return this; - } - - - /** - * Id of the subsidiary to search for - */ - public AccountingLocationsFilter withSubsidiary(Optional subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); + public AccountingLocationsFilter withSubsidiary(@Nullable String subsidiary) { this.subsidiary = subsidiary; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,33 +78,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional subsidiary = Optional.empty(); + private String subsidiary; private Builder() { // force use of static builder() method } - - /** - * Id of the subsidiary to search for - */ - public Builder subsidiary(String subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); - this.subsidiary = Optional.ofNullable(subsidiary); - return this; - } - /** * Id of the subsidiary to search for */ - public Builder subsidiary(Optional subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); + public Builder subsidiary(@Nullable String subsidiary) { this.subsidiary = subsidiary; return this; } public AccountingLocationsFilter build() { - return new AccountingLocationsFilter( subsidiary); } diff --git a/src/main/java/com/apideck/unify/models/components/ActivitiesFilter.java b/src/main/java/com/apideck/unify/models/components/ActivitiesFilter.java index 1cb948c4..f58c484c 100644 --- a/src/main/java/com/apideck/unify/models/components/ActivitiesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/ActivitiesFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; @@ -18,42 +18,37 @@ public class ActivitiesFilter { * Company ID to filter on */ @SpeakeasyMetadata("queryParam:name=company_id") - private Optional companyId; + private String companyId; /** * Owner ID to filter on */ @SpeakeasyMetadata("queryParam:name=owner_id") - private Optional ownerId; + private String ownerId; /** * Primary contact ID to filter on */ @SpeakeasyMetadata("queryParam:name=contact_id") - private Optional contactId; + private String contactId; @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private OffsetDateTime updatedSince; /** * Type to filter on */ @SpeakeasyMetadata("queryParam:name=type") - private Optional type; + private String type; @JsonCreator public ActivitiesFilter( - Optional companyId, - Optional ownerId, - Optional contactId, - Optional updatedSince, - Optional type) { - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(contactId, "contactId"); - Utils.checkNotNull(updatedSince, "updatedSince"); - Utils.checkNotNull(type, "type"); + @Nullable String companyId, + @Nullable String ownerId, + @Nullable String contactId, + @Nullable OffsetDateTime updatedSince, + @Nullable String type) { this.companyId = companyId; this.ownerId = ownerId; this.contactId = contactId; @@ -62,45 +57,40 @@ public ActivitiesFilter( } public ActivitiesFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * Company ID to filter on */ - @JsonIgnore public Optional companyId() { - return companyId; + return Optional.ofNullable(this.companyId); } /** * Owner ID to filter on */ - @JsonIgnore public Optional ownerId() { - return ownerId; + return Optional.ofNullable(this.ownerId); } /** * Primary contact ID to filter on */ - @JsonIgnore public Optional contactId() { - return contactId; + return Optional.ofNullable(this.contactId); } - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } /** * Type to filter on */ - @JsonIgnore public Optional type() { - return type; + return Optional.ofNullable(this.type); } public static Builder builder() { @@ -111,92 +101,45 @@ public static Builder builder() { /** * Company ID to filter on */ - public ActivitiesFilter withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - - - /** - * Company ID to filter on - */ - public ActivitiesFilter withCompanyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public ActivitiesFilter withCompanyId(@Nullable String companyId) { this.companyId = companyId; return this; } - /** - * Owner ID to filter on - */ - public ActivitiesFilter withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = Optional.ofNullable(ownerId); - return this; - } - /** * Owner ID to filter on */ - public ActivitiesFilter withOwnerId(Optional ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public ActivitiesFilter withOwnerId(@Nullable String ownerId) { this.ownerId = ownerId; return this; } - /** - * Primary contact ID to filter on - */ - public ActivitiesFilter withContactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = Optional.ofNullable(contactId); - return this; - } - /** * Primary contact ID to filter on */ - public ActivitiesFilter withContactId(Optional contactId) { - Utils.checkNotNull(contactId, "contactId"); + public ActivitiesFilter withContactId(@Nullable String contactId) { this.contactId = contactId; return this; } - public ActivitiesFilter withUpdatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public ActivitiesFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public ActivitiesFilter withUpdatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - /** - * Type to filter on - */ - public ActivitiesFilter withType(String type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type to filter on */ - public ActivitiesFilter withType(Optional type) { - Utils.checkNotNull(type, "type"); + public ActivitiesFilter withType(@Nullable String type) { this.type = type; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -234,111 +177,58 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional companyId = Optional.empty(); + private String companyId; - private Optional ownerId = Optional.empty(); + private String ownerId; - private Optional contactId = Optional.empty(); + private String contactId; - private Optional updatedSince = Optional.empty(); + private OffsetDateTime updatedSince; - private Optional type = Optional.empty(); + private String type; private Builder() { // force use of static builder() method } - - /** - * Company ID to filter on - */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - /** * Company ID to filter on */ - public Builder companyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = companyId; return this; } - - /** - * Owner ID to filter on - */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = Optional.ofNullable(ownerId); - return this; - } - /** * Owner ID to filter on */ - public Builder ownerId(Optional ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = ownerId; return this; } - /** * Primary contact ID to filter on */ - public Builder contactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = Optional.ofNullable(contactId); - return this; - } - - /** - * Primary contact ID to filter on - */ - public Builder contactId(Optional contactId) { - Utils.checkNotNull(contactId, "contactId"); + public Builder contactId(@Nullable String contactId) { this.contactId = contactId; return this; } - - public Builder updatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - /** * Type to filter on */ - public Builder type(String type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - /** - * Type to filter on - */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = type; return this; } public ActivitiesFilter build() { - return new ActivitiesFilter( companyId, ownerId, contactId, updatedSince, type); diff --git a/src/main/java/com/apideck/unify/models/components/ActivitiesSort.java b/src/main/java/com/apideck/unify/models/components/ActivitiesSort.java index 7abcb3ee..830a0430 100644 --- a/src/main/java/com/apideck/unify/models/components/ActivitiesSort.java +++ b/src/main/java/com/apideck/unify/models/components/ActivitiesSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class ActivitiesSort { * The field on which to sort the Activities */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private ActivitiesSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public ActivitiesSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable ActivitiesSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public ActivitiesSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Activities */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Activities */ - public ActivitiesSort withBy(ActivitiesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Activities - */ - public ActivitiesSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public ActivitiesSort withBy(@Nullable ActivitiesSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public ActivitiesSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public ActivitiesSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public ActivitiesSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private ActivitiesSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Activities - */ - public Builder by(ActivitiesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Activities */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable ActivitiesSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public ActivitiesSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new ActivitiesSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/Activity.java b/src/main/java/com/apideck/unify/models/components/Activity.java index 58218d74..deab9892 100644 --- a/src/main/java/com/apideck/unify/models/components/Activity.java +++ b/src/main/java/com/apideck/unify/models/components/Activity.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -27,7 +26,7 @@ public class Activity { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The third-party API ID of original entity @@ -153,7 +152,7 @@ public class Activity { */ @JsonInclude(Include.ALWAYS) @JsonProperty("type") - private Optional type; + private JsonNullable type; /** * The title of the activity @@ -186,7 +185,7 @@ public class Activity { @JsonInclude(Include.NON_ABSENT) @JsonProperty("location_address") - private Optional locationAddress; + private Address locationAddress; /** * Whether the Activity is an all day event or not @@ -247,7 +246,7 @@ public class Activity { @JsonInclude(Include.NON_ABSENT) @JsonProperty("show_as") - private JsonNullable showAs; + private JsonNullable showAs; /** * Whether the Activity is done or not @@ -296,7 +295,7 @@ public class Activity { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("recurrent") - private Optional recurrent; + private Boolean recurrent; /** * The date and time of the reminder @@ -331,19 +330,19 @@ public class Activity { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("attendees") - private Optional> attendees; + private List attendees; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the activity @@ -378,601 +377,535 @@ public class Activity { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Activity( - @JsonProperty("id") Optional id, - @JsonProperty("downstream_id") JsonNullable downstreamId, - @JsonProperty("activity_datetime") JsonNullable activityDatetime, - @JsonProperty("duration_seconds") JsonNullable durationSeconds, - @JsonProperty("user_id") JsonNullable userId, - @JsonProperty("account_id") JsonNullable accountId, - @JsonProperty("contact_id") JsonNullable contactId, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("opportunity_id") JsonNullable opportunityId, - @JsonProperty("lead_id") JsonNullable leadId, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("campaign_id") JsonNullable campaignId, - @JsonProperty("case_id") JsonNullable caseId, - @JsonProperty("asset_id") JsonNullable assetId, - @JsonProperty("contract_id") JsonNullable contractId, - @JsonProperty("product_id") JsonNullable productId, - @JsonProperty("solution_id") JsonNullable solutionId, - @JsonProperty("custom_object_id") JsonNullable customObjectId, - @JsonProperty("type") Optional type, - @JsonProperty("title") JsonNullable title, - @JsonProperty("description") JsonNullable description, - @JsonProperty("note") JsonNullable note, - @JsonProperty("location") JsonNullable location, - @JsonProperty("location_address") Optional locationAddress, - @JsonProperty("all_day_event") JsonNullable allDayEvent, - @JsonProperty("private") JsonNullable private_, - @JsonProperty("group_event") JsonNullable groupEvent, - @JsonProperty("event_sub_type") JsonNullable eventSubType, - @JsonProperty("group_event_type") JsonNullable groupEventType, - @JsonProperty("child") JsonNullable child, - @JsonProperty("archived") JsonNullable archived, - @JsonProperty("deleted") JsonNullable deleted, - @JsonProperty("show_as") JsonNullable showAs, - @JsonProperty("done") JsonNullable done, - @JsonProperty("start_datetime") JsonNullable startDatetime, - @JsonProperty("end_datetime") JsonNullable endDatetime, - @JsonProperty("duration_minutes") JsonNullable durationMinutes, - @JsonProperty("activity_date") JsonNullable activityDate, - @JsonProperty("end_date") JsonNullable endDate, - @JsonProperty("recurrent") Optional recurrent, - @JsonProperty("reminder_datetime") JsonNullable reminderDatetime, - @JsonProperty("reminder_set") JsonNullable reminderSet, - @JsonProperty("video_conference_url") JsonNullable videoConferenceUrl, - @JsonProperty("video_conference_id") JsonNullable videoConferenceId, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("attendees") Optional> attendees, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(activityDatetime, "activityDatetime"); - Utils.checkNotNull(durationSeconds, "durationSeconds"); - Utils.checkNotNull(userId, "userId"); - Utils.checkNotNull(accountId, "accountId"); - Utils.checkNotNull(contactId, "contactId"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(opportunityId, "opportunityId"); - Utils.checkNotNull(leadId, "leadId"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(campaignId, "campaignId"); - Utils.checkNotNull(caseId, "caseId"); - Utils.checkNotNull(assetId, "assetId"); - Utils.checkNotNull(contractId, "contractId"); - Utils.checkNotNull(productId, "productId"); - Utils.checkNotNull(solutionId, "solutionId"); - Utils.checkNotNull(customObjectId, "customObjectId"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(note, "note"); - Utils.checkNotNull(location, "location"); - Utils.checkNotNull(locationAddress, "locationAddress"); - Utils.checkNotNull(allDayEvent, "allDayEvent"); - Utils.checkNotNull(private_, "private_"); - Utils.checkNotNull(groupEvent, "groupEvent"); - Utils.checkNotNull(eventSubType, "eventSubType"); - Utils.checkNotNull(groupEventType, "groupEventType"); - Utils.checkNotNull(child, "child"); - Utils.checkNotNull(archived, "archived"); - Utils.checkNotNull(deleted, "deleted"); - Utils.checkNotNull(showAs, "showAs"); - Utils.checkNotNull(done, "done"); - Utils.checkNotNull(startDatetime, "startDatetime"); - Utils.checkNotNull(endDatetime, "endDatetime"); - Utils.checkNotNull(durationMinutes, "durationMinutes"); - Utils.checkNotNull(activityDate, "activityDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(recurrent, "recurrent"); - Utils.checkNotNull(reminderDatetime, "reminderDatetime"); - Utils.checkNotNull(reminderSet, "reminderSet"); - Utils.checkNotNull(videoConferenceUrl, "videoConferenceUrl"); - Utils.checkNotNull(videoConferenceId, "videoConferenceId"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(attendees, "attendees"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId, + @JsonProperty("activity_datetime") @Nullable JsonNullable activityDatetime, + @JsonProperty("duration_seconds") @Nullable JsonNullable durationSeconds, + @JsonProperty("user_id") @Nullable JsonNullable userId, + @JsonProperty("account_id") @Nullable JsonNullable accountId, + @JsonProperty("contact_id") @Nullable JsonNullable contactId, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("opportunity_id") @Nullable JsonNullable opportunityId, + @JsonProperty("lead_id") @Nullable JsonNullable leadId, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("campaign_id") @Nullable JsonNullable campaignId, + @JsonProperty("case_id") @Nullable JsonNullable caseId, + @JsonProperty("asset_id") @Nullable JsonNullable assetId, + @JsonProperty("contract_id") @Nullable JsonNullable contractId, + @JsonProperty("product_id") @Nullable JsonNullable productId, + @JsonProperty("solution_id") @Nullable JsonNullable solutionId, + @JsonProperty("custom_object_id") @Nullable JsonNullable customObjectId, + @JsonProperty("type") @Nullable ActivityType type, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("note") @Nullable JsonNullable note, + @JsonProperty("location") @Nullable JsonNullable location, + @JsonProperty("location_address") @Nullable Address locationAddress, + @JsonProperty("all_day_event") @Nullable JsonNullable allDayEvent, + @JsonProperty("private") @Nullable JsonNullable private_, + @JsonProperty("group_event") @Nullable JsonNullable groupEvent, + @JsonProperty("event_sub_type") @Nullable JsonNullable eventSubType, + @JsonProperty("group_event_type") @Nullable JsonNullable groupEventType, + @JsonProperty("child") @Nullable JsonNullable child, + @JsonProperty("archived") @Nullable JsonNullable archived, + @JsonProperty("deleted") @Nullable JsonNullable deleted, + @JsonProperty("show_as") @Nullable JsonNullable showAs, + @JsonProperty("done") @Nullable JsonNullable done, + @JsonProperty("start_datetime") @Nullable JsonNullable startDatetime, + @JsonProperty("end_datetime") @Nullable JsonNullable endDatetime, + @JsonProperty("duration_minutes") @Nullable JsonNullable durationMinutes, + @JsonProperty("activity_date") @Nullable JsonNullable activityDate, + @JsonProperty("end_date") @Nullable JsonNullable endDate, + @JsonProperty("recurrent") @Nullable Boolean recurrent, + @JsonProperty("reminder_datetime") @Nullable JsonNullable reminderDatetime, + @JsonProperty("reminder_set") @Nullable JsonNullable reminderSet, + @JsonProperty("video_conference_url") @Nullable JsonNullable videoConferenceUrl, + @JsonProperty("video_conference_id") @Nullable JsonNullable videoConferenceId, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("attendees") @Nullable List attendees, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.downstreamId = downstreamId; - this.activityDatetime = activityDatetime; - this.durationSeconds = durationSeconds; - this.userId = userId; - this.accountId = accountId; - this.contactId = contactId; - this.companyId = companyId; - this.opportunityId = opportunityId; - this.leadId = leadId; - this.ownerId = ownerId; - this.campaignId = campaignId; - this.caseId = caseId; - this.assetId = assetId; - this.contractId = contractId; - this.productId = productId; - this.solutionId = solutionId; - this.customObjectId = customObjectId; - this.type = type; - this.title = title; - this.description = description; - this.note = note; - this.location = location; + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); + this.activityDatetime = Optional.ofNullable(activityDatetime) + .orElse(JsonNullable.undefined()); + this.durationSeconds = Optional.ofNullable(durationSeconds) + .orElse(JsonNullable.undefined()); + this.userId = Optional.ofNullable(userId) + .orElse(JsonNullable.undefined()); + this.accountId = Optional.ofNullable(accountId) + .orElse(JsonNullable.undefined()); + this.contactId = Optional.ofNullable(contactId) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.opportunityId = Optional.ofNullable(opportunityId) + .orElse(JsonNullable.undefined()); + this.leadId = Optional.ofNullable(leadId) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.campaignId = Optional.ofNullable(campaignId) + .orElse(JsonNullable.undefined()); + this.caseId = Optional.ofNullable(caseId) + .orElse(JsonNullable.undefined()); + this.assetId = Optional.ofNullable(assetId) + .orElse(JsonNullable.undefined()); + this.contractId = Optional.ofNullable(contractId) + .orElse(JsonNullable.undefined()); + this.productId = Optional.ofNullable(productId) + .orElse(JsonNullable.undefined()); + this.solutionId = Optional.ofNullable(solutionId) + .orElse(JsonNullable.undefined()); + this.customObjectId = Optional.ofNullable(customObjectId) + .orElse(JsonNullable.undefined()); + this.type = JsonNullable.of(type); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.note = Optional.ofNullable(note) + .orElse(JsonNullable.undefined()); + this.location = Optional.ofNullable(location) + .orElse(JsonNullable.undefined()); this.locationAddress = locationAddress; - this.allDayEvent = allDayEvent; - this.private_ = private_; - this.groupEvent = groupEvent; - this.eventSubType = eventSubType; - this.groupEventType = groupEventType; - this.child = child; - this.archived = archived; - this.deleted = deleted; - this.showAs = showAs; - this.done = done; - this.startDatetime = startDatetime; - this.endDatetime = endDatetime; - this.durationMinutes = durationMinutes; - this.activityDate = activityDate; - this.endDate = endDate; + this.allDayEvent = Optional.ofNullable(allDayEvent) + .orElse(JsonNullable.undefined()); + this.private_ = Optional.ofNullable(private_) + .orElse(JsonNullable.undefined()); + this.groupEvent = Optional.ofNullable(groupEvent) + .orElse(JsonNullable.undefined()); + this.eventSubType = Optional.ofNullable(eventSubType) + .orElse(JsonNullable.undefined()); + this.groupEventType = Optional.ofNullable(groupEventType) + .orElse(JsonNullable.undefined()); + this.child = Optional.ofNullable(child) + .orElse(JsonNullable.undefined()); + this.archived = Optional.ofNullable(archived) + .orElse(JsonNullable.undefined()); + this.deleted = Optional.ofNullable(deleted) + .orElse(JsonNullable.undefined()); + this.showAs = Optional.ofNullable(showAs) + .orElse(JsonNullable.undefined()); + this.done = Optional.ofNullable(done) + .orElse(JsonNullable.undefined()); + this.startDatetime = Optional.ofNullable(startDatetime) + .orElse(JsonNullable.undefined()); + this.endDatetime = Optional.ofNullable(endDatetime) + .orElse(JsonNullable.undefined()); + this.durationMinutes = Optional.ofNullable(durationMinutes) + .orElse(JsonNullable.undefined()); + this.activityDate = Optional.ofNullable(activityDate) + .orElse(JsonNullable.undefined()); + this.endDate = Optional.ofNullable(endDate) + .orElse(JsonNullable.undefined()); this.recurrent = recurrent; - this.reminderDatetime = reminderDatetime; - this.reminderSet = reminderSet; - this.videoConferenceUrl = videoConferenceUrl; - this.videoConferenceId = videoConferenceId; + this.reminderDatetime = Optional.ofNullable(reminderDatetime) + .orElse(JsonNullable.undefined()); + this.reminderSet = Optional.ofNullable(reminderSet) + .orElse(JsonNullable.undefined()); + this.videoConferenceUrl = Optional.ofNullable(videoConferenceUrl) + .orElse(JsonNullable.undefined()); + this.videoConferenceId = Optional.ofNullable(videoConferenceId) + .orElse(JsonNullable.undefined()); this.customFields = customFields; this.attendees = attendees; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Activity() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * The unique identifier of the activity */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } /** * The date and time of the activity */ - @JsonIgnore public JsonNullable activityDatetime() { - return activityDatetime; + return this.activityDatetime; } /** * The duration of the activity in seconds */ - @JsonIgnore public JsonNullable durationSeconds() { - return durationSeconds; + return this.durationSeconds; } /** * The user related to the activity */ - @JsonIgnore public JsonNullable userId() { - return userId; + return this.userId; } /** * The account related to the activity */ - @JsonIgnore public JsonNullable accountId() { - return accountId; + return this.accountId; } /** * The contact related to the activity */ - @JsonIgnore public JsonNullable contactId() { - return contactId; + return this.contactId; } /** * The company related to the activity */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The opportunity related to the activity */ - @JsonIgnore public JsonNullable opportunityId() { - return opportunityId; + return this.opportunityId; } /** * The lead related to the activity */ - @JsonIgnore public JsonNullable leadId() { - return leadId; + return this.leadId; } /** * The owner of the activity */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The campaign related to the activity */ - @JsonIgnore public JsonNullable campaignId() { - return campaignId; + return this.campaignId; } /** * The case related to the activity */ - @JsonIgnore public JsonNullable caseId() { - return caseId; + return this.caseId; } /** * The asset related to the activity */ - @JsonIgnore public JsonNullable assetId() { - return assetId; + return this.assetId; } /** * The contract related to the activity */ - @JsonIgnore public JsonNullable contractId() { - return contractId; + return this.contractId; } /** * The product related to the activity */ - @JsonIgnore public JsonNullable productId() { - return productId; + return this.productId; } /** * The solution related to the activity */ - @JsonIgnore public JsonNullable solutionId() { - return solutionId; + return this.solutionId; } /** * The custom object related to the activity */ - @JsonIgnore public JsonNullable customObjectId() { - return customObjectId; + return this.customObjectId; } /** * The type of the activity */ - @SuppressWarnings("unchecked") - @JsonIgnore - public Optional type() { - return (Optional) type; + public JsonNullable type() { + return this.type; } /** * The title of the activity */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * A description of the activity */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * An internal note about the activity */ - @JsonIgnore public JsonNullable note() { - return note; + return this.note; } /** * The location of the activity */ - @JsonIgnore public JsonNullable location() { - return location; + return this.location; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
locationAddress() { - return (Optional
) locationAddress; + return Optional.ofNullable(this.locationAddress); } /** * Whether the Activity is an all day event or not */ - @JsonIgnore public JsonNullable allDayEvent() { - return allDayEvent; + return this.allDayEvent; } /** * Whether the Activity is private or not */ - @JsonIgnore public JsonNullable private_() { - return private_; + return this.private_; } /** * Whether the Activity is a group event or not */ - @JsonIgnore public JsonNullable groupEvent() { - return groupEvent; + return this.groupEvent; } /** * The sub type of the group event */ - @JsonIgnore public JsonNullable eventSubType() { - return eventSubType; + return this.eventSubType; } /** * The type of the group event */ - @JsonIgnore public JsonNullable groupEventType() { - return groupEventType; + return this.groupEventType; } /** * Whether the activity is a child of another activity or not */ - @JsonIgnore public JsonNullable child() { - return child; + return this.child; } /** * Whether the activity is archived or not */ - @JsonIgnore public JsonNullable archived() { - return archived; + return this.archived; } /** * Whether the activity is deleted or not */ - @JsonIgnore public JsonNullable deleted() { - return deleted; + return this.deleted; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable showAs() { - return (JsonNullable) showAs; + return this.showAs; } /** * Whether the Activity is done or not */ - @JsonIgnore public JsonNullable done() { - return done; + return this.done; } /** * The start date and time of the activity */ - @JsonIgnore public JsonNullable startDatetime() { - return startDatetime; + return this.startDatetime; } /** * The end date and time of the activity */ - @JsonIgnore public JsonNullable endDatetime() { - return endDatetime; + return this.endDatetime; } /** * The duration of the activity in minutes */ - @JsonIgnore public JsonNullable durationMinutes() { - return durationMinutes; + return this.durationMinutes; } /** * The date of the activity */ - @JsonIgnore public JsonNullable activityDate() { - return activityDate; + return this.activityDate; } /** * The end date of the activity */ - @JsonIgnore public JsonNullable endDate() { - return endDate; + return this.endDate; } /** * Whether the activity is recurrent or not */ - @JsonIgnore public Optional recurrent() { - return recurrent; + return Optional.ofNullable(this.recurrent); } /** * The date and time of the reminder */ - @JsonIgnore public JsonNullable reminderDatetime() { - return reminderDatetime; + return this.reminderDatetime; } /** * Whether the reminder is set or not */ - @JsonIgnore public JsonNullable reminderSet() { - return reminderSet; + return this.reminderSet; } /** * The URL of the video conference */ - @JsonIgnore public JsonNullable videoConferenceUrl() { - return videoConferenceUrl; + return this.videoConferenceUrl; } /** * The ID of the video conference */ - @JsonIgnore public JsonNullable videoConferenceId() { - return videoConferenceId; + return this.videoConferenceId; } /** * Custom fields of the activity */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> attendees() { - return (Optional>) attendees; + return Optional.ofNullable(this.attendees); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the activity */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the activity */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the activity was last updated */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the activity was created */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -983,928 +916,462 @@ public static Builder builder() { /** * The unique identifier of the activity */ - public Activity withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier of the activity - */ - public Activity withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Activity withId(@Nullable String id) { this.id = id; return this; } + /** * The third-party API ID of original entity */ - public Activity withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Activity withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Activity withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } /** * The date and time of the activity */ - public Activity withActivityDatetime(String activityDatetime) { - Utils.checkNotNull(activityDatetime, "activityDatetime"); + public Activity withActivityDatetime(@Nullable String activityDatetime) { this.activityDatetime = JsonNullable.of(activityDatetime); return this; } - /** - * The date and time of the activity - */ - public Activity withActivityDatetime(JsonNullable activityDatetime) { - Utils.checkNotNull(activityDatetime, "activityDatetime"); - this.activityDatetime = activityDatetime; - return this; - } /** * The duration of the activity in seconds */ - public Activity withDurationSeconds(long durationSeconds) { - Utils.checkNotNull(durationSeconds, "durationSeconds"); + public Activity withDurationSeconds(@Nullable Long durationSeconds) { this.durationSeconds = JsonNullable.of(durationSeconds); return this; } - /** - * The duration of the activity in seconds - */ - public Activity withDurationSeconds(JsonNullable durationSeconds) { - Utils.checkNotNull(durationSeconds, "durationSeconds"); - this.durationSeconds = durationSeconds; - return this; - } /** * The user related to the activity */ - public Activity withUserId(String userId) { - Utils.checkNotNull(userId, "userId"); + public Activity withUserId(@Nullable String userId) { this.userId = JsonNullable.of(userId); return this; } - /** - * The user related to the activity - */ - public Activity withUserId(JsonNullable userId) { - Utils.checkNotNull(userId, "userId"); - this.userId = userId; - return this; - } /** * The account related to the activity */ - public Activity withAccountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); + public Activity withAccountId(@Nullable String accountId) { this.accountId = JsonNullable.of(accountId); return this; } - /** - * The account related to the activity - */ - public Activity withAccountId(JsonNullable accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = accountId; - return this; - } /** * The contact related to the activity */ - public Activity withContactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public Activity withContactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The contact related to the activity - */ - public Activity withContactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } /** * The company related to the activity */ - public Activity withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Activity withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company related to the activity - */ - public Activity withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The opportunity related to the activity */ - public Activity withOpportunityId(String opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); + public Activity withOpportunityId(@Nullable String opportunityId) { this.opportunityId = JsonNullable.of(opportunityId); return this; } - /** - * The opportunity related to the activity - */ - public Activity withOpportunityId(JsonNullable opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); - this.opportunityId = opportunityId; - return this; - } /** * The lead related to the activity */ - public Activity withLeadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Activity withLeadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead related to the activity - */ - public Activity withLeadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } /** * The owner of the activity */ - public Activity withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Activity withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the activity - */ - public Activity withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The campaign related to the activity */ - public Activity withCampaignId(String campaignId) { - Utils.checkNotNull(campaignId, "campaignId"); + public Activity withCampaignId(@Nullable String campaignId) { this.campaignId = JsonNullable.of(campaignId); return this; } - /** - * The campaign related to the activity - */ - public Activity withCampaignId(JsonNullable campaignId) { - Utils.checkNotNull(campaignId, "campaignId"); - this.campaignId = campaignId; - return this; - } /** * The case related to the activity */ - public Activity withCaseId(String caseId) { - Utils.checkNotNull(caseId, "caseId"); + public Activity withCaseId(@Nullable String caseId) { this.caseId = JsonNullable.of(caseId); return this; } - /** - * The case related to the activity - */ - public Activity withCaseId(JsonNullable caseId) { - Utils.checkNotNull(caseId, "caseId"); - this.caseId = caseId; - return this; - } /** * The asset related to the activity */ - public Activity withAssetId(String assetId) { - Utils.checkNotNull(assetId, "assetId"); + public Activity withAssetId(@Nullable String assetId) { this.assetId = JsonNullable.of(assetId); return this; } - /** - * The asset related to the activity - */ - public Activity withAssetId(JsonNullable assetId) { - Utils.checkNotNull(assetId, "assetId"); - this.assetId = assetId; - return this; - } /** * The contract related to the activity */ - public Activity withContractId(String contractId) { - Utils.checkNotNull(contractId, "contractId"); + public Activity withContractId(@Nullable String contractId) { this.contractId = JsonNullable.of(contractId); return this; } - /** - * The contract related to the activity - */ - public Activity withContractId(JsonNullable contractId) { - Utils.checkNotNull(contractId, "contractId"); - this.contractId = contractId; - return this; - } /** * The product related to the activity */ - public Activity withProductId(String productId) { - Utils.checkNotNull(productId, "productId"); + public Activity withProductId(@Nullable String productId) { this.productId = JsonNullable.of(productId); return this; } - /** - * The product related to the activity - */ - public Activity withProductId(JsonNullable productId) { - Utils.checkNotNull(productId, "productId"); - this.productId = productId; - return this; - } /** * The solution related to the activity */ - public Activity withSolutionId(String solutionId) { - Utils.checkNotNull(solutionId, "solutionId"); + public Activity withSolutionId(@Nullable String solutionId) { this.solutionId = JsonNullable.of(solutionId); return this; } - /** - * The solution related to the activity - */ - public Activity withSolutionId(JsonNullable solutionId) { - Utils.checkNotNull(solutionId, "solutionId"); - this.solutionId = solutionId; - return this; - } /** * The custom object related to the activity */ - public Activity withCustomObjectId(String customObjectId) { - Utils.checkNotNull(customObjectId, "customObjectId"); + public Activity withCustomObjectId(@Nullable String customObjectId) { this.customObjectId = JsonNullable.of(customObjectId); return this; } - /** - * The custom object related to the activity - */ - public Activity withCustomObjectId(JsonNullable customObjectId) { - Utils.checkNotNull(customObjectId, "customObjectId"); - this.customObjectId = customObjectId; - return this; - } /** * The type of the activity */ - public Activity withType(ActivityType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); + public Activity withType(@Nullable ActivityType type) { + this.type = JsonNullable.of(type); return this; } - /** - * The type of the activity - */ - public Activity withType(Optional type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - /** * The title of the activity */ - public Activity withTitle(String title) { - Utils.checkNotNull(title, "title"); + public Activity withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The title of the activity - */ - public Activity withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * A description of the activity */ - public Activity withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Activity withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the activity - */ - public Activity withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * An internal note about the activity */ - public Activity withNote(String note) { - Utils.checkNotNull(note, "note"); + public Activity withNote(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * An internal note about the activity - */ - public Activity withNote(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } /** * The location of the activity */ - public Activity withLocation(String location) { - Utils.checkNotNull(location, "location"); + public Activity withLocation(@Nullable String location) { this.location = JsonNullable.of(location); return this; } - /** - * The location of the activity - */ - public Activity withLocation(JsonNullable location) { - Utils.checkNotNull(location, "location"); - this.location = location; - return this; - } - - public Activity withLocationAddress(Address locationAddress) { - Utils.checkNotNull(locationAddress, "locationAddress"); - this.locationAddress = Optional.ofNullable(locationAddress); - return this; - } - - public Activity withLocationAddress(Optional locationAddress) { - Utils.checkNotNull(locationAddress, "locationAddress"); + public Activity withLocationAddress(@Nullable Address locationAddress) { this.locationAddress = locationAddress; return this; } + /** * Whether the Activity is an all day event or not */ - public Activity withAllDayEvent(boolean allDayEvent) { - Utils.checkNotNull(allDayEvent, "allDayEvent"); + public Activity withAllDayEvent(@Nullable Boolean allDayEvent) { this.allDayEvent = JsonNullable.of(allDayEvent); return this; } - /** - * Whether the Activity is an all day event or not - */ - public Activity withAllDayEvent(JsonNullable allDayEvent) { - Utils.checkNotNull(allDayEvent, "allDayEvent"); - this.allDayEvent = allDayEvent; - return this; - } /** * Whether the Activity is private or not */ - public Activity withPrivate(boolean private_) { - Utils.checkNotNull(private_, "private_"); + public Activity withPrivate(@Nullable Boolean private_) { this.private_ = JsonNullable.of(private_); return this; } - /** - * Whether the Activity is private or not - */ - public Activity withPrivate(JsonNullable private_) { - Utils.checkNotNull(private_, "private_"); - this.private_ = private_; - return this; - } /** * Whether the Activity is a group event or not */ - public Activity withGroupEvent(boolean groupEvent) { - Utils.checkNotNull(groupEvent, "groupEvent"); + public Activity withGroupEvent(@Nullable Boolean groupEvent) { this.groupEvent = JsonNullable.of(groupEvent); return this; } - /** - * Whether the Activity is a group event or not - */ - public Activity withGroupEvent(JsonNullable groupEvent) { - Utils.checkNotNull(groupEvent, "groupEvent"); - this.groupEvent = groupEvent; - return this; - } /** * The sub type of the group event */ - public Activity withEventSubType(String eventSubType) { - Utils.checkNotNull(eventSubType, "eventSubType"); + public Activity withEventSubType(@Nullable String eventSubType) { this.eventSubType = JsonNullable.of(eventSubType); return this; } - /** - * The sub type of the group event - */ - public Activity withEventSubType(JsonNullable eventSubType) { - Utils.checkNotNull(eventSubType, "eventSubType"); - this.eventSubType = eventSubType; - return this; - } /** * The type of the group event */ - public Activity withGroupEventType(String groupEventType) { - Utils.checkNotNull(groupEventType, "groupEventType"); + public Activity withGroupEventType(@Nullable String groupEventType) { this.groupEventType = JsonNullable.of(groupEventType); return this; } - /** - * The type of the group event - */ - public Activity withGroupEventType(JsonNullable groupEventType) { - Utils.checkNotNull(groupEventType, "groupEventType"); - this.groupEventType = groupEventType; - return this; - } /** * Whether the activity is a child of another activity or not */ - public Activity withChild(boolean child) { - Utils.checkNotNull(child, "child"); + public Activity withChild(@Nullable Boolean child) { this.child = JsonNullable.of(child); return this; } - /** - * Whether the activity is a child of another activity or not - */ - public Activity withChild(JsonNullable child) { - Utils.checkNotNull(child, "child"); - this.child = child; - return this; - } /** * Whether the activity is archived or not */ - public Activity withArchived(boolean archived) { - Utils.checkNotNull(archived, "archived"); + public Activity withArchived(@Nullable Boolean archived) { this.archived = JsonNullable.of(archived); return this; } - /** - * Whether the activity is archived or not - */ - public Activity withArchived(JsonNullable archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = archived; - return this; - } /** * Whether the activity is deleted or not */ - public Activity withDeleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Activity withDeleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Whether the activity is deleted or not - */ - public Activity withDeleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - public Activity withShowAs(ShowAs showAs) { - Utils.checkNotNull(showAs, "showAs"); + public Activity withShowAs(@Nullable ShowAs showAs) { this.showAs = JsonNullable.of(showAs); return this; } - public Activity withShowAs(JsonNullable showAs) { - Utils.checkNotNull(showAs, "showAs"); - this.showAs = showAs; - return this; - } /** * Whether the Activity is done or not */ - public Activity withDone(boolean done) { - Utils.checkNotNull(done, "done"); + public Activity withDone(@Nullable Boolean done) { this.done = JsonNullable.of(done); return this; } - /** - * Whether the Activity is done or not - */ - public Activity withDone(JsonNullable done) { - Utils.checkNotNull(done, "done"); - this.done = done; - return this; - } /** * The start date and time of the activity */ - public Activity withStartDatetime(String startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); + public Activity withStartDatetime(@Nullable String startDatetime) { this.startDatetime = JsonNullable.of(startDatetime); return this; } - /** - * The start date and time of the activity - */ - public Activity withStartDatetime(JsonNullable startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); - this.startDatetime = startDatetime; - return this; - } /** * The end date and time of the activity */ - public Activity withEndDatetime(String endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); + public Activity withEndDatetime(@Nullable String endDatetime) { this.endDatetime = JsonNullable.of(endDatetime); return this; } - /** - * The end date and time of the activity - */ - public Activity withEndDatetime(JsonNullable endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); - this.endDatetime = endDatetime; - return this; - } /** * The duration of the activity in minutes */ - public Activity withDurationMinutes(long durationMinutes) { - Utils.checkNotNull(durationMinutes, "durationMinutes"); + public Activity withDurationMinutes(@Nullable Long durationMinutes) { this.durationMinutes = JsonNullable.of(durationMinutes); return this; } - /** - * The duration of the activity in minutes - */ - public Activity withDurationMinutes(JsonNullable durationMinutes) { - Utils.checkNotNull(durationMinutes, "durationMinutes"); - this.durationMinutes = durationMinutes; - return this; - } /** * The date of the activity */ - public Activity withActivityDate(String activityDate) { - Utils.checkNotNull(activityDate, "activityDate"); + public Activity withActivityDate(@Nullable String activityDate) { this.activityDate = JsonNullable.of(activityDate); return this; } - /** - * The date of the activity - */ - public Activity withActivityDate(JsonNullable activityDate) { - Utils.checkNotNull(activityDate, "activityDate"); - this.activityDate = activityDate; - return this; - } /** * The end date of the activity */ - public Activity withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Activity withEndDate(@Nullable String endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The end date of the activity - */ - public Activity withEndDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** - * Whether the activity is recurrent or not - */ - public Activity withRecurrent(boolean recurrent) { - Utils.checkNotNull(recurrent, "recurrent"); - this.recurrent = Optional.ofNullable(recurrent); - return this; - } - /** * Whether the activity is recurrent or not */ - public Activity withRecurrent(Optional recurrent) { - Utils.checkNotNull(recurrent, "recurrent"); + public Activity withRecurrent(@Nullable Boolean recurrent) { this.recurrent = recurrent; return this; } + /** * The date and time of the reminder */ - public Activity withReminderDatetime(String reminderDatetime) { - Utils.checkNotNull(reminderDatetime, "reminderDatetime"); + public Activity withReminderDatetime(@Nullable String reminderDatetime) { this.reminderDatetime = JsonNullable.of(reminderDatetime); return this; } - /** - * The date and time of the reminder - */ - public Activity withReminderDatetime(JsonNullable reminderDatetime) { - Utils.checkNotNull(reminderDatetime, "reminderDatetime"); - this.reminderDatetime = reminderDatetime; - return this; - } /** * Whether the reminder is set or not */ - public Activity withReminderSet(boolean reminderSet) { - Utils.checkNotNull(reminderSet, "reminderSet"); + public Activity withReminderSet(@Nullable Boolean reminderSet) { this.reminderSet = JsonNullable.of(reminderSet); return this; } - /** - * Whether the reminder is set or not - */ - public Activity withReminderSet(JsonNullable reminderSet) { - Utils.checkNotNull(reminderSet, "reminderSet"); - this.reminderSet = reminderSet; - return this; - } /** * The URL of the video conference */ - public Activity withVideoConferenceUrl(String videoConferenceUrl) { - Utils.checkNotNull(videoConferenceUrl, "videoConferenceUrl"); + public Activity withVideoConferenceUrl(@Nullable String videoConferenceUrl) { this.videoConferenceUrl = JsonNullable.of(videoConferenceUrl); return this; } - /** - * The URL of the video conference - */ - public Activity withVideoConferenceUrl(JsonNullable videoConferenceUrl) { - Utils.checkNotNull(videoConferenceUrl, "videoConferenceUrl"); - this.videoConferenceUrl = videoConferenceUrl; - return this; - } /** * The ID of the video conference */ - public Activity withVideoConferenceId(String videoConferenceId) { - Utils.checkNotNull(videoConferenceId, "videoConferenceId"); + public Activity withVideoConferenceId(@Nullable String videoConferenceId) { this.videoConferenceId = JsonNullable.of(videoConferenceId); return this; } - /** - * The ID of the video conference - */ - public Activity withVideoConferenceId(JsonNullable videoConferenceId) { - Utils.checkNotNull(videoConferenceId, "videoConferenceId"); - this.videoConferenceId = videoConferenceId; - return this; - } - - /** - * Custom fields of the activity - */ - public Activity withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - /** * Custom fields of the activity */ - public Activity withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Activity withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - public Activity withAttendees(List attendees) { - Utils.checkNotNull(attendees, "attendees"); - this.attendees = Optional.ofNullable(attendees); - return this; - } - - public Activity withAttendees(Optional> attendees) { - Utils.checkNotNull(attendees, "attendees"); + public Activity withAttendees(@Nullable List attendees) { this.attendees = attendees; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public Activity withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Activity withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Activity withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the activity */ - public Activity withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Activity withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the activity - */ - public Activity withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the activity */ - public Activity withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Activity withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the activity - */ - public Activity withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the activity was last updated */ - public Activity withUpdatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Activity withUpdatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the activity was last updated - */ - public Activity withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the activity was created */ - public Activity withCreatedAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Activity withCreatedAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - - /** - * The date and time when the activity was created - */ - public Activity withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Activity withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - + /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Activity withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Activity withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -2052,1086 +1519,522 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; - private JsonNullable activityDatetime = JsonNullable.undefined(); + private JsonNullable activityDatetime; - private JsonNullable durationSeconds = JsonNullable.undefined(); + private JsonNullable durationSeconds; - private JsonNullable userId = JsonNullable.undefined(); + private JsonNullable userId; - private JsonNullable accountId = JsonNullable.undefined(); + private JsonNullable accountId; - private JsonNullable contactId = JsonNullable.undefined(); + private JsonNullable contactId; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable opportunityId = JsonNullable.undefined(); + private JsonNullable opportunityId; - private JsonNullable leadId = JsonNullable.undefined(); + private JsonNullable leadId; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable campaignId = JsonNullable.undefined(); + private JsonNullable campaignId; - private JsonNullable caseId = JsonNullable.undefined(); + private JsonNullable caseId; - private JsonNullable assetId = JsonNullable.undefined(); + private JsonNullable assetId; - private JsonNullable contractId = JsonNullable.undefined(); + private JsonNullable contractId; - private JsonNullable productId = JsonNullable.undefined(); + private JsonNullable productId; - private JsonNullable solutionId = JsonNullable.undefined(); + private JsonNullable solutionId; - private JsonNullable customObjectId = JsonNullable.undefined(); + private JsonNullable customObjectId; - private Optional type = Optional.empty(); + private ActivityType type; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable note = JsonNullable.undefined(); + private JsonNullable note; - private JsonNullable location = JsonNullable.undefined(); + private JsonNullable location; - private Optional locationAddress = Optional.empty(); + private Address locationAddress; - private JsonNullable allDayEvent = JsonNullable.undefined(); + private JsonNullable allDayEvent; - private JsonNullable private_ = JsonNullable.undefined(); + private JsonNullable private_; - private JsonNullable groupEvent = JsonNullable.undefined(); + private JsonNullable groupEvent; - private JsonNullable eventSubType = JsonNullable.undefined(); + private JsonNullable eventSubType; - private JsonNullable groupEventType = JsonNullable.undefined(); + private JsonNullable groupEventType; - private JsonNullable child = JsonNullable.undefined(); + private JsonNullable child; - private JsonNullable archived = JsonNullable.undefined(); + private JsonNullable archived; - private JsonNullable deleted = JsonNullable.undefined(); + private JsonNullable deleted; - private JsonNullable showAs = JsonNullable.undefined(); + private JsonNullable showAs; - private JsonNullable done = JsonNullable.undefined(); + private JsonNullable done; - private JsonNullable startDatetime = JsonNullable.undefined(); + private JsonNullable startDatetime; - private JsonNullable endDatetime = JsonNullable.undefined(); + private JsonNullable endDatetime; - private JsonNullable durationMinutes = JsonNullable.undefined(); + private JsonNullable durationMinutes; - private JsonNullable activityDate = JsonNullable.undefined(); + private JsonNullable activityDate; - private JsonNullable endDate = JsonNullable.undefined(); + private JsonNullable endDate; - private Optional recurrent = Optional.empty(); + private Boolean recurrent; - private JsonNullable reminderDatetime = JsonNullable.undefined(); + private JsonNullable reminderDatetime; - private JsonNullable reminderSet = JsonNullable.undefined(); + private JsonNullable reminderSet; - private JsonNullable videoConferenceUrl = JsonNullable.undefined(); + private JsonNullable videoConferenceUrl; - private JsonNullable videoConferenceId = JsonNullable.undefined(); + private JsonNullable videoConferenceId; - private Optional> customFields = Optional.empty(); + private List customFields; - private Optional> attendees = Optional.empty(); + private List attendees; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * The unique identifier of the activity - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The unique identifier of the activity */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } - - /** * The date and time of the activity */ - public Builder activityDatetime(String activityDatetime) { - Utils.checkNotNull(activityDatetime, "activityDatetime"); + public Builder activityDatetime(@Nullable String activityDatetime) { this.activityDatetime = JsonNullable.of(activityDatetime); return this; } - /** - * The date and time of the activity - */ - public Builder activityDatetime(JsonNullable activityDatetime) { - Utils.checkNotNull(activityDatetime, "activityDatetime"); - this.activityDatetime = activityDatetime; - return this; - } - - /** * The duration of the activity in seconds */ - public Builder durationSeconds(long durationSeconds) { - Utils.checkNotNull(durationSeconds, "durationSeconds"); + public Builder durationSeconds(@Nullable Long durationSeconds) { this.durationSeconds = JsonNullable.of(durationSeconds); return this; } - /** - * The duration of the activity in seconds - */ - public Builder durationSeconds(JsonNullable durationSeconds) { - Utils.checkNotNull(durationSeconds, "durationSeconds"); - this.durationSeconds = durationSeconds; - return this; - } - - /** * The user related to the activity */ - public Builder userId(String userId) { - Utils.checkNotNull(userId, "userId"); + public Builder userId(@Nullable String userId) { this.userId = JsonNullable.of(userId); return this; } - /** - * The user related to the activity - */ - public Builder userId(JsonNullable userId) { - Utils.checkNotNull(userId, "userId"); - this.userId = userId; - return this; - } - - /** * The account related to the activity */ - public Builder accountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); + public Builder accountId(@Nullable String accountId) { this.accountId = JsonNullable.of(accountId); return this; } - /** - * The account related to the activity - */ - public Builder accountId(JsonNullable accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = accountId; - return this; - } - - /** * The contact related to the activity */ - public Builder contactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public Builder contactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The contact related to the activity - */ - public Builder contactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } - - /** * The company related to the activity */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company related to the activity - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The opportunity related to the activity */ - public Builder opportunityId(String opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); + public Builder opportunityId(@Nullable String opportunityId) { this.opportunityId = JsonNullable.of(opportunityId); return this; } - /** - * The opportunity related to the activity - */ - public Builder opportunityId(JsonNullable opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); - this.opportunityId = opportunityId; - return this; - } - - /** * The lead related to the activity */ - public Builder leadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Builder leadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead related to the activity - */ - public Builder leadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } - - /** * The owner of the activity */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the activity - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The campaign related to the activity */ - public Builder campaignId(String campaignId) { - Utils.checkNotNull(campaignId, "campaignId"); + public Builder campaignId(@Nullable String campaignId) { this.campaignId = JsonNullable.of(campaignId); return this; } - /** - * The campaign related to the activity - */ - public Builder campaignId(JsonNullable campaignId) { - Utils.checkNotNull(campaignId, "campaignId"); - this.campaignId = campaignId; - return this; - } - - /** * The case related to the activity */ - public Builder caseId(String caseId) { - Utils.checkNotNull(caseId, "caseId"); + public Builder caseId(@Nullable String caseId) { this.caseId = JsonNullable.of(caseId); return this; } - /** - * The case related to the activity - */ - public Builder caseId(JsonNullable caseId) { - Utils.checkNotNull(caseId, "caseId"); - this.caseId = caseId; - return this; - } - - /** * The asset related to the activity */ - public Builder assetId(String assetId) { - Utils.checkNotNull(assetId, "assetId"); + public Builder assetId(@Nullable String assetId) { this.assetId = JsonNullable.of(assetId); return this; } - /** - * The asset related to the activity - */ - public Builder assetId(JsonNullable assetId) { - Utils.checkNotNull(assetId, "assetId"); - this.assetId = assetId; - return this; - } - - /** * The contract related to the activity */ - public Builder contractId(String contractId) { - Utils.checkNotNull(contractId, "contractId"); + public Builder contractId(@Nullable String contractId) { this.contractId = JsonNullable.of(contractId); return this; } - /** - * The contract related to the activity - */ - public Builder contractId(JsonNullable contractId) { - Utils.checkNotNull(contractId, "contractId"); - this.contractId = contractId; - return this; - } - - /** * The product related to the activity */ - public Builder productId(String productId) { - Utils.checkNotNull(productId, "productId"); + public Builder productId(@Nullable String productId) { this.productId = JsonNullable.of(productId); return this; } - /** - * The product related to the activity - */ - public Builder productId(JsonNullable productId) { - Utils.checkNotNull(productId, "productId"); - this.productId = productId; - return this; - } - - /** * The solution related to the activity */ - public Builder solutionId(String solutionId) { - Utils.checkNotNull(solutionId, "solutionId"); + public Builder solutionId(@Nullable String solutionId) { this.solutionId = JsonNullable.of(solutionId); return this; } - /** - * The solution related to the activity - */ - public Builder solutionId(JsonNullable solutionId) { - Utils.checkNotNull(solutionId, "solutionId"); - this.solutionId = solutionId; - return this; - } - - /** * The custom object related to the activity */ - public Builder customObjectId(String customObjectId) { - Utils.checkNotNull(customObjectId, "customObjectId"); + public Builder customObjectId(@Nullable String customObjectId) { this.customObjectId = JsonNullable.of(customObjectId); return this; } - /** - * The custom object related to the activity - */ - public Builder customObjectId(JsonNullable customObjectId) { - Utils.checkNotNull(customObjectId, "customObjectId"); - this.customObjectId = customObjectId; - return this; - } - - - /** - * The type of the activity - */ - public Builder type(ActivityType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * The type of the activity */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ActivityType type) { this.type = type; return this; } - /** * The title of the activity */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The title of the activity - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * A description of the activity */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the activity - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * An internal note about the activity */ - public Builder note(String note) { - Utils.checkNotNull(note, "note"); + public Builder note(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * An internal note about the activity - */ - public Builder note(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } - - /** * The location of the activity */ - public Builder location(String location) { - Utils.checkNotNull(location, "location"); + public Builder location(@Nullable String location) { this.location = JsonNullable.of(location); return this; } - /** - * The location of the activity - */ - public Builder location(JsonNullable location) { - Utils.checkNotNull(location, "location"); - this.location = location; - return this; - } - - - public Builder locationAddress(Address locationAddress) { - Utils.checkNotNull(locationAddress, "locationAddress"); - this.locationAddress = Optional.ofNullable(locationAddress); - return this; - } - - public Builder locationAddress(Optional locationAddress) { - Utils.checkNotNull(locationAddress, "locationAddress"); + public Builder locationAddress(@Nullable Address locationAddress) { this.locationAddress = locationAddress; return this; } - /** * Whether the Activity is an all day event or not */ - public Builder allDayEvent(boolean allDayEvent) { - Utils.checkNotNull(allDayEvent, "allDayEvent"); + public Builder allDayEvent(@Nullable Boolean allDayEvent) { this.allDayEvent = JsonNullable.of(allDayEvent); return this; } - /** - * Whether the Activity is an all day event or not - */ - public Builder allDayEvent(JsonNullable allDayEvent) { - Utils.checkNotNull(allDayEvent, "allDayEvent"); - this.allDayEvent = allDayEvent; - return this; - } - - /** * Whether the Activity is private or not */ - public Builder private_(boolean private_) { - Utils.checkNotNull(private_, "private_"); + public Builder private_(@Nullable Boolean private_) { this.private_ = JsonNullable.of(private_); return this; } - /** - * Whether the Activity is private or not - */ - public Builder private_(JsonNullable private_) { - Utils.checkNotNull(private_, "private_"); - this.private_ = private_; - return this; - } - - /** * Whether the Activity is a group event or not */ - public Builder groupEvent(boolean groupEvent) { - Utils.checkNotNull(groupEvent, "groupEvent"); + public Builder groupEvent(@Nullable Boolean groupEvent) { this.groupEvent = JsonNullable.of(groupEvent); return this; } - /** - * Whether the Activity is a group event or not - */ - public Builder groupEvent(JsonNullable groupEvent) { - Utils.checkNotNull(groupEvent, "groupEvent"); - this.groupEvent = groupEvent; - return this; - } - - /** * The sub type of the group event */ - public Builder eventSubType(String eventSubType) { - Utils.checkNotNull(eventSubType, "eventSubType"); + public Builder eventSubType(@Nullable String eventSubType) { this.eventSubType = JsonNullable.of(eventSubType); return this; } - /** - * The sub type of the group event - */ - public Builder eventSubType(JsonNullable eventSubType) { - Utils.checkNotNull(eventSubType, "eventSubType"); - this.eventSubType = eventSubType; - return this; - } - - /** * The type of the group event */ - public Builder groupEventType(String groupEventType) { - Utils.checkNotNull(groupEventType, "groupEventType"); + public Builder groupEventType(@Nullable String groupEventType) { this.groupEventType = JsonNullable.of(groupEventType); return this; } - /** - * The type of the group event - */ - public Builder groupEventType(JsonNullable groupEventType) { - Utils.checkNotNull(groupEventType, "groupEventType"); - this.groupEventType = groupEventType; - return this; - } - - /** * Whether the activity is a child of another activity or not */ - public Builder child(boolean child) { - Utils.checkNotNull(child, "child"); + public Builder child(@Nullable Boolean child) { this.child = JsonNullable.of(child); return this; } - /** - * Whether the activity is a child of another activity or not - */ - public Builder child(JsonNullable child) { - Utils.checkNotNull(child, "child"); - this.child = child; - return this; - } - - /** * Whether the activity is archived or not */ - public Builder archived(boolean archived) { - Utils.checkNotNull(archived, "archived"); + public Builder archived(@Nullable Boolean archived) { this.archived = JsonNullable.of(archived); return this; } - /** - * Whether the activity is archived or not - */ - public Builder archived(JsonNullable archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = archived; - return this; - } - - /** * Whether the activity is deleted or not */ - public Builder deleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Builder deleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Whether the activity is deleted or not - */ - public Builder deleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - - - public Builder showAs(ShowAs showAs) { - Utils.checkNotNull(showAs, "showAs"); + public Builder showAs(@Nullable ShowAs showAs) { this.showAs = JsonNullable.of(showAs); return this; } - public Builder showAs(JsonNullable showAs) { - Utils.checkNotNull(showAs, "showAs"); - this.showAs = showAs; - return this; - } - - /** * Whether the Activity is done or not */ - public Builder done(boolean done) { - Utils.checkNotNull(done, "done"); + public Builder done(@Nullable Boolean done) { this.done = JsonNullable.of(done); return this; } - /** - * Whether the Activity is done or not - */ - public Builder done(JsonNullable done) { - Utils.checkNotNull(done, "done"); - this.done = done; - return this; - } - - /** * The start date and time of the activity */ - public Builder startDatetime(String startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); + public Builder startDatetime(@Nullable String startDatetime) { this.startDatetime = JsonNullable.of(startDatetime); return this; } - /** - * The start date and time of the activity - */ - public Builder startDatetime(JsonNullable startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); - this.startDatetime = startDatetime; - return this; - } - - /** * The end date and time of the activity */ - public Builder endDatetime(String endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); + public Builder endDatetime(@Nullable String endDatetime) { this.endDatetime = JsonNullable.of(endDatetime); return this; } - /** - * The end date and time of the activity - */ - public Builder endDatetime(JsonNullable endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); - this.endDatetime = endDatetime; - return this; - } - - /** * The duration of the activity in minutes */ - public Builder durationMinutes(long durationMinutes) { - Utils.checkNotNull(durationMinutes, "durationMinutes"); + public Builder durationMinutes(@Nullable Long durationMinutes) { this.durationMinutes = JsonNullable.of(durationMinutes); return this; } - /** - * The duration of the activity in minutes - */ - public Builder durationMinutes(JsonNullable durationMinutes) { - Utils.checkNotNull(durationMinutes, "durationMinutes"); - this.durationMinutes = durationMinutes; - return this; - } - - /** * The date of the activity */ - public Builder activityDate(String activityDate) { - Utils.checkNotNull(activityDate, "activityDate"); + public Builder activityDate(@Nullable String activityDate) { this.activityDate = JsonNullable.of(activityDate); return this; } - /** - * The date of the activity - */ - public Builder activityDate(JsonNullable activityDate) { - Utils.checkNotNull(activityDate, "activityDate"); - this.activityDate = activityDate; - return this; - } - - /** * The end date of the activity */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable String endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The end date of the activity - */ - public Builder endDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - - /** - * Whether the activity is recurrent or not - */ - public Builder recurrent(boolean recurrent) { - Utils.checkNotNull(recurrent, "recurrent"); - this.recurrent = Optional.ofNullable(recurrent); - return this; - } - /** * Whether the activity is recurrent or not */ - public Builder recurrent(Optional recurrent) { - Utils.checkNotNull(recurrent, "recurrent"); + public Builder recurrent(@Nullable Boolean recurrent) { this.recurrent = recurrent; return this; } - /** * The date and time of the reminder */ - public Builder reminderDatetime(String reminderDatetime) { - Utils.checkNotNull(reminderDatetime, "reminderDatetime"); + public Builder reminderDatetime(@Nullable String reminderDatetime) { this.reminderDatetime = JsonNullable.of(reminderDatetime); return this; } - /** - * The date and time of the reminder - */ - public Builder reminderDatetime(JsonNullable reminderDatetime) { - Utils.checkNotNull(reminderDatetime, "reminderDatetime"); - this.reminderDatetime = reminderDatetime; - return this; - } - - /** * Whether the reminder is set or not */ - public Builder reminderSet(boolean reminderSet) { - Utils.checkNotNull(reminderSet, "reminderSet"); + public Builder reminderSet(@Nullable Boolean reminderSet) { this.reminderSet = JsonNullable.of(reminderSet); return this; } - /** - * Whether the reminder is set or not - */ - public Builder reminderSet(JsonNullable reminderSet) { - Utils.checkNotNull(reminderSet, "reminderSet"); - this.reminderSet = reminderSet; - return this; - } - - /** * The URL of the video conference */ - public Builder videoConferenceUrl(String videoConferenceUrl) { - Utils.checkNotNull(videoConferenceUrl, "videoConferenceUrl"); + public Builder videoConferenceUrl(@Nullable String videoConferenceUrl) { this.videoConferenceUrl = JsonNullable.of(videoConferenceUrl); return this; } - /** - * The URL of the video conference - */ - public Builder videoConferenceUrl(JsonNullable videoConferenceUrl) { - Utils.checkNotNull(videoConferenceUrl, "videoConferenceUrl"); - this.videoConferenceUrl = videoConferenceUrl; - return this; - } - - /** * The ID of the video conference */ - public Builder videoConferenceId(String videoConferenceId) { - Utils.checkNotNull(videoConferenceId, "videoConferenceId"); + public Builder videoConferenceId(@Nullable String videoConferenceId) { this.videoConferenceId = JsonNullable.of(videoConferenceId); return this; } - /** - * The ID of the video conference - */ - public Builder videoConferenceId(JsonNullable videoConferenceId) { - Utils.checkNotNull(videoConferenceId, "videoConferenceId"); - this.videoConferenceId = videoConferenceId; - return this; - } - - /** * Custom fields of the activity */ - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - /** - * Custom fields of the activity - */ - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - - public Builder attendees(List attendees) { - Utils.checkNotNull(attendees, "attendees"); - this.attendees = Optional.ofNullable(attendees); - return this; - } - - public Builder attendees(Optional> attendees) { - Utils.checkNotNull(attendees, "attendees"); + public Builder attendees(@Nullable List attendees) { this.attendees = attendees; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the activity */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the activity - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the activity */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the activity - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the activity was last updated */ - public Builder updatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the activity was last updated - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the activity was created */ - public Builder createdAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the activity was created - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Activity build() { - return new Activity( id, downstreamId, activityDatetime, durationSeconds, userId, accountId, diff --git a/src/main/java/com/apideck/unify/models/components/ActivityAttendee.java b/src/main/java/com/apideck/unify/models/components/ActivityAttendee.java index be8093e2..ce4b31ac 100644 --- a/src/main/java/com/apideck/unify/models/components/ActivityAttendee.java +++ b/src/main/java/com/apideck/unify/models/components/ActivityAttendee.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -86,7 +86,7 @@ public class ActivityAttendee { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * The identifier for a related user @@ -118,169 +118,154 @@ public class ActivityAttendee { @JsonCreator public ActivityAttendee( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("prefix") JsonNullable prefix, - @JsonProperty("suffix") JsonNullable suffix, - @JsonProperty("email_address") JsonNullable emailAddress, - @JsonProperty("is_organizer") JsonNullable isOrganizer, - @JsonProperty("status") JsonNullable status, - @JsonProperty("user_id") JsonNullable userId, - @JsonProperty("contact_id") JsonNullable contactId, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(prefix, "prefix"); - Utils.checkNotNull(suffix, "suffix"); - Utils.checkNotNull(emailAddress, "emailAddress"); - Utils.checkNotNull(isOrganizer, "isOrganizer"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(userId, "userId"); - Utils.checkNotNull(contactId, "contactId"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - this.id = id; - this.name = name; - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.prefix = prefix; - this.suffix = suffix; - this.emailAddress = emailAddress; - this.isOrganizer = isOrganizer; - this.status = status; - this.userId = userId; - this.contactId = contactId; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("prefix") @Nullable JsonNullable prefix, + @JsonProperty("suffix") @Nullable JsonNullable suffix, + @JsonProperty("email_address") @Nullable JsonNullable emailAddress, + @JsonProperty("is_organizer") @Nullable JsonNullable isOrganizer, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("user_id") @Nullable JsonNullable userId, + @JsonProperty("contact_id") @Nullable JsonNullable contactId, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.prefix = Optional.ofNullable(prefix) + .orElse(JsonNullable.undefined()); + this.suffix = Optional.ofNullable(suffix) + .orElse(JsonNullable.undefined()); + this.emailAddress = Optional.ofNullable(emailAddress) + .orElse(JsonNullable.undefined()); + this.isOrganizer = Optional.ofNullable(isOrganizer) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.userId = Optional.ofNullable(userId) + .orElse(JsonNullable.undefined()); + this.contactId = Optional.ofNullable(contactId) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); } public ActivityAttendee() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * Unique identifier for the attendee */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Full name of the attendee */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * First name of the attendee */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * Middle name of the attendee */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * Last name of the attendee */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Prefix of the attendee */ - @JsonIgnore public JsonNullable prefix() { - return prefix; + return this.prefix; } /** * Suffix of the attendee */ - @JsonIgnore public JsonNullable suffix() { - return suffix; + return this.suffix; } /** * Email address of the attendee */ - @JsonIgnore public JsonNullable emailAddress() { - return emailAddress; + return this.emailAddress; } /** * Whether the attendee is the organizer of the activity */ - @JsonIgnore public JsonNullable isOrganizer() { - return isOrganizer; + return this.isOrganizer; } /** * Status of the attendee */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * The identifier for a related user */ - @JsonIgnore public JsonNullable userId() { - return userId; + return this.userId; } /** * The identifier for a related contact */ - @JsonIgnore public JsonNullable contactId() { - return contactId; + return this.contactId; } /** * The last time the attendee was updated (ISO 8601) */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The time the attendee was created (ISO 8601) */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } public static Builder builder() { @@ -291,254 +276,128 @@ public static Builder builder() { /** * Unique identifier for the attendee */ - public ActivityAttendee withId(String id) { - Utils.checkNotNull(id, "id"); + public ActivityAttendee withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the attendee - */ - public ActivityAttendee withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * Full name of the attendee */ - public ActivityAttendee withName(String name) { - Utils.checkNotNull(name, "name"); + public ActivityAttendee withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the attendee - */ - public ActivityAttendee withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * First name of the attendee */ - public ActivityAttendee withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public ActivityAttendee withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * First name of the attendee - */ - public ActivityAttendee withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * Middle name of the attendee */ - public ActivityAttendee withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public ActivityAttendee withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the attendee - */ - public ActivityAttendee withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * Last name of the attendee */ - public ActivityAttendee withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public ActivityAttendee withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * Last name of the attendee - */ - public ActivityAttendee withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Prefix of the attendee */ - public ActivityAttendee withPrefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public ActivityAttendee withPrefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * Prefix of the attendee - */ - public ActivityAttendee withPrefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } /** * Suffix of the attendee */ - public ActivityAttendee withSuffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public ActivityAttendee withSuffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - /** - * Suffix of the attendee - */ - public ActivityAttendee withSuffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } /** * Email address of the attendee */ - public ActivityAttendee withEmailAddress(String emailAddress) { - Utils.checkNotNull(emailAddress, "emailAddress"); + public ActivityAttendee withEmailAddress(@Nullable String emailAddress) { this.emailAddress = JsonNullable.of(emailAddress); return this; } - /** - * Email address of the attendee - */ - public ActivityAttendee withEmailAddress(JsonNullable emailAddress) { - Utils.checkNotNull(emailAddress, "emailAddress"); - this.emailAddress = emailAddress; - return this; - } /** * Whether the attendee is the organizer of the activity */ - public ActivityAttendee withIsOrganizer(boolean isOrganizer) { - Utils.checkNotNull(isOrganizer, "isOrganizer"); + public ActivityAttendee withIsOrganizer(@Nullable Boolean isOrganizer) { this.isOrganizer = JsonNullable.of(isOrganizer); return this; } - /** - * Whether the attendee is the organizer of the activity - */ - public ActivityAttendee withIsOrganizer(JsonNullable isOrganizer) { - Utils.checkNotNull(isOrganizer, "isOrganizer"); - this.isOrganizer = isOrganizer; - return this; - } /** * Status of the attendee */ - public ActivityAttendee withStatus(ActivityAttendeeStatus status) { - Utils.checkNotNull(status, "status"); + public ActivityAttendee withStatus(@Nullable ActivityAttendeeStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Status of the attendee - */ - public ActivityAttendee withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The identifier for a related user */ - public ActivityAttendee withUserId(String userId) { - Utils.checkNotNull(userId, "userId"); + public ActivityAttendee withUserId(@Nullable String userId) { this.userId = JsonNullable.of(userId); return this; } - /** - * The identifier for a related user - */ - public ActivityAttendee withUserId(JsonNullable userId) { - Utils.checkNotNull(userId, "userId"); - this.userId = userId; - return this; - } /** * The identifier for a related contact */ - public ActivityAttendee withContactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public ActivityAttendee withContactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The identifier for a related contact - */ - public ActivityAttendee withContactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } /** * The last time the attendee was updated (ISO 8601) */ - public ActivityAttendee withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public ActivityAttendee withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The last time the attendee was updated (ISO 8601) - */ - public ActivityAttendee withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The time the attendee was created (ISO 8601) */ - public ActivityAttendee withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public ActivityAttendee withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The time the attendee was created (ISO 8601) - */ - public ActivityAttendee withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -598,306 +457,151 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable prefix = JsonNullable.undefined(); + private JsonNullable prefix; - private JsonNullable suffix = JsonNullable.undefined(); + private JsonNullable suffix; - private JsonNullable emailAddress = JsonNullable.undefined(); + private JsonNullable emailAddress; - private JsonNullable isOrganizer = JsonNullable.undefined(); + private JsonNullable isOrganizer; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable userId = JsonNullable.undefined(); + private JsonNullable userId; - private JsonNullable contactId = JsonNullable.undefined(); + private JsonNullable contactId; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; private Builder() { // force use of static builder() method } - /** * Unique identifier for the attendee */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the attendee - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * Full name of the attendee */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the attendee - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * First name of the attendee */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * First name of the attendee - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * Middle name of the attendee */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the attendee - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * Last name of the attendee */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * Last name of the attendee - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Prefix of the attendee */ - public Builder prefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public Builder prefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * Prefix of the attendee - */ - public Builder prefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } - - /** * Suffix of the attendee */ - public Builder suffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Builder suffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - /** - * Suffix of the attendee - */ - public Builder suffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } - - /** * Email address of the attendee */ - public Builder emailAddress(String emailAddress) { - Utils.checkNotNull(emailAddress, "emailAddress"); + public Builder emailAddress(@Nullable String emailAddress) { this.emailAddress = JsonNullable.of(emailAddress); return this; } - /** - * Email address of the attendee - */ - public Builder emailAddress(JsonNullable emailAddress) { - Utils.checkNotNull(emailAddress, "emailAddress"); - this.emailAddress = emailAddress; - return this; - } - - /** * Whether the attendee is the organizer of the activity */ - public Builder isOrganizer(boolean isOrganizer) { - Utils.checkNotNull(isOrganizer, "isOrganizer"); + public Builder isOrganizer(@Nullable Boolean isOrganizer) { this.isOrganizer = JsonNullable.of(isOrganizer); return this; } - /** - * Whether the attendee is the organizer of the activity - */ - public Builder isOrganizer(JsonNullable isOrganizer) { - Utils.checkNotNull(isOrganizer, "isOrganizer"); - this.isOrganizer = isOrganizer; - return this; - } - - /** * Status of the attendee */ - public Builder status(ActivityAttendeeStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ActivityAttendeeStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Status of the attendee - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The identifier for a related user */ - public Builder userId(String userId) { - Utils.checkNotNull(userId, "userId"); + public Builder userId(@Nullable String userId) { this.userId = JsonNullable.of(userId); return this; } - /** - * The identifier for a related user - */ - public Builder userId(JsonNullable userId) { - Utils.checkNotNull(userId, "userId"); - this.userId = userId; - return this; - } - - /** * The identifier for a related contact */ - public Builder contactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public Builder contactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The identifier for a related contact - */ - public Builder contactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } - - /** * The last time the attendee was updated (ISO 8601) */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The last time the attendee was updated (ISO 8601) - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The time the attendee was created (ISO 8601) */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The time the attendee was created (ISO 8601) - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - public ActivityAttendee build() { - return new ActivityAttendee( id, name, firstName, middleName, lastName, prefix, diff --git a/src/main/java/com/apideck/unify/models/components/ActivityAttendeeInput.java b/src/main/java/com/apideck/unify/models/components/ActivityAttendeeInput.java index 152ac430..b39cda34 100644 --- a/src/main/java/com/apideck/unify/models/components/ActivityAttendeeInput.java +++ b/src/main/java/com/apideck/unify/models/components/ActivityAttendeeInput.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -78,116 +78,106 @@ public class ActivityAttendeeInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; @JsonCreator public ActivityAttendeeInput( - @JsonProperty("name") JsonNullable name, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("prefix") JsonNullable prefix, - @JsonProperty("suffix") JsonNullable suffix, - @JsonProperty("email_address") JsonNullable emailAddress, - @JsonProperty("is_organizer") JsonNullable isOrganizer, - @JsonProperty("status") JsonNullable status) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(prefix, "prefix"); - Utils.checkNotNull(suffix, "suffix"); - Utils.checkNotNull(emailAddress, "emailAddress"); - Utils.checkNotNull(isOrganizer, "isOrganizer"); - Utils.checkNotNull(status, "status"); - this.name = name; - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.prefix = prefix; - this.suffix = suffix; - this.emailAddress = emailAddress; - this.isOrganizer = isOrganizer; - this.status = status; + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("prefix") @Nullable JsonNullable prefix, + @JsonProperty("suffix") @Nullable JsonNullable suffix, + @JsonProperty("email_address") @Nullable JsonNullable emailAddress, + @JsonProperty("is_organizer") @Nullable JsonNullable isOrganizer, + @JsonProperty("status") @Nullable JsonNullable status) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.prefix = Optional.ofNullable(prefix) + .orElse(JsonNullable.undefined()); + this.suffix = Optional.ofNullable(suffix) + .orElse(JsonNullable.undefined()); + this.emailAddress = Optional.ofNullable(emailAddress) + .orElse(JsonNullable.undefined()); + this.isOrganizer = Optional.ofNullable(isOrganizer) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); } public ActivityAttendeeInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * Full name of the attendee */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * First name of the attendee */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * Middle name of the attendee */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * Last name of the attendee */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Prefix of the attendee */ - @JsonIgnore public JsonNullable prefix() { - return prefix; + return this.prefix; } /** * Suffix of the attendee */ - @JsonIgnore public JsonNullable suffix() { - return suffix; + return this.suffix; } /** * Email address of the attendee */ - @JsonIgnore public JsonNullable emailAddress() { - return emailAddress; + return this.emailAddress; } /** * Whether the attendee is the organizer of the activity */ - @JsonIgnore public JsonNullable isOrganizer() { - return isOrganizer; + return this.isOrganizer; } /** * Status of the attendee */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } public static Builder builder() { @@ -198,164 +188,83 @@ public static Builder builder() { /** * Full name of the attendee */ - public ActivityAttendeeInput withName(String name) { - Utils.checkNotNull(name, "name"); + public ActivityAttendeeInput withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the attendee - */ - public ActivityAttendeeInput withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * First name of the attendee */ - public ActivityAttendeeInput withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public ActivityAttendeeInput withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * First name of the attendee - */ - public ActivityAttendeeInput withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * Middle name of the attendee */ - public ActivityAttendeeInput withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public ActivityAttendeeInput withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the attendee - */ - public ActivityAttendeeInput withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * Last name of the attendee */ - public ActivityAttendeeInput withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public ActivityAttendeeInput withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * Last name of the attendee - */ - public ActivityAttendeeInput withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Prefix of the attendee */ - public ActivityAttendeeInput withPrefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public ActivityAttendeeInput withPrefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * Prefix of the attendee - */ - public ActivityAttendeeInput withPrefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } /** * Suffix of the attendee */ - public ActivityAttendeeInput withSuffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public ActivityAttendeeInput withSuffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - /** - * Suffix of the attendee - */ - public ActivityAttendeeInput withSuffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } /** * Email address of the attendee */ - public ActivityAttendeeInput withEmailAddress(String emailAddress) { - Utils.checkNotNull(emailAddress, "emailAddress"); + public ActivityAttendeeInput withEmailAddress(@Nullable String emailAddress) { this.emailAddress = JsonNullable.of(emailAddress); return this; } - /** - * Email address of the attendee - */ - public ActivityAttendeeInput withEmailAddress(JsonNullable emailAddress) { - Utils.checkNotNull(emailAddress, "emailAddress"); - this.emailAddress = emailAddress; - return this; - } /** * Whether the attendee is the organizer of the activity */ - public ActivityAttendeeInput withIsOrganizer(boolean isOrganizer) { - Utils.checkNotNull(isOrganizer, "isOrganizer"); + public ActivityAttendeeInput withIsOrganizer(@Nullable Boolean isOrganizer) { this.isOrganizer = JsonNullable.of(isOrganizer); return this; } - /** - * Whether the attendee is the organizer of the activity - */ - public ActivityAttendeeInput withIsOrganizer(JsonNullable isOrganizer) { - Utils.checkNotNull(isOrganizer, "isOrganizer"); - this.isOrganizer = isOrganizer; - return this; - } /** * Status of the attendee */ - public ActivityAttendeeInput withStatus(ActivityAttendeeStatus status) { - Utils.checkNotNull(status, "status"); + public ActivityAttendeeInput withStatus(@Nullable ActivityAttendeeStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Status of the attendee - */ - public ActivityAttendeeInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -403,201 +312,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable prefix = JsonNullable.undefined(); + private JsonNullable prefix; - private JsonNullable suffix = JsonNullable.undefined(); + private JsonNullable suffix; - private JsonNullable emailAddress = JsonNullable.undefined(); + private JsonNullable emailAddress; - private JsonNullable isOrganizer = JsonNullable.undefined(); + private JsonNullable isOrganizer; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; private Builder() { // force use of static builder() method } - /** * Full name of the attendee */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the attendee - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * First name of the attendee */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * First name of the attendee - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * Middle name of the attendee */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the attendee - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * Last name of the attendee */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * Last name of the attendee - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Prefix of the attendee */ - public Builder prefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public Builder prefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * Prefix of the attendee - */ - public Builder prefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } - - /** * Suffix of the attendee */ - public Builder suffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Builder suffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - /** - * Suffix of the attendee - */ - public Builder suffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } - - /** * Email address of the attendee */ - public Builder emailAddress(String emailAddress) { - Utils.checkNotNull(emailAddress, "emailAddress"); + public Builder emailAddress(@Nullable String emailAddress) { this.emailAddress = JsonNullable.of(emailAddress); return this; } - /** - * Email address of the attendee - */ - public Builder emailAddress(JsonNullable emailAddress) { - Utils.checkNotNull(emailAddress, "emailAddress"); - this.emailAddress = emailAddress; - return this; - } - - /** * Whether the attendee is the organizer of the activity */ - public Builder isOrganizer(boolean isOrganizer) { - Utils.checkNotNull(isOrganizer, "isOrganizer"); + public Builder isOrganizer(@Nullable Boolean isOrganizer) { this.isOrganizer = JsonNullable.of(isOrganizer); return this; } - /** - * Whether the attendee is the organizer of the activity - */ - public Builder isOrganizer(JsonNullable isOrganizer) { - Utils.checkNotNull(isOrganizer, "isOrganizer"); - this.isOrganizer = isOrganizer; - return this; - } - - /** * Status of the attendee */ - public Builder status(ActivityAttendeeStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ActivityAttendeeStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Status of the attendee - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - public ActivityAttendeeInput build() { - return new ActivityAttendeeInput( name, firstName, middleName, lastName, prefix, suffix, diff --git a/src/main/java/com/apideck/unify/models/components/ActivityInput.java b/src/main/java/com/apideck/unify/models/components/ActivityInput.java index 2d1f7b1a..4f39f310 100644 --- a/src/main/java/com/apideck/unify/models/components/ActivityInput.java +++ b/src/main/java/com/apideck/unify/models/components/ActivityInput.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -137,7 +136,7 @@ public class ActivityInput { */ @JsonInclude(Include.ALWAYS) @JsonProperty("type") - private Optional type; + private JsonNullable type; /** * The title of the activity @@ -170,7 +169,7 @@ public class ActivityInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("location_address") - private Optional locationAddress; + private Address locationAddress; /** * Whether the Activity is an all day event or not @@ -231,7 +230,7 @@ public class ActivityInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("show_as") - private JsonNullable showAs; + private JsonNullable showAs; /** * Whether the Activity is done or not @@ -273,7 +272,7 @@ public class ActivityInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("recurrent") - private Optional recurrent; + private Boolean recurrent; /** * The date and time of the reminder @@ -308,521 +307,465 @@ public class ActivityInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("attendees") - private Optional> attendees; + private List attendees; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public ActivityInput( - @JsonProperty("activity_datetime") JsonNullable activityDatetime, - @JsonProperty("duration_seconds") JsonNullable durationSeconds, - @JsonProperty("user_id") JsonNullable userId, - @JsonProperty("account_id") JsonNullable accountId, - @JsonProperty("contact_id") JsonNullable contactId, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("opportunity_id") JsonNullable opportunityId, - @JsonProperty("lead_id") JsonNullable leadId, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("campaign_id") JsonNullable campaignId, - @JsonProperty("case_id") JsonNullable caseId, - @JsonProperty("asset_id") JsonNullable assetId, - @JsonProperty("contract_id") JsonNullable contractId, - @JsonProperty("product_id") JsonNullable productId, - @JsonProperty("solution_id") JsonNullable solutionId, - @JsonProperty("custom_object_id") JsonNullable customObjectId, - @JsonProperty("type") Optional type, - @JsonProperty("title") JsonNullable title, - @JsonProperty("description") JsonNullable description, - @JsonProperty("note") JsonNullable note, - @JsonProperty("location") JsonNullable location, - @JsonProperty("location_address") Optional locationAddress, - @JsonProperty("all_day_event") JsonNullable allDayEvent, - @JsonProperty("private") JsonNullable private_, - @JsonProperty("group_event") JsonNullable groupEvent, - @JsonProperty("event_sub_type") JsonNullable eventSubType, - @JsonProperty("group_event_type") JsonNullable groupEventType, - @JsonProperty("child") JsonNullable child, - @JsonProperty("archived") JsonNullable archived, - @JsonProperty("deleted") JsonNullable deleted, - @JsonProperty("show_as") JsonNullable showAs, - @JsonProperty("done") JsonNullable done, - @JsonProperty("start_datetime") JsonNullable startDatetime, - @JsonProperty("end_datetime") JsonNullable endDatetime, - @JsonProperty("activity_date") JsonNullable activityDate, - @JsonProperty("end_date") JsonNullable endDate, - @JsonProperty("recurrent") Optional recurrent, - @JsonProperty("reminder_datetime") JsonNullable reminderDatetime, - @JsonProperty("reminder_set") JsonNullable reminderSet, - @JsonProperty("video_conference_url") JsonNullable videoConferenceUrl, - @JsonProperty("video_conference_id") JsonNullable videoConferenceId, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("attendees") Optional> attendees, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(activityDatetime, "activityDatetime"); - Utils.checkNotNull(durationSeconds, "durationSeconds"); - Utils.checkNotNull(userId, "userId"); - Utils.checkNotNull(accountId, "accountId"); - Utils.checkNotNull(contactId, "contactId"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(opportunityId, "opportunityId"); - Utils.checkNotNull(leadId, "leadId"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(campaignId, "campaignId"); - Utils.checkNotNull(caseId, "caseId"); - Utils.checkNotNull(assetId, "assetId"); - Utils.checkNotNull(contractId, "contractId"); - Utils.checkNotNull(productId, "productId"); - Utils.checkNotNull(solutionId, "solutionId"); - Utils.checkNotNull(customObjectId, "customObjectId"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(note, "note"); - Utils.checkNotNull(location, "location"); - Utils.checkNotNull(locationAddress, "locationAddress"); - Utils.checkNotNull(allDayEvent, "allDayEvent"); - Utils.checkNotNull(private_, "private_"); - Utils.checkNotNull(groupEvent, "groupEvent"); - Utils.checkNotNull(eventSubType, "eventSubType"); - Utils.checkNotNull(groupEventType, "groupEventType"); - Utils.checkNotNull(child, "child"); - Utils.checkNotNull(archived, "archived"); - Utils.checkNotNull(deleted, "deleted"); - Utils.checkNotNull(showAs, "showAs"); - Utils.checkNotNull(done, "done"); - Utils.checkNotNull(startDatetime, "startDatetime"); - Utils.checkNotNull(endDatetime, "endDatetime"); - Utils.checkNotNull(activityDate, "activityDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(recurrent, "recurrent"); - Utils.checkNotNull(reminderDatetime, "reminderDatetime"); - Utils.checkNotNull(reminderSet, "reminderSet"); - Utils.checkNotNull(videoConferenceUrl, "videoConferenceUrl"); - Utils.checkNotNull(videoConferenceId, "videoConferenceId"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(attendees, "attendees"); - Utils.checkNotNull(passThrough, "passThrough"); - this.activityDatetime = activityDatetime; - this.durationSeconds = durationSeconds; - this.userId = userId; - this.accountId = accountId; - this.contactId = contactId; - this.companyId = companyId; - this.opportunityId = opportunityId; - this.leadId = leadId; - this.ownerId = ownerId; - this.campaignId = campaignId; - this.caseId = caseId; - this.assetId = assetId; - this.contractId = contractId; - this.productId = productId; - this.solutionId = solutionId; - this.customObjectId = customObjectId; - this.type = type; - this.title = title; - this.description = description; - this.note = note; - this.location = location; + @JsonProperty("activity_datetime") @Nullable JsonNullable activityDatetime, + @JsonProperty("duration_seconds") @Nullable JsonNullable durationSeconds, + @JsonProperty("user_id") @Nullable JsonNullable userId, + @JsonProperty("account_id") @Nullable JsonNullable accountId, + @JsonProperty("contact_id") @Nullable JsonNullable contactId, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("opportunity_id") @Nullable JsonNullable opportunityId, + @JsonProperty("lead_id") @Nullable JsonNullable leadId, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("campaign_id") @Nullable JsonNullable campaignId, + @JsonProperty("case_id") @Nullable JsonNullable caseId, + @JsonProperty("asset_id") @Nullable JsonNullable assetId, + @JsonProperty("contract_id") @Nullable JsonNullable contractId, + @JsonProperty("product_id") @Nullable JsonNullable productId, + @JsonProperty("solution_id") @Nullable JsonNullable solutionId, + @JsonProperty("custom_object_id") @Nullable JsonNullable customObjectId, + @JsonProperty("type") @Nullable ActivityType type, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("note") @Nullable JsonNullable note, + @JsonProperty("location") @Nullable JsonNullable location, + @JsonProperty("location_address") @Nullable Address locationAddress, + @JsonProperty("all_day_event") @Nullable JsonNullable allDayEvent, + @JsonProperty("private") @Nullable JsonNullable private_, + @JsonProperty("group_event") @Nullable JsonNullable groupEvent, + @JsonProperty("event_sub_type") @Nullable JsonNullable eventSubType, + @JsonProperty("group_event_type") @Nullable JsonNullable groupEventType, + @JsonProperty("child") @Nullable JsonNullable child, + @JsonProperty("archived") @Nullable JsonNullable archived, + @JsonProperty("deleted") @Nullable JsonNullable deleted, + @JsonProperty("show_as") @Nullable JsonNullable showAs, + @JsonProperty("done") @Nullable JsonNullable done, + @JsonProperty("start_datetime") @Nullable JsonNullable startDatetime, + @JsonProperty("end_datetime") @Nullable JsonNullable endDatetime, + @JsonProperty("activity_date") @Nullable JsonNullable activityDate, + @JsonProperty("end_date") @Nullable JsonNullable endDate, + @JsonProperty("recurrent") @Nullable Boolean recurrent, + @JsonProperty("reminder_datetime") @Nullable JsonNullable reminderDatetime, + @JsonProperty("reminder_set") @Nullable JsonNullable reminderSet, + @JsonProperty("video_conference_url") @Nullable JsonNullable videoConferenceUrl, + @JsonProperty("video_conference_id") @Nullable JsonNullable videoConferenceId, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("attendees") @Nullable List attendees, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.activityDatetime = Optional.ofNullable(activityDatetime) + .orElse(JsonNullable.undefined()); + this.durationSeconds = Optional.ofNullable(durationSeconds) + .orElse(JsonNullable.undefined()); + this.userId = Optional.ofNullable(userId) + .orElse(JsonNullable.undefined()); + this.accountId = Optional.ofNullable(accountId) + .orElse(JsonNullable.undefined()); + this.contactId = Optional.ofNullable(contactId) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.opportunityId = Optional.ofNullable(opportunityId) + .orElse(JsonNullable.undefined()); + this.leadId = Optional.ofNullable(leadId) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.campaignId = Optional.ofNullable(campaignId) + .orElse(JsonNullable.undefined()); + this.caseId = Optional.ofNullable(caseId) + .orElse(JsonNullable.undefined()); + this.assetId = Optional.ofNullable(assetId) + .orElse(JsonNullable.undefined()); + this.contractId = Optional.ofNullable(contractId) + .orElse(JsonNullable.undefined()); + this.productId = Optional.ofNullable(productId) + .orElse(JsonNullable.undefined()); + this.solutionId = Optional.ofNullable(solutionId) + .orElse(JsonNullable.undefined()); + this.customObjectId = Optional.ofNullable(customObjectId) + .orElse(JsonNullable.undefined()); + this.type = JsonNullable.of(type); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.note = Optional.ofNullable(note) + .orElse(JsonNullable.undefined()); + this.location = Optional.ofNullable(location) + .orElse(JsonNullable.undefined()); this.locationAddress = locationAddress; - this.allDayEvent = allDayEvent; - this.private_ = private_; - this.groupEvent = groupEvent; - this.eventSubType = eventSubType; - this.groupEventType = groupEventType; - this.child = child; - this.archived = archived; - this.deleted = deleted; - this.showAs = showAs; - this.done = done; - this.startDatetime = startDatetime; - this.endDatetime = endDatetime; - this.activityDate = activityDate; - this.endDate = endDate; + this.allDayEvent = Optional.ofNullable(allDayEvent) + .orElse(JsonNullable.undefined()); + this.private_ = Optional.ofNullable(private_) + .orElse(JsonNullable.undefined()); + this.groupEvent = Optional.ofNullable(groupEvent) + .orElse(JsonNullable.undefined()); + this.eventSubType = Optional.ofNullable(eventSubType) + .orElse(JsonNullable.undefined()); + this.groupEventType = Optional.ofNullable(groupEventType) + .orElse(JsonNullable.undefined()); + this.child = Optional.ofNullable(child) + .orElse(JsonNullable.undefined()); + this.archived = Optional.ofNullable(archived) + .orElse(JsonNullable.undefined()); + this.deleted = Optional.ofNullable(deleted) + .orElse(JsonNullable.undefined()); + this.showAs = Optional.ofNullable(showAs) + .orElse(JsonNullable.undefined()); + this.done = Optional.ofNullable(done) + .orElse(JsonNullable.undefined()); + this.startDatetime = Optional.ofNullable(startDatetime) + .orElse(JsonNullable.undefined()); + this.endDatetime = Optional.ofNullable(endDatetime) + .orElse(JsonNullable.undefined()); + this.activityDate = Optional.ofNullable(activityDate) + .orElse(JsonNullable.undefined()); + this.endDate = Optional.ofNullable(endDate) + .orElse(JsonNullable.undefined()); this.recurrent = recurrent; - this.reminderDatetime = reminderDatetime; - this.reminderSet = reminderSet; - this.videoConferenceUrl = videoConferenceUrl; - this.videoConferenceId = videoConferenceId; + this.reminderDatetime = Optional.ofNullable(reminderDatetime) + .orElse(JsonNullable.undefined()); + this.reminderSet = Optional.ofNullable(reminderSet) + .orElse(JsonNullable.undefined()); + this.videoConferenceUrl = Optional.ofNullable(videoConferenceUrl) + .orElse(JsonNullable.undefined()); + this.videoConferenceId = Optional.ofNullable(videoConferenceId) + .orElse(JsonNullable.undefined()); this.customFields = customFields; this.attendees = attendees; this.passThrough = passThrough; } public ActivityInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * The date and time of the activity */ - @JsonIgnore public JsonNullable activityDatetime() { - return activityDatetime; + return this.activityDatetime; } /** * The duration of the activity in seconds */ - @JsonIgnore public JsonNullable durationSeconds() { - return durationSeconds; + return this.durationSeconds; } /** * The user related to the activity */ - @JsonIgnore public JsonNullable userId() { - return userId; + return this.userId; } /** * The account related to the activity */ - @JsonIgnore public JsonNullable accountId() { - return accountId; + return this.accountId; } /** * The contact related to the activity */ - @JsonIgnore public JsonNullable contactId() { - return contactId; + return this.contactId; } /** * The company related to the activity */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The opportunity related to the activity */ - @JsonIgnore public JsonNullable opportunityId() { - return opportunityId; + return this.opportunityId; } /** * The lead related to the activity */ - @JsonIgnore public JsonNullable leadId() { - return leadId; + return this.leadId; } /** * The owner of the activity */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The campaign related to the activity */ - @JsonIgnore public JsonNullable campaignId() { - return campaignId; + return this.campaignId; } /** * The case related to the activity */ - @JsonIgnore public JsonNullable caseId() { - return caseId; + return this.caseId; } /** * The asset related to the activity */ - @JsonIgnore public JsonNullable assetId() { - return assetId; + return this.assetId; } /** * The contract related to the activity */ - @JsonIgnore public JsonNullable contractId() { - return contractId; + return this.contractId; } /** * The product related to the activity */ - @JsonIgnore public JsonNullable productId() { - return productId; + return this.productId; } /** * The solution related to the activity */ - @JsonIgnore public JsonNullable solutionId() { - return solutionId; + return this.solutionId; } /** * The custom object related to the activity */ - @JsonIgnore public JsonNullable customObjectId() { - return customObjectId; + return this.customObjectId; } /** * The type of the activity */ - @SuppressWarnings("unchecked") - @JsonIgnore - public Optional type() { - return (Optional) type; + public JsonNullable type() { + return this.type; } /** * The title of the activity */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * A description of the activity */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * An internal note about the activity */ - @JsonIgnore public JsonNullable note() { - return note; + return this.note; } /** * The location of the activity */ - @JsonIgnore public JsonNullable location() { - return location; + return this.location; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
locationAddress() { - return (Optional
) locationAddress; + return Optional.ofNullable(this.locationAddress); } /** * Whether the Activity is an all day event or not */ - @JsonIgnore public JsonNullable allDayEvent() { - return allDayEvent; + return this.allDayEvent; } /** * Whether the Activity is private or not */ - @JsonIgnore public JsonNullable private_() { - return private_; + return this.private_; } /** * Whether the Activity is a group event or not */ - @JsonIgnore public JsonNullable groupEvent() { - return groupEvent; + return this.groupEvent; } /** * The sub type of the group event */ - @JsonIgnore public JsonNullable eventSubType() { - return eventSubType; + return this.eventSubType; } /** * The type of the group event */ - @JsonIgnore public JsonNullable groupEventType() { - return groupEventType; + return this.groupEventType; } /** * Whether the activity is a child of another activity or not */ - @JsonIgnore public JsonNullable child() { - return child; + return this.child; } /** * Whether the activity is archived or not */ - @JsonIgnore public JsonNullable archived() { - return archived; + return this.archived; } /** * Whether the activity is deleted or not */ - @JsonIgnore public JsonNullable deleted() { - return deleted; + return this.deleted; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable showAs() { - return (JsonNullable) showAs; + return this.showAs; } /** * Whether the Activity is done or not */ - @JsonIgnore public JsonNullable done() { - return done; + return this.done; } /** * The start date and time of the activity */ - @JsonIgnore public JsonNullable startDatetime() { - return startDatetime; + return this.startDatetime; } /** * The end date and time of the activity */ - @JsonIgnore public JsonNullable endDatetime() { - return endDatetime; + return this.endDatetime; } /** * The date of the activity */ - @JsonIgnore public JsonNullable activityDate() { - return activityDate; + return this.activityDate; } /** * The end date of the activity */ - @JsonIgnore public JsonNullable endDate() { - return endDate; + return this.endDate; } /** * Whether the activity is recurrent or not */ - @JsonIgnore public Optional recurrent() { - return recurrent; + return Optional.ofNullable(this.recurrent); } /** * The date and time of the reminder */ - @JsonIgnore public JsonNullable reminderDatetime() { - return reminderDatetime; + return this.reminderDatetime; } /** * Whether the reminder is set or not */ - @JsonIgnore public JsonNullable reminderSet() { - return reminderSet; + return this.reminderSet; } /** * The URL of the video conference */ - @JsonIgnore public JsonNullable videoConferenceUrl() { - return videoConferenceUrl; + return this.videoConferenceUrl; } /** * The ID of the video conference */ - @JsonIgnore public JsonNullable videoConferenceId() { - return videoConferenceId; + return this.videoConferenceId; } /** * Custom fields of the activity */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> attendees() { - return (Optional>) attendees; + return Optional.ofNullable(this.attendees); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -833,783 +776,390 @@ public static Builder builder() { /** * The date and time of the activity */ - public ActivityInput withActivityDatetime(String activityDatetime) { - Utils.checkNotNull(activityDatetime, "activityDatetime"); + public ActivityInput withActivityDatetime(@Nullable String activityDatetime) { this.activityDatetime = JsonNullable.of(activityDatetime); return this; } - /** - * The date and time of the activity - */ - public ActivityInput withActivityDatetime(JsonNullable activityDatetime) { - Utils.checkNotNull(activityDatetime, "activityDatetime"); - this.activityDatetime = activityDatetime; - return this; - } /** * The duration of the activity in seconds */ - public ActivityInput withDurationSeconds(long durationSeconds) { - Utils.checkNotNull(durationSeconds, "durationSeconds"); + public ActivityInput withDurationSeconds(@Nullable Long durationSeconds) { this.durationSeconds = JsonNullable.of(durationSeconds); return this; } - /** - * The duration of the activity in seconds - */ - public ActivityInput withDurationSeconds(JsonNullable durationSeconds) { - Utils.checkNotNull(durationSeconds, "durationSeconds"); - this.durationSeconds = durationSeconds; - return this; - } /** * The user related to the activity */ - public ActivityInput withUserId(String userId) { - Utils.checkNotNull(userId, "userId"); + public ActivityInput withUserId(@Nullable String userId) { this.userId = JsonNullable.of(userId); return this; } - /** - * The user related to the activity - */ - public ActivityInput withUserId(JsonNullable userId) { - Utils.checkNotNull(userId, "userId"); - this.userId = userId; - return this; - } /** * The account related to the activity */ - public ActivityInput withAccountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); + public ActivityInput withAccountId(@Nullable String accountId) { this.accountId = JsonNullable.of(accountId); return this; } - /** - * The account related to the activity - */ - public ActivityInput withAccountId(JsonNullable accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = accountId; - return this; - } /** * The contact related to the activity */ - public ActivityInput withContactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public ActivityInput withContactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The contact related to the activity - */ - public ActivityInput withContactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } /** * The company related to the activity */ - public ActivityInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public ActivityInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company related to the activity - */ - public ActivityInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The opportunity related to the activity */ - public ActivityInput withOpportunityId(String opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); + public ActivityInput withOpportunityId(@Nullable String opportunityId) { this.opportunityId = JsonNullable.of(opportunityId); return this; } - /** - * The opportunity related to the activity - */ - public ActivityInput withOpportunityId(JsonNullable opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); - this.opportunityId = opportunityId; - return this; - } /** * The lead related to the activity */ - public ActivityInput withLeadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public ActivityInput withLeadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead related to the activity - */ - public ActivityInput withLeadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } /** * The owner of the activity */ - public ActivityInput withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public ActivityInput withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the activity - */ - public ActivityInput withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The campaign related to the activity */ - public ActivityInput withCampaignId(String campaignId) { - Utils.checkNotNull(campaignId, "campaignId"); + public ActivityInput withCampaignId(@Nullable String campaignId) { this.campaignId = JsonNullable.of(campaignId); return this; } - /** - * The campaign related to the activity - */ - public ActivityInput withCampaignId(JsonNullable campaignId) { - Utils.checkNotNull(campaignId, "campaignId"); - this.campaignId = campaignId; - return this; - } /** * The case related to the activity */ - public ActivityInput withCaseId(String caseId) { - Utils.checkNotNull(caseId, "caseId"); + public ActivityInput withCaseId(@Nullable String caseId) { this.caseId = JsonNullable.of(caseId); return this; } - /** - * The case related to the activity - */ - public ActivityInput withCaseId(JsonNullable caseId) { - Utils.checkNotNull(caseId, "caseId"); - this.caseId = caseId; - return this; - } /** * The asset related to the activity */ - public ActivityInput withAssetId(String assetId) { - Utils.checkNotNull(assetId, "assetId"); + public ActivityInput withAssetId(@Nullable String assetId) { this.assetId = JsonNullable.of(assetId); return this; } - /** - * The asset related to the activity - */ - public ActivityInput withAssetId(JsonNullable assetId) { - Utils.checkNotNull(assetId, "assetId"); - this.assetId = assetId; - return this; - } /** * The contract related to the activity */ - public ActivityInput withContractId(String contractId) { - Utils.checkNotNull(contractId, "contractId"); + public ActivityInput withContractId(@Nullable String contractId) { this.contractId = JsonNullable.of(contractId); return this; } - /** - * The contract related to the activity - */ - public ActivityInput withContractId(JsonNullable contractId) { - Utils.checkNotNull(contractId, "contractId"); - this.contractId = contractId; - return this; - } /** * The product related to the activity */ - public ActivityInput withProductId(String productId) { - Utils.checkNotNull(productId, "productId"); + public ActivityInput withProductId(@Nullable String productId) { this.productId = JsonNullable.of(productId); return this; } - /** - * The product related to the activity - */ - public ActivityInput withProductId(JsonNullable productId) { - Utils.checkNotNull(productId, "productId"); - this.productId = productId; - return this; - } /** * The solution related to the activity */ - public ActivityInput withSolutionId(String solutionId) { - Utils.checkNotNull(solutionId, "solutionId"); + public ActivityInput withSolutionId(@Nullable String solutionId) { this.solutionId = JsonNullable.of(solutionId); return this; } - /** - * The solution related to the activity - */ - public ActivityInput withSolutionId(JsonNullable solutionId) { - Utils.checkNotNull(solutionId, "solutionId"); - this.solutionId = solutionId; - return this; - } /** * The custom object related to the activity */ - public ActivityInput withCustomObjectId(String customObjectId) { - Utils.checkNotNull(customObjectId, "customObjectId"); + public ActivityInput withCustomObjectId(@Nullable String customObjectId) { this.customObjectId = JsonNullable.of(customObjectId); return this; } - /** - * The custom object related to the activity - */ - public ActivityInput withCustomObjectId(JsonNullable customObjectId) { - Utils.checkNotNull(customObjectId, "customObjectId"); - this.customObjectId = customObjectId; - return this; - } /** * The type of the activity */ - public ActivityInput withType(ActivityType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); + public ActivityInput withType(@Nullable ActivityType type) { + this.type = JsonNullable.of(type); return this; } - /** - * The type of the activity - */ - public ActivityInput withType(Optional type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - /** * The title of the activity */ - public ActivityInput withTitle(String title) { - Utils.checkNotNull(title, "title"); + public ActivityInput withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The title of the activity - */ - public ActivityInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * A description of the activity */ - public ActivityInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public ActivityInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the activity - */ - public ActivityInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * An internal note about the activity */ - public ActivityInput withNote(String note) { - Utils.checkNotNull(note, "note"); + public ActivityInput withNote(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * An internal note about the activity - */ - public ActivityInput withNote(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } /** * The location of the activity */ - public ActivityInput withLocation(String location) { - Utils.checkNotNull(location, "location"); + public ActivityInput withLocation(@Nullable String location) { this.location = JsonNullable.of(location); return this; } - /** - * The location of the activity - */ - public ActivityInput withLocation(JsonNullable location) { - Utils.checkNotNull(location, "location"); - this.location = location; - return this; - } - - public ActivityInput withLocationAddress(Address locationAddress) { - Utils.checkNotNull(locationAddress, "locationAddress"); - this.locationAddress = Optional.ofNullable(locationAddress); - return this; - } - - public ActivityInput withLocationAddress(Optional locationAddress) { - Utils.checkNotNull(locationAddress, "locationAddress"); + public ActivityInput withLocationAddress(@Nullable Address locationAddress) { this.locationAddress = locationAddress; return this; } + /** * Whether the Activity is an all day event or not */ - public ActivityInput withAllDayEvent(boolean allDayEvent) { - Utils.checkNotNull(allDayEvent, "allDayEvent"); + public ActivityInput withAllDayEvent(@Nullable Boolean allDayEvent) { this.allDayEvent = JsonNullable.of(allDayEvent); return this; } - /** - * Whether the Activity is an all day event or not - */ - public ActivityInput withAllDayEvent(JsonNullable allDayEvent) { - Utils.checkNotNull(allDayEvent, "allDayEvent"); - this.allDayEvent = allDayEvent; - return this; - } /** * Whether the Activity is private or not */ - public ActivityInput withPrivate(boolean private_) { - Utils.checkNotNull(private_, "private_"); + public ActivityInput withPrivate(@Nullable Boolean private_) { this.private_ = JsonNullable.of(private_); return this; } - /** - * Whether the Activity is private or not - */ - public ActivityInput withPrivate(JsonNullable private_) { - Utils.checkNotNull(private_, "private_"); - this.private_ = private_; - return this; - } /** * Whether the Activity is a group event or not */ - public ActivityInput withGroupEvent(boolean groupEvent) { - Utils.checkNotNull(groupEvent, "groupEvent"); + public ActivityInput withGroupEvent(@Nullable Boolean groupEvent) { this.groupEvent = JsonNullable.of(groupEvent); return this; } - /** - * Whether the Activity is a group event or not - */ - public ActivityInput withGroupEvent(JsonNullable groupEvent) { - Utils.checkNotNull(groupEvent, "groupEvent"); - this.groupEvent = groupEvent; - return this; - } /** * The sub type of the group event */ - public ActivityInput withEventSubType(String eventSubType) { - Utils.checkNotNull(eventSubType, "eventSubType"); + public ActivityInput withEventSubType(@Nullable String eventSubType) { this.eventSubType = JsonNullable.of(eventSubType); return this; } - /** - * The sub type of the group event - */ - public ActivityInput withEventSubType(JsonNullable eventSubType) { - Utils.checkNotNull(eventSubType, "eventSubType"); - this.eventSubType = eventSubType; - return this; - } /** * The type of the group event */ - public ActivityInput withGroupEventType(String groupEventType) { - Utils.checkNotNull(groupEventType, "groupEventType"); + public ActivityInput withGroupEventType(@Nullable String groupEventType) { this.groupEventType = JsonNullable.of(groupEventType); return this; } - /** - * The type of the group event - */ - public ActivityInput withGroupEventType(JsonNullable groupEventType) { - Utils.checkNotNull(groupEventType, "groupEventType"); - this.groupEventType = groupEventType; - return this; - } /** * Whether the activity is a child of another activity or not */ - public ActivityInput withChild(boolean child) { - Utils.checkNotNull(child, "child"); + public ActivityInput withChild(@Nullable Boolean child) { this.child = JsonNullable.of(child); return this; } - /** - * Whether the activity is a child of another activity or not - */ - public ActivityInput withChild(JsonNullable child) { - Utils.checkNotNull(child, "child"); - this.child = child; - return this; - } /** * Whether the activity is archived or not */ - public ActivityInput withArchived(boolean archived) { - Utils.checkNotNull(archived, "archived"); + public ActivityInput withArchived(@Nullable Boolean archived) { this.archived = JsonNullable.of(archived); return this; } - /** - * Whether the activity is archived or not - */ - public ActivityInput withArchived(JsonNullable archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = archived; - return this; - } /** * Whether the activity is deleted or not */ - public ActivityInput withDeleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public ActivityInput withDeleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Whether the activity is deleted or not - */ - public ActivityInput withDeleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - public ActivityInput withShowAs(ShowAs showAs) { - Utils.checkNotNull(showAs, "showAs"); + public ActivityInput withShowAs(@Nullable ShowAs showAs) { this.showAs = JsonNullable.of(showAs); return this; } - public ActivityInput withShowAs(JsonNullable showAs) { - Utils.checkNotNull(showAs, "showAs"); - this.showAs = showAs; - return this; - } /** * Whether the Activity is done or not */ - public ActivityInput withDone(boolean done) { - Utils.checkNotNull(done, "done"); + public ActivityInput withDone(@Nullable Boolean done) { this.done = JsonNullable.of(done); return this; } - /** - * Whether the Activity is done or not - */ - public ActivityInput withDone(JsonNullable done) { - Utils.checkNotNull(done, "done"); - this.done = done; - return this; - } /** * The start date and time of the activity */ - public ActivityInput withStartDatetime(String startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); + public ActivityInput withStartDatetime(@Nullable String startDatetime) { this.startDatetime = JsonNullable.of(startDatetime); return this; } - /** - * The start date and time of the activity - */ - public ActivityInput withStartDatetime(JsonNullable startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); - this.startDatetime = startDatetime; - return this; - } /** * The end date and time of the activity */ - public ActivityInput withEndDatetime(String endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); + public ActivityInput withEndDatetime(@Nullable String endDatetime) { this.endDatetime = JsonNullable.of(endDatetime); return this; } - /** - * The end date and time of the activity - */ - public ActivityInput withEndDatetime(JsonNullable endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); - this.endDatetime = endDatetime; - return this; - } /** * The date of the activity */ - public ActivityInput withActivityDate(String activityDate) { - Utils.checkNotNull(activityDate, "activityDate"); + public ActivityInput withActivityDate(@Nullable String activityDate) { this.activityDate = JsonNullable.of(activityDate); return this; } - /** - * The date of the activity - */ - public ActivityInput withActivityDate(JsonNullable activityDate) { - Utils.checkNotNull(activityDate, "activityDate"); - this.activityDate = activityDate; - return this; - } /** * The end date of the activity */ - public ActivityInput withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); + public ActivityInput withEndDate(@Nullable String endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The end date of the activity - */ - public ActivityInput withEndDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** - * Whether the activity is recurrent or not - */ - public ActivityInput withRecurrent(boolean recurrent) { - Utils.checkNotNull(recurrent, "recurrent"); - this.recurrent = Optional.ofNullable(recurrent); - return this; - } - /** * Whether the activity is recurrent or not */ - public ActivityInput withRecurrent(Optional recurrent) { - Utils.checkNotNull(recurrent, "recurrent"); + public ActivityInput withRecurrent(@Nullable Boolean recurrent) { this.recurrent = recurrent; return this; } + /** * The date and time of the reminder */ - public ActivityInput withReminderDatetime(String reminderDatetime) { - Utils.checkNotNull(reminderDatetime, "reminderDatetime"); + public ActivityInput withReminderDatetime(@Nullable String reminderDatetime) { this.reminderDatetime = JsonNullable.of(reminderDatetime); return this; } - /** - * The date and time of the reminder - */ - public ActivityInput withReminderDatetime(JsonNullable reminderDatetime) { - Utils.checkNotNull(reminderDatetime, "reminderDatetime"); - this.reminderDatetime = reminderDatetime; - return this; - } /** * Whether the reminder is set or not */ - public ActivityInput withReminderSet(boolean reminderSet) { - Utils.checkNotNull(reminderSet, "reminderSet"); + public ActivityInput withReminderSet(@Nullable Boolean reminderSet) { this.reminderSet = JsonNullable.of(reminderSet); return this; } - /** - * Whether the reminder is set or not - */ - public ActivityInput withReminderSet(JsonNullable reminderSet) { - Utils.checkNotNull(reminderSet, "reminderSet"); - this.reminderSet = reminderSet; - return this; - } /** * The URL of the video conference */ - public ActivityInput withVideoConferenceUrl(String videoConferenceUrl) { - Utils.checkNotNull(videoConferenceUrl, "videoConferenceUrl"); + public ActivityInput withVideoConferenceUrl(@Nullable String videoConferenceUrl) { this.videoConferenceUrl = JsonNullable.of(videoConferenceUrl); return this; } - /** - * The URL of the video conference - */ - public ActivityInput withVideoConferenceUrl(JsonNullable videoConferenceUrl) { - Utils.checkNotNull(videoConferenceUrl, "videoConferenceUrl"); - this.videoConferenceUrl = videoConferenceUrl; - return this; - } /** * The ID of the video conference */ - public ActivityInput withVideoConferenceId(String videoConferenceId) { - Utils.checkNotNull(videoConferenceId, "videoConferenceId"); + public ActivityInput withVideoConferenceId(@Nullable String videoConferenceId) { this.videoConferenceId = JsonNullable.of(videoConferenceId); return this; } - /** - * The ID of the video conference - */ - public ActivityInput withVideoConferenceId(JsonNullable videoConferenceId) { - Utils.checkNotNull(videoConferenceId, "videoConferenceId"); - this.videoConferenceId = videoConferenceId; - return this; - } - - /** - * Custom fields of the activity - */ - public ActivityInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - /** * Custom fields of the activity */ - public ActivityInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public ActivityInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - public ActivityInput withAttendees(List attendees) { - Utils.checkNotNull(attendees, "attendees"); - this.attendees = Optional.ofNullable(attendees); - return this; - } - - public ActivityInput withAttendees(Optional> attendees) { - Utils.checkNotNull(attendees, "attendees"); + public ActivityInput withAttendees(@Nullable List attendees) { this.attendees = attendees; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public ActivityInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public ActivityInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public ActivityInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1738,918 +1288,442 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable activityDatetime = JsonNullable.undefined(); + private JsonNullable activityDatetime; - private JsonNullable durationSeconds = JsonNullable.undefined(); + private JsonNullable durationSeconds; - private JsonNullable userId = JsonNullable.undefined(); + private JsonNullable userId; - private JsonNullable accountId = JsonNullable.undefined(); + private JsonNullable accountId; - private JsonNullable contactId = JsonNullable.undefined(); + private JsonNullable contactId; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable opportunityId = JsonNullable.undefined(); + private JsonNullable opportunityId; - private JsonNullable leadId = JsonNullable.undefined(); + private JsonNullable leadId; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable campaignId = JsonNullable.undefined(); + private JsonNullable campaignId; - private JsonNullable caseId = JsonNullable.undefined(); + private JsonNullable caseId; - private JsonNullable assetId = JsonNullable.undefined(); + private JsonNullable assetId; - private JsonNullable contractId = JsonNullable.undefined(); + private JsonNullable contractId; - private JsonNullable productId = JsonNullable.undefined(); + private JsonNullable productId; - private JsonNullable solutionId = JsonNullable.undefined(); + private JsonNullable solutionId; - private JsonNullable customObjectId = JsonNullable.undefined(); + private JsonNullable customObjectId; - private Optional type = Optional.empty(); + private ActivityType type; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable note = JsonNullable.undefined(); + private JsonNullable note; - private JsonNullable location = JsonNullable.undefined(); + private JsonNullable location; - private Optional locationAddress = Optional.empty(); + private Address locationAddress; - private JsonNullable allDayEvent = JsonNullable.undefined(); + private JsonNullable allDayEvent; - private JsonNullable private_ = JsonNullable.undefined(); + private JsonNullable private_; - private JsonNullable groupEvent = JsonNullable.undefined(); + private JsonNullable groupEvent; - private JsonNullable eventSubType = JsonNullable.undefined(); + private JsonNullable eventSubType; - private JsonNullable groupEventType = JsonNullable.undefined(); + private JsonNullable groupEventType; - private JsonNullable child = JsonNullable.undefined(); + private JsonNullable child; - private JsonNullable archived = JsonNullable.undefined(); + private JsonNullable archived; - private JsonNullable deleted = JsonNullable.undefined(); + private JsonNullable deleted; - private JsonNullable showAs = JsonNullable.undefined(); + private JsonNullable showAs; - private JsonNullable done = JsonNullable.undefined(); + private JsonNullable done; - private JsonNullable startDatetime = JsonNullable.undefined(); + private JsonNullable startDatetime; - private JsonNullable endDatetime = JsonNullable.undefined(); + private JsonNullable endDatetime; - private JsonNullable activityDate = JsonNullable.undefined(); + private JsonNullable activityDate; - private JsonNullable endDate = JsonNullable.undefined(); + private JsonNullable endDate; - private Optional recurrent = Optional.empty(); + private Boolean recurrent; - private JsonNullable reminderDatetime = JsonNullable.undefined(); + private JsonNullable reminderDatetime; - private JsonNullable reminderSet = JsonNullable.undefined(); + private JsonNullable reminderSet; - private JsonNullable videoConferenceUrl = JsonNullable.undefined(); + private JsonNullable videoConferenceUrl; - private JsonNullable videoConferenceId = JsonNullable.undefined(); + private JsonNullable videoConferenceId; - private Optional> customFields = Optional.empty(); + private List customFields; - private Optional> attendees = Optional.empty(); + private List attendees; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The date and time of the activity */ - public Builder activityDatetime(String activityDatetime) { - Utils.checkNotNull(activityDatetime, "activityDatetime"); + public Builder activityDatetime(@Nullable String activityDatetime) { this.activityDatetime = JsonNullable.of(activityDatetime); return this; } /** - * The date and time of the activity + * The duration of the activity in seconds */ - public Builder activityDatetime(JsonNullable activityDatetime) { - Utils.checkNotNull(activityDatetime, "activityDatetime"); - this.activityDatetime = activityDatetime; + public Builder durationSeconds(@Nullable Long durationSeconds) { + this.durationSeconds = JsonNullable.of(durationSeconds); return this; } - /** - * The duration of the activity in seconds + * The user related to the activity */ - public Builder durationSeconds(long durationSeconds) { - Utils.checkNotNull(durationSeconds, "durationSeconds"); - this.durationSeconds = JsonNullable.of(durationSeconds); + public Builder userId(@Nullable String userId) { + this.userId = JsonNullable.of(userId); return this; } /** - * The duration of the activity in seconds + * The account related to the activity */ - public Builder durationSeconds(JsonNullable durationSeconds) { - Utils.checkNotNull(durationSeconds, "durationSeconds"); - this.durationSeconds = durationSeconds; + public Builder accountId(@Nullable String accountId) { + this.accountId = JsonNullable.of(accountId); return this; } - /** - * The user related to the activity + * The contact related to the activity */ - public Builder userId(String userId) { - Utils.checkNotNull(userId, "userId"); - this.userId = JsonNullable.of(userId); + public Builder contactId(@Nullable String contactId) { + this.contactId = JsonNullable.of(contactId); return this; } /** - * The user related to the activity + * The company related to the activity */ - public Builder userId(JsonNullable userId) { - Utils.checkNotNull(userId, "userId"); - this.userId = userId; + public Builder companyId(@Nullable String companyId) { + this.companyId = JsonNullable.of(companyId); return this; } - /** - * The account related to the activity + * The opportunity related to the activity */ - public Builder accountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = JsonNullable.of(accountId); + public Builder opportunityId(@Nullable String opportunityId) { + this.opportunityId = JsonNullable.of(opportunityId); return this; } /** - * The account related to the activity + * The lead related to the activity */ - public Builder accountId(JsonNullable accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = accountId; + public Builder leadId(@Nullable String leadId) { + this.leadId = JsonNullable.of(leadId); return this; } - /** - * The contact related to the activity + * The owner of the activity */ - public Builder contactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = JsonNullable.of(contactId); + public Builder ownerId(@Nullable String ownerId) { + this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The contact related to the activity - */ - public Builder contactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } - - - /** - * The company related to the activity - */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = JsonNullable.of(companyId); - return this; - } - - /** - * The company related to the activity - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - - /** - * The opportunity related to the activity - */ - public Builder opportunityId(String opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); - this.opportunityId = JsonNullable.of(opportunityId); - return this; - } - - /** - * The opportunity related to the activity - */ - public Builder opportunityId(JsonNullable opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); - this.opportunityId = opportunityId; - return this; - } - - - /** - * The lead related to the activity - */ - public Builder leadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = JsonNullable.of(leadId); - return this; - } - - /** - * The lead related to the activity - */ - public Builder leadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } - - - /** - * The owner of the activity - */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = JsonNullable.of(ownerId); - return this; - } - - /** - * The owner of the activity - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The campaign related to the activity */ - public Builder campaignId(String campaignId) { - Utils.checkNotNull(campaignId, "campaignId"); + public Builder campaignId(@Nullable String campaignId) { this.campaignId = JsonNullable.of(campaignId); return this; } - /** - * The campaign related to the activity - */ - public Builder campaignId(JsonNullable campaignId) { - Utils.checkNotNull(campaignId, "campaignId"); - this.campaignId = campaignId; - return this; - } - - /** * The case related to the activity */ - public Builder caseId(String caseId) { - Utils.checkNotNull(caseId, "caseId"); + public Builder caseId(@Nullable String caseId) { this.caseId = JsonNullable.of(caseId); return this; } - /** - * The case related to the activity - */ - public Builder caseId(JsonNullable caseId) { - Utils.checkNotNull(caseId, "caseId"); - this.caseId = caseId; - return this; - } - - /** * The asset related to the activity */ - public Builder assetId(String assetId) { - Utils.checkNotNull(assetId, "assetId"); + public Builder assetId(@Nullable String assetId) { this.assetId = JsonNullable.of(assetId); return this; } - /** - * The asset related to the activity - */ - public Builder assetId(JsonNullable assetId) { - Utils.checkNotNull(assetId, "assetId"); - this.assetId = assetId; - return this; - } - - /** * The contract related to the activity */ - public Builder contractId(String contractId) { - Utils.checkNotNull(contractId, "contractId"); + public Builder contractId(@Nullable String contractId) { this.contractId = JsonNullable.of(contractId); return this; } - /** - * The contract related to the activity - */ - public Builder contractId(JsonNullable contractId) { - Utils.checkNotNull(contractId, "contractId"); - this.contractId = contractId; - return this; - } - - /** * The product related to the activity */ - public Builder productId(String productId) { - Utils.checkNotNull(productId, "productId"); + public Builder productId(@Nullable String productId) { this.productId = JsonNullable.of(productId); return this; } - /** - * The product related to the activity - */ - public Builder productId(JsonNullable productId) { - Utils.checkNotNull(productId, "productId"); - this.productId = productId; - return this; - } - - /** * The solution related to the activity */ - public Builder solutionId(String solutionId) { - Utils.checkNotNull(solutionId, "solutionId"); + public Builder solutionId(@Nullable String solutionId) { this.solutionId = JsonNullable.of(solutionId); return this; } - /** - * The solution related to the activity - */ - public Builder solutionId(JsonNullable solutionId) { - Utils.checkNotNull(solutionId, "solutionId"); - this.solutionId = solutionId; - return this; - } - - /** * The custom object related to the activity */ - public Builder customObjectId(String customObjectId) { - Utils.checkNotNull(customObjectId, "customObjectId"); + public Builder customObjectId(@Nullable String customObjectId) { this.customObjectId = JsonNullable.of(customObjectId); return this; } - /** - * The custom object related to the activity - */ - public Builder customObjectId(JsonNullable customObjectId) { - Utils.checkNotNull(customObjectId, "customObjectId"); - this.customObjectId = customObjectId; - return this; - } - - /** * The type of the activity */ - public Builder type(ActivityType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - /** - * The type of the activity - */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ActivityType type) { this.type = type; return this; } - /** * The title of the activity */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The title of the activity - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * A description of the activity */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the activity - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * An internal note about the activity */ - public Builder note(String note) { - Utils.checkNotNull(note, "note"); + public Builder note(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * An internal note about the activity - */ - public Builder note(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } - - /** * The location of the activity */ - public Builder location(String location) { - Utils.checkNotNull(location, "location"); + public Builder location(@Nullable String location) { this.location = JsonNullable.of(location); return this; } - /** - * The location of the activity - */ - public Builder location(JsonNullable location) { - Utils.checkNotNull(location, "location"); - this.location = location; - return this; - } - - - public Builder locationAddress(Address locationAddress) { - Utils.checkNotNull(locationAddress, "locationAddress"); - this.locationAddress = Optional.ofNullable(locationAddress); - return this; - } - - public Builder locationAddress(Optional locationAddress) { - Utils.checkNotNull(locationAddress, "locationAddress"); + public Builder locationAddress(@Nullable Address locationAddress) { this.locationAddress = locationAddress; return this; } - /** * Whether the Activity is an all day event or not */ - public Builder allDayEvent(boolean allDayEvent) { - Utils.checkNotNull(allDayEvent, "allDayEvent"); + public Builder allDayEvent(@Nullable Boolean allDayEvent) { this.allDayEvent = JsonNullable.of(allDayEvent); return this; } - /** - * Whether the Activity is an all day event or not - */ - public Builder allDayEvent(JsonNullable allDayEvent) { - Utils.checkNotNull(allDayEvent, "allDayEvent"); - this.allDayEvent = allDayEvent; - return this; - } - - /** * Whether the Activity is private or not */ - public Builder private_(boolean private_) { - Utils.checkNotNull(private_, "private_"); + public Builder private_(@Nullable Boolean private_) { this.private_ = JsonNullable.of(private_); return this; } - /** - * Whether the Activity is private or not - */ - public Builder private_(JsonNullable private_) { - Utils.checkNotNull(private_, "private_"); - this.private_ = private_; - return this; - } - - /** * Whether the Activity is a group event or not */ - public Builder groupEvent(boolean groupEvent) { - Utils.checkNotNull(groupEvent, "groupEvent"); + public Builder groupEvent(@Nullable Boolean groupEvent) { this.groupEvent = JsonNullable.of(groupEvent); return this; } - /** - * Whether the Activity is a group event or not - */ - public Builder groupEvent(JsonNullable groupEvent) { - Utils.checkNotNull(groupEvent, "groupEvent"); - this.groupEvent = groupEvent; - return this; - } - - /** * The sub type of the group event */ - public Builder eventSubType(String eventSubType) { - Utils.checkNotNull(eventSubType, "eventSubType"); + public Builder eventSubType(@Nullable String eventSubType) { this.eventSubType = JsonNullable.of(eventSubType); return this; } - /** - * The sub type of the group event - */ - public Builder eventSubType(JsonNullable eventSubType) { - Utils.checkNotNull(eventSubType, "eventSubType"); - this.eventSubType = eventSubType; - return this; - } - - /** * The type of the group event */ - public Builder groupEventType(String groupEventType) { - Utils.checkNotNull(groupEventType, "groupEventType"); + public Builder groupEventType(@Nullable String groupEventType) { this.groupEventType = JsonNullable.of(groupEventType); return this; } - /** - * The type of the group event - */ - public Builder groupEventType(JsonNullable groupEventType) { - Utils.checkNotNull(groupEventType, "groupEventType"); - this.groupEventType = groupEventType; - return this; - } - - /** * Whether the activity is a child of another activity or not */ - public Builder child(boolean child) { - Utils.checkNotNull(child, "child"); + public Builder child(@Nullable Boolean child) { this.child = JsonNullable.of(child); return this; } - /** - * Whether the activity is a child of another activity or not - */ - public Builder child(JsonNullable child) { - Utils.checkNotNull(child, "child"); - this.child = child; - return this; - } - - /** * Whether the activity is archived or not */ - public Builder archived(boolean archived) { - Utils.checkNotNull(archived, "archived"); + public Builder archived(@Nullable Boolean archived) { this.archived = JsonNullable.of(archived); return this; } - /** - * Whether the activity is archived or not - */ - public Builder archived(JsonNullable archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = archived; - return this; - } - - /** * Whether the activity is deleted or not */ - public Builder deleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Builder deleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Whether the activity is deleted or not - */ - public Builder deleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - - - public Builder showAs(ShowAs showAs) { - Utils.checkNotNull(showAs, "showAs"); + public Builder showAs(@Nullable ShowAs showAs) { this.showAs = JsonNullable.of(showAs); return this; } - public Builder showAs(JsonNullable showAs) { - Utils.checkNotNull(showAs, "showAs"); - this.showAs = showAs; - return this; - } - - /** * Whether the Activity is done or not */ - public Builder done(boolean done) { - Utils.checkNotNull(done, "done"); + public Builder done(@Nullable Boolean done) { this.done = JsonNullable.of(done); return this; } - /** - * Whether the Activity is done or not - */ - public Builder done(JsonNullable done) { - Utils.checkNotNull(done, "done"); - this.done = done; - return this; - } - - /** * The start date and time of the activity */ - public Builder startDatetime(String startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); + public Builder startDatetime(@Nullable String startDatetime) { this.startDatetime = JsonNullable.of(startDatetime); return this; } - /** - * The start date and time of the activity - */ - public Builder startDatetime(JsonNullable startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); - this.startDatetime = startDatetime; - return this; - } - - /** * The end date and time of the activity */ - public Builder endDatetime(String endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); + public Builder endDatetime(@Nullable String endDatetime) { this.endDatetime = JsonNullable.of(endDatetime); return this; } - /** - * The end date and time of the activity - */ - public Builder endDatetime(JsonNullable endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); - this.endDatetime = endDatetime; - return this; - } - - /** * The date of the activity */ - public Builder activityDate(String activityDate) { - Utils.checkNotNull(activityDate, "activityDate"); + public Builder activityDate(@Nullable String activityDate) { this.activityDate = JsonNullable.of(activityDate); return this; } - /** - * The date of the activity - */ - public Builder activityDate(JsonNullable activityDate) { - Utils.checkNotNull(activityDate, "activityDate"); - this.activityDate = activityDate; - return this; - } - - /** * The end date of the activity */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable String endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The end date of the activity - */ - public Builder endDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** * Whether the activity is recurrent or not */ - public Builder recurrent(boolean recurrent) { - Utils.checkNotNull(recurrent, "recurrent"); - this.recurrent = Optional.ofNullable(recurrent); - return this; - } - - /** - * Whether the activity is recurrent or not - */ - public Builder recurrent(Optional recurrent) { - Utils.checkNotNull(recurrent, "recurrent"); + public Builder recurrent(@Nullable Boolean recurrent) { this.recurrent = recurrent; return this; } - /** * The date and time of the reminder */ - public Builder reminderDatetime(String reminderDatetime) { - Utils.checkNotNull(reminderDatetime, "reminderDatetime"); + public Builder reminderDatetime(@Nullable String reminderDatetime) { this.reminderDatetime = JsonNullable.of(reminderDatetime); return this; } - /** - * The date and time of the reminder - */ - public Builder reminderDatetime(JsonNullable reminderDatetime) { - Utils.checkNotNull(reminderDatetime, "reminderDatetime"); - this.reminderDatetime = reminderDatetime; - return this; - } - - /** * Whether the reminder is set or not */ - public Builder reminderSet(boolean reminderSet) { - Utils.checkNotNull(reminderSet, "reminderSet"); + public Builder reminderSet(@Nullable Boolean reminderSet) { this.reminderSet = JsonNullable.of(reminderSet); return this; } - /** - * Whether the reminder is set or not - */ - public Builder reminderSet(JsonNullable reminderSet) { - Utils.checkNotNull(reminderSet, "reminderSet"); - this.reminderSet = reminderSet; - return this; - } - - /** * The URL of the video conference */ - public Builder videoConferenceUrl(String videoConferenceUrl) { - Utils.checkNotNull(videoConferenceUrl, "videoConferenceUrl"); + public Builder videoConferenceUrl(@Nullable String videoConferenceUrl) { this.videoConferenceUrl = JsonNullable.of(videoConferenceUrl); return this; } - /** - * The URL of the video conference - */ - public Builder videoConferenceUrl(JsonNullable videoConferenceUrl) { - Utils.checkNotNull(videoConferenceUrl, "videoConferenceUrl"); - this.videoConferenceUrl = videoConferenceUrl; - return this; - } - - /** * The ID of the video conference */ - public Builder videoConferenceId(String videoConferenceId) { - Utils.checkNotNull(videoConferenceId, "videoConferenceId"); + public Builder videoConferenceId(@Nullable String videoConferenceId) { this.videoConferenceId = JsonNullable.of(videoConferenceId); return this; } - /** - * The ID of the video conference - */ - public Builder videoConferenceId(JsonNullable videoConferenceId) { - Utils.checkNotNull(videoConferenceId, "videoConferenceId"); - this.videoConferenceId = videoConferenceId; - return this; - } - - /** * Custom fields of the activity */ - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - /** - * Custom fields of the activity - */ - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - - public Builder attendees(List attendees) { - Utils.checkNotNull(attendees, "attendees"); - this.attendees = Optional.ofNullable(attendees); - return this; - } - - public Builder attendees(Optional> attendees) { - Utils.checkNotNull(attendees, "attendees"); + public Builder attendees(@Nullable List attendees) { this.attendees = attendees; return this; } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public ActivityInput build() { - return new ActivityInput( activityDatetime, durationSeconds, userId, accountId, contactId, companyId, diff --git a/src/main/java/com/apideck/unify/models/components/Address.java b/src/main/java/com/apideck/unify/models/components/Address.java index 7b0006c7..2d3039bb 100644 --- a/src/main/java/com/apideck/unify/models/components/Address.java +++ b/src/main/java/com/apideck/unify/models/components/Address.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -28,7 +28,7 @@ public class Address { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The address string. Some APIs don't provide structured address data. @@ -186,282 +186,257 @@ public class Address { @JsonCreator public Address( - @JsonProperty("id") JsonNullable id, - @JsonProperty("type") JsonNullable type, - @JsonProperty("string") JsonNullable string, - @JsonProperty("name") JsonNullable name, - @JsonProperty("line1") JsonNullable line1, - @JsonProperty("line2") JsonNullable line2, - @JsonProperty("line3") JsonNullable line3, - @JsonProperty("line4") JsonNullable line4, - @JsonProperty("street_number") JsonNullable streetNumber, - @JsonProperty("city") JsonNullable city, - @JsonProperty("state") JsonNullable state, - @JsonProperty("postal_code") JsonNullable postalCode, - @JsonProperty("country") JsonNullable country, - @JsonProperty("latitude") JsonNullable latitude, - @JsonProperty("longitude") JsonNullable longitude, - @JsonProperty("county") JsonNullable county, - @JsonProperty("contact_name") JsonNullable contactName, - @JsonProperty("salutation") JsonNullable salutation, - @JsonProperty("phone_number") JsonNullable phoneNumber, - @JsonProperty("fax") JsonNullable fax, - @JsonProperty("email") JsonNullable email, - @JsonProperty("website") JsonNullable website, - @JsonProperty("notes") JsonNullable notes, - @JsonProperty("row_version") JsonNullable rowVersion) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(string, "string"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(line1, "line1"); - Utils.checkNotNull(line2, "line2"); - Utils.checkNotNull(line3, "line3"); - Utils.checkNotNull(line4, "line4"); - Utils.checkNotNull(streetNumber, "streetNumber"); - Utils.checkNotNull(city, "city"); - Utils.checkNotNull(state, "state"); - Utils.checkNotNull(postalCode, "postalCode"); - Utils.checkNotNull(country, "country"); - Utils.checkNotNull(latitude, "latitude"); - Utils.checkNotNull(longitude, "longitude"); - Utils.checkNotNull(county, "county"); - Utils.checkNotNull(contactName, "contactName"); - Utils.checkNotNull(salutation, "salutation"); - Utils.checkNotNull(phoneNumber, "phoneNumber"); - Utils.checkNotNull(fax, "fax"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(website, "website"); - Utils.checkNotNull(notes, "notes"); - Utils.checkNotNull(rowVersion, "rowVersion"); - this.id = id; - this.type = type; - this.string = string; - this.name = name; - this.line1 = line1; - this.line2 = line2; - this.line3 = line3; - this.line4 = line4; - this.streetNumber = streetNumber; - this.city = city; - this.state = state; - this.postalCode = postalCode; - this.country = country; - this.latitude = latitude; - this.longitude = longitude; - this.county = county; - this.contactName = contactName; - this.salutation = salutation; - this.phoneNumber = phoneNumber; - this.fax = fax; - this.email = email; - this.website = website; - this.notes = notes; - this.rowVersion = rowVersion; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("string") @Nullable JsonNullable string, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("line1") @Nullable JsonNullable line1, + @JsonProperty("line2") @Nullable JsonNullable line2, + @JsonProperty("line3") @Nullable JsonNullable line3, + @JsonProperty("line4") @Nullable JsonNullable line4, + @JsonProperty("street_number") @Nullable JsonNullable streetNumber, + @JsonProperty("city") @Nullable JsonNullable city, + @JsonProperty("state") @Nullable JsonNullable state, + @JsonProperty("postal_code") @Nullable JsonNullable postalCode, + @JsonProperty("country") @Nullable JsonNullable country, + @JsonProperty("latitude") @Nullable JsonNullable latitude, + @JsonProperty("longitude") @Nullable JsonNullable longitude, + @JsonProperty("county") @Nullable JsonNullable county, + @JsonProperty("contact_name") @Nullable JsonNullable contactName, + @JsonProperty("salutation") @Nullable JsonNullable salutation, + @JsonProperty("phone_number") @Nullable JsonNullable phoneNumber, + @JsonProperty("fax") @Nullable JsonNullable fax, + @JsonProperty("email") @Nullable JsonNullable email, + @JsonProperty("website") @Nullable JsonNullable website, + @JsonProperty("notes") @Nullable JsonNullable notes, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.string = Optional.ofNullable(string) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.line1 = Optional.ofNullable(line1) + .orElse(JsonNullable.undefined()); + this.line2 = Optional.ofNullable(line2) + .orElse(JsonNullable.undefined()); + this.line3 = Optional.ofNullable(line3) + .orElse(JsonNullable.undefined()); + this.line4 = Optional.ofNullable(line4) + .orElse(JsonNullable.undefined()); + this.streetNumber = Optional.ofNullable(streetNumber) + .orElse(JsonNullable.undefined()); + this.city = Optional.ofNullable(city) + .orElse(JsonNullable.undefined()); + this.state = Optional.ofNullable(state) + .orElse(JsonNullable.undefined()); + this.postalCode = Optional.ofNullable(postalCode) + .orElse(JsonNullable.undefined()); + this.country = Optional.ofNullable(country) + .orElse(JsonNullable.undefined()); + this.latitude = Optional.ofNullable(latitude) + .orElse(JsonNullable.undefined()); + this.longitude = Optional.ofNullable(longitude) + .orElse(JsonNullable.undefined()); + this.county = Optional.ofNullable(county) + .orElse(JsonNullable.undefined()); + this.contactName = Optional.ofNullable(contactName) + .orElse(JsonNullable.undefined()); + this.salutation = Optional.ofNullable(salutation) + .orElse(JsonNullable.undefined()); + this.phoneNumber = Optional.ofNullable(phoneNumber) + .orElse(JsonNullable.undefined()); + this.fax = Optional.ofNullable(fax) + .orElse(JsonNullable.undefined()); + this.email = Optional.ofNullable(email) + .orElse(JsonNullable.undefined()); + this.website = Optional.ofNullable(website) + .orElse(JsonNullable.undefined()); + this.notes = Optional.ofNullable(notes) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); } public Address() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * Unique identifier for the address. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The type of address. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The address string. Some APIs don't provide structured address data. */ - @JsonIgnore public JsonNullable string() { - return string; + return this.string; } /** * The name of the address. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * Line 1 of the address e.g. number, street, suite, apt #, etc. */ - @JsonIgnore public JsonNullable line1() { - return line1; + return this.line1; } /** * Line 2 of the address */ - @JsonIgnore public JsonNullable line2() { - return line2; + return this.line2; } /** * Line 3 of the address */ - @JsonIgnore public JsonNullable line3() { - return line3; + return this.line3; } /** * Line 4 of the address */ - @JsonIgnore public JsonNullable line4() { - return line4; + return this.line4; } /** * Street number */ - @JsonIgnore public JsonNullable streetNumber() { - return streetNumber; + return this.streetNumber; } /** * Name of city. */ - @JsonIgnore public JsonNullable city() { - return city; + return this.city; } /** * Name of state */ - @JsonIgnore public JsonNullable state() { - return state; + return this.state; } /** * Zip code or equivalent. */ - @JsonIgnore public JsonNullable postalCode() { - return postalCode; + return this.postalCode; } /** * country code according to ISO 3166-1 alpha-2. */ - @JsonIgnore public JsonNullable country() { - return country; + return this.country; } /** * Latitude of the address */ - @JsonIgnore public JsonNullable latitude() { - return latitude; + return this.latitude; } /** * Longitude of the address */ - @JsonIgnore public JsonNullable longitude() { - return longitude; + return this.longitude; } /** * Address field that holds a sublocality, such as a county */ - @JsonIgnore public JsonNullable county() { - return county; + return this.county; } /** * Name of the contact person at the address */ - @JsonIgnore public JsonNullable contactName() { - return contactName; + return this.contactName; } /** * Salutation of the contact person at the address */ - @JsonIgnore public JsonNullable salutation() { - return salutation; + return this.salutation; } /** * Phone number of the address */ - @JsonIgnore public JsonNullable phoneNumber() { - return phoneNumber; + return this.phoneNumber; } /** * Fax number of the address */ - @JsonIgnore public JsonNullable fax() { - return fax; + return this.fax; } /** * Email address of the address */ - @JsonIgnore public JsonNullable email() { - return email; + return this.email; } /** * Website of the address */ - @JsonIgnore public JsonNullable website() { - return website; + return this.website; } /** * Additional notes */ - @JsonIgnore public JsonNullable notes() { - return notes; + return this.notes; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } public static Builder builder() { @@ -472,434 +447,218 @@ public static Builder builder() { /** * Unique identifier for the address. */ - public Address withId(String id) { - Utils.checkNotNull(id, "id"); + public Address withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the address. - */ - public Address withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The type of address. */ - public Address withType(Type type) { - Utils.checkNotNull(type, "type"); + public Address withType(@Nullable Type type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of address. - */ - public Address withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The address string. Some APIs don't provide structured address data. */ - public Address withString(String string) { - Utils.checkNotNull(string, "string"); + public Address withString(@Nullable String string) { this.string = JsonNullable.of(string); return this; } - /** - * The address string. Some APIs don't provide structured address data. - */ - public Address withString(JsonNullable string) { - Utils.checkNotNull(string, "string"); - this.string = string; - return this; - } /** * The name of the address. */ - public Address withName(String name) { - Utils.checkNotNull(name, "name"); + public Address withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the address. - */ - public Address withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * Line 1 of the address e.g. number, street, suite, apt #, etc. */ - public Address withLine1(String line1) { - Utils.checkNotNull(line1, "line1"); + public Address withLine1(@Nullable String line1) { this.line1 = JsonNullable.of(line1); return this; } - /** - * Line 1 of the address e.g. number, street, suite, apt #, etc. - */ - public Address withLine1(JsonNullable line1) { - Utils.checkNotNull(line1, "line1"); - this.line1 = line1; - return this; - } /** * Line 2 of the address */ - public Address withLine2(String line2) { - Utils.checkNotNull(line2, "line2"); + public Address withLine2(@Nullable String line2) { this.line2 = JsonNullable.of(line2); return this; } - /** - * Line 2 of the address - */ - public Address withLine2(JsonNullable line2) { - Utils.checkNotNull(line2, "line2"); - this.line2 = line2; - return this; - } /** * Line 3 of the address */ - public Address withLine3(String line3) { - Utils.checkNotNull(line3, "line3"); + public Address withLine3(@Nullable String line3) { this.line3 = JsonNullable.of(line3); return this; } - /** - * Line 3 of the address - */ - public Address withLine3(JsonNullable line3) { - Utils.checkNotNull(line3, "line3"); - this.line3 = line3; - return this; - } /** * Line 4 of the address */ - public Address withLine4(String line4) { - Utils.checkNotNull(line4, "line4"); + public Address withLine4(@Nullable String line4) { this.line4 = JsonNullable.of(line4); return this; } - /** - * Line 4 of the address - */ - public Address withLine4(JsonNullable line4) { - Utils.checkNotNull(line4, "line4"); - this.line4 = line4; - return this; - } /** * Street number */ - public Address withStreetNumber(String streetNumber) { - Utils.checkNotNull(streetNumber, "streetNumber"); + public Address withStreetNumber(@Nullable String streetNumber) { this.streetNumber = JsonNullable.of(streetNumber); return this; } - /** - * Street number - */ - public Address withStreetNumber(JsonNullable streetNumber) { - Utils.checkNotNull(streetNumber, "streetNumber"); - this.streetNumber = streetNumber; - return this; - } /** * Name of city. */ - public Address withCity(String city) { - Utils.checkNotNull(city, "city"); + public Address withCity(@Nullable String city) { this.city = JsonNullable.of(city); return this; } - /** - * Name of city. - */ - public Address withCity(JsonNullable city) { - Utils.checkNotNull(city, "city"); - this.city = city; - return this; - } /** * Name of state */ - public Address withState(String state) { - Utils.checkNotNull(state, "state"); + public Address withState(@Nullable String state) { this.state = JsonNullable.of(state); return this; } - /** - * Name of state - */ - public Address withState(JsonNullable state) { - Utils.checkNotNull(state, "state"); - this.state = state; - return this; - } /** * Zip code or equivalent. */ - public Address withPostalCode(String postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); + public Address withPostalCode(@Nullable String postalCode) { this.postalCode = JsonNullable.of(postalCode); return this; } - /** - * Zip code or equivalent. - */ - public Address withPostalCode(JsonNullable postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); - this.postalCode = postalCode; - return this; - } /** * country code according to ISO 3166-1 alpha-2. */ - public Address withCountry(String country) { - Utils.checkNotNull(country, "country"); + public Address withCountry(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * country code according to ISO 3166-1 alpha-2. - */ - public Address withCountry(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } /** * Latitude of the address */ - public Address withLatitude(String latitude) { - Utils.checkNotNull(latitude, "latitude"); + public Address withLatitude(@Nullable String latitude) { this.latitude = JsonNullable.of(latitude); return this; } - /** - * Latitude of the address - */ - public Address withLatitude(JsonNullable latitude) { - Utils.checkNotNull(latitude, "latitude"); - this.latitude = latitude; - return this; - } /** * Longitude of the address */ - public Address withLongitude(String longitude) { - Utils.checkNotNull(longitude, "longitude"); + public Address withLongitude(@Nullable String longitude) { this.longitude = JsonNullable.of(longitude); return this; } - /** - * Longitude of the address - */ - public Address withLongitude(JsonNullable longitude) { - Utils.checkNotNull(longitude, "longitude"); - this.longitude = longitude; - return this; - } /** * Address field that holds a sublocality, such as a county */ - public Address withCounty(String county) { - Utils.checkNotNull(county, "county"); + public Address withCounty(@Nullable String county) { this.county = JsonNullable.of(county); return this; } - /** - * Address field that holds a sublocality, such as a county - */ - public Address withCounty(JsonNullable county) { - Utils.checkNotNull(county, "county"); - this.county = county; - return this; - } /** * Name of the contact person at the address */ - public Address withContactName(String contactName) { - Utils.checkNotNull(contactName, "contactName"); + public Address withContactName(@Nullable String contactName) { this.contactName = JsonNullable.of(contactName); return this; } - /** - * Name of the contact person at the address - */ - public Address withContactName(JsonNullable contactName) { - Utils.checkNotNull(contactName, "contactName"); - this.contactName = contactName; - return this; - } /** * Salutation of the contact person at the address */ - public Address withSalutation(String salutation) { - Utils.checkNotNull(salutation, "salutation"); + public Address withSalutation(@Nullable String salutation) { this.salutation = JsonNullable.of(salutation); return this; } - /** - * Salutation of the contact person at the address - */ - public Address withSalutation(JsonNullable salutation) { - Utils.checkNotNull(salutation, "salutation"); - this.salutation = salutation; - return this; - } /** * Phone number of the address */ - public Address withPhoneNumber(String phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); + public Address withPhoneNumber(@Nullable String phoneNumber) { this.phoneNumber = JsonNullable.of(phoneNumber); return this; } - /** - * Phone number of the address - */ - public Address withPhoneNumber(JsonNullable phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); - this.phoneNumber = phoneNumber; - return this; - } /** * Fax number of the address */ - public Address withFax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Address withFax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * Fax number of the address - */ - public Address withFax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } /** * Email address of the address */ - public Address withEmail(String email) { - Utils.checkNotNull(email, "email"); + public Address withEmail(@Nullable String email) { this.email = JsonNullable.of(email); return this; } - /** - * Email address of the address - */ - public Address withEmail(JsonNullable email) { - Utils.checkNotNull(email, "email"); - this.email = email; - return this; - } /** * Website of the address */ - public Address withWebsite(String website) { - Utils.checkNotNull(website, "website"); + public Address withWebsite(@Nullable String website) { this.website = JsonNullable.of(website); return this; } - /** - * Website of the address - */ - public Address withWebsite(JsonNullable website) { - Utils.checkNotNull(website, "website"); - this.website = website; - return this; - } /** * Additional notes */ - public Address withNotes(String notes) { - Utils.checkNotNull(notes, "notes"); + public Address withNotes(@Nullable String notes) { this.notes = JsonNullable.of(notes); return this; } - /** - * Additional notes - */ - public Address withNotes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Address withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Address withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Address withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -982,516 +741,251 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable string = JsonNullable.undefined(); + private JsonNullable string; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable line1 = JsonNullable.undefined(); + private JsonNullable line1; - private JsonNullable line2 = JsonNullable.undefined(); + private JsonNullable line2; - private JsonNullable line3 = JsonNullable.undefined(); + private JsonNullable line3; - private JsonNullable line4 = JsonNullable.undefined(); + private JsonNullable line4; - private JsonNullable streetNumber = JsonNullable.undefined(); + private JsonNullable streetNumber; - private JsonNullable city = JsonNullable.undefined(); + private JsonNullable city; - private JsonNullable state = JsonNullable.undefined(); + private JsonNullable state; - private JsonNullable postalCode = JsonNullable.undefined(); + private JsonNullable postalCode; - private JsonNullable country = JsonNullable.undefined(); + private JsonNullable country; - private JsonNullable latitude = JsonNullable.undefined(); + private JsonNullable latitude; - private JsonNullable longitude = JsonNullable.undefined(); + private JsonNullable longitude; - private JsonNullable county = JsonNullable.undefined(); + private JsonNullable county; - private JsonNullable contactName = JsonNullable.undefined(); + private JsonNullable contactName; - private JsonNullable salutation = JsonNullable.undefined(); + private JsonNullable salutation; - private JsonNullable phoneNumber = JsonNullable.undefined(); + private JsonNullable phoneNumber; - private JsonNullable fax = JsonNullable.undefined(); + private JsonNullable fax; - private JsonNullable email = JsonNullable.undefined(); + private JsonNullable email; - private JsonNullable website = JsonNullable.undefined(); + private JsonNullable website; - private JsonNullable notes = JsonNullable.undefined(); + private JsonNullable notes; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; private Builder() { // force use of static builder() method } - /** * Unique identifier for the address. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the address. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The type of address. */ - public Builder type(Type type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable Type type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of address. - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The address string. Some APIs don't provide structured address data. */ - public Builder string(String string) { - Utils.checkNotNull(string, "string"); + public Builder string(@Nullable String string) { this.string = JsonNullable.of(string); return this; } - /** - * The address string. Some APIs don't provide structured address data. - */ - public Builder string(JsonNullable string) { - Utils.checkNotNull(string, "string"); - this.string = string; - return this; - } - - /** * The name of the address. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the address. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * Line 1 of the address e.g. number, street, suite, apt #, etc. */ - public Builder line1(String line1) { - Utils.checkNotNull(line1, "line1"); + public Builder line1(@Nullable String line1) { this.line1 = JsonNullable.of(line1); return this; } - /** - * Line 1 of the address e.g. number, street, suite, apt #, etc. - */ - public Builder line1(JsonNullable line1) { - Utils.checkNotNull(line1, "line1"); - this.line1 = line1; - return this; - } - - /** * Line 2 of the address */ - public Builder line2(String line2) { - Utils.checkNotNull(line2, "line2"); + public Builder line2(@Nullable String line2) { this.line2 = JsonNullable.of(line2); return this; } - /** - * Line 2 of the address - */ - public Builder line2(JsonNullable line2) { - Utils.checkNotNull(line2, "line2"); - this.line2 = line2; - return this; - } - - /** * Line 3 of the address */ - public Builder line3(String line3) { - Utils.checkNotNull(line3, "line3"); + public Builder line3(@Nullable String line3) { this.line3 = JsonNullable.of(line3); return this; } - /** - * Line 3 of the address - */ - public Builder line3(JsonNullable line3) { - Utils.checkNotNull(line3, "line3"); - this.line3 = line3; - return this; - } - - /** * Line 4 of the address */ - public Builder line4(String line4) { - Utils.checkNotNull(line4, "line4"); + public Builder line4(@Nullable String line4) { this.line4 = JsonNullable.of(line4); return this; } - /** - * Line 4 of the address - */ - public Builder line4(JsonNullable line4) { - Utils.checkNotNull(line4, "line4"); - this.line4 = line4; - return this; - } - - /** * Street number */ - public Builder streetNumber(String streetNumber) { - Utils.checkNotNull(streetNumber, "streetNumber"); + public Builder streetNumber(@Nullable String streetNumber) { this.streetNumber = JsonNullable.of(streetNumber); return this; } - /** - * Street number - */ - public Builder streetNumber(JsonNullable streetNumber) { - Utils.checkNotNull(streetNumber, "streetNumber"); - this.streetNumber = streetNumber; - return this; - } - - /** * Name of city. */ - public Builder city(String city) { - Utils.checkNotNull(city, "city"); + public Builder city(@Nullable String city) { this.city = JsonNullable.of(city); return this; } - /** - * Name of city. - */ - public Builder city(JsonNullable city) { - Utils.checkNotNull(city, "city"); - this.city = city; - return this; - } - - /** * Name of state */ - public Builder state(String state) { - Utils.checkNotNull(state, "state"); + public Builder state(@Nullable String state) { this.state = JsonNullable.of(state); return this; } - /** - * Name of state - */ - public Builder state(JsonNullable state) { - Utils.checkNotNull(state, "state"); - this.state = state; - return this; - } - - /** * Zip code or equivalent. */ - public Builder postalCode(String postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); + public Builder postalCode(@Nullable String postalCode) { this.postalCode = JsonNullable.of(postalCode); return this; } - /** - * Zip code or equivalent. - */ - public Builder postalCode(JsonNullable postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); - this.postalCode = postalCode; - return this; - } - - /** * country code according to ISO 3166-1 alpha-2. */ - public Builder country(String country) { - Utils.checkNotNull(country, "country"); + public Builder country(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * country code according to ISO 3166-1 alpha-2. - */ - public Builder country(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - - /** * Latitude of the address */ - public Builder latitude(String latitude) { - Utils.checkNotNull(latitude, "latitude"); + public Builder latitude(@Nullable String latitude) { this.latitude = JsonNullable.of(latitude); return this; } - /** - * Latitude of the address - */ - public Builder latitude(JsonNullable latitude) { - Utils.checkNotNull(latitude, "latitude"); - this.latitude = latitude; - return this; - } - - /** * Longitude of the address */ - public Builder longitude(String longitude) { - Utils.checkNotNull(longitude, "longitude"); + public Builder longitude(@Nullable String longitude) { this.longitude = JsonNullable.of(longitude); return this; } - /** - * Longitude of the address - */ - public Builder longitude(JsonNullable longitude) { - Utils.checkNotNull(longitude, "longitude"); - this.longitude = longitude; - return this; - } - - /** * Address field that holds a sublocality, such as a county */ - public Builder county(String county) { - Utils.checkNotNull(county, "county"); + public Builder county(@Nullable String county) { this.county = JsonNullable.of(county); return this; } - /** - * Address field that holds a sublocality, such as a county - */ - public Builder county(JsonNullable county) { - Utils.checkNotNull(county, "county"); - this.county = county; - return this; - } - - /** * Name of the contact person at the address */ - public Builder contactName(String contactName) { - Utils.checkNotNull(contactName, "contactName"); + public Builder contactName(@Nullable String contactName) { this.contactName = JsonNullable.of(contactName); return this; } - /** - * Name of the contact person at the address - */ - public Builder contactName(JsonNullable contactName) { - Utils.checkNotNull(contactName, "contactName"); - this.contactName = contactName; - return this; - } - - /** * Salutation of the contact person at the address */ - public Builder salutation(String salutation) { - Utils.checkNotNull(salutation, "salutation"); + public Builder salutation(@Nullable String salutation) { this.salutation = JsonNullable.of(salutation); return this; } - /** - * Salutation of the contact person at the address - */ - public Builder salutation(JsonNullable salutation) { - Utils.checkNotNull(salutation, "salutation"); - this.salutation = salutation; - return this; - } - - /** * Phone number of the address */ - public Builder phoneNumber(String phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); + public Builder phoneNumber(@Nullable String phoneNumber) { this.phoneNumber = JsonNullable.of(phoneNumber); return this; } - /** - * Phone number of the address - */ - public Builder phoneNumber(JsonNullable phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); - this.phoneNumber = phoneNumber; - return this; - } - - /** * Fax number of the address */ - public Builder fax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Builder fax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * Fax number of the address - */ - public Builder fax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } - - /** * Email address of the address */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = JsonNullable.of(email); return this; } - /** - * Email address of the address - */ - public Builder email(JsonNullable email) { - Utils.checkNotNull(email, "email"); - this.email = email; - return this; - } - - /** * Website of the address */ - public Builder website(String website) { - Utils.checkNotNull(website, "website"); + public Builder website(@Nullable String website) { this.website = JsonNullable.of(website); return this; } - /** - * Website of the address - */ - public Builder website(JsonNullable website) { - Utils.checkNotNull(website, "website"); - this.website = website; - return this; - } - - /** * Additional notes */ - public Builder notes(String notes) { - Utils.checkNotNull(notes, "notes"); + public Builder notes(@Nullable String notes) { this.notes = JsonNullable.of(notes); return this; } - /** - * Additional notes - */ - public Builder notes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - public Address build() { - return new Address( id, type, string, name, line1, line2, diff --git a/src/main/java/com/apideck/unify/models/components/Addresses.java b/src/main/java/com/apideck/unify/models/components/Addresses.java index e38a8516..bc27952e 100644 --- a/src/main/java/com/apideck/unify/models/components/Addresses.java +++ b/src/main/java/com/apideck/unify/models/components/Addresses.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,7 +19,7 @@ public class Addresses { @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private EcommerceCustomerType type; /** * A unique identifier for an object. @@ -73,98 +72,88 @@ public class Addresses { @JsonCreator public Addresses( - @JsonProperty("type") Optional type, - @JsonProperty("id") JsonNullable id, - @JsonProperty("line1") JsonNullable line1, - @JsonProperty("line2") JsonNullable line2, - @JsonProperty("city") JsonNullable city, - @JsonProperty("state") JsonNullable state, - @JsonProperty("postal_code") JsonNullable postalCode, - @JsonProperty("country") JsonNullable country) { - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(line1, "line1"); - Utils.checkNotNull(line2, "line2"); - Utils.checkNotNull(city, "city"); - Utils.checkNotNull(state, "state"); - Utils.checkNotNull(postalCode, "postalCode"); - Utils.checkNotNull(country, "country"); + @JsonProperty("type") @Nullable EcommerceCustomerType type, + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("line1") @Nullable JsonNullable line1, + @JsonProperty("line2") @Nullable JsonNullable line2, + @JsonProperty("city") @Nullable JsonNullable city, + @JsonProperty("state") @Nullable JsonNullable state, + @JsonProperty("postal_code") @Nullable JsonNullable postalCode, + @JsonProperty("country") @Nullable JsonNullable country) { this.type = type; - this.id = id; - this.line1 = line1; - this.line2 = line2; - this.city = city; - this.state = state; - this.postalCode = postalCode; - this.country = country; + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.line1 = Optional.ofNullable(line1) + .orElse(JsonNullable.undefined()); + this.line2 = Optional.ofNullable(line2) + .orElse(JsonNullable.undefined()); + this.city = Optional.ofNullable(city) + .orElse(JsonNullable.undefined()); + this.state = Optional.ofNullable(state) + .orElse(JsonNullable.undefined()); + this.postalCode = Optional.ofNullable(postalCode) + .orElse(JsonNullable.undefined()); + this.country = Optional.ofNullable(country) + .orElse(JsonNullable.undefined()); } public Addresses() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * First line of the street address of the customer */ - @JsonIgnore public JsonNullable line1() { - return line1; + return this.line1; } /** * Second line of the street address of the customer */ - @JsonIgnore public JsonNullable line2() { - return line2; + return this.line2; } /** * City of the customer */ - @JsonIgnore public JsonNullable city() { - return city; + return this.city; } /** * State of the customer */ - @JsonIgnore public JsonNullable state() { - return state; + return this.state; } /** * Postal code of the customer */ - @JsonIgnore public JsonNullable postalCode() { - return postalCode; + return this.postalCode; } /** * Country of the customer */ - @JsonIgnore public JsonNullable country() { - return country; + return this.country; } public static Builder builder() { @@ -172,144 +161,74 @@ public static Builder builder() { } - public Addresses withType(EcommerceCustomerType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - - public Addresses withType(Optional type) { - Utils.checkNotNull(type, "type"); + public Addresses withType(@Nullable EcommerceCustomerType type) { this.type = type; return this; } + /** * A unique identifier for an object. */ - public Addresses withId(String id) { - Utils.checkNotNull(id, "id"); + public Addresses withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Addresses withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * First line of the street address of the customer */ - public Addresses withLine1(String line1) { - Utils.checkNotNull(line1, "line1"); + public Addresses withLine1(@Nullable String line1) { this.line1 = JsonNullable.of(line1); return this; } - /** - * First line of the street address of the customer - */ - public Addresses withLine1(JsonNullable line1) { - Utils.checkNotNull(line1, "line1"); - this.line1 = line1; - return this; - } /** * Second line of the street address of the customer */ - public Addresses withLine2(String line2) { - Utils.checkNotNull(line2, "line2"); + public Addresses withLine2(@Nullable String line2) { this.line2 = JsonNullable.of(line2); return this; } - /** - * Second line of the street address of the customer - */ - public Addresses withLine2(JsonNullable line2) { - Utils.checkNotNull(line2, "line2"); - this.line2 = line2; - return this; - } /** * City of the customer */ - public Addresses withCity(String city) { - Utils.checkNotNull(city, "city"); + public Addresses withCity(@Nullable String city) { this.city = JsonNullable.of(city); return this; } - /** - * City of the customer - */ - public Addresses withCity(JsonNullable city) { - Utils.checkNotNull(city, "city"); - this.city = city; - return this; - } /** * State of the customer */ - public Addresses withState(String state) { - Utils.checkNotNull(state, "state"); + public Addresses withState(@Nullable String state) { this.state = JsonNullable.of(state); return this; } - /** - * State of the customer - */ - public Addresses withState(JsonNullable state) { - Utils.checkNotNull(state, "state"); - this.state = state; - return this; - } /** * Postal code of the customer */ - public Addresses withPostalCode(String postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); + public Addresses withPostalCode(@Nullable String postalCode) { this.postalCode = JsonNullable.of(postalCode); return this; } - /** - * Postal code of the customer - */ - public Addresses withPostalCode(JsonNullable postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); - this.postalCode = postalCode; - return this; - } /** * Country of the customer */ - public Addresses withCountry(String country) { - Utils.checkNotNull(country, "country"); + public Addresses withCountry(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * Country of the customer - */ - public Addresses withCountry(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -355,174 +274,88 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional type = Optional.empty(); + private EcommerceCustomerType type; - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable line1 = JsonNullable.undefined(); + private JsonNullable line1; - private JsonNullable line2 = JsonNullable.undefined(); + private JsonNullable line2; - private JsonNullable city = JsonNullable.undefined(); + private JsonNullable city; - private JsonNullable state = JsonNullable.undefined(); + private JsonNullable state; - private JsonNullable postalCode = JsonNullable.undefined(); + private JsonNullable postalCode; - private JsonNullable country = JsonNullable.undefined(); + private JsonNullable country; private Builder() { // force use of static builder() method } - - public Builder type(EcommerceCustomerType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable EcommerceCustomerType type) { this.type = type; return this; } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * First line of the street address of the customer */ - public Builder line1(String line1) { - Utils.checkNotNull(line1, "line1"); + public Builder line1(@Nullable String line1) { this.line1 = JsonNullable.of(line1); return this; } - /** - * First line of the street address of the customer - */ - public Builder line1(JsonNullable line1) { - Utils.checkNotNull(line1, "line1"); - this.line1 = line1; - return this; - } - - /** * Second line of the street address of the customer */ - public Builder line2(String line2) { - Utils.checkNotNull(line2, "line2"); + public Builder line2(@Nullable String line2) { this.line2 = JsonNullable.of(line2); return this; } - /** - * Second line of the street address of the customer - */ - public Builder line2(JsonNullable line2) { - Utils.checkNotNull(line2, "line2"); - this.line2 = line2; - return this; - } - - /** * City of the customer */ - public Builder city(String city) { - Utils.checkNotNull(city, "city"); + public Builder city(@Nullable String city) { this.city = JsonNullable.of(city); return this; } - /** - * City of the customer - */ - public Builder city(JsonNullable city) { - Utils.checkNotNull(city, "city"); - this.city = city; - return this; - } - - /** * State of the customer */ - public Builder state(String state) { - Utils.checkNotNull(state, "state"); + public Builder state(@Nullable String state) { this.state = JsonNullable.of(state); return this; } - /** - * State of the customer - */ - public Builder state(JsonNullable state) { - Utils.checkNotNull(state, "state"); - this.state = state; - return this; - } - - /** * Postal code of the customer */ - public Builder postalCode(String postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); + public Builder postalCode(@Nullable String postalCode) { this.postalCode = JsonNullable.of(postalCode); return this; } - /** - * Postal code of the customer - */ - public Builder postalCode(JsonNullable postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); - this.postalCode = postalCode; - return this; - } - - /** * Country of the customer */ - public Builder country(String country) { - Utils.checkNotNull(country, "country"); + public Builder country(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * Country of the customer - */ - public Builder country(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - public Addresses build() { - return new Addresses( type, id, line1, line2, city, state, diff --git a/src/main/java/com/apideck/unify/models/components/AgedCreditors.java b/src/main/java/com/apideck/unify/models/components/AgedCreditors.java index 844aad73..4f813d19 100644 --- a/src/main/java/com/apideck/unify/models/components/AgedCreditors.java +++ b/src/main/java/com/apideck/unify/models/components/AgedCreditors.java @@ -6,15 +6,14 @@ import com.apideck.unify.utils.LazySingletonValue; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -27,94 +26,85 @@ public class AgedCreditors { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("report_generated_at") - private Optional reportGeneratedAt; + private OffsetDateTime reportGeneratedAt; /** * The cutoff date for transactions included in the report. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("report_as_of_date") - private Optional reportAsOfDate; + private LocalDate reportAsOfDate; /** * Number of aging periods shown in the report. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("period_count") - private Optional periodCount; + private Long periodCount; /** * Length of each aging period in days. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("period_length") - private Optional periodLength; + private Long periodLength; @JsonInclude(Include.NON_ABSENT) @JsonProperty("outstanding_balances") - private Optional> outstandingBalances; + private List outstandingBalances; @JsonCreator public AgedCreditors( - @JsonProperty("report_generated_at") Optional reportGeneratedAt, - @JsonProperty("report_as_of_date") Optional reportAsOfDate, - @JsonProperty("period_count") Optional periodCount, - @JsonProperty("period_length") Optional periodLength, - @JsonProperty("outstanding_balances") Optional> outstandingBalances) { - Utils.checkNotNull(reportGeneratedAt, "reportGeneratedAt"); - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); - Utils.checkNotNull(periodCount, "periodCount"); - Utils.checkNotNull(periodLength, "periodLength"); - Utils.checkNotNull(outstandingBalances, "outstandingBalances"); + @JsonProperty("report_generated_at") @Nullable OffsetDateTime reportGeneratedAt, + @JsonProperty("report_as_of_date") @Nullable LocalDate reportAsOfDate, + @JsonProperty("period_count") @Nullable Long periodCount, + @JsonProperty("period_length") @Nullable Long periodLength, + @JsonProperty("outstanding_balances") @Nullable List outstandingBalances) { this.reportGeneratedAt = reportGeneratedAt; this.reportAsOfDate = reportAsOfDate; - this.periodCount = periodCount; - this.periodLength = periodLength; + this.periodCount = Optional.ofNullable(periodCount) + .orElse(Builder._SINGLETON_VALUE_PeriodCount.value()); + this.periodLength = Optional.ofNullable(periodLength) + .orElse(Builder._SINGLETON_VALUE_PeriodLength.value()); this.outstandingBalances = outstandingBalances; } public AgedCreditors() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * The exact date and time the report was generated. */ - @JsonIgnore public Optional reportGeneratedAt() { - return reportGeneratedAt; + return Optional.ofNullable(this.reportGeneratedAt); } /** * The cutoff date for transactions included in the report. */ - @JsonIgnore public Optional reportAsOfDate() { - return reportAsOfDate; + return Optional.ofNullable(this.reportAsOfDate); } /** * Number of aging periods shown in the report. */ - @JsonIgnore public Optional periodCount() { - return periodCount; + return Optional.ofNullable(this.periodCount); } /** * Length of each aging period in days. */ - @JsonIgnore public Optional periodLength() { - return periodLength; + return Optional.ofNullable(this.periodLength); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> outstandingBalances() { - return (Optional>) outstandingBalances; + return Optional.ofNullable(this.outstandingBalances); } public static Builder builder() { @@ -125,92 +115,45 @@ public static Builder builder() { /** * The exact date and time the report was generated. */ - public AgedCreditors withReportGeneratedAt(OffsetDateTime reportGeneratedAt) { - Utils.checkNotNull(reportGeneratedAt, "reportGeneratedAt"); - this.reportGeneratedAt = Optional.ofNullable(reportGeneratedAt); - return this; - } - - - /** - * The exact date and time the report was generated. - */ - public AgedCreditors withReportGeneratedAt(Optional reportGeneratedAt) { - Utils.checkNotNull(reportGeneratedAt, "reportGeneratedAt"); + public AgedCreditors withReportGeneratedAt(@Nullable OffsetDateTime reportGeneratedAt) { this.reportGeneratedAt = reportGeneratedAt; return this; } - /** - * The cutoff date for transactions included in the report. - */ - public AgedCreditors withReportAsOfDate(LocalDate reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); - this.reportAsOfDate = Optional.ofNullable(reportAsOfDate); - return this; - } - /** * The cutoff date for transactions included in the report. */ - public AgedCreditors withReportAsOfDate(Optional reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); + public AgedCreditors withReportAsOfDate(@Nullable LocalDate reportAsOfDate) { this.reportAsOfDate = reportAsOfDate; return this; } - /** - * Number of aging periods shown in the report. - */ - public AgedCreditors withPeriodCount(long periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); - this.periodCount = Optional.ofNullable(periodCount); - return this; - } - /** * Number of aging periods shown in the report. */ - public AgedCreditors withPeriodCount(Optional periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); + public AgedCreditors withPeriodCount(@Nullable Long periodCount) { this.periodCount = periodCount; return this; } - /** - * Length of each aging period in days. - */ - public AgedCreditors withPeriodLength(long periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); - this.periodLength = Optional.ofNullable(periodLength); - return this; - } - /** * Length of each aging period in days. */ - public AgedCreditors withPeriodLength(Optional periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); + public AgedCreditors withPeriodLength(@Nullable Long periodLength) { this.periodLength = periodLength; return this; } - public AgedCreditors withOutstandingBalances(List outstandingBalances) { - Utils.checkNotNull(outstandingBalances, "outstandingBalances"); - this.outstandingBalances = Optional.ofNullable(outstandingBalances); - return this; - } - - public AgedCreditors withOutstandingBalances(Optional> outstandingBalances) { - Utils.checkNotNull(outstandingBalances, "outstandingBalances"); + public AgedCreditors withOutstandingBalances(@Nullable List outstandingBalances) { this.outstandingBalances = outstandingBalances; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -248,133 +191,74 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional reportGeneratedAt = Optional.empty(); + private OffsetDateTime reportGeneratedAt; - private Optional reportAsOfDate = Optional.empty(); + private LocalDate reportAsOfDate; - private Optional periodCount; + private Long periodCount; - private Optional periodLength; + private Long periodLength; - private Optional> outstandingBalances = Optional.empty(); + private List outstandingBalances; private Builder() { // force use of static builder() method } - - /** - * The exact date and time the report was generated. - */ - public Builder reportGeneratedAt(OffsetDateTime reportGeneratedAt) { - Utils.checkNotNull(reportGeneratedAt, "reportGeneratedAt"); - this.reportGeneratedAt = Optional.ofNullable(reportGeneratedAt); - return this; - } - /** * The exact date and time the report was generated. */ - public Builder reportGeneratedAt(Optional reportGeneratedAt) { - Utils.checkNotNull(reportGeneratedAt, "reportGeneratedAt"); + public Builder reportGeneratedAt(@Nullable OffsetDateTime reportGeneratedAt) { this.reportGeneratedAt = reportGeneratedAt; return this; } - - /** - * The cutoff date for transactions included in the report. - */ - public Builder reportAsOfDate(LocalDate reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); - this.reportAsOfDate = Optional.ofNullable(reportAsOfDate); - return this; - } - /** * The cutoff date for transactions included in the report. */ - public Builder reportAsOfDate(Optional reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); + public Builder reportAsOfDate(@Nullable LocalDate reportAsOfDate) { this.reportAsOfDate = reportAsOfDate; return this; } - - /** - * Number of aging periods shown in the report. - */ - public Builder periodCount(long periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); - this.periodCount = Optional.ofNullable(periodCount); - return this; - } - /** * Number of aging periods shown in the report. */ - public Builder periodCount(Optional periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); + public Builder periodCount(@Nullable Long periodCount) { this.periodCount = periodCount; return this; } - - /** - * Length of each aging period in days. - */ - public Builder periodLength(long periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); - this.periodLength = Optional.ofNullable(periodLength); - return this; - } - /** * Length of each aging period in days. */ - public Builder periodLength(Optional periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); + public Builder periodLength(@Nullable Long periodLength) { this.periodLength = periodLength; return this; } - - public Builder outstandingBalances(List outstandingBalances) { - Utils.checkNotNull(outstandingBalances, "outstandingBalances"); - this.outstandingBalances = Optional.ofNullable(outstandingBalances); - return this; - } - - public Builder outstandingBalances(Optional> outstandingBalances) { - Utils.checkNotNull(outstandingBalances, "outstandingBalances"); + public Builder outstandingBalances(@Nullable List outstandingBalances) { this.outstandingBalances = outstandingBalances; return this; } public AgedCreditors build() { - if (periodCount == null) { - periodCount = _SINGLETON_VALUE_PeriodCount.value(); - } - if (periodLength == null) { - periodLength = _SINGLETON_VALUE_PeriodLength.value(); - } - return new AgedCreditors( reportGeneratedAt, reportAsOfDate, periodCount, periodLength, outstandingBalances); } - private static final LazySingletonValue> _SINGLETON_VALUE_PeriodCount = + private static final LazySingletonValue _SINGLETON_VALUE_PeriodCount = new LazySingletonValue<>( "period_count", "4", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_PeriodLength = + private static final LazySingletonValue _SINGLETON_VALUE_PeriodLength = new LazySingletonValue<>( "period_length", "30", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/AgedDebtors.java b/src/main/java/com/apideck/unify/models/components/AgedDebtors.java index 0d9d7b34..5ac131ef 100644 --- a/src/main/java/com/apideck/unify/models/components/AgedDebtors.java +++ b/src/main/java/com/apideck/unify/models/components/AgedDebtors.java @@ -6,15 +6,14 @@ import com.apideck.unify.utils.LazySingletonValue; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -27,94 +26,85 @@ public class AgedDebtors { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("report_generated_at") - private Optional reportGeneratedAt; + private OffsetDateTime reportGeneratedAt; /** * The cutoff date for transactions included in the report. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("report_as_of_date") - private Optional reportAsOfDate; + private LocalDate reportAsOfDate; /** * Number of aging periods shown in the report. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("period_count") - private Optional periodCount; + private Long periodCount; /** * Length of each aging period in days. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("period_length") - private Optional periodLength; + private Long periodLength; @JsonInclude(Include.NON_ABSENT) @JsonProperty("outstanding_balances") - private Optional> outstandingBalances; + private List outstandingBalances; @JsonCreator public AgedDebtors( - @JsonProperty("report_generated_at") Optional reportGeneratedAt, - @JsonProperty("report_as_of_date") Optional reportAsOfDate, - @JsonProperty("period_count") Optional periodCount, - @JsonProperty("period_length") Optional periodLength, - @JsonProperty("outstanding_balances") Optional> outstandingBalances) { - Utils.checkNotNull(reportGeneratedAt, "reportGeneratedAt"); - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); - Utils.checkNotNull(periodCount, "periodCount"); - Utils.checkNotNull(periodLength, "periodLength"); - Utils.checkNotNull(outstandingBalances, "outstandingBalances"); + @JsonProperty("report_generated_at") @Nullable OffsetDateTime reportGeneratedAt, + @JsonProperty("report_as_of_date") @Nullable LocalDate reportAsOfDate, + @JsonProperty("period_count") @Nullable Long periodCount, + @JsonProperty("period_length") @Nullable Long periodLength, + @JsonProperty("outstanding_balances") @Nullable List outstandingBalances) { this.reportGeneratedAt = reportGeneratedAt; this.reportAsOfDate = reportAsOfDate; - this.periodCount = periodCount; - this.periodLength = periodLength; + this.periodCount = Optional.ofNullable(periodCount) + .orElse(Builder._SINGLETON_VALUE_PeriodCount.value()); + this.periodLength = Optional.ofNullable(periodLength) + .orElse(Builder._SINGLETON_VALUE_PeriodLength.value()); this.outstandingBalances = outstandingBalances; } public AgedDebtors() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * The exact date and time the report was generated. */ - @JsonIgnore public Optional reportGeneratedAt() { - return reportGeneratedAt; + return Optional.ofNullable(this.reportGeneratedAt); } /** * The cutoff date for transactions included in the report. */ - @JsonIgnore public Optional reportAsOfDate() { - return reportAsOfDate; + return Optional.ofNullable(this.reportAsOfDate); } /** * Number of aging periods shown in the report. */ - @JsonIgnore public Optional periodCount() { - return periodCount; + return Optional.ofNullable(this.periodCount); } /** * Length of each aging period in days. */ - @JsonIgnore public Optional periodLength() { - return periodLength; + return Optional.ofNullable(this.periodLength); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> outstandingBalances() { - return (Optional>) outstandingBalances; + return Optional.ofNullable(this.outstandingBalances); } public static Builder builder() { @@ -125,92 +115,45 @@ public static Builder builder() { /** * The exact date and time the report was generated. */ - public AgedDebtors withReportGeneratedAt(OffsetDateTime reportGeneratedAt) { - Utils.checkNotNull(reportGeneratedAt, "reportGeneratedAt"); - this.reportGeneratedAt = Optional.ofNullable(reportGeneratedAt); - return this; - } - - - /** - * The exact date and time the report was generated. - */ - public AgedDebtors withReportGeneratedAt(Optional reportGeneratedAt) { - Utils.checkNotNull(reportGeneratedAt, "reportGeneratedAt"); + public AgedDebtors withReportGeneratedAt(@Nullable OffsetDateTime reportGeneratedAt) { this.reportGeneratedAt = reportGeneratedAt; return this; } - /** - * The cutoff date for transactions included in the report. - */ - public AgedDebtors withReportAsOfDate(LocalDate reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); - this.reportAsOfDate = Optional.ofNullable(reportAsOfDate); - return this; - } - /** * The cutoff date for transactions included in the report. */ - public AgedDebtors withReportAsOfDate(Optional reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); + public AgedDebtors withReportAsOfDate(@Nullable LocalDate reportAsOfDate) { this.reportAsOfDate = reportAsOfDate; return this; } - /** - * Number of aging periods shown in the report. - */ - public AgedDebtors withPeriodCount(long periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); - this.periodCount = Optional.ofNullable(periodCount); - return this; - } - /** * Number of aging periods shown in the report. */ - public AgedDebtors withPeriodCount(Optional periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); + public AgedDebtors withPeriodCount(@Nullable Long periodCount) { this.periodCount = periodCount; return this; } - /** - * Length of each aging period in days. - */ - public AgedDebtors withPeriodLength(long periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); - this.periodLength = Optional.ofNullable(periodLength); - return this; - } - /** * Length of each aging period in days. */ - public AgedDebtors withPeriodLength(Optional periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); + public AgedDebtors withPeriodLength(@Nullable Long periodLength) { this.periodLength = periodLength; return this; } - public AgedDebtors withOutstandingBalances(List outstandingBalances) { - Utils.checkNotNull(outstandingBalances, "outstandingBalances"); - this.outstandingBalances = Optional.ofNullable(outstandingBalances); - return this; - } - - public AgedDebtors withOutstandingBalances(Optional> outstandingBalances) { - Utils.checkNotNull(outstandingBalances, "outstandingBalances"); + public AgedDebtors withOutstandingBalances(@Nullable List outstandingBalances) { this.outstandingBalances = outstandingBalances; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -248,133 +191,74 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional reportGeneratedAt = Optional.empty(); + private OffsetDateTime reportGeneratedAt; - private Optional reportAsOfDate = Optional.empty(); + private LocalDate reportAsOfDate; - private Optional periodCount; + private Long periodCount; - private Optional periodLength; + private Long periodLength; - private Optional> outstandingBalances = Optional.empty(); + private List outstandingBalances; private Builder() { // force use of static builder() method } - - /** - * The exact date and time the report was generated. - */ - public Builder reportGeneratedAt(OffsetDateTime reportGeneratedAt) { - Utils.checkNotNull(reportGeneratedAt, "reportGeneratedAt"); - this.reportGeneratedAt = Optional.ofNullable(reportGeneratedAt); - return this; - } - /** * The exact date and time the report was generated. */ - public Builder reportGeneratedAt(Optional reportGeneratedAt) { - Utils.checkNotNull(reportGeneratedAt, "reportGeneratedAt"); + public Builder reportGeneratedAt(@Nullable OffsetDateTime reportGeneratedAt) { this.reportGeneratedAt = reportGeneratedAt; return this; } - - /** - * The cutoff date for transactions included in the report. - */ - public Builder reportAsOfDate(LocalDate reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); - this.reportAsOfDate = Optional.ofNullable(reportAsOfDate); - return this; - } - /** * The cutoff date for transactions included in the report. */ - public Builder reportAsOfDate(Optional reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); + public Builder reportAsOfDate(@Nullable LocalDate reportAsOfDate) { this.reportAsOfDate = reportAsOfDate; return this; } - - /** - * Number of aging periods shown in the report. - */ - public Builder periodCount(long periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); - this.periodCount = Optional.ofNullable(periodCount); - return this; - } - /** * Number of aging periods shown in the report. */ - public Builder periodCount(Optional periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); + public Builder periodCount(@Nullable Long periodCount) { this.periodCount = periodCount; return this; } - - /** - * Length of each aging period in days. - */ - public Builder periodLength(long periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); - this.periodLength = Optional.ofNullable(periodLength); - return this; - } - /** * Length of each aging period in days. */ - public Builder periodLength(Optional periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); + public Builder periodLength(@Nullable Long periodLength) { this.periodLength = periodLength; return this; } - - public Builder outstandingBalances(List outstandingBalances) { - Utils.checkNotNull(outstandingBalances, "outstandingBalances"); - this.outstandingBalances = Optional.ofNullable(outstandingBalances); - return this; - } - - public Builder outstandingBalances(Optional> outstandingBalances) { - Utils.checkNotNull(outstandingBalances, "outstandingBalances"); + public Builder outstandingBalances(@Nullable List outstandingBalances) { this.outstandingBalances = outstandingBalances; return this; } public AgedDebtors build() { - if (periodCount == null) { - periodCount = _SINGLETON_VALUE_PeriodCount.value(); - } - if (periodLength == null) { - periodLength = _SINGLETON_VALUE_PeriodLength.value(); - } - return new AgedDebtors( reportGeneratedAt, reportAsOfDate, periodCount, periodLength, outstandingBalances); } - private static final LazySingletonValue> _SINGLETON_VALUE_PeriodCount = + private static final LazySingletonValue _SINGLETON_VALUE_PeriodCount = new LazySingletonValue<>( "period_count", "4", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_PeriodLength = + private static final LazySingletonValue _SINGLETON_VALUE_PeriodLength = new LazySingletonValue<>( "period_length", "30", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/AgedReportFilter.java b/src/main/java/com/apideck/unify/models/components/AgedReportFilter.java index 19ee1dc4..a9c9dadc 100644 --- a/src/main/java/com/apideck/unify/models/components/AgedReportFilter.java +++ b/src/main/java/com/apideck/unify/models/components/AgedReportFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; @@ -18,44 +18,39 @@ public class AgedReportFilter { * Filter by customer id */ @SpeakeasyMetadata("queryParam:name=customer_id") - private Optional customerId; + private String customerId; /** * Filter by supplier id */ @SpeakeasyMetadata("queryParam:name=supplier_id") - private Optional supplierId; + private String supplierId; /** * The cutoff date for considering transactions */ @SpeakeasyMetadata("queryParam:name=report_as_of_date") - private Optional reportAsOfDate; + private String reportAsOfDate; /** * Number of periods to split the aged creditors report into */ @SpeakeasyMetadata("queryParam:name=period_count") - private Optional periodCount; + private Long periodCount; /** * Length of each period in days */ @SpeakeasyMetadata("queryParam:name=period_length") - private Optional periodLength; + private Long periodLength; @JsonCreator public AgedReportFilter( - Optional customerId, - Optional supplierId, - Optional reportAsOfDate, - Optional periodCount, - Optional periodLength) { - Utils.checkNotNull(customerId, "customerId"); - Utils.checkNotNull(supplierId, "supplierId"); - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); - Utils.checkNotNull(periodCount, "periodCount"); - Utils.checkNotNull(periodLength, "periodLength"); + @Nullable String customerId, + @Nullable String supplierId, + @Nullable String reportAsOfDate, + @Nullable Long periodCount, + @Nullable Long periodLength) { this.customerId = customerId; this.supplierId = supplierId; this.reportAsOfDate = reportAsOfDate; @@ -64,48 +59,43 @@ public AgedReportFilter( } public AgedReportFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * Filter by customer id */ - @JsonIgnore public Optional customerId() { - return customerId; + return Optional.ofNullable(this.customerId); } /** * Filter by supplier id */ - @JsonIgnore public Optional supplierId() { - return supplierId; + return Optional.ofNullable(this.supplierId); } /** * The cutoff date for considering transactions */ - @JsonIgnore public Optional reportAsOfDate() { - return reportAsOfDate; + return Optional.ofNullable(this.reportAsOfDate); } /** * Number of periods to split the aged creditors report into */ - @JsonIgnore public Optional periodCount() { - return periodCount; + return Optional.ofNullable(this.periodCount); } /** * Length of each period in days */ - @JsonIgnore public Optional periodLength() { - return periodLength; + return Optional.ofNullable(this.periodLength); } public static Builder builder() { @@ -116,98 +106,48 @@ public static Builder builder() { /** * Filter by customer id */ - public AgedReportFilter withCustomerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - - - /** - * Filter by customer id - */ - public AgedReportFilter withCustomerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public AgedReportFilter withCustomerId(@Nullable String customerId) { this.customerId = customerId; return this; } - /** - * Filter by supplier id - */ - public AgedReportFilter withSupplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - /** * Filter by supplier id */ - public AgedReportFilter withSupplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public AgedReportFilter withSupplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } - /** - * The cutoff date for considering transactions - */ - public AgedReportFilter withReportAsOfDate(String reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); - this.reportAsOfDate = Optional.ofNullable(reportAsOfDate); - return this; - } - /** * The cutoff date for considering transactions */ - public AgedReportFilter withReportAsOfDate(Optional reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); + public AgedReportFilter withReportAsOfDate(@Nullable String reportAsOfDate) { this.reportAsOfDate = reportAsOfDate; return this; } - /** - * Number of periods to split the aged creditors report into - */ - public AgedReportFilter withPeriodCount(long periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); - this.periodCount = Optional.ofNullable(periodCount); - return this; - } - /** * Number of periods to split the aged creditors report into */ - public AgedReportFilter withPeriodCount(Optional periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); + public AgedReportFilter withPeriodCount(@Nullable Long periodCount) { this.periodCount = periodCount; return this; } - /** - * Length of each period in days - */ - public AgedReportFilter withPeriodLength(long periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); - this.periodLength = Optional.ofNullable(periodLength); - return this; - } - /** * Length of each period in days */ - public AgedReportFilter withPeriodLength(Optional periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); + public AgedReportFilter withPeriodLength(@Nullable Long periodLength) { this.periodLength = periodLength; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -245,117 +185,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional customerId = Optional.empty(); + private String customerId; - private Optional supplierId = Optional.empty(); + private String supplierId; - private Optional reportAsOfDate = Optional.empty(); + private String reportAsOfDate; - private Optional periodCount = Optional.empty(); + private Long periodCount; - private Optional periodLength = Optional.empty(); + private Long periodLength; private Builder() { // force use of static builder() method } - - /** - * Filter by customer id - */ - public Builder customerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - /** * Filter by customer id */ - public Builder customerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public Builder customerId(@Nullable String customerId) { this.customerId = customerId; return this; } - /** * Filter by supplier id */ - public Builder supplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - - /** - * Filter by supplier id - */ - public Builder supplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public Builder supplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } - - /** - * The cutoff date for considering transactions - */ - public Builder reportAsOfDate(String reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); - this.reportAsOfDate = Optional.ofNullable(reportAsOfDate); - return this; - } - /** * The cutoff date for considering transactions */ - public Builder reportAsOfDate(Optional reportAsOfDate) { - Utils.checkNotNull(reportAsOfDate, "reportAsOfDate"); + public Builder reportAsOfDate(@Nullable String reportAsOfDate) { this.reportAsOfDate = reportAsOfDate; return this; } - - /** - * Number of periods to split the aged creditors report into - */ - public Builder periodCount(long periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); - this.periodCount = Optional.ofNullable(periodCount); - return this; - } - /** * Number of periods to split the aged creditors report into */ - public Builder periodCount(Optional periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); + public Builder periodCount(@Nullable Long periodCount) { this.periodCount = periodCount; return this; } - - /** - * Length of each period in days - */ - public Builder periodLength(long periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); - this.periodLength = Optional.ofNullable(periodLength); - return this; - } - /** * Length of each period in days */ - public Builder periodLength(Optional periodLength) { - Utils.checkNotNull(periodLength, "periodLength"); + public Builder periodLength(@Nullable Long periodLength) { this.periodLength = periodLength; return this; } public AgedReportFilter build() { - return new AgedReportFilter( customerId, supplierId, reportAsOfDate, periodCount, periodLength); diff --git a/src/main/java/com/apideck/unify/models/components/Allocation.java b/src/main/java/com/apideck/unify/models/components/Allocation.java index 207e735d..35b154b4 100644 --- a/src/main/java/com/apideck/unify/models/components/Allocation.java +++ b/src/main/java/com/apideck/unify/models/components/Allocation.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,19 +22,19 @@ public class Allocation { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Type of entity this payment should be attributed to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private AllocationType type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. @@ -49,68 +48,58 @@ public class Allocation { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("allocation_id") - private Optional allocationId; + private String allocationId; @JsonCreator public Allocation( - @JsonProperty("id") Optional id, - @JsonProperty("type") Optional type, - @JsonProperty("code") Optional code, - @JsonProperty("amount") JsonNullable amount, - @JsonProperty("allocation_id") Optional allocationId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(amount, "amount"); - Utils.checkNotNull(allocationId, "allocationId"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("type") @Nullable AllocationType type, + @JsonProperty("code") @Nullable String code, + @JsonProperty("amount") @Nullable JsonNullable amount, + @JsonProperty("allocation_id") @Nullable String allocationId) { this.id = id; this.type = type; this.code = code; - this.amount = amount; + this.amount = Optional.ofNullable(amount) + .orElse(JsonNullable.undefined()); this.allocationId = allocationId; } public Allocation() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null); } /** * Unique identifier of entity this payment should be attributed to. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Type of entity this payment should be attributed to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - @JsonIgnore public JsonNullable amount() { - return amount; + return this.amount; } /** * Unique identifier of the allocation */ - @JsonIgnore public Optional allocationId() { - return allocationId; + return Optional.ofNullable(this.allocationId); } public static Builder builder() { @@ -121,78 +110,32 @@ public static Builder builder() { /** * Unique identifier of entity this payment should be attributed to. */ - public Allocation withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * Unique identifier of entity this payment should be attributed to. - */ - public Allocation withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Allocation withId(@Nullable String id) { this.id = id; return this; } - /** - * Type of entity this payment should be attributed to. - */ - public Allocation withType(AllocationType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of entity this payment should be attributed to. */ - public Allocation withType(Optional type) { - Utils.checkNotNull(type, "type"); + public Allocation withType(@Nullable AllocationType type) { this.type = type; return this; } - public Allocation withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - public Allocation withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public Allocation withCode(@Nullable String code) { this.code = code; return this; } - /** - * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - */ - public Allocation withAmount(double amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = JsonNullable.of(amount); - return this; - } /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - public Allocation withAmount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** - * Unique identifier of the allocation - */ - public Allocation withAllocationId(String allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); - this.allocationId = Optional.ofNullable(allocationId); + public Allocation withAmount(@Nullable Double amount) { + this.amount = JsonNullable.of(amount); return this; } @@ -200,12 +143,12 @@ public Allocation withAllocationId(String allocationId) { /** * Unique identifier of the allocation */ - public Allocation withAllocationId(Optional allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); + public Allocation withAllocationId(@Nullable String allocationId) { this.allocationId = allocationId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -243,111 +186,58 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional type = Optional.empty(); + private AllocationType type; - private Optional code = Optional.empty(); + private String code; - private JsonNullable amount = JsonNullable.undefined(); + private JsonNullable amount; - private Optional allocationId = Optional.empty(); + private String allocationId; private Builder() { // force use of static builder() method } - /** * Unique identifier of entity this payment should be attributed to. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * Unique identifier of entity this payment should be attributed to. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Type of entity this payment should be attributed to. - */ - public Builder type(AllocationType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of entity this payment should be attributed to. */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable AllocationType type) { this.type = type; return this; } - - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - public Builder amount(double amount) { - Utils.checkNotNull(amount, "amount"); + public Builder amount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - */ - public Builder amount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** * Unique identifier of the allocation */ - public Builder allocationId(String allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); - this.allocationId = Optional.ofNullable(allocationId); - return this; - } - - /** - * Unique identifier of the allocation - */ - public Builder allocationId(Optional allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); + public Builder allocationId(@Nullable String allocationId) { this.allocationId = allocationId; return this; } public Allocation build() { - return new Allocation( id, type, code, amount, allocationId); diff --git a/src/main/java/com/apideck/unify/models/components/AllocationInput.java b/src/main/java/com/apideck/unify/models/components/AllocationInput.java index d2039a98..4aa59d1d 100644 --- a/src/main/java/com/apideck/unify/models/components/AllocationInput.java +++ b/src/main/java/com/apideck/unify/models/components/AllocationInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,14 +22,14 @@ public class AllocationInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Type of entity this payment should be attributed to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private AllocationType type; /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. @@ -44,60 +43,52 @@ public class AllocationInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("allocation_id") - private Optional allocationId; + private String allocationId; @JsonCreator public AllocationInput( - @JsonProperty("id") Optional id, - @JsonProperty("type") Optional type, - @JsonProperty("amount") JsonNullable amount, - @JsonProperty("allocation_id") Optional allocationId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(amount, "amount"); - Utils.checkNotNull(allocationId, "allocationId"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("type") @Nullable AllocationType type, + @JsonProperty("amount") @Nullable JsonNullable amount, + @JsonProperty("allocation_id") @Nullable String allocationId) { this.id = id; this.type = type; - this.amount = amount; + this.amount = Optional.ofNullable(amount) + .orElse(JsonNullable.undefined()); this.allocationId = allocationId; } public AllocationInput() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null); } /** * Unique identifier of entity this payment should be attributed to. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Type of entity this payment should be attributed to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - @JsonIgnore public JsonNullable amount() { - return amount; + return this.amount; } /** * Unique identifier of the allocation */ - @JsonIgnore public Optional allocationId() { - return allocationId; + return Optional.ofNullable(this.allocationId); } public static Builder builder() { @@ -108,65 +99,26 @@ public static Builder builder() { /** * Unique identifier of entity this payment should be attributed to. */ - public AllocationInput withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * Unique identifier of entity this payment should be attributed to. - */ - public AllocationInput withId(Optional id) { - Utils.checkNotNull(id, "id"); + public AllocationInput withId(@Nullable String id) { this.id = id; return this; } - /** - * Type of entity this payment should be attributed to. - */ - public AllocationInput withType(AllocationType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of entity this payment should be attributed to. */ - public AllocationInput withType(Optional type) { - Utils.checkNotNull(type, "type"); + public AllocationInput withType(@Nullable AllocationType type) { this.type = type; return this; } - /** - * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - */ - public AllocationInput withAmount(double amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = JsonNullable.of(amount); - return this; - } /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - public AllocationInput withAmount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** - * Unique identifier of the allocation - */ - public AllocationInput withAllocationId(String allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); - this.allocationId = Optional.ofNullable(allocationId); + public AllocationInput withAmount(@Nullable Double amount) { + this.amount = JsonNullable.of(amount); return this; } @@ -174,12 +126,12 @@ public AllocationInput withAllocationId(String allocationId) { /** * Unique identifier of the allocation */ - public AllocationInput withAllocationId(Optional allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); + public AllocationInput withAllocationId(@Nullable String allocationId) { this.allocationId = allocationId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -215,96 +167,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional type = Optional.empty(); + private AllocationType type; - private JsonNullable amount = JsonNullable.undefined(); + private JsonNullable amount; - private Optional allocationId = Optional.empty(); + private String allocationId; private Builder() { // force use of static builder() method } - - /** - * Unique identifier of entity this payment should be attributed to. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * Unique identifier of entity this payment should be attributed to. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Type of entity this payment should be attributed to. - */ - public Builder type(AllocationType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of entity this payment should be attributed to. */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable AllocationType type) { this.type = type; return this; } - /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - public Builder amount(double amount) { - Utils.checkNotNull(amount, "amount"); + public Builder amount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - */ - public Builder amount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** * Unique identifier of the allocation */ - public Builder allocationId(String allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); - this.allocationId = Optional.ofNullable(allocationId); - return this; - } - - /** - * Unique identifier of the allocation - */ - public Builder allocationId(Optional allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); + public Builder allocationId(@Nullable String allocationId) { this.allocationId = allocationId; return this; } public AllocationInput build() { - return new AllocationInput( id, type, amount, allocationId); diff --git a/src/main/java/com/apideck/unify/models/components/Allocations.java b/src/main/java/com/apideck/unify/models/components/Allocations.java index b48ba04d..dc71cbd1 100644 --- a/src/main/java/com/apideck/unify/models/components/Allocations.java +++ b/src/main/java/com/apideck/unify/models/components/Allocations.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,12 +29,12 @@ public class Allocations { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private BillPaymentAllocationType type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. @@ -49,68 +48,59 @@ public class Allocations { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("allocation_id") - private Optional allocationId; + private String allocationId; @JsonCreator public Allocations( - @JsonProperty("id") JsonNullable id, - @JsonProperty("type") Optional type, - @JsonProperty("code") Optional code, - @JsonProperty("amount") JsonNullable amount, - @JsonProperty("allocation_id") Optional allocationId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(amount, "amount"); - Utils.checkNotNull(allocationId, "allocationId"); - this.id = id; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("type") @Nullable BillPaymentAllocationType type, + @JsonProperty("code") @Nullable String code, + @JsonProperty("amount") @Nullable JsonNullable amount, + @JsonProperty("allocation_id") @Nullable String allocationId) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); this.type = type; this.code = code; - this.amount = amount; + this.amount = Optional.ofNullable(amount) + .orElse(JsonNullable.undefined()); this.allocationId = allocationId; } public Allocations() { - this(JsonNullable.undefined(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Type of entity this payment should be attributed to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - @JsonIgnore public JsonNullable amount() { - return amount; + return this.amount; } /** * Unique identifier of the allocation */ - @JsonIgnore public Optional allocationId() { - return allocationId; + return Optional.ofNullable(this.allocationId); } public static Builder builder() { @@ -121,77 +111,32 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Allocations withId(String id) { - Utils.checkNotNull(id, "id"); + public Allocations withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Allocations withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * Type of entity this payment should be attributed to. - */ - public Allocations withType(BillPaymentAllocationType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of entity this payment should be attributed to. */ - public Allocations withType(Optional type) { - Utils.checkNotNull(type, "type"); + public Allocations withType(@Nullable BillPaymentAllocationType type) { this.type = type; return this; } - public Allocations withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - public Allocations withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public Allocations withCode(@Nullable String code) { this.code = code; return this; } - /** - * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - */ - public Allocations withAmount(double amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = JsonNullable.of(amount); - return this; - } /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - public Allocations withAmount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** - * Unique identifier of the allocation - */ - public Allocations withAllocationId(String allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); - this.allocationId = Optional.ofNullable(allocationId); + public Allocations withAmount(@Nullable Double amount) { + this.amount = JsonNullable.of(amount); return this; } @@ -199,12 +144,12 @@ public Allocations withAllocationId(String allocationId) { /** * Unique identifier of the allocation */ - public Allocations withAllocationId(Optional allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); + public Allocations withAllocationId(@Nullable String allocationId) { this.allocationId = allocationId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -242,111 +187,58 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private Optional type = Optional.empty(); + private BillPaymentAllocationType type; - private Optional code = Optional.empty(); + private String code; - private JsonNullable amount = JsonNullable.undefined(); + private JsonNullable amount; - private Optional allocationId = Optional.empty(); + private String allocationId; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * Type of entity this payment should be attributed to. - */ - public Builder type(BillPaymentAllocationType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of entity this payment should be attributed to. */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable BillPaymentAllocationType type) { this.type = type; return this; } - - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - public Builder amount(double amount) { - Utils.checkNotNull(amount, "amount"); + public Builder amount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - */ - public Builder amount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** * Unique identifier of the allocation */ - public Builder allocationId(String allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); - this.allocationId = Optional.ofNullable(allocationId); - return this; - } - - /** - * Unique identifier of the allocation - */ - public Builder allocationId(Optional allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); + public Builder allocationId(@Nullable String allocationId) { this.allocationId = allocationId; return this; } public Allocations build() { - return new Allocations( id, type, code, amount, allocationId); diff --git a/src/main/java/com/apideck/unify/models/components/Api.java b/src/main/java/com/apideck/unify/models/components/Api.java index 83b4df8d..4c149148 100644 --- a/src/main/java/com/apideck/unify/models/components/Api.java +++ b/src/main/java/com/apideck/unify/models/components/Api.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,21 +22,21 @@ public class Api { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Indicates whether the API is a Unified API. If unified_api is false, the API is a Platform API. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private ApiType type; /** * Name of the API. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Description of the API. @@ -51,21 +50,21 @@ public class Api { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private ApiStatus status; /** * Link to the latest OpenAPI specification of the API. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("spec_url") - private Optional specUrl; + private String specUrl; /** * Link to the API reference of the API. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("api_reference_url") - private Optional apiReferenceUrl; + private String apiReferenceUrl; /** * ID of the Postman collection of the API. @@ -79,157 +78,132 @@ public class Api { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("categories") - private Optional> categories; + private List categories; /** * List of resources supported in this API. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("resources") - private Optional> resources; + private List resources; /** * List of event types this API supports. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("events") - private Optional> events; + private List events; @JsonCreator public Api( - @JsonProperty("id") Optional id, - @JsonProperty("type") Optional type, - @JsonProperty("name") Optional name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("status") Optional status, - @JsonProperty("spec_url") Optional specUrl, - @JsonProperty("api_reference_url") Optional apiReferenceUrl, - @JsonProperty("postman_collection_id") JsonNullable postmanCollectionId, - @JsonProperty("categories") Optional> categories, - @JsonProperty("resources") Optional> resources, - @JsonProperty("events") Optional> events) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(specUrl, "specUrl"); - Utils.checkNotNull(apiReferenceUrl, "apiReferenceUrl"); - Utils.checkNotNull(postmanCollectionId, "postmanCollectionId"); - Utils.checkNotNull(categories, "categories"); - Utils.checkNotNull(resources, "resources"); - Utils.checkNotNull(events, "events"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("type") @Nullable ApiType type, + @JsonProperty("name") @Nullable String name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("status") @Nullable ApiStatus status, + @JsonProperty("spec_url") @Nullable String specUrl, + @JsonProperty("api_reference_url") @Nullable String apiReferenceUrl, + @JsonProperty("postman_collection_id") @Nullable JsonNullable postmanCollectionId, + @JsonProperty("categories") @Nullable List categories, + @JsonProperty("resources") @Nullable List resources, + @JsonProperty("events") @Nullable List events) { this.id = id; this.type = type; this.name = name; - this.description = description; + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.status = status; this.specUrl = specUrl; this.apiReferenceUrl = apiReferenceUrl; - this.postmanCollectionId = postmanCollectionId; + this.postmanCollectionId = Optional.ofNullable(postmanCollectionId) + .orElse(JsonNullable.undefined()); this.categories = categories; this.resources = resources; this.events = events; } public Api() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null); } /** * ID of the API. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Indicates whether the API is a Unified API. If unified_api is false, the API is a Platform API. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } /** * Name of the API. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Description of the API. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Status of the API. APIs with status live or beta are callable. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Link to the latest OpenAPI specification of the API. */ - @JsonIgnore public Optional specUrl() { - return specUrl; + return Optional.ofNullable(this.specUrl); } /** * Link to the API reference of the API. */ - @JsonIgnore public Optional apiReferenceUrl() { - return apiReferenceUrl; + return Optional.ofNullable(this.apiReferenceUrl); } /** * ID of the Postman collection of the API. */ - @JsonIgnore public JsonNullable postmanCollectionId() { - return postmanCollectionId; + return this.postmanCollectionId; } /** * List of categories the API belongs to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> categories() { - return (Optional>) categories; + return Optional.ofNullable(this.categories); } /** * List of resources supported in this API. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> resources() { - return (Optional>) resources; + return Optional.ofNullable(this.resources); } /** * List of event types this API supports. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> events() { - return (Optional>) events; + return Optional.ofNullable(this.events); } public static Builder builder() { @@ -240,84 +214,35 @@ public static Builder builder() { /** * ID of the API. */ - public Api withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the API. - */ - public Api withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Api withId(@Nullable String id) { this.id = id; return this; } - /** - * Indicates whether the API is a Unified API. If unified_api is false, the API is a Platform API. - */ - public Api withType(ApiType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Indicates whether the API is a Unified API. If unified_api is false, the API is a Platform API. */ - public Api withType(Optional type) { - Utils.checkNotNull(type, "type"); + public Api withType(@Nullable ApiType type) { this.type = type; return this; } - /** - * Name of the API. - */ - public Api withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the API. */ - public Api withName(Optional name) { - Utils.checkNotNull(name, "name"); + public Api withName(@Nullable String name) { this.name = name; return this; } - /** - * Description of the API. - */ - public Api withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = JsonNullable.of(description); - return this; - } /** * Description of the API. */ - public Api withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * Status of the API. APIs with status live or beta are callable. - */ - public Api withStatus(ApiStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); + public Api withDescription(@Nullable String description) { + this.description = JsonNullable.of(description); return this; } @@ -325,74 +250,35 @@ public Api withStatus(ApiStatus status) { /** * Status of the API. APIs with status live or beta are callable. */ - public Api withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public Api withStatus(@Nullable ApiStatus status) { this.status = status; return this; } - /** - * Link to the latest OpenAPI specification of the API. - */ - public Api withSpecUrl(String specUrl) { - Utils.checkNotNull(specUrl, "specUrl"); - this.specUrl = Optional.ofNullable(specUrl); - return this; - } - /** * Link to the latest OpenAPI specification of the API. */ - public Api withSpecUrl(Optional specUrl) { - Utils.checkNotNull(specUrl, "specUrl"); + public Api withSpecUrl(@Nullable String specUrl) { this.specUrl = specUrl; return this; } - /** - * Link to the API reference of the API. - */ - public Api withApiReferenceUrl(String apiReferenceUrl) { - Utils.checkNotNull(apiReferenceUrl, "apiReferenceUrl"); - this.apiReferenceUrl = Optional.ofNullable(apiReferenceUrl); - return this; - } - /** * Link to the API reference of the API. */ - public Api withApiReferenceUrl(Optional apiReferenceUrl) { - Utils.checkNotNull(apiReferenceUrl, "apiReferenceUrl"); + public Api withApiReferenceUrl(@Nullable String apiReferenceUrl) { this.apiReferenceUrl = apiReferenceUrl; return this; } - /** - * ID of the Postman collection of the API. - */ - public Api withPostmanCollectionId(String postmanCollectionId) { - Utils.checkNotNull(postmanCollectionId, "postmanCollectionId"); - this.postmanCollectionId = JsonNullable.of(postmanCollectionId); - return this; - } /** * ID of the Postman collection of the API. */ - public Api withPostmanCollectionId(JsonNullable postmanCollectionId) { - Utils.checkNotNull(postmanCollectionId, "postmanCollectionId"); - this.postmanCollectionId = postmanCollectionId; - return this; - } - - /** - * List of categories the API belongs to. - */ - public Api withCategories(List categories) { - Utils.checkNotNull(categories, "categories"); - this.categories = Optional.ofNullable(categories); + public Api withPostmanCollectionId(@Nullable String postmanCollectionId) { + this.postmanCollectionId = JsonNullable.of(postmanCollectionId); return this; } @@ -400,50 +286,30 @@ public Api withCategories(List categories) { /** * List of categories the API belongs to. */ - public Api withCategories(Optional> categories) { - Utils.checkNotNull(categories, "categories"); + public Api withCategories(@Nullable List categories) { this.categories = categories; return this; } - /** - * List of resources supported in this API. - */ - public Api withResources(List resources) { - Utils.checkNotNull(resources, "resources"); - this.resources = Optional.ofNullable(resources); - return this; - } - /** * List of resources supported in this API. */ - public Api withResources(Optional> resources) { - Utils.checkNotNull(resources, "resources"); + public Api withResources(@Nullable List resources) { this.resources = resources; return this; } - /** - * List of event types this API supports. - */ - public Api withEvents(List events) { - Utils.checkNotNull(events, "events"); - this.events = Optional.ofNullable(events); - return this; - } - /** * List of event types this API supports. */ - public Api withEvents(Optional> events) { - Utils.checkNotNull(events, "events"); + public Api withEvents(@Nullable List events) { this.events = events; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -495,243 +361,121 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional type = Optional.empty(); + private ApiType type; - private Optional name = Optional.empty(); + private String name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional status = Optional.empty(); + private ApiStatus status; - private Optional specUrl = Optional.empty(); + private String specUrl; - private Optional apiReferenceUrl = Optional.empty(); + private String apiReferenceUrl; - private JsonNullable postmanCollectionId = JsonNullable.undefined(); + private JsonNullable postmanCollectionId; - private Optional> categories = Optional.empty(); + private List categories; - private Optional> resources = Optional.empty(); + private List resources; - private Optional> events = Optional.empty(); + private List events; private Builder() { // force use of static builder() method } - - /** - * ID of the API. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * ID of the API. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Indicates whether the API is a Unified API. If unified_api is false, the API is a Platform API. - */ - public Builder type(ApiType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Indicates whether the API is a Unified API. If unified_api is false, the API is a Platform API. */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ApiType type) { this.type = type; return this; } - /** * Name of the API. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * Name of the API. - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * Description of the API. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of the API. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * Status of the API. APIs with status live or beta are callable. - */ - public Builder status(ApiStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the API. APIs with status live or beta are callable. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ApiStatus status) { this.status = status; return this; } - - /** - * Link to the latest OpenAPI specification of the API. - */ - public Builder specUrl(String specUrl) { - Utils.checkNotNull(specUrl, "specUrl"); - this.specUrl = Optional.ofNullable(specUrl); - return this; - } - /** * Link to the latest OpenAPI specification of the API. */ - public Builder specUrl(Optional specUrl) { - Utils.checkNotNull(specUrl, "specUrl"); + public Builder specUrl(@Nullable String specUrl) { this.specUrl = specUrl; return this; } - - /** - * Link to the API reference of the API. - */ - public Builder apiReferenceUrl(String apiReferenceUrl) { - Utils.checkNotNull(apiReferenceUrl, "apiReferenceUrl"); - this.apiReferenceUrl = Optional.ofNullable(apiReferenceUrl); - return this; - } - /** * Link to the API reference of the API. */ - public Builder apiReferenceUrl(Optional apiReferenceUrl) { - Utils.checkNotNull(apiReferenceUrl, "apiReferenceUrl"); + public Builder apiReferenceUrl(@Nullable String apiReferenceUrl) { this.apiReferenceUrl = apiReferenceUrl; return this; } - /** * ID of the Postman collection of the API. */ - public Builder postmanCollectionId(String postmanCollectionId) { - Utils.checkNotNull(postmanCollectionId, "postmanCollectionId"); + public Builder postmanCollectionId(@Nullable String postmanCollectionId) { this.postmanCollectionId = JsonNullable.of(postmanCollectionId); return this; } - /** - * ID of the Postman collection of the API. - */ - public Builder postmanCollectionId(JsonNullable postmanCollectionId) { - Utils.checkNotNull(postmanCollectionId, "postmanCollectionId"); - this.postmanCollectionId = postmanCollectionId; - return this; - } - - /** * List of categories the API belongs to. */ - public Builder categories(List categories) { - Utils.checkNotNull(categories, "categories"); - this.categories = Optional.ofNullable(categories); - return this; - } - - /** - * List of categories the API belongs to. - */ - public Builder categories(Optional> categories) { - Utils.checkNotNull(categories, "categories"); + public Builder categories(@Nullable List categories) { this.categories = categories; return this; } - - /** - * List of resources supported in this API. - */ - public Builder resources(List resources) { - Utils.checkNotNull(resources, "resources"); - this.resources = Optional.ofNullable(resources); - return this; - } - /** * List of resources supported in this API. */ - public Builder resources(Optional> resources) { - Utils.checkNotNull(resources, "resources"); + public Builder resources(@Nullable List resources) { this.resources = resources; return this; } - /** * List of event types this API supports. */ - public Builder events(List events) { - Utils.checkNotNull(events, "events"); - this.events = Optional.ofNullable(events); - return this; - } - - /** - * List of event types this API supports. - */ - public Builder events(Optional> events) { - Utils.checkNotNull(events, "events"); + public Builder events(@Nullable List events) { this.events = events; return this; } public Api build() { - return new Api( id, type, name, description, status, specUrl, diff --git a/src/main/java/com/apideck/unify/models/components/ApiResource.java b/src/main/java/com/apideck/unify/models/components/ApiResource.java index 7ea484fd..38727ff3 100644 --- a/src/main/java/com/apideck/unify/models/components/ApiResource.java +++ b/src/main/java/com/apideck/unify/models/components/ApiResource.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -22,48 +21,43 @@ public class ApiResource { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Name of the resource (plural) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Status of the resource. Resources with status live or beta are callable. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private ResourceStatus status; /** * List of linked resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("linked_resources") - private Optional> linkedResources; + private List linkedResources; /** * JSON Schema of the resource in our Unified API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("schema") - private Optional schema; + private Schema schema; @JsonCreator public ApiResource( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("status") Optional status, - @JsonProperty("linked_resources") Optional> linkedResources, - @JsonProperty("schema") Optional schema) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(linkedResources, "linkedResources"); - Utils.checkNotNull(schema, "schema"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("status") @Nullable ResourceStatus status, + @JsonProperty("linked_resources") @Nullable List linkedResources, + @JsonProperty("schema") @Nullable Schema schema) { this.id = id; this.name = name; this.status = status; @@ -72,51 +66,43 @@ public ApiResource( } public ApiResource() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * ID of the resource, typically a lowercased version of name. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Name of the resource (plural) */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Status of the resource. Resources with status live or beta are callable. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * List of linked resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> linkedResources() { - return (Optional>) linkedResources; + return Optional.ofNullable(this.linkedResources); } /** * JSON Schema of the resource in our Unified API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional schema() { - return (Optional) schema; + return Optional.ofNullable(this.schema); } public static Builder builder() { @@ -127,98 +113,48 @@ public static Builder builder() { /** * ID of the resource, typically a lowercased version of name. */ - public ApiResource withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the resource, typically a lowercased version of name. - */ - public ApiResource withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ApiResource withId(@Nullable String id) { this.id = id; return this; } - /** - * Name of the resource (plural) - */ - public ApiResource withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the resource (plural) */ - public ApiResource withName(Optional name) { - Utils.checkNotNull(name, "name"); + public ApiResource withName(@Nullable String name) { this.name = name; return this; } - /** - * Status of the resource. Resources with status live or beta are callable. - */ - public ApiResource withStatus(ResourceStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the resource. Resources with status live or beta are callable. */ - public ApiResource withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public ApiResource withStatus(@Nullable ResourceStatus status) { this.status = status; return this; } - /** - * List of linked resources. - */ - public ApiResource withLinkedResources(List linkedResources) { - Utils.checkNotNull(linkedResources, "linkedResources"); - this.linkedResources = Optional.ofNullable(linkedResources); - return this; - } - /** * List of linked resources. */ - public ApiResource withLinkedResources(Optional> linkedResources) { - Utils.checkNotNull(linkedResources, "linkedResources"); + public ApiResource withLinkedResources(@Nullable List linkedResources) { this.linkedResources = linkedResources; return this; } - /** - * JSON Schema of the resource in our Unified API - */ - public ApiResource withSchema(Schema schema) { - Utils.checkNotNull(schema, "schema"); - this.schema = Optional.ofNullable(schema); - return this; - } - /** * JSON Schema of the resource in our Unified API */ - public ApiResource withSchema(Optional schema) { - Utils.checkNotNull(schema, "schema"); + public ApiResource withSchema(@Nullable Schema schema) { this.schema = schema; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -256,117 +192,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private Optional status = Optional.empty(); + private ResourceStatus status; - private Optional> linkedResources = Optional.empty(); + private List linkedResources; - private Optional schema = Optional.empty(); + private Schema schema; private Builder() { // force use of static builder() method } - - /** - * ID of the resource, typically a lowercased version of name. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * ID of the resource, typically a lowercased version of name. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Name of the resource (plural) */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * Name of the resource (plural) - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * Status of the resource. Resources with status live or beta are callable. - */ - public Builder status(ResourceStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the resource. Resources with status live or beta are callable. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ResourceStatus status) { this.status = status; return this; } - - /** - * List of linked resources. - */ - public Builder linkedResources(List linkedResources) { - Utils.checkNotNull(linkedResources, "linkedResources"); - this.linkedResources = Optional.ofNullable(linkedResources); - return this; - } - /** * List of linked resources. */ - public Builder linkedResources(Optional> linkedResources) { - Utils.checkNotNull(linkedResources, "linkedResources"); + public Builder linkedResources(@Nullable List linkedResources) { this.linkedResources = linkedResources; return this; } - - /** - * JSON Schema of the resource in our Unified API - */ - public Builder schema(Schema schema) { - Utils.checkNotNull(schema, "schema"); - this.schema = Optional.ofNullable(schema); - return this; - } - /** * JSON Schema of the resource in our Unified API */ - public Builder schema(Optional schema) { - Utils.checkNotNull(schema, "schema"); + public Builder schema(@Nullable Schema schema) { this.schema = schema; return this; } public ApiResource build() { - return new ApiResource( id, name, status, linkedResources, schema); diff --git a/src/main/java/com/apideck/unify/models/components/ApiResourceCoverage.java b/src/main/java/com/apideck/unify/models/components/ApiResourceCoverage.java index 4985c110..08267b3c 100644 --- a/src/main/java/com/apideck/unify/models/components/ApiResourceCoverage.java +++ b/src/main/java/com/apideck/unify/models/components/ApiResourceCoverage.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -22,37 +21,33 @@ public class ApiResourceCoverage { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Name of the resource (plural) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Status of the resource. Resources with status live or beta are callable. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private ResourceStatus status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("coverage") - private Optional> coverage; + private List coverage; @JsonCreator public ApiResourceCoverage( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("status") Optional status, - @JsonProperty("coverage") Optional> coverage) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(coverage, "coverage"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("status") @Nullable ResourceStatus status, + @JsonProperty("coverage") @Nullable List coverage) { this.id = id; this.name = name; this.status = status; @@ -60,39 +55,33 @@ public ApiResourceCoverage( } public ApiResourceCoverage() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * ID of the resource, typically a lowercased version of name. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Name of the resource (plural) */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Status of the resource. Resources with status live or beta are callable. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> coverage() { - return (Optional>) coverage; + return Optional.ofNullable(this.coverage); } public static Builder builder() { @@ -103,73 +92,36 @@ public static Builder builder() { /** * ID of the resource, typically a lowercased version of name. */ - public ApiResourceCoverage withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the resource, typically a lowercased version of name. - */ - public ApiResourceCoverage withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ApiResourceCoverage withId(@Nullable String id) { this.id = id; return this; } - /** - * Name of the resource (plural) - */ - public ApiResourceCoverage withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the resource (plural) */ - public ApiResourceCoverage withName(Optional name) { - Utils.checkNotNull(name, "name"); + public ApiResourceCoverage withName(@Nullable String name) { this.name = name; return this; } - /** - * Status of the resource. Resources with status live or beta are callable. - */ - public ApiResourceCoverage withStatus(ResourceStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the resource. Resources with status live or beta are callable. */ - public ApiResourceCoverage withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public ApiResourceCoverage withStatus(@Nullable ResourceStatus status) { this.status = status; return this; } - public ApiResourceCoverage withCoverage(List coverage) { - Utils.checkNotNull(coverage, "coverage"); - this.coverage = Optional.ofNullable(coverage); - return this; - } - - public ApiResourceCoverage withCoverage(Optional> coverage) { - Utils.checkNotNull(coverage, "coverage"); + public ApiResourceCoverage withCoverage(@Nullable List coverage) { this.coverage = coverage; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -205,90 +157,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private Optional status = Optional.empty(); + private ResourceStatus status; - private Optional> coverage = Optional.empty(); + private List coverage; private Builder() { // force use of static builder() method } - /** * ID of the resource, typically a lowercased version of name. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * ID of the resource, typically a lowercased version of name. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Name of the resource (plural) - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the resource (plural) */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * Status of the resource. Resources with status live or beta are callable. - */ - public Builder status(ResourceStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the resource. Resources with status live or beta are callable. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ResourceStatus status) { this.status = status; return this; } - - public Builder coverage(List coverage) { - Utils.checkNotNull(coverage, "coverage"); - this.coverage = Optional.ofNullable(coverage); - return this; - } - - public Builder coverage(Optional> coverage) { - Utils.checkNotNull(coverage, "coverage"); + public Builder coverage(@Nullable List coverage) { this.coverage = coverage; return this; } public ApiResourceCoverage build() { - return new ApiResourceCoverage( id, name, status, coverage); diff --git a/src/main/java/com/apideck/unify/models/components/ApisFilter.java b/src/main/java/com/apideck/unify/models/components/ApisFilter.java index 69d8a7ab..5d34a9f4 100644 --- a/src/main/java/com/apideck/unify/models/components/ApisFilter.java +++ b/src/main/java/com/apideck/unify/models/components/ApisFilter.java @@ -6,10 +6,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -18,26 +17,23 @@ public class ApisFilter { * Status of the API. APIs with status live or beta are callable. */ @SpeakeasyMetadata("queryParam:name=status") - private Optional status; + private ApiStatus status; @JsonCreator public ApisFilter( - Optional status) { - Utils.checkNotNull(status, "status"); + @Nullable ApiStatus status) { this.status = status; } public ApisFilter() { - this(Optional.empty()); + this(null); } /** * Status of the API. APIs with status live or beta are callable. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } public static Builder builder() { @@ -48,22 +44,12 @@ public static Builder builder() { /** * Status of the API. APIs with status live or beta are callable. */ - public ApisFilter withStatus(ApiStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - - /** - * Status of the API. APIs with status live or beta are callable. - */ - public ApisFilter withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public ApisFilter withStatus(@Nullable ApiStatus status) { this.status = status; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -92,33 +78,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional status = Optional.empty(); + private ApiStatus status; private Builder() { // force use of static builder() method } - - /** - * Status of the API. APIs with status live or beta are callable. - */ - public Builder status(ApiStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the API. APIs with status live or beta are callable. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ApiStatus status) { this.status = status; return this; } public ApisFilter build() { - return new ApisFilter( status); } diff --git a/src/main/java/com/apideck/unify/models/components/Applicant.java b/src/main/java/com/apideck/unify/models/components/Applicant.java index 2f8e8f2c..46c46ae1 100644 --- a/src/main/java/com/apideck/unify/models/components/Applicant.java +++ b/src/main/java/com/apideck/unify/models/components/Applicant.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -28,14 +27,14 @@ public class Applicant { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of an applicant. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * The first name of the person. @@ -75,7 +74,7 @@ public class Applicant { @JsonInclude(Include.NON_ABSENT) @JsonProperty("cover_letter") - private Optional coverLetter; + private String coverLetter; @JsonInclude(Include.NON_ABSENT) @@ -94,7 +93,7 @@ public class Applicant { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("headline") - private Optional headline; + private String headline; /** * The job title of the person. @@ -106,87 +105,87 @@ public class Applicant { @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("social_links") - private Optional> socialLinks; + private List socialLinks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("stage_id") - private Optional stageId; + private String stageId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("recruiter_id") - private Optional recruiterId; + private String recruiterId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("coordinator_id") - private Optional coordinatorId; + private String coordinatorId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("application_ids") - private JsonNullable> applicationIds; + private JsonNullable> applicationIds; @JsonInclude(Include.NON_ABSENT) @JsonProperty("applications") - private JsonNullable> applications; + private JsonNullable> applications; @JsonInclude(Include.NON_ABSENT) @JsonProperty("followers") - private JsonNullable> followers; + private JsonNullable> followers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("sources") - private JsonNullable> sources; + private JsonNullable> sources; @JsonInclude(Include.NON_ABSENT) @JsonProperty("source_id") - private Optional sourceId; + private String sourceId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("confidential") - private Optional confidential; + private Boolean confidential; @JsonInclude(Include.NON_ABSENT) @JsonProperty("anonymized") - private Optional anonymized; + private Boolean anonymized; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; @JsonInclude(Include.NON_ABSENT) @@ -211,7 +210,7 @@ public class Applicant { @JsonInclude(Include.NON_ABSENT) @JsonProperty("cv_url") - private Optional cvUrl; + private String cvUrl; @JsonInclude(Include.NON_ABSENT) @@ -228,7 +227,7 @@ public class Applicant { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * Flag to indicate if the object is deleted. @@ -284,112 +283,75 @@ public class Applicant { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Applicant( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("initials") JsonNullable initials, - @JsonProperty("birthday") JsonNullable birthday, - @JsonProperty("cover_letter") Optional coverLetter, - @JsonProperty("job_url") JsonNullable jobUrl, - @JsonProperty("photo_url") JsonNullable photoUrl, - @JsonProperty("headline") Optional headline, - @JsonProperty("title") JsonNullable title, - @JsonProperty("emails") Optional> emails, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("websites") Optional> websites, - @JsonProperty("social_links") Optional> socialLinks, - @JsonProperty("stage_id") Optional stageId, - @JsonProperty("recruiter_id") Optional recruiterId, - @JsonProperty("coordinator_id") Optional coordinatorId, - @JsonProperty("application_ids") JsonNullable> applicationIds, - @JsonProperty("applications") JsonNullable> applications, - @JsonProperty("followers") JsonNullable> followers, - @JsonProperty("sources") JsonNullable> sources, - @JsonProperty("source_id") Optional sourceId, - @JsonProperty("confidential") Optional confidential, - @JsonProperty("anonymized") Optional anonymized, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("archived") JsonNullable archived, - @JsonProperty("last_interaction_at") JsonNullable lastInteractionAt, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("sourced_by") JsonNullable sourcedBy, - @JsonProperty("cv_url") Optional cvUrl, - @JsonProperty("record_url") JsonNullable recordUrl, - @JsonProperty("rejected_at") JsonNullable rejectedAt, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("deleted") JsonNullable deleted, - @JsonProperty("deleted_by") JsonNullable deletedBy, - @JsonProperty("deleted_at") JsonNullable deletedAt, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(initials, "initials"); - Utils.checkNotNull(birthday, "birthday"); - Utils.checkNotNull(coverLetter, "coverLetter"); - Utils.checkNotNull(jobUrl, "jobUrl"); - Utils.checkNotNull(photoUrl, "photoUrl"); - Utils.checkNotNull(headline, "headline"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(socialLinks, "socialLinks"); - Utils.checkNotNull(stageId, "stageId"); - Utils.checkNotNull(recruiterId, "recruiterId"); - Utils.checkNotNull(coordinatorId, "coordinatorId"); - Utils.checkNotNull(applicationIds, "applicationIds"); - Utils.checkNotNull(applications, "applications"); - Utils.checkNotNull(followers, "followers"); - Utils.checkNotNull(sources, "sources"); - Utils.checkNotNull(sourceId, "sourceId"); - Utils.checkNotNull(confidential, "confidential"); - Utils.checkNotNull(anonymized, "anonymized"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(archived, "archived"); - Utils.checkNotNull(lastInteractionAt, "lastInteractionAt"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(sourcedBy, "sourcedBy"); - Utils.checkNotNull(cvUrl, "cvUrl"); - Utils.checkNotNull(recordUrl, "recordUrl"); - Utils.checkNotNull(rejectedAt, "rejectedAt"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(deleted, "deleted"); - Utils.checkNotNull(deletedBy, "deletedBy"); - Utils.checkNotNull(deletedAt, "deletedAt"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("initials") @Nullable JsonNullable initials, + @JsonProperty("birthday") @Nullable JsonNullable birthday, + @JsonProperty("cover_letter") @Nullable String coverLetter, + @JsonProperty("job_url") @Nullable JsonNullable jobUrl, + @JsonProperty("photo_url") @Nullable JsonNullable photoUrl, + @JsonProperty("headline") @Nullable String headline, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("social_links") @Nullable List socialLinks, + @JsonProperty("stage_id") @Nullable String stageId, + @JsonProperty("recruiter_id") @Nullable String recruiterId, + @JsonProperty("coordinator_id") @Nullable String coordinatorId, + @JsonProperty("application_ids") @Nullable JsonNullable> applicationIds, + @JsonProperty("applications") @Nullable JsonNullable> applications, + @JsonProperty("followers") @Nullable JsonNullable> followers, + @JsonProperty("sources") @Nullable JsonNullable> sources, + @JsonProperty("source_id") @Nullable String sourceId, + @JsonProperty("confidential") @Nullable Boolean confidential, + @JsonProperty("anonymized") @Nullable Boolean anonymized, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("archived") @Nullable JsonNullable archived, + @JsonProperty("last_interaction_at") @Nullable JsonNullable lastInteractionAt, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("sourced_by") @Nullable JsonNullable sourcedBy, + @JsonProperty("cv_url") @Nullable String cvUrl, + @JsonProperty("record_url") @Nullable JsonNullable recordUrl, + @JsonProperty("rejected_at") @Nullable JsonNullable rejectedAt, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("deleted") @Nullable JsonNullable deleted, + @JsonProperty("deleted_by") @Nullable JsonNullable deletedBy, + @JsonProperty("deleted_at") @Nullable JsonNullable deletedAt, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; this.name = name; - this.firstName = firstName; - this.lastName = lastName; - this.middleName = middleName; - this.initials = initials; - this.birthday = birthday; + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.initials = Optional.ofNullable(initials) + .orElse(JsonNullable.undefined()); + this.birthday = Optional.ofNullable(birthday) + .orElse(JsonNullable.undefined()); this.coverLetter = coverLetter; - this.jobUrl = jobUrl; - this.photoUrl = photoUrl; + this.jobUrl = Optional.ofNullable(jobUrl) + .orElse(JsonNullable.undefined()); + this.photoUrl = Optional.ofNullable(photoUrl) + .orElse(JsonNullable.undefined()); this.headline = headline; - this.title = title; + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); this.emails = emails; this.customFields = customFields; this.phoneNumbers = phoneNumbers; @@ -399,343 +361,304 @@ public Applicant( this.stageId = stageId; this.recruiterId = recruiterId; this.coordinatorId = coordinatorId; - this.applicationIds = applicationIds; - this.applications = applications; - this.followers = followers; - this.sources = sources; + this.applicationIds = Optional.ofNullable(applicationIds) + .orElse(JsonNullable.undefined()); + this.applications = Optional.ofNullable(applications) + .orElse(JsonNullable.undefined()); + this.followers = Optional.ofNullable(followers) + .orElse(JsonNullable.undefined()); + this.sources = Optional.ofNullable(sources) + .orElse(JsonNullable.undefined()); this.sourceId = sourceId; this.confidential = confidential; this.anonymized = anonymized; - this.tags = tags; - this.archived = archived; - this.lastInteractionAt = lastInteractionAt; - this.ownerId = ownerId; - this.sourcedBy = sourcedBy; + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); + this.archived = Optional.ofNullable(archived) + .orElse(JsonNullable.undefined()); + this.lastInteractionAt = Optional.ofNullable(lastInteractionAt) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.sourcedBy = Optional.ofNullable(sourcedBy) + .orElse(JsonNullable.undefined()); this.cvUrl = cvUrl; - this.recordUrl = recordUrl; - this.rejectedAt = rejectedAt; - this.customMappings = customMappings; - this.deleted = deleted; - this.deletedBy = deletedBy; - this.deletedAt = deletedAt; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.recordUrl = Optional.ofNullable(recordUrl) + .orElse(JsonNullable.undefined()); + this.rejectedAt = Optional.ofNullable(rejectedAt) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.deleted = Optional.ofNullable(deleted) + .orElse(JsonNullable.undefined()); + this.deletedBy = Optional.ofNullable(deletedBy) + .orElse(JsonNullable.undefined()); + this.deletedAt = Optional.ofNullable(deletedAt) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Applicant() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of an applicant. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Middle name of the person. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The initials of the person, usually derived from their first, middle, and last names. */ - @JsonIgnore public JsonNullable initials() { - return initials; + return this.initials; } /** * The date of birth of the person. */ - @JsonIgnore public JsonNullable birthday() { - return birthday; + return this.birthday; } - @JsonIgnore public Optional coverLetter() { - return coverLetter; + return Optional.ofNullable(this.coverLetter); } - @JsonIgnore public JsonNullable jobUrl() { - return jobUrl; + return this.jobUrl; } /** * The URL of the photo of a person. */ - @JsonIgnore public JsonNullable photoUrl() { - return photoUrl; + return this.photoUrl; } /** * Typically a list of previous companies where the contact has worked or schools that the contact has attended */ - @JsonIgnore public Optional headline() { - return headline; + return Optional.ofNullable(this.headline); } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> socialLinks() { - return (Optional>) socialLinks; + return Optional.ofNullable(this.socialLinks); } - @JsonIgnore public Optional stageId() { - return stageId; + return Optional.ofNullable(this.stageId); } - @JsonIgnore public Optional recruiterId() { - return recruiterId; + return Optional.ofNullable(this.recruiterId); } - @JsonIgnore public Optional coordinatorId() { - return coordinatorId; + return Optional.ofNullable(this.coordinatorId); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> applicationIds() { - return (JsonNullable>) applicationIds; + return this.applicationIds; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> applications() { - return (JsonNullable>) applications; + return this.applications; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> followers() { - return (JsonNullable>) followers; + return this.followers; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> sources() { - return (JsonNullable>) sources; + return this.sources; } - @JsonIgnore public Optional sourceId() { - return sourceId; + return Optional.ofNullable(this.sourceId); } - @JsonIgnore public Optional confidential() { - return confidential; + return Optional.ofNullable(this.confidential); } - @JsonIgnore public Optional anonymized() { - return anonymized; + return Optional.ofNullable(this.anonymized); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } - @JsonIgnore public JsonNullable archived() { - return archived; + return this.archived; } - @JsonIgnore public JsonNullable lastInteractionAt() { - return lastInteractionAt; + return this.lastInteractionAt; } - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } - @JsonIgnore public JsonNullable sourcedBy() { - return sourcedBy; + return this.sourcedBy; } - @JsonIgnore public Optional cvUrl() { - return cvUrl; + return Optional.ofNullable(this.cvUrl); } - @JsonIgnore public JsonNullable recordUrl() { - return recordUrl; + return this.recordUrl; } - @JsonIgnore public JsonNullable rejectedAt() { - return rejectedAt; + return this.rejectedAt; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * Flag to indicate if the object is deleted. */ - @JsonIgnore public JsonNullable deleted() { - return deleted; + return this.deleted; } /** * The user who deleted the object. */ - @JsonIgnore public JsonNullable deletedBy() { - return deletedBy; + return this.deletedBy; } /** * The time at which the object was deleted. */ - @JsonIgnore public JsonNullable deletedAt() { - return deletedAt; + return this.deletedAt; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -746,675 +669,330 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Applicant withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Applicant withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Applicant withId(@Nullable String id) { this.id = id; return this; } - /** - * The name of an applicant. - */ - public Applicant withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of an applicant. */ - public Applicant withName(Optional name) { - Utils.checkNotNull(name, "name"); + public Applicant withName(@Nullable String name) { this.name = name; return this; } + /** * The first name of the person. */ - public Applicant withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Applicant withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Applicant withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public Applicant withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Applicant withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Applicant withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Middle name of the person. */ - public Applicant withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Applicant withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Applicant withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The initials of the person, usually derived from their first, middle, and last names. */ - public Applicant withInitials(String initials) { - Utils.checkNotNull(initials, "initials"); + public Applicant withInitials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * The initials of the person, usually derived from their first, middle, and last names. - */ - public Applicant withInitials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } /** * The date of birth of the person. */ - public Applicant withBirthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Applicant withBirthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public Applicant withBirthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - public Applicant withCoverLetter(String coverLetter) { - Utils.checkNotNull(coverLetter, "coverLetter"); - this.coverLetter = Optional.ofNullable(coverLetter); - return this; - } - - public Applicant withCoverLetter(Optional coverLetter) { - Utils.checkNotNull(coverLetter, "coverLetter"); + public Applicant withCoverLetter(@Nullable String coverLetter) { this.coverLetter = coverLetter; return this; } - public Applicant withJobUrl(String jobUrl) { - Utils.checkNotNull(jobUrl, "jobUrl"); + + public Applicant withJobUrl(@Nullable String jobUrl) { this.jobUrl = JsonNullable.of(jobUrl); return this; } - public Applicant withJobUrl(JsonNullable jobUrl) { - Utils.checkNotNull(jobUrl, "jobUrl"); - this.jobUrl = jobUrl; - return this; - } /** * The URL of the photo of a person. */ - public Applicant withPhotoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public Applicant withPhotoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public Applicant withPhotoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } /** * Typically a list of previous companies where the contact has worked or schools that the contact has attended */ - public Applicant withHeadline(String headline) { - Utils.checkNotNull(headline, "headline"); - this.headline = Optional.ofNullable(headline); - return this; - } - - - /** - * Typically a list of previous companies where the contact has worked or schools that the contact has attended - */ - public Applicant withHeadline(Optional headline) { - Utils.checkNotNull(headline, "headline"); + public Applicant withHeadline(@Nullable String headline) { this.headline = headline; return this; } - /** - * The job title of the person. - */ - public Applicant withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = JsonNullable.of(title); - return this; - } /** * The job title of the person. */ - public Applicant withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - public Applicant withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); + public Applicant withTitle(@Nullable String title) { + this.title = JsonNullable.of(title); return this; } - public Applicant withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Applicant withEmails(@Nullable List emails) { this.emails = emails; return this; } - public Applicant withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Applicant withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Applicant withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - public Applicant withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Applicant withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Applicant withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Applicant withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Applicant withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Applicant withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public Applicant withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Applicant withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Applicant withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public Applicant withSocialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Applicant withSocialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Applicant withSocialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - public Applicant withStageId(String stageId) { - Utils.checkNotNull(stageId, "stageId"); - this.stageId = Optional.ofNullable(stageId); - return this; - } - - public Applicant withStageId(Optional stageId) { - Utils.checkNotNull(stageId, "stageId"); + public Applicant withStageId(@Nullable String stageId) { this.stageId = stageId; return this; } - public Applicant withRecruiterId(String recruiterId) { - Utils.checkNotNull(recruiterId, "recruiterId"); - this.recruiterId = Optional.ofNullable(recruiterId); - return this; - } - - public Applicant withRecruiterId(Optional recruiterId) { - Utils.checkNotNull(recruiterId, "recruiterId"); + public Applicant withRecruiterId(@Nullable String recruiterId) { this.recruiterId = recruiterId; return this; } - public Applicant withCoordinatorId(String coordinatorId) { - Utils.checkNotNull(coordinatorId, "coordinatorId"); - this.coordinatorId = Optional.ofNullable(coordinatorId); - return this; - } - - public Applicant withCoordinatorId(Optional coordinatorId) { - Utils.checkNotNull(coordinatorId, "coordinatorId"); + public Applicant withCoordinatorId(@Nullable String coordinatorId) { this.coordinatorId = coordinatorId; return this; } - public Applicant withApplicationIds(List applicationIds) { - Utils.checkNotNull(applicationIds, "applicationIds"); + + public Applicant withApplicationIds(@Nullable List applicationIds) { this.applicationIds = JsonNullable.of(applicationIds); return this; } - public Applicant withApplicationIds(JsonNullable> applicationIds) { - Utils.checkNotNull(applicationIds, "applicationIds"); - this.applicationIds = applicationIds; - return this; - } - public Applicant withApplications(List applications) { - Utils.checkNotNull(applications, "applications"); + public Applicant withApplications(@Nullable List applications) { this.applications = JsonNullable.of(applications); return this; } - public Applicant withApplications(JsonNullable> applications) { - Utils.checkNotNull(applications, "applications"); - this.applications = applications; - return this; - } - public Applicant withFollowers(List followers) { - Utils.checkNotNull(followers, "followers"); + public Applicant withFollowers(@Nullable List followers) { this.followers = JsonNullable.of(followers); return this; } - public Applicant withFollowers(JsonNullable> followers) { - Utils.checkNotNull(followers, "followers"); - this.followers = followers; - return this; - } - public Applicant withSources(List sources) { - Utils.checkNotNull(sources, "sources"); + public Applicant withSources(@Nullable List sources) { this.sources = JsonNullable.of(sources); return this; } - public Applicant withSources(JsonNullable> sources) { - Utils.checkNotNull(sources, "sources"); - this.sources = sources; - return this; - } - - public Applicant withSourceId(String sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); - this.sourceId = Optional.ofNullable(sourceId); - return this; - } - - public Applicant withSourceId(Optional sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); + public Applicant withSourceId(@Nullable String sourceId) { this.sourceId = sourceId; return this; } - public Applicant withConfidential(boolean confidential) { - Utils.checkNotNull(confidential, "confidential"); - this.confidential = Optional.ofNullable(confidential); - return this; - } - - public Applicant withConfidential(Optional confidential) { - Utils.checkNotNull(confidential, "confidential"); + public Applicant withConfidential(@Nullable Boolean confidential) { this.confidential = confidential; return this; } - public Applicant withAnonymized(boolean anonymized) { - Utils.checkNotNull(anonymized, "anonymized"); - this.anonymized = Optional.ofNullable(anonymized); - return this; - } - - public Applicant withAnonymized(Optional anonymized) { - Utils.checkNotNull(anonymized, "anonymized"); + public Applicant withAnonymized(@Nullable Boolean anonymized) { this.anonymized = anonymized; return this; } - public Applicant withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + + public Applicant withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Applicant withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - public Applicant withArchived(boolean archived) { - Utils.checkNotNull(archived, "archived"); + public Applicant withArchived(@Nullable Boolean archived) { this.archived = JsonNullable.of(archived); return this; } - public Applicant withArchived(JsonNullable archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = archived; - return this; - } - public Applicant withLastInteractionAt(OffsetDateTime lastInteractionAt) { - Utils.checkNotNull(lastInteractionAt, "lastInteractionAt"); + public Applicant withLastInteractionAt(@Nullable OffsetDateTime lastInteractionAt) { this.lastInteractionAt = JsonNullable.of(lastInteractionAt); return this; } - public Applicant withLastInteractionAt(JsonNullable lastInteractionAt) { - Utils.checkNotNull(lastInteractionAt, "lastInteractionAt"); - this.lastInteractionAt = lastInteractionAt; - return this; - } - public Applicant withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Applicant withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - public Applicant withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - public Applicant withSourcedBy(String sourcedBy) { - Utils.checkNotNull(sourcedBy, "sourcedBy"); + public Applicant withSourcedBy(@Nullable String sourcedBy) { this.sourcedBy = JsonNullable.of(sourcedBy); return this; } - public Applicant withSourcedBy(JsonNullable sourcedBy) { - Utils.checkNotNull(sourcedBy, "sourcedBy"); - this.sourcedBy = sourcedBy; - return this; - } - - public Applicant withCvUrl(String cvUrl) { - Utils.checkNotNull(cvUrl, "cvUrl"); - this.cvUrl = Optional.ofNullable(cvUrl); - return this; - } - - public Applicant withCvUrl(Optional cvUrl) { - Utils.checkNotNull(cvUrl, "cvUrl"); + public Applicant withCvUrl(@Nullable String cvUrl) { this.cvUrl = cvUrl; return this; } - public Applicant withRecordUrl(String recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); + + public Applicant withRecordUrl(@Nullable String recordUrl) { this.recordUrl = JsonNullable.of(recordUrl); return this; } - public Applicant withRecordUrl(JsonNullable recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); - this.recordUrl = recordUrl; - return this; - } - public Applicant withRejectedAt(OffsetDateTime rejectedAt) { - Utils.checkNotNull(rejectedAt, "rejectedAt"); + public Applicant withRejectedAt(@Nullable OffsetDateTime rejectedAt) { this.rejectedAt = JsonNullable.of(rejectedAt); return this; } - public Applicant withRejectedAt(JsonNullable rejectedAt) { - Utils.checkNotNull(rejectedAt, "rejectedAt"); - this.rejectedAt = rejectedAt; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Applicant withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Applicant withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Applicant withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * Flag to indicate if the object is deleted. */ - public Applicant withDeleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Applicant withDeleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Flag to indicate if the object is deleted. - */ - public Applicant withDeleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } /** * The user who deleted the object. */ - public Applicant withDeletedBy(String deletedBy) { - Utils.checkNotNull(deletedBy, "deletedBy"); + public Applicant withDeletedBy(@Nullable String deletedBy) { this.deletedBy = JsonNullable.of(deletedBy); return this; } - /** - * The user who deleted the object. - */ - public Applicant withDeletedBy(JsonNullable deletedBy) { - Utils.checkNotNull(deletedBy, "deletedBy"); - this.deletedBy = deletedBy; - return this; - } /** * The time at which the object was deleted. */ - public Applicant withDeletedAt(OffsetDateTime deletedAt) { - Utils.checkNotNull(deletedAt, "deletedAt"); + public Applicant withDeletedAt(@Nullable OffsetDateTime deletedAt) { this.deletedAt = JsonNullable.of(deletedAt); return this; } - /** - * The time at which the object was deleted. - */ - public Applicant withDeletedAt(JsonNullable deletedAt) { - Utils.checkNotNull(deletedAt, "deletedAt"); - this.deletedAt = deletedAt; - return this; - } /** * The user who last updated the object. */ - public Applicant withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Applicant withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Applicant withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Applicant withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Applicant withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Applicant withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Applicant withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Applicant withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Applicant withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Applicant withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Applicant withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Applicant withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Applicant withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Applicant withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Applicant withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1545,801 +1123,383 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable initials = JsonNullable.undefined(); + private JsonNullable initials; - private JsonNullable birthday = JsonNullable.undefined(); + private JsonNullable birthday; - private Optional coverLetter = Optional.empty(); + private String coverLetter; - private JsonNullable jobUrl = JsonNullable.undefined(); + private JsonNullable jobUrl; - private JsonNullable photoUrl = JsonNullable.undefined(); + private JsonNullable photoUrl; - private Optional headline = Optional.empty(); + private String headline; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private Optional> emails = Optional.empty(); + private List emails; - private Optional> customFields = Optional.empty(); + private List customFields; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> socialLinks = Optional.empty(); + private List socialLinks; - private Optional stageId = Optional.empty(); + private String stageId; - private Optional recruiterId = Optional.empty(); + private String recruiterId; - private Optional coordinatorId = Optional.empty(); + private String coordinatorId; - private JsonNullable> applicationIds = JsonNullable.undefined(); + private JsonNullable> applicationIds; - private JsonNullable> applications = JsonNullable.undefined(); + private JsonNullable> applications; - private JsonNullable> followers = JsonNullable.undefined(); + private JsonNullable> followers; - private JsonNullable> sources = JsonNullable.undefined(); + private JsonNullable> sources; - private Optional sourceId = Optional.empty(); + private String sourceId; - private Optional confidential = Optional.empty(); + private Boolean confidential; - private Optional anonymized = Optional.empty(); + private Boolean anonymized; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private JsonNullable archived = JsonNullable.undefined(); + private JsonNullable archived; - private JsonNullable lastInteractionAt = JsonNullable.undefined(); + private JsonNullable lastInteractionAt; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable sourcedBy = JsonNullable.undefined(); + private JsonNullable sourcedBy; - private Optional cvUrl = Optional.empty(); + private String cvUrl; - private JsonNullable recordUrl = JsonNullable.undefined(); + private JsonNullable recordUrl; - private JsonNullable rejectedAt = JsonNullable.undefined(); + private JsonNullable rejectedAt; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable deleted = JsonNullable.undefined(); + private JsonNullable deleted; - private JsonNullable deletedBy = JsonNullable.undefined(); + private JsonNullable deletedBy; - private JsonNullable deletedAt = JsonNullable.undefined(); + private JsonNullable deletedAt; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of an applicant. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * The name of an applicant. - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Middle name of the person. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The initials of the person, usually derived from their first, middle, and last names. */ - public Builder initials(String initials) { - Utils.checkNotNull(initials, "initials"); + public Builder initials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * The initials of the person, usually derived from their first, middle, and last names. - */ - public Builder initials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } - - /** * The date of birth of the person. */ - public Builder birthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Builder birthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public Builder birthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - - public Builder coverLetter(String coverLetter) { - Utils.checkNotNull(coverLetter, "coverLetter"); - this.coverLetter = Optional.ofNullable(coverLetter); - return this; - } - - public Builder coverLetter(Optional coverLetter) { - Utils.checkNotNull(coverLetter, "coverLetter"); + public Builder coverLetter(@Nullable String coverLetter) { this.coverLetter = coverLetter; return this; } - - public Builder jobUrl(String jobUrl) { - Utils.checkNotNull(jobUrl, "jobUrl"); + public Builder jobUrl(@Nullable String jobUrl) { this.jobUrl = JsonNullable.of(jobUrl); return this; } - public Builder jobUrl(JsonNullable jobUrl) { - Utils.checkNotNull(jobUrl, "jobUrl"); - this.jobUrl = jobUrl; - return this; - } - - /** * The URL of the photo of a person. */ - public Builder photoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public Builder photoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public Builder photoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } - - - /** - * Typically a list of previous companies where the contact has worked or schools that the contact has attended - */ - public Builder headline(String headline) { - Utils.checkNotNull(headline, "headline"); - this.headline = Optional.ofNullable(headline); - return this; - } - /** * Typically a list of previous companies where the contact has worked or schools that the contact has attended */ - public Builder headline(Optional headline) { - Utils.checkNotNull(headline, "headline"); + public Builder headline(@Nullable String headline) { this.headline = headline; return this; } - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder socialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Builder socialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Builder socialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - - public Builder stageId(String stageId) { - Utils.checkNotNull(stageId, "stageId"); - this.stageId = Optional.ofNullable(stageId); - return this; - } - - public Builder stageId(Optional stageId) { - Utils.checkNotNull(stageId, "stageId"); + public Builder stageId(@Nullable String stageId) { this.stageId = stageId; return this; } - - public Builder recruiterId(String recruiterId) { - Utils.checkNotNull(recruiterId, "recruiterId"); - this.recruiterId = Optional.ofNullable(recruiterId); - return this; - } - - public Builder recruiterId(Optional recruiterId) { - Utils.checkNotNull(recruiterId, "recruiterId"); + public Builder recruiterId(@Nullable String recruiterId) { this.recruiterId = recruiterId; return this; } - - public Builder coordinatorId(String coordinatorId) { - Utils.checkNotNull(coordinatorId, "coordinatorId"); - this.coordinatorId = Optional.ofNullable(coordinatorId); - return this; - } - - public Builder coordinatorId(Optional coordinatorId) { - Utils.checkNotNull(coordinatorId, "coordinatorId"); + public Builder coordinatorId(@Nullable String coordinatorId) { this.coordinatorId = coordinatorId; return this; } - - public Builder applicationIds(List applicationIds) { - Utils.checkNotNull(applicationIds, "applicationIds"); + public Builder applicationIds(@Nullable List applicationIds) { this.applicationIds = JsonNullable.of(applicationIds); return this; } - public Builder applicationIds(JsonNullable> applicationIds) { - Utils.checkNotNull(applicationIds, "applicationIds"); - this.applicationIds = applicationIds; - return this; - } - - - public Builder applications(List applications) { - Utils.checkNotNull(applications, "applications"); + public Builder applications(@Nullable List applications) { this.applications = JsonNullable.of(applications); return this; } - public Builder applications(JsonNullable> applications) { - Utils.checkNotNull(applications, "applications"); - this.applications = applications; - return this; - } - - - public Builder followers(List followers) { - Utils.checkNotNull(followers, "followers"); + public Builder followers(@Nullable List followers) { this.followers = JsonNullable.of(followers); return this; } - public Builder followers(JsonNullable> followers) { - Utils.checkNotNull(followers, "followers"); - this.followers = followers; - return this; - } - - - public Builder sources(List sources) { - Utils.checkNotNull(sources, "sources"); + public Builder sources(@Nullable List sources) { this.sources = JsonNullable.of(sources); return this; } - public Builder sources(JsonNullable> sources) { - Utils.checkNotNull(sources, "sources"); - this.sources = sources; - return this; - } - - - public Builder sourceId(String sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); - this.sourceId = Optional.ofNullable(sourceId); - return this; - } - - public Builder sourceId(Optional sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); + public Builder sourceId(@Nullable String sourceId) { this.sourceId = sourceId; return this; } - - public Builder confidential(boolean confidential) { - Utils.checkNotNull(confidential, "confidential"); - this.confidential = Optional.ofNullable(confidential); - return this; - } - - public Builder confidential(Optional confidential) { - Utils.checkNotNull(confidential, "confidential"); + public Builder confidential(@Nullable Boolean confidential) { this.confidential = confidential; return this; } - - public Builder anonymized(boolean anonymized) { - Utils.checkNotNull(anonymized, "anonymized"); - this.anonymized = Optional.ofNullable(anonymized); - return this; - } - - public Builder anonymized(Optional anonymized) { - Utils.checkNotNull(anonymized, "anonymized"); + public Builder anonymized(@Nullable Boolean anonymized) { this.anonymized = anonymized; return this; } - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - - public Builder archived(boolean archived) { - Utils.checkNotNull(archived, "archived"); + public Builder archived(@Nullable Boolean archived) { this.archived = JsonNullable.of(archived); return this; } - public Builder archived(JsonNullable archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = archived; - return this; - } - - - public Builder lastInteractionAt(OffsetDateTime lastInteractionAt) { - Utils.checkNotNull(lastInteractionAt, "lastInteractionAt"); + public Builder lastInteractionAt(@Nullable OffsetDateTime lastInteractionAt) { this.lastInteractionAt = JsonNullable.of(lastInteractionAt); return this; } - public Builder lastInteractionAt(JsonNullable lastInteractionAt) { - Utils.checkNotNull(lastInteractionAt, "lastInteractionAt"); - this.lastInteractionAt = lastInteractionAt; - return this; - } - - - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - - public Builder sourcedBy(String sourcedBy) { - Utils.checkNotNull(sourcedBy, "sourcedBy"); + public Builder sourcedBy(@Nullable String sourcedBy) { this.sourcedBy = JsonNullable.of(sourcedBy); return this; } - public Builder sourcedBy(JsonNullable sourcedBy) { - Utils.checkNotNull(sourcedBy, "sourcedBy"); - this.sourcedBy = sourcedBy; - return this; - } - - - public Builder cvUrl(String cvUrl) { - Utils.checkNotNull(cvUrl, "cvUrl"); - this.cvUrl = Optional.ofNullable(cvUrl); - return this; - } - - public Builder cvUrl(Optional cvUrl) { - Utils.checkNotNull(cvUrl, "cvUrl"); + public Builder cvUrl(@Nullable String cvUrl) { this.cvUrl = cvUrl; return this; } - - public Builder recordUrl(String recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); + public Builder recordUrl(@Nullable String recordUrl) { this.recordUrl = JsonNullable.of(recordUrl); return this; } - public Builder recordUrl(JsonNullable recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); - this.recordUrl = recordUrl; - return this; - } - - - public Builder rejectedAt(OffsetDateTime rejectedAt) { - Utils.checkNotNull(rejectedAt, "rejectedAt"); + public Builder rejectedAt(@Nullable OffsetDateTime rejectedAt) { this.rejectedAt = JsonNullable.of(rejectedAt); return this; } - public Builder rejectedAt(JsonNullable rejectedAt) { - Utils.checkNotNull(rejectedAt, "rejectedAt"); - this.rejectedAt = rejectedAt; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * Flag to indicate if the object is deleted. */ - public Builder deleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Builder deleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Flag to indicate if the object is deleted. - */ - public Builder deleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - - /** * The user who deleted the object. */ - public Builder deletedBy(String deletedBy) { - Utils.checkNotNull(deletedBy, "deletedBy"); + public Builder deletedBy(@Nullable String deletedBy) { this.deletedBy = JsonNullable.of(deletedBy); return this; } - /** - * The user who deleted the object. - */ - public Builder deletedBy(JsonNullable deletedBy) { - Utils.checkNotNull(deletedBy, "deletedBy"); - this.deletedBy = deletedBy; - return this; - } - - /** * The time at which the object was deleted. */ - public Builder deletedAt(OffsetDateTime deletedAt) { - Utils.checkNotNull(deletedAt, "deletedAt"); + public Builder deletedAt(@Nullable OffsetDateTime deletedAt) { this.deletedAt = JsonNullable.of(deletedAt); return this; } - /** - * The time at which the object was deleted. - */ - public Builder deletedAt(JsonNullable deletedAt) { - Utils.checkNotNull(deletedAt, "deletedAt"); - this.deletedAt = deletedAt; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Applicant build() { - return new Applicant( id, name, firstName, lastName, middleName, initials, diff --git a/src/main/java/com/apideck/unify/models/components/ApplicantInput.java b/src/main/java/com/apideck/unify/models/components/ApplicantInput.java index 7ec51fa2..b70d5e05 100644 --- a/src/main/java/com/apideck/unify/models/components/ApplicantInput.java +++ b/src/main/java/com/apideck/unify/models/components/ApplicantInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -25,7 +24,7 @@ public class ApplicantInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * The first name of the person. @@ -65,7 +64,7 @@ public class ApplicantInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("cover_letter") - private Optional coverLetter; + private String coverLetter; /** * The URL of the photo of a person. @@ -79,7 +78,7 @@ public class ApplicantInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("headline") - private Optional headline; + private String headline; /** * The job title of the person. @@ -91,82 +90,82 @@ public class ApplicantInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("social_links") - private Optional> socialLinks; + private List socialLinks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("stage_id") - private Optional stageId; + private String stageId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("recruiter_id") - private Optional recruiterId; + private String recruiterId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("coordinator_id") - private Optional coordinatorId; + private String coordinatorId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("application_ids") - private JsonNullable> applicationIds; + private JsonNullable> applicationIds; @JsonInclude(Include.NON_ABSENT) @JsonProperty("applications") - private JsonNullable> applications; + private JsonNullable> applications; @JsonInclude(Include.NON_ABSENT) @JsonProperty("followers") - private JsonNullable> followers; + private JsonNullable> followers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("sources") - private JsonNullable> sources; + private JsonNullable> sources; @JsonInclude(Include.NON_ABSENT) @JsonProperty("confidential") - private Optional confidential; + private Boolean confidential; @JsonInclude(Include.NON_ABSENT) @JsonProperty("anonymized") - private Optional anonymized; + private Boolean anonymized; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; @JsonInclude(Include.NON_ABSENT) @@ -195,82 +194,58 @@ public class ApplicantInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public ApplicantInput( - @JsonProperty("name") Optional name, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("initials") JsonNullable initials, - @JsonProperty("birthday") JsonNullable birthday, - @JsonProperty("cover_letter") Optional coverLetter, - @JsonProperty("photo_url") JsonNullable photoUrl, - @JsonProperty("headline") Optional headline, - @JsonProperty("title") JsonNullable title, - @JsonProperty("emails") Optional> emails, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("websites") Optional> websites, - @JsonProperty("social_links") Optional> socialLinks, - @JsonProperty("stage_id") Optional stageId, - @JsonProperty("recruiter_id") Optional recruiterId, - @JsonProperty("coordinator_id") Optional coordinatorId, - @JsonProperty("application_ids") JsonNullable> applicationIds, - @JsonProperty("applications") JsonNullable> applications, - @JsonProperty("followers") JsonNullable> followers, - @JsonProperty("sources") JsonNullable> sources, - @JsonProperty("confidential") Optional confidential, - @JsonProperty("anonymized") Optional anonymized, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("archived") JsonNullable archived, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("record_url") JsonNullable recordUrl, - @JsonProperty("deleted") JsonNullable deleted, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(initials, "initials"); - Utils.checkNotNull(birthday, "birthday"); - Utils.checkNotNull(coverLetter, "coverLetter"); - Utils.checkNotNull(photoUrl, "photoUrl"); - Utils.checkNotNull(headline, "headline"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(socialLinks, "socialLinks"); - Utils.checkNotNull(stageId, "stageId"); - Utils.checkNotNull(recruiterId, "recruiterId"); - Utils.checkNotNull(coordinatorId, "coordinatorId"); - Utils.checkNotNull(applicationIds, "applicationIds"); - Utils.checkNotNull(applications, "applications"); - Utils.checkNotNull(followers, "followers"); - Utils.checkNotNull(sources, "sources"); - Utils.checkNotNull(confidential, "confidential"); - Utils.checkNotNull(anonymized, "anonymized"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(archived, "archived"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(recordUrl, "recordUrl"); - Utils.checkNotNull(deleted, "deleted"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("name") @Nullable String name, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("initials") @Nullable JsonNullable initials, + @JsonProperty("birthday") @Nullable JsonNullable birthday, + @JsonProperty("cover_letter") @Nullable String coverLetter, + @JsonProperty("photo_url") @Nullable JsonNullable photoUrl, + @JsonProperty("headline") @Nullable String headline, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("social_links") @Nullable List socialLinks, + @JsonProperty("stage_id") @Nullable String stageId, + @JsonProperty("recruiter_id") @Nullable String recruiterId, + @JsonProperty("coordinator_id") @Nullable String coordinatorId, + @JsonProperty("application_ids") @Nullable JsonNullable> applicationIds, + @JsonProperty("applications") @Nullable JsonNullable> applications, + @JsonProperty("followers") @Nullable JsonNullable> followers, + @JsonProperty("sources") @Nullable JsonNullable> sources, + @JsonProperty("confidential") @Nullable Boolean confidential, + @JsonProperty("anonymized") @Nullable Boolean anonymized, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("archived") @Nullable JsonNullable archived, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("record_url") @Nullable JsonNullable recordUrl, + @JsonProperty("deleted") @Nullable JsonNullable deleted, + @JsonProperty("pass_through") @Nullable List passThrough) { this.name = name; - this.firstName = firstName; - this.lastName = lastName; - this.middleName = middleName; - this.initials = initials; - this.birthday = birthday; + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.initials = Optional.ofNullable(initials) + .orElse(JsonNullable.undefined()); + this.birthday = Optional.ofNullable(birthday) + .orElse(JsonNullable.undefined()); this.coverLetter = coverLetter; - this.photoUrl = photoUrl; + this.photoUrl = Optional.ofNullable(photoUrl) + .orElse(JsonNullable.undefined()); this.headline = headline; - this.title = title; + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); this.emails = emails; this.customFields = customFields; this.phoneNumbers = phoneNumbers; @@ -280,232 +255,198 @@ public ApplicantInput( this.stageId = stageId; this.recruiterId = recruiterId; this.coordinatorId = coordinatorId; - this.applicationIds = applicationIds; - this.applications = applications; - this.followers = followers; - this.sources = sources; + this.applicationIds = Optional.ofNullable(applicationIds) + .orElse(JsonNullable.undefined()); + this.applications = Optional.ofNullable(applications) + .orElse(JsonNullable.undefined()); + this.followers = Optional.ofNullable(followers) + .orElse(JsonNullable.undefined()); + this.sources = Optional.ofNullable(sources) + .orElse(JsonNullable.undefined()); this.confidential = confidential; this.anonymized = anonymized; - this.tags = tags; - this.archived = archived; - this.ownerId = ownerId; - this.recordUrl = recordUrl; - this.deleted = deleted; + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); + this.archived = Optional.ofNullable(archived) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.recordUrl = Optional.ofNullable(recordUrl) + .orElse(JsonNullable.undefined()); + this.deleted = Optional.ofNullable(deleted) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public ApplicantInput() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * The name of an applicant. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Middle name of the person. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The initials of the person, usually derived from their first, middle, and last names. */ - @JsonIgnore public JsonNullable initials() { - return initials; + return this.initials; } /** * The date of birth of the person. */ - @JsonIgnore public JsonNullable birthday() { - return birthday; + return this.birthday; } - @JsonIgnore public Optional coverLetter() { - return coverLetter; + return Optional.ofNullable(this.coverLetter); } /** * The URL of the photo of a person. */ - @JsonIgnore public JsonNullable photoUrl() { - return photoUrl; + return this.photoUrl; } /** * Typically a list of previous companies where the contact has worked or schools that the contact has attended */ - @JsonIgnore public Optional headline() { - return headline; + return Optional.ofNullable(this.headline); } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> socialLinks() { - return (Optional>) socialLinks; + return Optional.ofNullable(this.socialLinks); } - @JsonIgnore public Optional stageId() { - return stageId; + return Optional.ofNullable(this.stageId); } - @JsonIgnore public Optional recruiterId() { - return recruiterId; + return Optional.ofNullable(this.recruiterId); } - @JsonIgnore public Optional coordinatorId() { - return coordinatorId; + return Optional.ofNullable(this.coordinatorId); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> applicationIds() { - return (JsonNullable>) applicationIds; + return this.applicationIds; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> applications() { - return (JsonNullable>) applications; + return this.applications; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> followers() { - return (JsonNullable>) followers; + return this.followers; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> sources() { - return (JsonNullable>) sources; + return this.sources; } - @JsonIgnore public Optional confidential() { - return confidential; + return Optional.ofNullable(this.confidential); } - @JsonIgnore public Optional anonymized() { - return anonymized; + return Optional.ofNullable(this.anonymized); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } - @JsonIgnore public JsonNullable archived() { - return archived; + return this.archived; } - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } - @JsonIgnore public JsonNullable recordUrl() { - return recordUrl; + return this.recordUrl; } /** * Flag to indicate if the object is deleted. */ - @JsonIgnore public JsonNullable deleted() { - return deleted; + return this.deleted; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -516,149 +457,68 @@ public static Builder builder() { /** * The name of an applicant. */ - public ApplicantInput withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - /** - * The name of an applicant. - */ - public ApplicantInput withName(Optional name) { - Utils.checkNotNull(name, "name"); + public ApplicantInput withName(@Nullable String name) { this.name = name; return this; } + /** * The first name of the person. */ - public ApplicantInput withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public ApplicantInput withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public ApplicantInput withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public ApplicantInput withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public ApplicantInput withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public ApplicantInput withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Middle name of the person. */ - public ApplicantInput withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public ApplicantInput withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public ApplicantInput withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The initials of the person, usually derived from their first, middle, and last names. */ - public ApplicantInput withInitials(String initials) { - Utils.checkNotNull(initials, "initials"); + public ApplicantInput withInitials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * The initials of the person, usually derived from their first, middle, and last names. - */ - public ApplicantInput withInitials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } /** * The date of birth of the person. */ - public ApplicantInput withBirthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public ApplicantInput withBirthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public ApplicantInput withBirthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - public ApplicantInput withCoverLetter(String coverLetter) { - Utils.checkNotNull(coverLetter, "coverLetter"); - this.coverLetter = Optional.ofNullable(coverLetter); - return this; - } - - public ApplicantInput withCoverLetter(Optional coverLetter) { - Utils.checkNotNull(coverLetter, "coverLetter"); + public ApplicantInput withCoverLetter(@Nullable String coverLetter) { this.coverLetter = coverLetter; return this; } - /** - * The URL of the photo of a person. - */ - public ApplicantInput withPhotoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = JsonNullable.of(photoUrl); - return this; - } /** * The URL of the photo of a person. */ - public ApplicantInput withPhotoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } - - /** - * Typically a list of previous companies where the contact has worked or schools that the contact has attended - */ - public ApplicantInput withHeadline(String headline) { - Utils.checkNotNull(headline, "headline"); - this.headline = Optional.ofNullable(headline); + public ApplicantInput withPhotoUrl(@Nullable String photoUrl) { + this.photoUrl = JsonNullable.of(photoUrl); return this; } @@ -666,306 +526,153 @@ public ApplicantInput withHeadline(String headline) { /** * Typically a list of previous companies where the contact has worked or schools that the contact has attended */ - public ApplicantInput withHeadline(Optional headline) { - Utils.checkNotNull(headline, "headline"); + public ApplicantInput withHeadline(@Nullable String headline) { this.headline = headline; return this; } - /** - * The job title of the person. - */ - public ApplicantInput withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = JsonNullable.of(title); - return this; - } /** * The job title of the person. */ - public ApplicantInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - public ApplicantInput withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); + public ApplicantInput withTitle(@Nullable String title) { + this.title = JsonNullable.of(title); return this; } - public ApplicantInput withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public ApplicantInput withEmails(@Nullable List emails) { this.emails = emails; return this; } - public ApplicantInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public ApplicantInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public ApplicantInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - public ApplicantInput withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public ApplicantInput withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public ApplicantInput withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public ApplicantInput withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public ApplicantInput withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public ApplicantInput withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public ApplicantInput withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public ApplicantInput withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public ApplicantInput withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public ApplicantInput withSocialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public ApplicantInput withSocialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public ApplicantInput withSocialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - public ApplicantInput withStageId(String stageId) { - Utils.checkNotNull(stageId, "stageId"); - this.stageId = Optional.ofNullable(stageId); - return this; - } - - public ApplicantInput withStageId(Optional stageId) { - Utils.checkNotNull(stageId, "stageId"); + public ApplicantInput withStageId(@Nullable String stageId) { this.stageId = stageId; return this; } - public ApplicantInput withRecruiterId(String recruiterId) { - Utils.checkNotNull(recruiterId, "recruiterId"); - this.recruiterId = Optional.ofNullable(recruiterId); - return this; - } - - public ApplicantInput withRecruiterId(Optional recruiterId) { - Utils.checkNotNull(recruiterId, "recruiterId"); + public ApplicantInput withRecruiterId(@Nullable String recruiterId) { this.recruiterId = recruiterId; return this; } - public ApplicantInput withCoordinatorId(String coordinatorId) { - Utils.checkNotNull(coordinatorId, "coordinatorId"); - this.coordinatorId = Optional.ofNullable(coordinatorId); - return this; - } - - public ApplicantInput withCoordinatorId(Optional coordinatorId) { - Utils.checkNotNull(coordinatorId, "coordinatorId"); + public ApplicantInput withCoordinatorId(@Nullable String coordinatorId) { this.coordinatorId = coordinatorId; return this; } - public ApplicantInput withApplicationIds(List applicationIds) { - Utils.checkNotNull(applicationIds, "applicationIds"); + + public ApplicantInput withApplicationIds(@Nullable List applicationIds) { this.applicationIds = JsonNullable.of(applicationIds); return this; } - public ApplicantInput withApplicationIds(JsonNullable> applicationIds) { - Utils.checkNotNull(applicationIds, "applicationIds"); - this.applicationIds = applicationIds; - return this; - } - public ApplicantInput withApplications(List applications) { - Utils.checkNotNull(applications, "applications"); + public ApplicantInput withApplications(@Nullable List applications) { this.applications = JsonNullable.of(applications); return this; } - public ApplicantInput withApplications(JsonNullable> applications) { - Utils.checkNotNull(applications, "applications"); - this.applications = applications; - return this; - } - public ApplicantInput withFollowers(List followers) { - Utils.checkNotNull(followers, "followers"); + public ApplicantInput withFollowers(@Nullable List followers) { this.followers = JsonNullable.of(followers); return this; } - public ApplicantInput withFollowers(JsonNullable> followers) { - Utils.checkNotNull(followers, "followers"); - this.followers = followers; - return this; - } - public ApplicantInput withSources(List sources) { - Utils.checkNotNull(sources, "sources"); + public ApplicantInput withSources(@Nullable List sources) { this.sources = JsonNullable.of(sources); return this; } - public ApplicantInput withSources(JsonNullable> sources) { - Utils.checkNotNull(sources, "sources"); - this.sources = sources; - return this; - } - - public ApplicantInput withConfidential(boolean confidential) { - Utils.checkNotNull(confidential, "confidential"); - this.confidential = Optional.ofNullable(confidential); - return this; - } - - public ApplicantInput withConfidential(Optional confidential) { - Utils.checkNotNull(confidential, "confidential"); + public ApplicantInput withConfidential(@Nullable Boolean confidential) { this.confidential = confidential; return this; } - public ApplicantInput withAnonymized(boolean anonymized) { - Utils.checkNotNull(anonymized, "anonymized"); - this.anonymized = Optional.ofNullable(anonymized); - return this; - } - - public ApplicantInput withAnonymized(Optional anonymized) { - Utils.checkNotNull(anonymized, "anonymized"); + public ApplicantInput withAnonymized(@Nullable Boolean anonymized) { this.anonymized = anonymized; return this; } - public ApplicantInput withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + + public ApplicantInput withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public ApplicantInput withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - public ApplicantInput withArchived(boolean archived) { - Utils.checkNotNull(archived, "archived"); + public ApplicantInput withArchived(@Nullable Boolean archived) { this.archived = JsonNullable.of(archived); return this; } - public ApplicantInput withArchived(JsonNullable archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = archived; - return this; - } - public ApplicantInput withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public ApplicantInput withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - public ApplicantInput withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - public ApplicantInput withRecordUrl(String recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); + public ApplicantInput withRecordUrl(@Nullable String recordUrl) { this.recordUrl = JsonNullable.of(recordUrl); return this; } - public ApplicantInput withRecordUrl(JsonNullable recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); - this.recordUrl = recordUrl; - return this; - } /** * Flag to indicate if the object is deleted. */ - public ApplicantInput withDeleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public ApplicantInput withDeleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Flag to indicate if the object is deleted. - */ - public ApplicantInput withDeleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public ApplicantInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public ApplicantInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public ApplicantInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1064,543 +771,261 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional name = Optional.empty(); + private String name; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable initials = JsonNullable.undefined(); + private JsonNullable initials; - private JsonNullable birthday = JsonNullable.undefined(); + private JsonNullable birthday; - private Optional coverLetter = Optional.empty(); + private String coverLetter; - private JsonNullable photoUrl = JsonNullable.undefined(); + private JsonNullable photoUrl; - private Optional headline = Optional.empty(); + private String headline; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private Optional> emails = Optional.empty(); + private List emails; - private Optional> customFields = Optional.empty(); + private List customFields; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> socialLinks = Optional.empty(); + private List socialLinks; - private Optional stageId = Optional.empty(); + private String stageId; - private Optional recruiterId = Optional.empty(); + private String recruiterId; - private Optional coordinatorId = Optional.empty(); + private String coordinatorId; - private JsonNullable> applicationIds = JsonNullable.undefined(); + private JsonNullable> applicationIds; - private JsonNullable> applications = JsonNullable.undefined(); + private JsonNullable> applications; - private JsonNullable> followers = JsonNullable.undefined(); + private JsonNullable> followers; - private JsonNullable> sources = JsonNullable.undefined(); + private JsonNullable> sources; - private Optional confidential = Optional.empty(); + private Boolean confidential; - private Optional anonymized = Optional.empty(); + private Boolean anonymized; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private JsonNullable archived = JsonNullable.undefined(); + private JsonNullable archived; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable recordUrl = JsonNullable.undefined(); + private JsonNullable recordUrl; - private JsonNullable deleted = JsonNullable.undefined(); + private JsonNullable deleted; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The name of an applicant. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * The name of an applicant. - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Middle name of the person. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The initials of the person, usually derived from their first, middle, and last names. */ - public Builder initials(String initials) { - Utils.checkNotNull(initials, "initials"); + public Builder initials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * The initials of the person, usually derived from their first, middle, and last names. - */ - public Builder initials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } - - /** * The date of birth of the person. */ - public Builder birthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Builder birthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public Builder birthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - - public Builder coverLetter(String coverLetter) { - Utils.checkNotNull(coverLetter, "coverLetter"); - this.coverLetter = Optional.ofNullable(coverLetter); - return this; - } - - public Builder coverLetter(Optional coverLetter) { - Utils.checkNotNull(coverLetter, "coverLetter"); + public Builder coverLetter(@Nullable String coverLetter) { this.coverLetter = coverLetter; return this; } - /** * The URL of the photo of a person. */ - public Builder photoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public Builder photoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public Builder photoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } - - /** * Typically a list of previous companies where the contact has worked or schools that the contact has attended */ - public Builder headline(String headline) { - Utils.checkNotNull(headline, "headline"); - this.headline = Optional.ofNullable(headline); - return this; - } - - /** - * Typically a list of previous companies where the contact has worked or schools that the contact has attended - */ - public Builder headline(Optional headline) { - Utils.checkNotNull(headline, "headline"); + public Builder headline(@Nullable String headline) { this.headline = headline; return this; } - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder socialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Builder socialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Builder socialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - - public Builder stageId(String stageId) { - Utils.checkNotNull(stageId, "stageId"); - this.stageId = Optional.ofNullable(stageId); - return this; - } - - public Builder stageId(Optional stageId) { - Utils.checkNotNull(stageId, "stageId"); + public Builder stageId(@Nullable String stageId) { this.stageId = stageId; return this; } - - public Builder recruiterId(String recruiterId) { - Utils.checkNotNull(recruiterId, "recruiterId"); - this.recruiterId = Optional.ofNullable(recruiterId); - return this; - } - - public Builder recruiterId(Optional recruiterId) { - Utils.checkNotNull(recruiterId, "recruiterId"); + public Builder recruiterId(@Nullable String recruiterId) { this.recruiterId = recruiterId; return this; } - - public Builder coordinatorId(String coordinatorId) { - Utils.checkNotNull(coordinatorId, "coordinatorId"); - this.coordinatorId = Optional.ofNullable(coordinatorId); - return this; - } - - public Builder coordinatorId(Optional coordinatorId) { - Utils.checkNotNull(coordinatorId, "coordinatorId"); + public Builder coordinatorId(@Nullable String coordinatorId) { this.coordinatorId = coordinatorId; return this; } - - public Builder applicationIds(List applicationIds) { - Utils.checkNotNull(applicationIds, "applicationIds"); + public Builder applicationIds(@Nullable List applicationIds) { this.applicationIds = JsonNullable.of(applicationIds); return this; } - public Builder applicationIds(JsonNullable> applicationIds) { - Utils.checkNotNull(applicationIds, "applicationIds"); - this.applicationIds = applicationIds; - return this; - } - - - public Builder applications(List applications) { - Utils.checkNotNull(applications, "applications"); + public Builder applications(@Nullable List applications) { this.applications = JsonNullable.of(applications); return this; } - public Builder applications(JsonNullable> applications) { - Utils.checkNotNull(applications, "applications"); - this.applications = applications; - return this; - } - - - public Builder followers(List followers) { - Utils.checkNotNull(followers, "followers"); + public Builder followers(@Nullable List followers) { this.followers = JsonNullable.of(followers); return this; } - public Builder followers(JsonNullable> followers) { - Utils.checkNotNull(followers, "followers"); - this.followers = followers; - return this; - } - - - public Builder sources(List sources) { - Utils.checkNotNull(sources, "sources"); + public Builder sources(@Nullable List sources) { this.sources = JsonNullable.of(sources); return this; } - public Builder sources(JsonNullable> sources) { - Utils.checkNotNull(sources, "sources"); - this.sources = sources; - return this; - } - - - public Builder confidential(boolean confidential) { - Utils.checkNotNull(confidential, "confidential"); - this.confidential = Optional.ofNullable(confidential); - return this; - } - - public Builder confidential(Optional confidential) { - Utils.checkNotNull(confidential, "confidential"); + public Builder confidential(@Nullable Boolean confidential) { this.confidential = confidential; return this; } - - public Builder anonymized(boolean anonymized) { - Utils.checkNotNull(anonymized, "anonymized"); - this.anonymized = Optional.ofNullable(anonymized); - return this; - } - - public Builder anonymized(Optional anonymized) { - Utils.checkNotNull(anonymized, "anonymized"); + public Builder anonymized(@Nullable Boolean anonymized) { this.anonymized = anonymized; return this; } - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - - public Builder archived(boolean archived) { - Utils.checkNotNull(archived, "archived"); + public Builder archived(@Nullable Boolean archived) { this.archived = JsonNullable.of(archived); return this; } - public Builder archived(JsonNullable archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = archived; - return this; - } - - - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - - public Builder recordUrl(String recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); + public Builder recordUrl(@Nullable String recordUrl) { this.recordUrl = JsonNullable.of(recordUrl); return this; } - public Builder recordUrl(JsonNullable recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); - this.recordUrl = recordUrl; - return this; - } - - /** * Flag to indicate if the object is deleted. */ - public Builder deleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Builder deleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Flag to indicate if the object is deleted. - */ - public Builder deleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public ApplicantInput build() { - return new ApplicantInput( name, firstName, lastName, middleName, initials, birthday, diff --git a/src/main/java/com/apideck/unify/models/components/ApplicantsFilter.java b/src/main/java/com/apideck/unify/models/components/ApplicantsFilter.java index 23f2b3f6..d1a68c9b 100644 --- a/src/main/java/com/apideck/unify/models/components/ApplicantsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/ApplicantsFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,25 +17,23 @@ public class ApplicantsFilter { * Id of the job to filter on */ @SpeakeasyMetadata("queryParam:name=job_id") - private Optional jobId; + private String jobId; @JsonCreator public ApplicantsFilter( - Optional jobId) { - Utils.checkNotNull(jobId, "jobId"); + @Nullable String jobId) { this.jobId = jobId; } public ApplicantsFilter() { - this(Optional.empty()); + this(null); } /** * Id of the job to filter on */ - @JsonIgnore public Optional jobId() { - return jobId; + return Optional.ofNullable(this.jobId); } public static Builder builder() { @@ -46,22 +44,12 @@ public static Builder builder() { /** * Id of the job to filter on */ - public ApplicantsFilter withJobId(String jobId) { - Utils.checkNotNull(jobId, "jobId"); - this.jobId = Optional.ofNullable(jobId); - return this; - } - - - /** - * Id of the job to filter on - */ - public ApplicantsFilter withJobId(Optional jobId) { - Utils.checkNotNull(jobId, "jobId"); + public ApplicantsFilter withJobId(@Nullable String jobId) { this.jobId = jobId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,33 +78,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional jobId = Optional.empty(); + private String jobId; private Builder() { // force use of static builder() method } - - /** - * Id of the job to filter on - */ - public Builder jobId(String jobId) { - Utils.checkNotNull(jobId, "jobId"); - this.jobId = Optional.ofNullable(jobId); - return this; - } - /** * Id of the job to filter on */ - public Builder jobId(Optional jobId) { - Utils.checkNotNull(jobId, "jobId"); + public Builder jobId(@Nullable String jobId) { this.jobId = jobId; return this; } public ApplicantsFilter build() { - return new ApplicantsFilter( jobId); } diff --git a/src/main/java/com/apideck/unify/models/components/Application.java b/src/main/java/com/apideck/unify/models/components/Application.java index 49f57522..3e0da2c7 100644 --- a/src/main/java/com/apideck/unify/models/components/Application.java +++ b/src/main/java/com/apideck/unify/models/components/Application.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -26,34 +25,34 @@ public class Application { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonInclude(Include.ALWAYS) @JsonProperty("applicant_id") - private Optional applicantId; + private JsonNullable applicantId; @JsonInclude(Include.ALWAYS) @JsonProperty("job_id") - private Optional jobId; + private JsonNullable jobId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("stage") - private Optional stage; + private Stage stage; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -88,130 +87,110 @@ public class Application { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Application( - @JsonProperty("id") Optional id, - @JsonProperty("applicant_id") Optional applicantId, - @JsonProperty("job_id") Optional jobId, - @JsonProperty("status") JsonNullable status, - @JsonProperty("stage") Optional stage, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(applicantId, "applicantId"); - Utils.checkNotNull(jobId, "jobId"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(stage, "stage"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("applicant_id") @Nullable String applicantId, + @JsonProperty("job_id") @Nullable String jobId, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("stage") @Nullable Stage stage, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.applicantId = applicantId; - this.jobId = jobId; - this.status = status; + this.applicantId = JsonNullable.of(applicantId); + this.jobId = JsonNullable.of(jobId); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); this.stage = stage; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Application() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } - @JsonIgnore - public Optional applicantId() { - return applicantId; + public JsonNullable applicantId() { + return this.applicantId; } - @JsonIgnore - public Optional jobId() { - return jobId; + public JsonNullable jobId() { + return this.jobId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional stage() { - return (Optional) stage; + return Optional.ofNullable(this.stage); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -222,182 +201,90 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Application withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Application withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Application withId(@Nullable String id) { this.id = id; return this; } - public Application withApplicantId(String applicantId) { - Utils.checkNotNull(applicantId, "applicantId"); - this.applicantId = Optional.ofNullable(applicantId); - return this; - } - - public Application withApplicantId(Optional applicantId) { - Utils.checkNotNull(applicantId, "applicantId"); - this.applicantId = applicantId; + public Application withApplicantId(@Nullable String applicantId) { + this.applicantId = JsonNullable.of(applicantId); return this; } - public Application withJobId(String jobId) { - Utils.checkNotNull(jobId, "jobId"); - this.jobId = Optional.ofNullable(jobId); - return this; - } - - - public Application withJobId(Optional jobId) { - Utils.checkNotNull(jobId, "jobId"); - this.jobId = jobId; - return this; - } - public Application withStatus(ApplicationStatus status) { - Utils.checkNotNull(status, "status"); - this.status = JsonNullable.of(status); + public Application withJobId(@Nullable String jobId) { + this.jobId = JsonNullable.of(jobId); return this; } - public Application withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - public Application withStage(Stage stage) { - Utils.checkNotNull(stage, "stage"); - this.stage = Optional.ofNullable(stage); + public Application withStatus(@Nullable ApplicationStatus status) { + this.status = JsonNullable.of(status); return this; } - public Application withStage(Optional stage) { - Utils.checkNotNull(stage, "stage"); + public Application withStage(@Nullable Stage stage) { this.stage = stage; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public Application withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Application withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Application withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public Application withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Application withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Application withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Application withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Application withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Application withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Application withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Application withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Application withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Application withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Application withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Application withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Application withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Application withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Application withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -449,219 +336,109 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional applicantId = Optional.empty(); + private String applicantId; - private Optional jobId = Optional.empty(); + private String jobId; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private Optional stage = Optional.empty(); + private Stage stage; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - public Builder applicantId(String applicantId) { - Utils.checkNotNull(applicantId, "applicantId"); - this.applicantId = Optional.ofNullable(applicantId); - return this; - } - - public Builder applicantId(Optional applicantId) { - Utils.checkNotNull(applicantId, "applicantId"); + public Builder applicantId(@Nullable String applicantId) { this.applicantId = applicantId; return this; } - - public Builder jobId(String jobId) { - Utils.checkNotNull(jobId, "jobId"); - this.jobId = Optional.ofNullable(jobId); - return this; - } - - public Builder jobId(Optional jobId) { - Utils.checkNotNull(jobId, "jobId"); + public Builder jobId(@Nullable String jobId) { this.jobId = jobId; return this; } - - public Builder status(ApplicationStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ApplicationStatus status) { this.status = JsonNullable.of(status); return this; } - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - - public Builder stage(Stage stage) { - Utils.checkNotNull(stage, "stage"); - this.stage = Optional.ofNullable(stage); - return this; - } - - public Builder stage(Optional stage) { - Utils.checkNotNull(stage, "stage"); + public Builder stage(@Nullable Stage stage) { this.stage = stage; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Application build() { - return new Application( id, applicantId, jobId, status, stage, customMappings, diff --git a/src/main/java/com/apideck/unify/models/components/ApplicationInput.java b/src/main/java/com/apideck/unify/models/components/ApplicationInput.java index 2edbc77f..de58fc43 100644 --- a/src/main/java/com/apideck/unify/models/components/ApplicationInput.java +++ b/src/main/java/com/apideck/unify/models/components/ApplicationInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -21,83 +20,71 @@ public class ApplicationInput { @JsonInclude(Include.ALWAYS) @JsonProperty("applicant_id") - private Optional applicantId; + private JsonNullable applicantId; @JsonInclude(Include.ALWAYS) @JsonProperty("job_id") - private Optional jobId; + private JsonNullable jobId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("stage") - private Optional stage; + private Stage stage; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public ApplicationInput( - @JsonProperty("applicant_id") Optional applicantId, - @JsonProperty("job_id") Optional jobId, - @JsonProperty("status") JsonNullable status, - @JsonProperty("stage") Optional stage, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(applicantId, "applicantId"); - Utils.checkNotNull(jobId, "jobId"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(stage, "stage"); - Utils.checkNotNull(passThrough, "passThrough"); - this.applicantId = applicantId; - this.jobId = jobId; - this.status = status; + @JsonProperty("applicant_id") @Nullable String applicantId, + @JsonProperty("job_id") @Nullable String jobId, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("stage") @Nullable Stage stage, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.applicantId = JsonNullable.of(applicantId); + this.jobId = JsonNullable.of(jobId); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); this.stage = stage; this.passThrough = passThrough; } public ApplicationInput() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } - @JsonIgnore - public Optional applicantId() { - return applicantId; + public JsonNullable applicantId() { + return this.applicantId; } - @JsonIgnore - public Optional jobId() { - return jobId; + public JsonNullable jobId() { + return this.jobId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional stage() { - return (Optional) stage; + return Optional.ofNullable(this.stage); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -105,76 +92,39 @@ public static Builder builder() { } - public ApplicationInput withApplicantId(String applicantId) { - Utils.checkNotNull(applicantId, "applicantId"); - this.applicantId = Optional.ofNullable(applicantId); + public ApplicationInput withApplicantId(@Nullable String applicantId) { + this.applicantId = JsonNullable.of(applicantId); return this; } - public ApplicationInput withApplicantId(Optional applicantId) { - Utils.checkNotNull(applicantId, "applicantId"); - this.applicantId = applicantId; + public ApplicationInput withJobId(@Nullable String jobId) { + this.jobId = JsonNullable.of(jobId); return this; } - public ApplicationInput withJobId(String jobId) { - Utils.checkNotNull(jobId, "jobId"); - this.jobId = Optional.ofNullable(jobId); - return this; - } - - - public ApplicationInput withJobId(Optional jobId) { - Utils.checkNotNull(jobId, "jobId"); - this.jobId = jobId; - return this; - } - public ApplicationInput withStatus(ApplicationStatus status) { - Utils.checkNotNull(status, "status"); + public ApplicationInput withStatus(@Nullable ApplicationStatus status) { this.status = JsonNullable.of(status); return this; } - public ApplicationInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - public ApplicationInput withStage(Stage stage) { - Utils.checkNotNull(stage, "stage"); - this.stage = Optional.ofNullable(stage); - return this; - } - - public ApplicationInput withStage(Optional stage) { - Utils.checkNotNull(stage, "stage"); + public ApplicationInput withStage(@Nullable Stage stage) { this.stage = stage; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public ApplicationInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public ApplicationInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public ApplicationInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -212,93 +162,49 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional applicantId = Optional.empty(); + private String applicantId; - private Optional jobId = Optional.empty(); + private String jobId; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private Optional stage = Optional.empty(); + private Stage stage; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - public Builder applicantId(String applicantId) { - Utils.checkNotNull(applicantId, "applicantId"); - this.applicantId = Optional.ofNullable(applicantId); - return this; - } - - public Builder applicantId(Optional applicantId) { - Utils.checkNotNull(applicantId, "applicantId"); + public Builder applicantId(@Nullable String applicantId) { this.applicantId = applicantId; return this; } - - public Builder jobId(String jobId) { - Utils.checkNotNull(jobId, "jobId"); - this.jobId = Optional.ofNullable(jobId); - return this; - } - - public Builder jobId(Optional jobId) { - Utils.checkNotNull(jobId, "jobId"); + public Builder jobId(@Nullable String jobId) { this.jobId = jobId; return this; } - - public Builder status(ApplicationStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ApplicationStatus status) { this.status = JsonNullable.of(status); return this; } - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - - public Builder stage(Stage stage) { - Utils.checkNotNull(stage, "stage"); - this.stage = Optional.ofNullable(stage); - return this; - } - - public Builder stage(Optional stage) { - Utils.checkNotNull(stage, "stage"); + public Builder stage(@Nullable Stage stage) { this.stage = stage; return this; } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public ApplicationInput build() { - return new ApplicationInput( applicantId, jobId, status, stage, passThrough); diff --git a/src/main/java/com/apideck/unify/models/components/Assignee.java b/src/main/java/com/apideck/unify/models/components/Assignee.java index d69f4cbf..753d28a0 100644 --- a/src/main/java/com/apideck/unify/models/components/Assignee.java +++ b/src/main/java/com/apideck/unify/models/components/Assignee.java @@ -5,12 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -28,30 +30,28 @@ public class Assignee { @JsonCreator public Assignee( - @JsonProperty("id") String id, - @JsonProperty("username") JsonNullable username) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(username, "username"); - this.id = id; - this.username = username; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("username") @Nullable JsonNullable username) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.username = Optional.ofNullable(username) + .orElse(JsonNullable.undefined()); } public Assignee( - String id) { - this(id, JsonNullable.undefined()); + @Nonnull String id) { + this(id, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } - @JsonIgnore public JsonNullable username() { - return username; + return this.username; } public static Builder builder() { @@ -62,23 +62,17 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Assignee withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Assignee withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - public Assignee withUsername(String username) { - Utils.checkNotNull(username, "username"); + + public Assignee withUsername(@Nullable String username) { this.username = JsonNullable.of(username); return this; } - public Assignee withUsername(JsonNullable username) { - Utils.checkNotNull(username, "username"); - this.username = username; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -112,37 +106,26 @@ public final static class Builder { private String id; - private JsonNullable username = JsonNullable.undefined(); + private JsonNullable username; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - - public Builder username(String username) { - Utils.checkNotNull(username, "username"); + public Builder username(@Nullable String username) { this.username = JsonNullable.of(username); return this; } - public Builder username(JsonNullable username) { - Utils.checkNotNull(username, "username"); - this.username = username; - return this; - } - public Assignee build() { - return new Assignee( id, username); } diff --git a/src/main/java/com/apideck/unify/models/components/AssigneeInput.java b/src/main/java/com/apideck/unify/models/components/AssigneeInput.java index fd18f8e6..195ad595 100644 --- a/src/main/java/com/apideck/unify/models/components/AssigneeInput.java +++ b/src/main/java/com/apideck/unify/models/components/AssigneeInput.java @@ -5,10 +5,11 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; import java.lang.Override; import java.lang.String; +import java.util.Optional; public class AssigneeInput { @@ -20,17 +21,16 @@ public class AssigneeInput { @JsonCreator public AssigneeInput( - @JsonProperty("id") String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + @JsonProperty("id") @Nonnull String id) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } public static Builder builder() { @@ -41,12 +41,12 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public AssigneeInput withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public AssigneeInput withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -81,18 +81,15 @@ private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } public AssigneeInput build() { - return new AssigneeInput( id); } diff --git a/src/main/java/com/apideck/unify/models/components/Attachment.java b/src/main/java/com/apideck/unify/models/components/Attachment.java index ae123436..1023b3d5 100644 --- a/src/main/java/com/apideck/unify/models/components/Attachment.java +++ b/src/main/java/com/apideck/unify/models/components/Attachment.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -25,7 +24,7 @@ public class Attachment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The display id of the file @@ -58,7 +57,7 @@ public class Attachment { @JsonInclude(Include.NON_ABSENT) @JsonProperty("reference") - private Optional reference; + private AttachmentReference reference; /** * Optional description of the file @@ -107,160 +106,142 @@ public class Attachment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Attachment( - @JsonProperty("id") Optional id, - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("name") JsonNullable name, - @JsonProperty("mime_type") JsonNullable mimeType, - @JsonProperty("size") JsonNullable size, - @JsonProperty("reference") Optional reference, - @JsonProperty("description") JsonNullable description, - @JsonProperty("parent_folder_id") JsonNullable parentFolderId, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(mimeType, "mimeType"); - Utils.checkNotNull(size, "size"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(parentFolderId, "parentFolderId"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("mime_type") @Nullable JsonNullable mimeType, + @JsonProperty("size") @Nullable JsonNullable size, + @JsonProperty("reference") @Nullable AttachmentReference reference, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("parent_folder_id") @Nullable JsonNullable parentFolderId, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.displayId = displayId; - this.name = name; - this.mimeType = mimeType; - this.size = size; + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.mimeType = Optional.ofNullable(mimeType) + .orElse(JsonNullable.undefined()); + this.size = Optional.ofNullable(size) + .orElse(JsonNullable.undefined()); this.reference = reference; - this.description = description; - this.parentFolderId = parentFolderId; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.parentFolderId = Optional.ofNullable(parentFolderId) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Attachment() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The display id of the file */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * The name of the file */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The MIME type of the file. */ - @JsonIgnore public JsonNullable mimeType() { - return mimeType; + return this.mimeType; } /** * The size of the file in bytes */ - @JsonIgnore public JsonNullable size() { - return size; + return this.size; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional reference() { - return (Optional) reference; + return Optional.ofNullable(this.reference); } /** * Optional description of the file */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The folder id where this attachment belong to */ - @JsonIgnore public JsonNullable parentFolderId() { - return parentFolderId; + return this.parentFolderId; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -271,234 +252,117 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Attachment withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Attachment withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Attachment withId(@Nullable String id) { this.id = id; return this; } + /** * The display id of the file */ - public Attachment withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Attachment withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * The display id of the file - */ - public Attachment withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } /** * The name of the file */ - public Attachment withName(String name) { - Utils.checkNotNull(name, "name"); + public Attachment withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the file - */ - public Attachment withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The MIME type of the file. */ - public Attachment withMimeType(String mimeType) { - Utils.checkNotNull(mimeType, "mimeType"); + public Attachment withMimeType(@Nullable String mimeType) { this.mimeType = JsonNullable.of(mimeType); return this; } - /** - * The MIME type of the file. - */ - public Attachment withMimeType(JsonNullable mimeType) { - Utils.checkNotNull(mimeType, "mimeType"); - this.mimeType = mimeType; - return this; - } /** * The size of the file in bytes */ - public Attachment withSize(long size) { - Utils.checkNotNull(size, "size"); + public Attachment withSize(@Nullable Long size) { this.size = JsonNullable.of(size); return this; } - /** - * The size of the file in bytes - */ - public Attachment withSize(JsonNullable size) { - Utils.checkNotNull(size, "size"); - this.size = size; - return this; - } - - public Attachment withReference(AttachmentReference reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = Optional.ofNullable(reference); - return this; - } - - public Attachment withReference(Optional reference) { - Utils.checkNotNull(reference, "reference"); + public Attachment withReference(@Nullable AttachmentReference reference) { this.reference = reference; return this; } + /** * Optional description of the file */ - public Attachment withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Attachment withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Optional description of the file - */ - public Attachment withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The folder id where this attachment belong to */ - public Attachment withParentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); + public Attachment withParentFolderId(@Nullable String parentFolderId) { this.parentFolderId = JsonNullable.of(parentFolderId); return this; } - /** - * The folder id where this attachment belong to - */ - public Attachment withParentFolderId(JsonNullable parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = parentFolderId; - return this; - } /** * The user who last updated the object. */ - public Attachment withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Attachment withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Attachment withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Attachment withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Attachment withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Attachment withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Attachment withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Attachment withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Attachment withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Attachment withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Attachment withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Attachment withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Attachment withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Attachment withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Attachment withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -555,279 +419,138 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable mimeType = JsonNullable.undefined(); + private JsonNullable mimeType; - private JsonNullable size = JsonNullable.undefined(); + private JsonNullable size; - private Optional reference = Optional.empty(); + private AttachmentReference reference; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable parentFolderId = JsonNullable.undefined(); + private JsonNullable parentFolderId; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The display id of the file */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * The display id of the file - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * The name of the file */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the file - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The MIME type of the file. */ - public Builder mimeType(String mimeType) { - Utils.checkNotNull(mimeType, "mimeType"); + public Builder mimeType(@Nullable String mimeType) { this.mimeType = JsonNullable.of(mimeType); return this; } - /** - * The MIME type of the file. - */ - public Builder mimeType(JsonNullable mimeType) { - Utils.checkNotNull(mimeType, "mimeType"); - this.mimeType = mimeType; - return this; - } - - /** * The size of the file in bytes */ - public Builder size(long size) { - Utils.checkNotNull(size, "size"); + public Builder size(@Nullable Long size) { this.size = JsonNullable.of(size); return this; } - /** - * The size of the file in bytes - */ - public Builder size(JsonNullable size) { - Utils.checkNotNull(size, "size"); - this.size = size; - return this; - } - - - public Builder reference(AttachmentReference reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = Optional.ofNullable(reference); - return this; - } - - public Builder reference(Optional reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable AttachmentReference reference) { this.reference = reference; return this; } - /** * Optional description of the file */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Optional description of the file - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The folder id where this attachment belong to */ - public Builder parentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); + public Builder parentFolderId(@Nullable String parentFolderId) { this.parentFolderId = JsonNullable.of(parentFolderId); return this; } - /** - * The folder id where this attachment belong to - */ - public Builder parentFolderId(JsonNullable parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = parentFolderId; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Attachment build() { - return new Attachment( id, displayId, name, mimeType, size, reference, diff --git a/src/main/java/com/apideck/unify/models/components/AttachmentReference.java b/src/main/java/com/apideck/unify/models/components/AttachmentReference.java index 9ad548aa..ae626ee8 100644 --- a/src/main/java/com/apideck/unify/models/components/AttachmentReference.java +++ b/src/main/java/com/apideck/unify/models/components/AttachmentReference.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -19,41 +18,36 @@ public class AttachmentReference { @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private AttachmentReferenceType type; /** * A unique identifier for an object. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonCreator public AttachmentReference( - @JsonProperty("type") Optional type, - @JsonProperty("id") Optional id) { - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(id, "id"); + @JsonProperty("type") @Nullable AttachmentReferenceType type, + @JsonProperty("id") @Nullable String id) { this.type = type; this.id = id; } public AttachmentReference() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } public static Builder builder() { @@ -61,38 +55,21 @@ public static Builder builder() { } - public AttachmentReference withType(AttachmentReferenceType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - - public AttachmentReference withType(Optional type) { - Utils.checkNotNull(type, "type"); + public AttachmentReference withType(@Nullable AttachmentReferenceType type) { this.type = type; return this; } - /** - * A unique identifier for an object. - */ - public AttachmentReference withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public AttachmentReference withId(Optional id) { - Utils.checkNotNull(id, "id"); + public AttachmentReference withId(@Nullable String id) { this.id = id; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -123,48 +100,28 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional type = Optional.empty(); + private AttachmentReferenceType type; - private Optional id = Optional.empty(); + private String id; private Builder() { // force use of static builder() method } - - public Builder type(AttachmentReferenceType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable AttachmentReferenceType type) { this.type = type; return this; } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } public AttachmentReference build() { - return new AttachmentReference( type, id); } diff --git a/src/main/java/com/apideck/unify/models/components/BalanceByPeriod.java b/src/main/java/com/apideck/unify/models/components/BalanceByPeriod.java index 39c5cb8b..c6c03910 100644 --- a/src/main/java/com/apideck/unify/models/components/BalanceByPeriod.java +++ b/src/main/java/com/apideck/unify/models/components/BalanceByPeriod.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -39,62 +38,55 @@ public class BalanceByPeriod { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("total_amount") - private Optional totalAmount; + private Double totalAmount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("balances_by_transaction") - private Optional> balancesByTransaction; + private List balancesByTransaction; @JsonCreator public BalanceByPeriod( - @JsonProperty("start_date") JsonNullable startDate, - @JsonProperty("end_date") JsonNullable endDate, - @JsonProperty("total_amount") Optional totalAmount, - @JsonProperty("balances_by_transaction") Optional> balancesByTransaction) { - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(balancesByTransaction, "balancesByTransaction"); - this.startDate = startDate; - this.endDate = endDate; + @JsonProperty("start_date") @Nullable JsonNullable startDate, + @JsonProperty("end_date") @Nullable JsonNullable endDate, + @JsonProperty("total_amount") @Nullable Double totalAmount, + @JsonProperty("balances_by_transaction") @Nullable List balancesByTransaction) { + this.startDate = Optional.ofNullable(startDate) + .orElse(JsonNullable.undefined()); + this.endDate = Optional.ofNullable(endDate) + .orElse(JsonNullable.undefined()); this.totalAmount = totalAmount; this.balancesByTransaction = balancesByTransaction; } public BalanceByPeriod() { - this(JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * The starting date of the period. If not provided, it represents the oldest period, where all transactions due before the specified `end_date` are included. */ - @JsonIgnore public JsonNullable startDate() { - return startDate; + return this.startDate; } /** * The ending date of the period. If not provided, it represents an open-ended period starting from the `start_date`, typically capturing future-dated transactions that are not yet aged. */ - @JsonIgnore public JsonNullable endDate() { - return endDate; + return this.endDate; } /** * Total amount of the period. */ - @JsonIgnore public Optional totalAmount() { - return totalAmount; + return Optional.ofNullable(this.totalAmount); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> balancesByTransaction() { - return (Optional>) balancesByTransaction; + return Optional.ofNullable(this.balancesByTransaction); } public static Builder builder() { @@ -105,71 +97,36 @@ public static Builder builder() { /** * The starting date of the period. If not provided, it represents the oldest period, where all transactions due before the specified `end_date` are included. */ - public BalanceByPeriod withStartDate(LocalDate startDate) { - Utils.checkNotNull(startDate, "startDate"); + public BalanceByPeriod withStartDate(@Nullable LocalDate startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The starting date of the period. If not provided, it represents the oldest period, where all transactions due before the specified `end_date` are included. - */ - public BalanceByPeriod withStartDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } /** * The ending date of the period. If not provided, it represents an open-ended period starting from the `start_date`, typically capturing future-dated transactions that are not yet aged. */ - public BalanceByPeriod withEndDate(LocalDate endDate) { - Utils.checkNotNull(endDate, "endDate"); + public BalanceByPeriod withEndDate(@Nullable LocalDate endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The ending date of the period. If not provided, it represents an open-ended period starting from the `start_date`, typically capturing future-dated transactions that are not yet aged. - */ - public BalanceByPeriod withEndDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** - * Total amount of the period. - */ - public BalanceByPeriod withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - /** * Total amount of the period. */ - public BalanceByPeriod withTotalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public BalanceByPeriod withTotalAmount(@Nullable Double totalAmount) { this.totalAmount = totalAmount; return this; } - public BalanceByPeriod withBalancesByTransaction(List balancesByTransaction) { - Utils.checkNotNull(balancesByTransaction, "balancesByTransaction"); - this.balancesByTransaction = Optional.ofNullable(balancesByTransaction); - return this; - } - - public BalanceByPeriod withBalancesByTransaction(Optional> balancesByTransaction) { - Utils.checkNotNull(balancesByTransaction, "balancesByTransaction"); + public BalanceByPeriod withBalancesByTransaction(@Nullable List balancesByTransaction) { this.balancesByTransaction = balancesByTransaction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -205,90 +162,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable startDate = JsonNullable.undefined(); + private JsonNullable startDate; - private JsonNullable endDate = JsonNullable.undefined(); + private JsonNullable endDate; - private Optional totalAmount = Optional.empty(); + private Double totalAmount; - private Optional> balancesByTransaction = Optional.empty(); + private List balancesByTransaction; private Builder() { // force use of static builder() method } - /** * The starting date of the period. If not provided, it represents the oldest period, where all transactions due before the specified `end_date` are included. */ - public Builder startDate(LocalDate startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable LocalDate startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The starting date of the period. If not provided, it represents the oldest period, where all transactions due before the specified `end_date` are included. - */ - public Builder startDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } - - /** * The ending date of the period. If not provided, it represents an open-ended period starting from the `start_date`, typically capturing future-dated transactions that are not yet aged. */ - public Builder endDate(LocalDate endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable LocalDate endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The ending date of the period. If not provided, it represents an open-ended period starting from the `start_date`, typically capturing future-dated transactions that are not yet aged. - */ - public Builder endDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** * Total amount of the period. */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - - /** - * Total amount of the period. - */ - public Builder totalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = totalAmount; return this; } - - public Builder balancesByTransaction(List balancesByTransaction) { - Utils.checkNotNull(balancesByTransaction, "balancesByTransaction"); - this.balancesByTransaction = Optional.ofNullable(balancesByTransaction); - return this; - } - - public Builder balancesByTransaction(Optional> balancesByTransaction) { - Utils.checkNotNull(balancesByTransaction, "balancesByTransaction"); + public Builder balancesByTransaction(@Nullable List balancesByTransaction) { this.balancesByTransaction = balancesByTransaction; return this; } public BalanceByPeriod build() { - return new BalanceByPeriod( startDate, endDate, totalAmount, balancesByTransaction); diff --git a/src/main/java/com/apideck/unify/models/components/BalanceByTransaction.java b/src/main/java/com/apideck/unify/models/components/BalanceByTransaction.java index b96a8f43..f3ed1785 100644 --- a/src/main/java/com/apideck/unify/models/components/BalanceByTransaction.java +++ b/src/main/java/com/apideck/unify/models/components/BalanceByTransaction.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.Optional; @@ -23,66 +22,59 @@ public class BalanceByTransaction { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("transaction_id") - private Optional transactionId; + private String transactionId; /** * Date of the transaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("transaction_date") - private Optional transactionDate; + private LocalDate transactionDate; /** * Type of the transaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("transaction_type") - private Optional transactionType; + private TransactionType transactionType; /** * Due date of the transaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("due_date") - private Optional dueDate; + private LocalDate dueDate; /** * Original amount of the transaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("original_amount") - private Optional originalAmount; + private Double originalAmount; /** * Outstanding balance of the transaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("outstanding_balance") - private Optional outstandingBalance; + private Double outstandingBalance; /** * Transaction number of the transaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("transaction_number") - private Optional transactionNumber; + private String transactionNumber; @JsonCreator public BalanceByTransaction( - @JsonProperty("transaction_id") Optional transactionId, - @JsonProperty("transaction_date") Optional transactionDate, - @JsonProperty("transaction_type") Optional transactionType, - @JsonProperty("due_date") Optional dueDate, - @JsonProperty("original_amount") Optional originalAmount, - @JsonProperty("outstanding_balance") Optional outstandingBalance, - @JsonProperty("transaction_number") Optional transactionNumber) { - Utils.checkNotNull(transactionId, "transactionId"); - Utils.checkNotNull(transactionDate, "transactionDate"); - Utils.checkNotNull(transactionType, "transactionType"); - Utils.checkNotNull(dueDate, "dueDate"); - Utils.checkNotNull(originalAmount, "originalAmount"); - Utils.checkNotNull(outstandingBalance, "outstandingBalance"); - Utils.checkNotNull(transactionNumber, "transactionNumber"); + @JsonProperty("transaction_id") @Nullable String transactionId, + @JsonProperty("transaction_date") @Nullable LocalDate transactionDate, + @JsonProperty("transaction_type") @Nullable TransactionType transactionType, + @JsonProperty("due_date") @Nullable LocalDate dueDate, + @JsonProperty("original_amount") @Nullable Double originalAmount, + @JsonProperty("outstanding_balance") @Nullable Double outstandingBalance, + @JsonProperty("transaction_number") @Nullable String transactionNumber) { this.transactionId = transactionId; this.transactionDate = transactionDate; this.transactionType = transactionType; @@ -93,66 +85,58 @@ public BalanceByTransaction( } public BalanceByTransaction() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } /** * Unique identifier for the transaction. */ - @JsonIgnore public Optional transactionId() { - return transactionId; + return Optional.ofNullable(this.transactionId); } /** * Date of the transaction. */ - @JsonIgnore public Optional transactionDate() { - return transactionDate; + return Optional.ofNullable(this.transactionDate); } /** * Type of the transaction. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional transactionType() { - return (Optional) transactionType; + return Optional.ofNullable(this.transactionType); } /** * Due date of the transaction. */ - @JsonIgnore public Optional dueDate() { - return dueDate; + return Optional.ofNullable(this.dueDate); } /** * Original amount of the transaction. */ - @JsonIgnore public Optional originalAmount() { - return originalAmount; + return Optional.ofNullable(this.originalAmount); } /** * Outstanding balance of the transaction. */ - @JsonIgnore public Optional outstandingBalance() { - return outstandingBalance; + return Optional.ofNullable(this.outstandingBalance); } /** * Transaction number of the transaction. */ - @JsonIgnore public Optional transactionNumber() { - return transactionNumber; + return Optional.ofNullable(this.transactionNumber); } public static Builder builder() { @@ -163,136 +147,66 @@ public static Builder builder() { /** * Unique identifier for the transaction. */ - public BalanceByTransaction withTransactionId(String transactionId) { - Utils.checkNotNull(transactionId, "transactionId"); - this.transactionId = Optional.ofNullable(transactionId); - return this; - } - - - /** - * Unique identifier for the transaction. - */ - public BalanceByTransaction withTransactionId(Optional transactionId) { - Utils.checkNotNull(transactionId, "transactionId"); + public BalanceByTransaction withTransactionId(@Nullable String transactionId) { this.transactionId = transactionId; return this; } - /** - * Date of the transaction. - */ - public BalanceByTransaction withTransactionDate(LocalDate transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); - return this; - } - /** * Date of the transaction. */ - public BalanceByTransaction withTransactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); + public BalanceByTransaction withTransactionDate(@Nullable LocalDate transactionDate) { this.transactionDate = transactionDate; return this; } - /** - * Type of the transaction. - */ - public BalanceByTransaction withTransactionType(TransactionType transactionType) { - Utils.checkNotNull(transactionType, "transactionType"); - this.transactionType = Optional.ofNullable(transactionType); - return this; - } - /** * Type of the transaction. */ - public BalanceByTransaction withTransactionType(Optional transactionType) { - Utils.checkNotNull(transactionType, "transactionType"); + public BalanceByTransaction withTransactionType(@Nullable TransactionType transactionType) { this.transactionType = transactionType; return this; } - /** - * Due date of the transaction. - */ - public BalanceByTransaction withDueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = Optional.ofNullable(dueDate); - return this; - } - /** * Due date of the transaction. */ - public BalanceByTransaction withDueDate(Optional dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public BalanceByTransaction withDueDate(@Nullable LocalDate dueDate) { this.dueDate = dueDate; return this; } - /** - * Original amount of the transaction. - */ - public BalanceByTransaction withOriginalAmount(double originalAmount) { - Utils.checkNotNull(originalAmount, "originalAmount"); - this.originalAmount = Optional.ofNullable(originalAmount); - return this; - } - /** * Original amount of the transaction. */ - public BalanceByTransaction withOriginalAmount(Optional originalAmount) { - Utils.checkNotNull(originalAmount, "originalAmount"); + public BalanceByTransaction withOriginalAmount(@Nullable Double originalAmount) { this.originalAmount = originalAmount; return this; } - /** - * Outstanding balance of the transaction. - */ - public BalanceByTransaction withOutstandingBalance(double outstandingBalance) { - Utils.checkNotNull(outstandingBalance, "outstandingBalance"); - this.outstandingBalance = Optional.ofNullable(outstandingBalance); - return this; - } - /** * Outstanding balance of the transaction. */ - public BalanceByTransaction withOutstandingBalance(Optional outstandingBalance) { - Utils.checkNotNull(outstandingBalance, "outstandingBalance"); + public BalanceByTransaction withOutstandingBalance(@Nullable Double outstandingBalance) { this.outstandingBalance = outstandingBalance; return this; } - /** - * Transaction number of the transaction. - */ - public BalanceByTransaction withTransactionNumber(String transactionNumber) { - Utils.checkNotNull(transactionNumber, "transactionNumber"); - this.transactionNumber = Optional.ofNullable(transactionNumber); - return this; - } - /** * Transaction number of the transaction. */ - public BalanceByTransaction withTransactionNumber(Optional transactionNumber) { - Utils.checkNotNull(transactionNumber, "transactionNumber"); + public BalanceByTransaction withTransactionNumber(@Nullable String transactionNumber) { this.transactionNumber = transactionNumber; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -335,159 +249,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional transactionId = Optional.empty(); + private String transactionId; - private Optional transactionDate = Optional.empty(); + private LocalDate transactionDate; - private Optional transactionType = Optional.empty(); + private TransactionType transactionType; - private Optional dueDate = Optional.empty(); + private LocalDate dueDate; - private Optional originalAmount = Optional.empty(); + private Double originalAmount; - private Optional outstandingBalance = Optional.empty(); + private Double outstandingBalance; - private Optional transactionNumber = Optional.empty(); + private String transactionNumber; private Builder() { // force use of static builder() method } - - /** - * Unique identifier for the transaction. - */ - public Builder transactionId(String transactionId) { - Utils.checkNotNull(transactionId, "transactionId"); - this.transactionId = Optional.ofNullable(transactionId); - return this; - } - /** * Unique identifier for the transaction. */ - public Builder transactionId(Optional transactionId) { - Utils.checkNotNull(transactionId, "transactionId"); + public Builder transactionId(@Nullable String transactionId) { this.transactionId = transactionId; return this; } - - /** - * Date of the transaction. - */ - public Builder transactionDate(LocalDate transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); - return this; - } - /** * Date of the transaction. */ - public Builder transactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); + public Builder transactionDate(@Nullable LocalDate transactionDate) { this.transactionDate = transactionDate; return this; } - - /** - * Type of the transaction. - */ - public Builder transactionType(TransactionType transactionType) { - Utils.checkNotNull(transactionType, "transactionType"); - this.transactionType = Optional.ofNullable(transactionType); - return this; - } - /** * Type of the transaction. */ - public Builder transactionType(Optional transactionType) { - Utils.checkNotNull(transactionType, "transactionType"); + public Builder transactionType(@Nullable TransactionType transactionType) { this.transactionType = transactionType; return this; } - /** * Due date of the transaction. */ - public Builder dueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = Optional.ofNullable(dueDate); - return this; - } - - /** - * Due date of the transaction. - */ - public Builder dueDate(Optional dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Builder dueDate(@Nullable LocalDate dueDate) { this.dueDate = dueDate; return this; } - - /** - * Original amount of the transaction. - */ - public Builder originalAmount(double originalAmount) { - Utils.checkNotNull(originalAmount, "originalAmount"); - this.originalAmount = Optional.ofNullable(originalAmount); - return this; - } - /** * Original amount of the transaction. */ - public Builder originalAmount(Optional originalAmount) { - Utils.checkNotNull(originalAmount, "originalAmount"); + public Builder originalAmount(@Nullable Double originalAmount) { this.originalAmount = originalAmount; return this; } - /** * Outstanding balance of the transaction. */ - public Builder outstandingBalance(double outstandingBalance) { - Utils.checkNotNull(outstandingBalance, "outstandingBalance"); - this.outstandingBalance = Optional.ofNullable(outstandingBalance); - return this; - } - - /** - * Outstanding balance of the transaction. - */ - public Builder outstandingBalance(Optional outstandingBalance) { - Utils.checkNotNull(outstandingBalance, "outstandingBalance"); + public Builder outstandingBalance(@Nullable Double outstandingBalance) { this.outstandingBalance = outstandingBalance; return this; } - /** * Transaction number of the transaction. */ - public Builder transactionNumber(String transactionNumber) { - Utils.checkNotNull(transactionNumber, "transactionNumber"); - this.transactionNumber = Optional.ofNullable(transactionNumber); - return this; - } - - /** - * Transaction number of the transaction. - */ - public Builder transactionNumber(Optional transactionNumber) { - Utils.checkNotNull(transactionNumber, "transactionNumber"); + public Builder transactionNumber(@Nullable String transactionNumber) { this.transactionNumber = transactionNumber; return this; } public BalanceByTransaction build() { - return new BalanceByTransaction( transactionId, transactionDate, transactionType, dueDate, originalAmount, outstandingBalance, diff --git a/src/main/java/com/apideck/unify/models/components/BalanceSheet.java b/src/main/java/com/apideck/unify/models/components/BalanceSheet.java index 1d3bdb49..5a499e1d 100644 --- a/src/main/java/com/apideck/unify/models/components/BalanceSheet.java +++ b/src/main/java/com/apideck/unify/models/components/BalanceSheet.java @@ -5,11 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; import java.lang.Override; import java.lang.String; import java.util.List; +import java.util.Optional; public class BalanceSheet { @@ -19,14 +20,13 @@ public class BalanceSheet { @JsonCreator public BalanceSheet( - @JsonProperty("reports") List reports) { - Utils.checkNotNull(reports, "reports"); - this.reports = reports; + @JsonProperty("reports") @Nonnull List reports) { + this.reports = Optional.ofNullable(reports) + .orElseThrow(() -> new IllegalArgumentException("reports cannot be null")); } - @JsonIgnore public List reports() { - return reports; + return this.reports; } public static Builder builder() { @@ -34,12 +34,12 @@ public static Builder builder() { } - public BalanceSheet withReports(List reports) { - Utils.checkNotNull(reports, "reports"); - this.reports = reports; + public BalanceSheet withReports(@Nonnull List reports) { + this.reports = Utils.checkNotNull(reports, "reports"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,15 +74,12 @@ private Builder() { // force use of static builder() method } - - public Builder reports(List reports) { - Utils.checkNotNull(reports, "reports"); - this.reports = reports; + public Builder reports(@Nonnull List reports) { + this.reports = Utils.checkNotNull(reports, "reports"); return this; } public BalanceSheet build() { - return new BalanceSheet( reports); } diff --git a/src/main/java/com/apideck/unify/models/components/BalanceSheetAssetsAccount.java b/src/main/java/com/apideck/unify/models/components/BalanceSheetAssetsAccount.java index f9ac9ed6..c35a356a 100644 --- a/src/main/java/com/apideck/unify/models/components/BalanceSheetAssetsAccount.java +++ b/src/main/java/com/apideck/unify/models/components/BalanceSheetAssetsAccount.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; /** @@ -27,48 +26,43 @@ public class BalanceSheetAssetsAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("account_id") - private Optional accountId; + private String accountId; /** * The account code of the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * The name of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * The amount or value of the item */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private Double value; /** * A list of balance sheet accounts */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("items") - private Optional items; + private Object items; @JsonCreator public BalanceSheetAssetsAccount( - @JsonProperty("account_id") Optional accountId, - @JsonProperty("code") Optional code, - @JsonProperty("name") Optional name, - @JsonProperty("value") Optional value, - @JsonProperty("items") Optional items) { - Utils.checkNotNull(accountId, "accountId"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(value, "value"); - Utils.checkNotNull(items, "items"); + @JsonProperty("account_id") @Nullable String accountId, + @JsonProperty("code") @Nullable String code, + @JsonProperty("name") @Nullable String name, + @JsonProperty("value") @Nullable Double value, + @JsonProperty("items") @Nullable Object items) { this.accountId = accountId; this.code = code; this.name = name; @@ -77,49 +71,43 @@ public BalanceSheetAssetsAccount( } public BalanceSheetAssetsAccount() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * The unique identifier for the account. */ - @JsonIgnore public Optional accountId() { - return accountId; + return Optional.ofNullable(this.accountId); } /** * The account code of the account */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * The name of the account. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The amount or value of the item */ - @JsonIgnore public Optional value() { - return value; + return Optional.ofNullable(this.value); } /** * A list of balance sheet accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional items() { - return (Optional) items; + return Optional.ofNullable(this.items); } public static Builder builder() { @@ -130,98 +118,48 @@ public static Builder builder() { /** * The unique identifier for the account. */ - public BalanceSheetAssetsAccount withAccountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - - - /** - * The unique identifier for the account. - */ - public BalanceSheetAssetsAccount withAccountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public BalanceSheetAssetsAccount withAccountId(@Nullable String accountId) { this.accountId = accountId; return this; } - /** - * The account code of the account - */ - public BalanceSheetAssetsAccount withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The account code of the account */ - public BalanceSheetAssetsAccount withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public BalanceSheetAssetsAccount withCode(@Nullable String code) { this.code = code; return this; } - /** - * The name of the account. - */ - public BalanceSheetAssetsAccount withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the account. */ - public BalanceSheetAssetsAccount withName(Optional name) { - Utils.checkNotNull(name, "name"); + public BalanceSheetAssetsAccount withName(@Nullable String name) { this.name = name; return this; } - /** - * The amount or value of the item - */ - public BalanceSheetAssetsAccount withValue(double value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * The amount or value of the item */ - public BalanceSheetAssetsAccount withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public BalanceSheetAssetsAccount withValue(@Nullable Double value) { this.value = value; return this; } - /** - * A list of balance sheet accounts - */ - public BalanceSheetAssetsAccount withItems(Object items) { - Utils.checkNotNull(items, "items"); - this.items = Optional.ofNullable(items); - return this; - } - /** * A list of balance sheet accounts */ - public BalanceSheetAssetsAccount withItems(Optional items) { - Utils.checkNotNull(items, "items"); + public BalanceSheetAssetsAccount withItems(@Nullable Object items) { this.items = items; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -259,117 +197,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional accountId = Optional.empty(); + private String accountId; - private Optional code = Optional.empty(); + private String code; - private Optional name = Optional.empty(); + private String name; - private Optional value = Optional.empty(); + private Double value; - private Optional items = Optional.empty(); + private Object items; private Builder() { // force use of static builder() method } - - /** - * The unique identifier for the account. - */ - public Builder accountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - /** * The unique identifier for the account. */ - public Builder accountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public Builder accountId(@Nullable String accountId) { this.accountId = accountId; return this; } - /** * The account code of the account */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The account code of the account - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - /** - * The name of the account. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the account. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * The amount or value of the item - */ - public Builder value(double value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * The amount or value of the item */ - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable Double value) { this.value = value; return this; } - - /** - * A list of balance sheet accounts - */ - public Builder items(Object items) { - Utils.checkNotNull(items, "items"); - this.items = Optional.ofNullable(items); - return this; - } - /** * A list of balance sheet accounts */ - public Builder items(Optional items) { - Utils.checkNotNull(items, "items"); + public Builder items(@Nullable Object items) { this.items = items; return this; } public BalanceSheetAssetsAccount build() { - return new BalanceSheetAssetsAccount( accountId, code, name, value, items); diff --git a/src/main/java/com/apideck/unify/models/components/BalanceSheetEquityAccount.java b/src/main/java/com/apideck/unify/models/components/BalanceSheetEquityAccount.java index 11224649..6c998f88 100644 --- a/src/main/java/com/apideck/unify/models/components/BalanceSheetEquityAccount.java +++ b/src/main/java/com/apideck/unify/models/components/BalanceSheetEquityAccount.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; /** @@ -27,48 +26,43 @@ public class BalanceSheetEquityAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("account_id") - private Optional accountId; + private String accountId; /** * The account code of the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * The name of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * The amount or value of the item */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private Double value; /** * A list of balance sheet accounts */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("items") - private Optional items; + private Object items; @JsonCreator public BalanceSheetEquityAccount( - @JsonProperty("account_id") Optional accountId, - @JsonProperty("code") Optional code, - @JsonProperty("name") Optional name, - @JsonProperty("value") Optional value, - @JsonProperty("items") Optional items) { - Utils.checkNotNull(accountId, "accountId"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(value, "value"); - Utils.checkNotNull(items, "items"); + @JsonProperty("account_id") @Nullable String accountId, + @JsonProperty("code") @Nullable String code, + @JsonProperty("name") @Nullable String name, + @JsonProperty("value") @Nullable Double value, + @JsonProperty("items") @Nullable Object items) { this.accountId = accountId; this.code = code; this.name = name; @@ -77,49 +71,43 @@ public BalanceSheetEquityAccount( } public BalanceSheetEquityAccount() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * The unique identifier for the account. */ - @JsonIgnore public Optional accountId() { - return accountId; + return Optional.ofNullable(this.accountId); } /** * The account code of the account */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * The name of the account. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The amount or value of the item */ - @JsonIgnore public Optional value() { - return value; + return Optional.ofNullable(this.value); } /** * A list of balance sheet accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional items() { - return (Optional) items; + return Optional.ofNullable(this.items); } public static Builder builder() { @@ -130,98 +118,48 @@ public static Builder builder() { /** * The unique identifier for the account. */ - public BalanceSheetEquityAccount withAccountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - - - /** - * The unique identifier for the account. - */ - public BalanceSheetEquityAccount withAccountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public BalanceSheetEquityAccount withAccountId(@Nullable String accountId) { this.accountId = accountId; return this; } - /** - * The account code of the account - */ - public BalanceSheetEquityAccount withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The account code of the account */ - public BalanceSheetEquityAccount withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public BalanceSheetEquityAccount withCode(@Nullable String code) { this.code = code; return this; } - /** - * The name of the account. - */ - public BalanceSheetEquityAccount withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the account. */ - public BalanceSheetEquityAccount withName(Optional name) { - Utils.checkNotNull(name, "name"); + public BalanceSheetEquityAccount withName(@Nullable String name) { this.name = name; return this; } - /** - * The amount or value of the item - */ - public BalanceSheetEquityAccount withValue(double value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * The amount or value of the item */ - public BalanceSheetEquityAccount withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public BalanceSheetEquityAccount withValue(@Nullable Double value) { this.value = value; return this; } - /** - * A list of balance sheet accounts - */ - public BalanceSheetEquityAccount withItems(Object items) { - Utils.checkNotNull(items, "items"); - this.items = Optional.ofNullable(items); - return this; - } - /** * A list of balance sheet accounts */ - public BalanceSheetEquityAccount withItems(Optional items) { - Utils.checkNotNull(items, "items"); + public BalanceSheetEquityAccount withItems(@Nullable Object items) { this.items = items; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -259,117 +197,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional accountId = Optional.empty(); + private String accountId; - private Optional code = Optional.empty(); + private String code; - private Optional name = Optional.empty(); + private String name; - private Optional value = Optional.empty(); + private Double value; - private Optional items = Optional.empty(); + private Object items; private Builder() { // force use of static builder() method } - - /** - * The unique identifier for the account. - */ - public Builder accountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - /** * The unique identifier for the account. */ - public Builder accountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public Builder accountId(@Nullable String accountId) { this.accountId = accountId; return this; } - /** * The account code of the account */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The account code of the account - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - /** - * The name of the account. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the account. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * The amount or value of the item - */ - public Builder value(double value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * The amount or value of the item */ - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable Double value) { this.value = value; return this; } - - /** - * A list of balance sheet accounts - */ - public Builder items(Object items) { - Utils.checkNotNull(items, "items"); - this.items = Optional.ofNullable(items); - return this; - } - /** * A list of balance sheet accounts */ - public Builder items(Optional items) { - Utils.checkNotNull(items, "items"); + public Builder items(@Nullable Object items) { this.items = items; return this; } public BalanceSheetEquityAccount build() { - return new BalanceSheetEquityAccount( accountId, code, name, value, items); diff --git a/src/main/java/com/apideck/unify/models/components/BalanceSheetFilter.java b/src/main/java/com/apideck/unify/models/components/BalanceSheetFilter.java index e2521e39..06699364 100644 --- a/src/main/java/com/apideck/unify/models/components/BalanceSheetFilter.java +++ b/src/main/java/com/apideck/unify/models/components/BalanceSheetFilter.java @@ -6,12 +6,11 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Deprecated; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -23,45 +22,49 @@ public class BalanceSheetFilter { */ @SpeakeasyMetadata("queryParam:name=start_date") @Deprecated - private Optional startDate; + private String startDate; /** * The end date of the period to include in the resource. */ @SpeakeasyMetadata("queryParam:name=end_date") - private Optional endDate; + private String endDate; /** * The number of periods to include in the resource. */ @SpeakeasyMetadata("queryParam:name=period_count") - private Optional periodCount; + private Long periodCount; /** * The type of period to include in the resource: month, quarter, year. */ @SpeakeasyMetadata("queryParam:name=period_type") - private Optional periodType; + private PeriodType periodType; + + /** + * The ID of the location to include in the resource. + */ + @SpeakeasyMetadata("queryParam:name=location_id") + private String locationId; @JsonCreator public BalanceSheetFilter( - Optional startDate, - Optional endDate, - Optional periodCount, - Optional periodType) { - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(periodCount, "periodCount"); - Utils.checkNotNull(periodType, "periodType"); + @Nullable String startDate, + @Nullable String endDate, + @Nullable Long periodCount, + @Nullable PeriodType periodType, + @Nullable String locationId) { this.startDate = startDate; this.endDate = endDate; this.periodCount = periodCount; this.periodType = periodType; + this.locationId = locationId; } public BalanceSheetFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null); } /** @@ -70,51 +73,40 @@ public BalanceSheetFilter() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public Optional startDate() { - return startDate; + return Optional.ofNullable(this.startDate); } /** * The end date of the period to include in the resource. */ - @JsonIgnore public Optional endDate() { - return endDate; + return Optional.ofNullable(this.endDate); } /** * The number of periods to include in the resource. */ - @JsonIgnore public Optional periodCount() { - return periodCount; + return Optional.ofNullable(this.periodCount); } /** * The type of period to include in the resource: month, quarter, year. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional periodType() { - return (Optional) periodType; - } - - public static Builder builder() { - return new Builder(); + return Optional.ofNullable(this.periodType); } - /** - * The start date of the period to include in the resource. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + * The ID of the location to include in the resource. */ - @Deprecated - public BalanceSheetFilter withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; + public Optional locationId() { + return Optional.ofNullable(this.locationId); + } + + public static Builder builder() { + return new Builder(); } @@ -124,69 +116,48 @@ public BalanceSheetFilter withStartDate(String startDate) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public BalanceSheetFilter withStartDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public BalanceSheetFilter withStartDate(@Nullable String startDate) { this.startDate = startDate; return this; } - /** - * The end date of the period to include in the resource. - */ - public BalanceSheetFilter withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * The end date of the period to include in the resource. */ - public BalanceSheetFilter withEndDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public BalanceSheetFilter withEndDate(@Nullable String endDate) { this.endDate = endDate; return this; } - /** - * The number of periods to include in the resource. - */ - public BalanceSheetFilter withPeriodCount(long periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); - this.periodCount = Optional.ofNullable(periodCount); - return this; - } - /** * The number of periods to include in the resource. */ - public BalanceSheetFilter withPeriodCount(Optional periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); + public BalanceSheetFilter withPeriodCount(@Nullable Long periodCount) { this.periodCount = periodCount; return this; } + /** * The type of period to include in the resource: month, quarter, year. */ - public BalanceSheetFilter withPeriodType(PeriodType periodType) { - Utils.checkNotNull(periodType, "periodType"); - this.periodType = Optional.ofNullable(periodType); + public BalanceSheetFilter withPeriodType(@Nullable PeriodType periodType) { + this.periodType = periodType; return this; } /** - * The type of period to include in the resource: month, quarter, year. + * The ID of the location to include in the resource. */ - public BalanceSheetFilter withPeriodType(Optional periodType) { - Utils.checkNotNull(periodType, "periodType"); - this.periodType = periodType; + public BalanceSheetFilter withLocationId(@Nullable String locationId) { + this.locationId = locationId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -200,14 +171,15 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.startDate, other.startDate) && Utils.enhancedDeepEquals(this.endDate, other.endDate) && Utils.enhancedDeepEquals(this.periodCount, other.periodCount) && - Utils.enhancedDeepEquals(this.periodType, other.periodType); + Utils.enhancedDeepEquals(this.periodType, other.periodType) && + Utils.enhancedDeepEquals(this.locationId, other.locationId); } @Override public int hashCode() { return Utils.enhancedHash( startDate, endDate, periodCount, - periodType); + periodType, locationId); } @Override @@ -216,112 +188,75 @@ public String toString() { "startDate", startDate, "endDate", endDate, "periodCount", periodCount, - "periodType", periodType); + "periodType", periodType, + "locationId", locationId); } @SuppressWarnings("UnusedReturnValue") public final static class Builder { @Deprecated - private Optional startDate = Optional.empty(); + private String startDate; - private Optional endDate = Optional.empty(); + private String endDate; - private Optional periodCount = Optional.empty(); + private Long periodCount; - private Optional periodType = Optional.empty(); + private PeriodType periodType; + + private String locationId; private Builder() { // force use of static builder() method } - - /** - * The start date of the period to include in the resource. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - /** * The start date of the period to include in the resource. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder startDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable String startDate) { this.startDate = startDate; return this; } - - /** - * The end date of the period to include in the resource. - */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * The end date of the period to include in the resource. */ - public Builder endDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable String endDate) { this.endDate = endDate; return this; } - - /** - * The number of periods to include in the resource. - */ - public Builder periodCount(long periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); - this.periodCount = Optional.ofNullable(periodCount); - return this; - } - /** * The number of periods to include in the resource. */ - public Builder periodCount(Optional periodCount) { - Utils.checkNotNull(periodCount, "periodCount"); + public Builder periodCount(@Nullable Long periodCount) { this.periodCount = periodCount; return this; } - /** * The type of period to include in the resource: month, quarter, year. */ - public Builder periodType(PeriodType periodType) { - Utils.checkNotNull(periodType, "periodType"); - this.periodType = Optional.ofNullable(periodType); + public Builder periodType(@Nullable PeriodType periodType) { + this.periodType = periodType; return this; } /** - * The type of period to include in the resource: month, quarter, year. + * The ID of the location to include in the resource. */ - public Builder periodType(Optional periodType) { - Utils.checkNotNull(periodType, "periodType"); - this.periodType = periodType; + public Builder locationId(@Nullable String locationId) { + this.locationId = locationId; return this; } public BalanceSheetFilter build() { - return new BalanceSheetFilter( startDate, endDate, periodCount, - periodType); + periodType, locationId); } } diff --git a/src/main/java/com/apideck/unify/models/components/BalanceSheetLiabilitiesAccount.java b/src/main/java/com/apideck/unify/models/components/BalanceSheetLiabilitiesAccount.java index 47457feb..213cc5e5 100644 --- a/src/main/java/com/apideck/unify/models/components/BalanceSheetLiabilitiesAccount.java +++ b/src/main/java/com/apideck/unify/models/components/BalanceSheetLiabilitiesAccount.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; /** @@ -27,48 +26,43 @@ public class BalanceSheetLiabilitiesAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("account_id") - private Optional accountId; + private String accountId; /** * The account code of the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * The name of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * The amount or value of the item */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private Double value; /** * A list of balance sheet accounts */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("items") - private Optional items; + private Object items; @JsonCreator public BalanceSheetLiabilitiesAccount( - @JsonProperty("account_id") Optional accountId, - @JsonProperty("code") Optional code, - @JsonProperty("name") Optional name, - @JsonProperty("value") Optional value, - @JsonProperty("items") Optional items) { - Utils.checkNotNull(accountId, "accountId"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(value, "value"); - Utils.checkNotNull(items, "items"); + @JsonProperty("account_id") @Nullable String accountId, + @JsonProperty("code") @Nullable String code, + @JsonProperty("name") @Nullable String name, + @JsonProperty("value") @Nullable Double value, + @JsonProperty("items") @Nullable Object items) { this.accountId = accountId; this.code = code; this.name = name; @@ -77,49 +71,43 @@ public BalanceSheetLiabilitiesAccount( } public BalanceSheetLiabilitiesAccount() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * The unique identifier for the account. */ - @JsonIgnore public Optional accountId() { - return accountId; + return Optional.ofNullable(this.accountId); } /** * The account code of the account */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * The name of the account. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The amount or value of the item */ - @JsonIgnore public Optional value() { - return value; + return Optional.ofNullable(this.value); } /** * A list of balance sheet accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional items() { - return (Optional) items; + return Optional.ofNullable(this.items); } public static Builder builder() { @@ -130,98 +118,48 @@ public static Builder builder() { /** * The unique identifier for the account. */ - public BalanceSheetLiabilitiesAccount withAccountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - - - /** - * The unique identifier for the account. - */ - public BalanceSheetLiabilitiesAccount withAccountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public BalanceSheetLiabilitiesAccount withAccountId(@Nullable String accountId) { this.accountId = accountId; return this; } - /** - * The account code of the account - */ - public BalanceSheetLiabilitiesAccount withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The account code of the account */ - public BalanceSheetLiabilitiesAccount withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public BalanceSheetLiabilitiesAccount withCode(@Nullable String code) { this.code = code; return this; } - /** - * The name of the account. - */ - public BalanceSheetLiabilitiesAccount withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the account. */ - public BalanceSheetLiabilitiesAccount withName(Optional name) { - Utils.checkNotNull(name, "name"); + public BalanceSheetLiabilitiesAccount withName(@Nullable String name) { this.name = name; return this; } - /** - * The amount or value of the item - */ - public BalanceSheetLiabilitiesAccount withValue(double value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * The amount or value of the item */ - public BalanceSheetLiabilitiesAccount withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public BalanceSheetLiabilitiesAccount withValue(@Nullable Double value) { this.value = value; return this; } - /** - * A list of balance sheet accounts - */ - public BalanceSheetLiabilitiesAccount withItems(Object items) { - Utils.checkNotNull(items, "items"); - this.items = Optional.ofNullable(items); - return this; - } - /** * A list of balance sheet accounts */ - public BalanceSheetLiabilitiesAccount withItems(Optional items) { - Utils.checkNotNull(items, "items"); + public BalanceSheetLiabilitiesAccount withItems(@Nullable Object items) { this.items = items; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -259,117 +197,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional accountId = Optional.empty(); + private String accountId; - private Optional code = Optional.empty(); + private String code; - private Optional name = Optional.empty(); + private String name; - private Optional value = Optional.empty(); + private Double value; - private Optional items = Optional.empty(); + private Object items; private Builder() { // force use of static builder() method } - - /** - * The unique identifier for the account. - */ - public Builder accountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - /** * The unique identifier for the account. */ - public Builder accountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public Builder accountId(@Nullable String accountId) { this.accountId = accountId; return this; } - /** * The account code of the account */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The account code of the account - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - /** - * The name of the account. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the account. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * The amount or value of the item - */ - public Builder value(double value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * The amount or value of the item */ - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable Double value) { this.value = value; return this; } - - /** - * A list of balance sheet accounts - */ - public Builder items(Object items) { - Utils.checkNotNull(items, "items"); - this.items = Optional.ofNullable(items); - return this; - } - /** * A list of balance sheet accounts */ - public Builder items(Optional items) { - Utils.checkNotNull(items, "items"); + public Builder items(@Nullable Object items) { this.items = items; return this; } public BalanceSheetLiabilitiesAccount build() { - return new BalanceSheetLiabilitiesAccount( accountId, code, name, value, items); diff --git a/src/main/java/com/apideck/unify/models/components/BalanceSheetUncategorizedItemsAccount.java b/src/main/java/com/apideck/unify/models/components/BalanceSheetUncategorizedItemsAccount.java index fb6664be..57bae9aa 100644 --- a/src/main/java/com/apideck/unify/models/components/BalanceSheetUncategorizedItemsAccount.java +++ b/src/main/java/com/apideck/unify/models/components/BalanceSheetUncategorizedItemsAccount.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; /** @@ -27,48 +26,43 @@ public class BalanceSheetUncategorizedItemsAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("account_id") - private Optional accountId; + private String accountId; /** * The account code of the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * The name of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * The amount or value of the item */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private Double value; /** * A list of balance sheet accounts */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("items") - private Optional items; + private Object items; @JsonCreator public BalanceSheetUncategorizedItemsAccount( - @JsonProperty("account_id") Optional accountId, - @JsonProperty("code") Optional code, - @JsonProperty("name") Optional name, - @JsonProperty("value") Optional value, - @JsonProperty("items") Optional items) { - Utils.checkNotNull(accountId, "accountId"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(value, "value"); - Utils.checkNotNull(items, "items"); + @JsonProperty("account_id") @Nullable String accountId, + @JsonProperty("code") @Nullable String code, + @JsonProperty("name") @Nullable String name, + @JsonProperty("value") @Nullable Double value, + @JsonProperty("items") @Nullable Object items) { this.accountId = accountId; this.code = code; this.name = name; @@ -77,49 +71,43 @@ public BalanceSheetUncategorizedItemsAccount( } public BalanceSheetUncategorizedItemsAccount() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * The unique identifier for the account. */ - @JsonIgnore public Optional accountId() { - return accountId; + return Optional.ofNullable(this.accountId); } /** * The account code of the account */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * The name of the account. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The amount or value of the item */ - @JsonIgnore public Optional value() { - return value; + return Optional.ofNullable(this.value); } /** * A list of balance sheet accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional items() { - return (Optional) items; + return Optional.ofNullable(this.items); } public static Builder builder() { @@ -130,98 +118,48 @@ public static Builder builder() { /** * The unique identifier for the account. */ - public BalanceSheetUncategorizedItemsAccount withAccountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - - - /** - * The unique identifier for the account. - */ - public BalanceSheetUncategorizedItemsAccount withAccountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public BalanceSheetUncategorizedItemsAccount withAccountId(@Nullable String accountId) { this.accountId = accountId; return this; } - /** - * The account code of the account - */ - public BalanceSheetUncategorizedItemsAccount withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The account code of the account */ - public BalanceSheetUncategorizedItemsAccount withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public BalanceSheetUncategorizedItemsAccount withCode(@Nullable String code) { this.code = code; return this; } - /** - * The name of the account. - */ - public BalanceSheetUncategorizedItemsAccount withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the account. */ - public BalanceSheetUncategorizedItemsAccount withName(Optional name) { - Utils.checkNotNull(name, "name"); + public BalanceSheetUncategorizedItemsAccount withName(@Nullable String name) { this.name = name; return this; } - /** - * The amount or value of the item - */ - public BalanceSheetUncategorizedItemsAccount withValue(double value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * The amount or value of the item */ - public BalanceSheetUncategorizedItemsAccount withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public BalanceSheetUncategorizedItemsAccount withValue(@Nullable Double value) { this.value = value; return this; } - /** - * A list of balance sheet accounts - */ - public BalanceSheetUncategorizedItemsAccount withItems(Object items) { - Utils.checkNotNull(items, "items"); - this.items = Optional.ofNullable(items); - return this; - } - /** * A list of balance sheet accounts */ - public BalanceSheetUncategorizedItemsAccount withItems(Optional items) { - Utils.checkNotNull(items, "items"); + public BalanceSheetUncategorizedItemsAccount withItems(@Nullable Object items) { this.items = items; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -259,117 +197,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional accountId = Optional.empty(); + private String accountId; - private Optional code = Optional.empty(); + private String code; - private Optional name = Optional.empty(); + private String name; - private Optional value = Optional.empty(); + private Double value; - private Optional items = Optional.empty(); + private Object items; private Builder() { // force use of static builder() method } - - /** - * The unique identifier for the account. - */ - public Builder accountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - /** * The unique identifier for the account. */ - public Builder accountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public Builder accountId(@Nullable String accountId) { this.accountId = accountId; return this; } - /** * The account code of the account */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The account code of the account - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - /** - * The name of the account. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the account. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * The amount or value of the item - */ - public Builder value(double value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * The amount or value of the item */ - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable Double value) { this.value = value; return this; } - - /** - * A list of balance sheet accounts - */ - public Builder items(Object items) { - Utils.checkNotNull(items, "items"); - this.items = Optional.ofNullable(items); - return this; - } - /** * A list of balance sheet accounts */ - public Builder items(Optional items) { - Utils.checkNotNull(items, "items"); + public Builder items(@Nullable Object items) { this.items = items; return this; } public BalanceSheetUncategorizedItemsAccount build() { - return new BalanceSheetUncategorizedItemsAccount( accountId, code, name, value, items); diff --git a/src/main/java/com/apideck/unify/models/components/BankAccount.java b/src/main/java/com/apideck/unify/models/components/BankAccount.java index e2e638db..a80c73d9 100644 --- a/src/main/java/com/apideck/unify/models/components/BankAccount.java +++ b/src/main/java/com/apideck/unify/models/components/BankAccount.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -42,7 +42,7 @@ public class BankAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("account_type") - private JsonNullable accountType; + private JsonNullable accountType; /** * The International Bank Account Number (IBAN). @@ -91,7 +91,7 @@ public class BankAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Country code according to ISO 3166-1 alpha-2. @@ -102,147 +102,133 @@ public class BankAccount { @JsonCreator public BankAccount( - @JsonProperty("bank_name") JsonNullable bankName, - @JsonProperty("account_number") JsonNullable accountNumber, - @JsonProperty("account_name") JsonNullable accountName, - @JsonProperty("account_type") JsonNullable accountType, - @JsonProperty("iban") JsonNullable iban, - @JsonProperty("bic") JsonNullable bic, - @JsonProperty("routing_number") JsonNullable routingNumber, - @JsonProperty("bsb_number") JsonNullable bsbNumber, - @JsonProperty("branch_identifier") JsonNullable branchIdentifier, - @JsonProperty("bank_code") JsonNullable bankCode, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("country") JsonNullable country) { - Utils.checkNotNull(bankName, "bankName"); - Utils.checkNotNull(accountNumber, "accountNumber"); - Utils.checkNotNull(accountName, "accountName"); - Utils.checkNotNull(accountType, "accountType"); - Utils.checkNotNull(iban, "iban"); - Utils.checkNotNull(bic, "bic"); - Utils.checkNotNull(routingNumber, "routingNumber"); - Utils.checkNotNull(bsbNumber, "bsbNumber"); - Utils.checkNotNull(branchIdentifier, "branchIdentifier"); - Utils.checkNotNull(bankCode, "bankCode"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(country, "country"); - this.bankName = bankName; - this.accountNumber = accountNumber; - this.accountName = accountName; - this.accountType = accountType; - this.iban = iban; - this.bic = bic; - this.routingNumber = routingNumber; - this.bsbNumber = bsbNumber; - this.branchIdentifier = branchIdentifier; - this.bankCode = bankCode; - this.currency = currency; - this.country = country; + @JsonProperty("bank_name") @Nullable JsonNullable bankName, + @JsonProperty("account_number") @Nullable JsonNullable accountNumber, + @JsonProperty("account_name") @Nullable JsonNullable accountName, + @JsonProperty("account_type") @Nullable JsonNullable accountType, + @JsonProperty("iban") @Nullable JsonNullable iban, + @JsonProperty("bic") @Nullable JsonNullable bic, + @JsonProperty("routing_number") @Nullable JsonNullable routingNumber, + @JsonProperty("bsb_number") @Nullable JsonNullable bsbNumber, + @JsonProperty("branch_identifier") @Nullable JsonNullable branchIdentifier, + @JsonProperty("bank_code") @Nullable JsonNullable bankCode, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("country") @Nullable JsonNullable country) { + this.bankName = Optional.ofNullable(bankName) + .orElse(JsonNullable.undefined()); + this.accountNumber = Optional.ofNullable(accountNumber) + .orElse(JsonNullable.undefined()); + this.accountName = Optional.ofNullable(accountName) + .orElse(JsonNullable.undefined()); + this.accountType = Optional.ofNullable(accountType) + .orElse(JsonNullable.undefined()); + this.iban = Optional.ofNullable(iban) + .orElse(JsonNullable.undefined()); + this.bic = Optional.ofNullable(bic) + .orElse(JsonNullable.undefined()); + this.routingNumber = Optional.ofNullable(routingNumber) + .orElse(JsonNullable.undefined()); + this.bsbNumber = Optional.ofNullable(bsbNumber) + .orElse(JsonNullable.undefined()); + this.branchIdentifier = Optional.ofNullable(branchIdentifier) + .orElse(JsonNullable.undefined()); + this.bankCode = Optional.ofNullable(bankCode) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.country = Optional.ofNullable(country) + .orElse(JsonNullable.undefined()); } public BankAccount() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * The name of the bank */ - @JsonIgnore public JsonNullable bankName() { - return bankName; + return this.bankName; } /** * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. */ - @JsonIgnore public JsonNullable accountNumber() { - return accountNumber; + return this.accountNumber; } /** * The name which you used in opening your bank account. */ - @JsonIgnore public JsonNullable accountName() { - return accountName; + return this.accountName; } /** * The type of bank account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable accountType() { - return (JsonNullable) accountType; + return this.accountType; } /** * The International Bank Account Number (IBAN). */ - @JsonIgnore public JsonNullable iban() { - return iban; + return this.iban; } /** * The Bank Identifier Code (BIC). */ - @JsonIgnore public JsonNullable bic() { - return bic; + return this.bic; } /** * A routing number is a nine-digit code used to identify a financial institution in the United States. */ - @JsonIgnore public JsonNullable routingNumber() { - return routingNumber; + return this.routingNumber; } /** * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. */ - @JsonIgnore public JsonNullable bsbNumber() { - return bsbNumber; + return this.bsbNumber; } /** * A branch identifier is a unique identifier for a branch of a bank or financial institution. */ - @JsonIgnore public JsonNullable branchIdentifier() { - return branchIdentifier; + return this.branchIdentifier; } /** * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. */ - @JsonIgnore public JsonNullable bankCode() { - return bankCode; + return this.bankCode; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Country code according to ISO 3166-1 alpha-2. */ - @JsonIgnore public JsonNullable country() { - return country; + return this.country; } public static Builder builder() { @@ -253,218 +239,110 @@ public static Builder builder() { /** * The name of the bank */ - public BankAccount withBankName(String bankName) { - Utils.checkNotNull(bankName, "bankName"); + public BankAccount withBankName(@Nullable String bankName) { this.bankName = JsonNullable.of(bankName); return this; } - /** - * The name of the bank - */ - public BankAccount withBankName(JsonNullable bankName) { - Utils.checkNotNull(bankName, "bankName"); - this.bankName = bankName; - return this; - } /** * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. */ - public BankAccount withAccountNumber(String accountNumber) { - Utils.checkNotNull(accountNumber, "accountNumber"); + public BankAccount withAccountNumber(@Nullable String accountNumber) { this.accountNumber = JsonNullable.of(accountNumber); return this; } - /** - * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. - */ - public BankAccount withAccountNumber(JsonNullable accountNumber) { - Utils.checkNotNull(accountNumber, "accountNumber"); - this.accountNumber = accountNumber; - return this; - } /** * The name which you used in opening your bank account. */ - public BankAccount withAccountName(String accountName) { - Utils.checkNotNull(accountName, "accountName"); + public BankAccount withAccountName(@Nullable String accountName) { this.accountName = JsonNullable.of(accountName); return this; } - /** - * The name which you used in opening your bank account. - */ - public BankAccount withAccountName(JsonNullable accountName) { - Utils.checkNotNull(accountName, "accountName"); - this.accountName = accountName; - return this; - } /** * The type of bank account. */ - public BankAccount withAccountType(AccountType accountType) { - Utils.checkNotNull(accountType, "accountType"); + public BankAccount withAccountType(@Nullable AccountType accountType) { this.accountType = JsonNullable.of(accountType); return this; } - /** - * The type of bank account. - */ - public BankAccount withAccountType(JsonNullable accountType) { - Utils.checkNotNull(accountType, "accountType"); - this.accountType = accountType; - return this; - } /** * The International Bank Account Number (IBAN). */ - public BankAccount withIban(String iban) { - Utils.checkNotNull(iban, "iban"); + public BankAccount withIban(@Nullable String iban) { this.iban = JsonNullable.of(iban); return this; } - /** - * The International Bank Account Number (IBAN). - */ - public BankAccount withIban(JsonNullable iban) { - Utils.checkNotNull(iban, "iban"); - this.iban = iban; - return this; - } /** * The Bank Identifier Code (BIC). */ - public BankAccount withBic(String bic) { - Utils.checkNotNull(bic, "bic"); + public BankAccount withBic(@Nullable String bic) { this.bic = JsonNullable.of(bic); return this; } - /** - * The Bank Identifier Code (BIC). - */ - public BankAccount withBic(JsonNullable bic) { - Utils.checkNotNull(bic, "bic"); - this.bic = bic; - return this; - } /** * A routing number is a nine-digit code used to identify a financial institution in the United States. */ - public BankAccount withRoutingNumber(String routingNumber) { - Utils.checkNotNull(routingNumber, "routingNumber"); + public BankAccount withRoutingNumber(@Nullable String routingNumber) { this.routingNumber = JsonNullable.of(routingNumber); return this; } - /** - * A routing number is a nine-digit code used to identify a financial institution in the United States. - */ - public BankAccount withRoutingNumber(JsonNullable routingNumber) { - Utils.checkNotNull(routingNumber, "routingNumber"); - this.routingNumber = routingNumber; - return this; - } /** * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. */ - public BankAccount withBsbNumber(String bsbNumber) { - Utils.checkNotNull(bsbNumber, "bsbNumber"); + public BankAccount withBsbNumber(@Nullable String bsbNumber) { this.bsbNumber = JsonNullable.of(bsbNumber); return this; } - /** - * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. - */ - public BankAccount withBsbNumber(JsonNullable bsbNumber) { - Utils.checkNotNull(bsbNumber, "bsbNumber"); - this.bsbNumber = bsbNumber; - return this; - } /** * A branch identifier is a unique identifier for a branch of a bank or financial institution. */ - public BankAccount withBranchIdentifier(String branchIdentifier) { - Utils.checkNotNull(branchIdentifier, "branchIdentifier"); + public BankAccount withBranchIdentifier(@Nullable String branchIdentifier) { this.branchIdentifier = JsonNullable.of(branchIdentifier); return this; } - /** - * A branch identifier is a unique identifier for a branch of a bank or financial institution. - */ - public BankAccount withBranchIdentifier(JsonNullable branchIdentifier) { - Utils.checkNotNull(branchIdentifier, "branchIdentifier"); - this.branchIdentifier = branchIdentifier; - return this; - } /** * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. */ - public BankAccount withBankCode(String bankCode) { - Utils.checkNotNull(bankCode, "bankCode"); + public BankAccount withBankCode(@Nullable String bankCode) { this.bankCode = JsonNullable.of(bankCode); return this; } - /** - * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. - */ - public BankAccount withBankCode(JsonNullable bankCode) { - Utils.checkNotNull(bankCode, "bankCode"); - this.bankCode = bankCode; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public BankAccount withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public BankAccount withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public BankAccount withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Country code according to ISO 3166-1 alpha-2. */ - public BankAccount withCountry(String country) { - Utils.checkNotNull(country, "country"); + public BankAccount withCountry(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public BankAccount withCountry(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -519,264 +397,131 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable bankName = JsonNullable.undefined(); + private JsonNullable bankName; - private JsonNullable accountNumber = JsonNullable.undefined(); + private JsonNullable accountNumber; - private JsonNullable accountName = JsonNullable.undefined(); + private JsonNullable accountName; - private JsonNullable accountType = JsonNullable.undefined(); + private JsonNullable accountType; - private JsonNullable iban = JsonNullable.undefined(); + private JsonNullable iban; - private JsonNullable bic = JsonNullable.undefined(); + private JsonNullable bic; - private JsonNullable routingNumber = JsonNullable.undefined(); + private JsonNullable routingNumber; - private JsonNullable bsbNumber = JsonNullable.undefined(); + private JsonNullable bsbNumber; - private JsonNullable branchIdentifier = JsonNullable.undefined(); + private JsonNullable branchIdentifier; - private JsonNullable bankCode = JsonNullable.undefined(); + private JsonNullable bankCode; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable country = JsonNullable.undefined(); + private JsonNullable country; private Builder() { // force use of static builder() method } - /** * The name of the bank */ - public Builder bankName(String bankName) { - Utils.checkNotNull(bankName, "bankName"); + public Builder bankName(@Nullable String bankName) { this.bankName = JsonNullable.of(bankName); return this; } - /** - * The name of the bank - */ - public Builder bankName(JsonNullable bankName) { - Utils.checkNotNull(bankName, "bankName"); - this.bankName = bankName; - return this; - } - - /** * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. */ - public Builder accountNumber(String accountNumber) { - Utils.checkNotNull(accountNumber, "accountNumber"); + public Builder accountNumber(@Nullable String accountNumber) { this.accountNumber = JsonNullable.of(accountNumber); return this; } - /** - * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. - */ - public Builder accountNumber(JsonNullable accountNumber) { - Utils.checkNotNull(accountNumber, "accountNumber"); - this.accountNumber = accountNumber; - return this; - } - - /** * The name which you used in opening your bank account. */ - public Builder accountName(String accountName) { - Utils.checkNotNull(accountName, "accountName"); + public Builder accountName(@Nullable String accountName) { this.accountName = JsonNullable.of(accountName); return this; } - /** - * The name which you used in opening your bank account. - */ - public Builder accountName(JsonNullable accountName) { - Utils.checkNotNull(accountName, "accountName"); - this.accountName = accountName; - return this; - } - - /** * The type of bank account. */ - public Builder accountType(AccountType accountType) { - Utils.checkNotNull(accountType, "accountType"); + public Builder accountType(@Nullable AccountType accountType) { this.accountType = JsonNullable.of(accountType); return this; } - /** - * The type of bank account. - */ - public Builder accountType(JsonNullable accountType) { - Utils.checkNotNull(accountType, "accountType"); - this.accountType = accountType; - return this; - } - - /** * The International Bank Account Number (IBAN). */ - public Builder iban(String iban) { - Utils.checkNotNull(iban, "iban"); + public Builder iban(@Nullable String iban) { this.iban = JsonNullable.of(iban); return this; } - /** - * The International Bank Account Number (IBAN). - */ - public Builder iban(JsonNullable iban) { - Utils.checkNotNull(iban, "iban"); - this.iban = iban; - return this; - } - - /** * The Bank Identifier Code (BIC). */ - public Builder bic(String bic) { - Utils.checkNotNull(bic, "bic"); + public Builder bic(@Nullable String bic) { this.bic = JsonNullable.of(bic); return this; } - /** - * The Bank Identifier Code (BIC). - */ - public Builder bic(JsonNullable bic) { - Utils.checkNotNull(bic, "bic"); - this.bic = bic; - return this; - } - - /** * A routing number is a nine-digit code used to identify a financial institution in the United States. */ - public Builder routingNumber(String routingNumber) { - Utils.checkNotNull(routingNumber, "routingNumber"); + public Builder routingNumber(@Nullable String routingNumber) { this.routingNumber = JsonNullable.of(routingNumber); return this; } - /** - * A routing number is a nine-digit code used to identify a financial institution in the United States. - */ - public Builder routingNumber(JsonNullable routingNumber) { - Utils.checkNotNull(routingNumber, "routingNumber"); - this.routingNumber = routingNumber; - return this; - } - - /** * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. */ - public Builder bsbNumber(String bsbNumber) { - Utils.checkNotNull(bsbNumber, "bsbNumber"); + public Builder bsbNumber(@Nullable String bsbNumber) { this.bsbNumber = JsonNullable.of(bsbNumber); return this; } - /** - * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. - */ - public Builder bsbNumber(JsonNullable bsbNumber) { - Utils.checkNotNull(bsbNumber, "bsbNumber"); - this.bsbNumber = bsbNumber; - return this; - } - - /** * A branch identifier is a unique identifier for a branch of a bank or financial institution. */ - public Builder branchIdentifier(String branchIdentifier) { - Utils.checkNotNull(branchIdentifier, "branchIdentifier"); + public Builder branchIdentifier(@Nullable String branchIdentifier) { this.branchIdentifier = JsonNullable.of(branchIdentifier); return this; } - /** - * A branch identifier is a unique identifier for a branch of a bank or financial institution. - */ - public Builder branchIdentifier(JsonNullable branchIdentifier) { - Utils.checkNotNull(branchIdentifier, "branchIdentifier"); - this.branchIdentifier = branchIdentifier; - return this; - } - - /** * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. */ - public Builder bankCode(String bankCode) { - Utils.checkNotNull(bankCode, "bankCode"); + public Builder bankCode(@Nullable String bankCode) { this.bankCode = JsonNullable.of(bankCode); return this; } - /** - * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. - */ - public Builder bankCode(JsonNullable bankCode) { - Utils.checkNotNull(bankCode, "bankCode"); - this.bankCode = bankCode; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Country code according to ISO 3166-1 alpha-2. */ - public Builder country(String country) { - Utils.checkNotNull(country, "country"); + public Builder country(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public Builder country(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - public BankAccount build() { - return new BankAccount( bankName, accountNumber, accountName, accountType, iban, bic, diff --git a/src/main/java/com/apideck/unify/models/components/BankAccount1.java b/src/main/java/com/apideck/unify/models/components/BankAccount1.java index a415e908..bc72f8b8 100644 --- a/src/main/java/com/apideck/unify/models/components/BankAccount1.java +++ b/src/main/java/com/apideck/unify/models/components/BankAccount1.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -42,7 +42,7 @@ public class BankAccount1 { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("account_type") - private JsonNullable accountType; + private JsonNullable accountType; /** * The International Bank Account Number (IBAN). @@ -91,7 +91,7 @@ public class BankAccount1 { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Country code according to ISO 3166-1 alpha-2. @@ -102,147 +102,133 @@ public class BankAccount1 { @JsonCreator public BankAccount1( - @JsonProperty("bank_name") JsonNullable bankName, - @JsonProperty("account_number") JsonNullable accountNumber, - @JsonProperty("account_name") JsonNullable accountName, - @JsonProperty("account_type") JsonNullable accountType, - @JsonProperty("iban") JsonNullable iban, - @JsonProperty("bic") JsonNullable bic, - @JsonProperty("routing_number") JsonNullable routingNumber, - @JsonProperty("bsb_number") JsonNullable bsbNumber, - @JsonProperty("branch_identifier") JsonNullable branchIdentifier, - @JsonProperty("bank_code") JsonNullable bankCode, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("country") JsonNullable country) { - Utils.checkNotNull(bankName, "bankName"); - Utils.checkNotNull(accountNumber, "accountNumber"); - Utils.checkNotNull(accountName, "accountName"); - Utils.checkNotNull(accountType, "accountType"); - Utils.checkNotNull(iban, "iban"); - Utils.checkNotNull(bic, "bic"); - Utils.checkNotNull(routingNumber, "routingNumber"); - Utils.checkNotNull(bsbNumber, "bsbNumber"); - Utils.checkNotNull(branchIdentifier, "branchIdentifier"); - Utils.checkNotNull(bankCode, "bankCode"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(country, "country"); - this.bankName = bankName; - this.accountNumber = accountNumber; - this.accountName = accountName; - this.accountType = accountType; - this.iban = iban; - this.bic = bic; - this.routingNumber = routingNumber; - this.bsbNumber = bsbNumber; - this.branchIdentifier = branchIdentifier; - this.bankCode = bankCode; - this.currency = currency; - this.country = country; + @JsonProperty("bank_name") @Nullable JsonNullable bankName, + @JsonProperty("account_number") @Nullable JsonNullable accountNumber, + @JsonProperty("account_name") @Nullable JsonNullable accountName, + @JsonProperty("account_type") @Nullable JsonNullable accountType, + @JsonProperty("iban") @Nullable JsonNullable iban, + @JsonProperty("bic") @Nullable JsonNullable bic, + @JsonProperty("routing_number") @Nullable JsonNullable routingNumber, + @JsonProperty("bsb_number") @Nullable JsonNullable bsbNumber, + @JsonProperty("branch_identifier") @Nullable JsonNullable branchIdentifier, + @JsonProperty("bank_code") @Nullable JsonNullable bankCode, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("country") @Nullable JsonNullable country) { + this.bankName = Optional.ofNullable(bankName) + .orElse(JsonNullable.undefined()); + this.accountNumber = Optional.ofNullable(accountNumber) + .orElse(JsonNullable.undefined()); + this.accountName = Optional.ofNullable(accountName) + .orElse(JsonNullable.undefined()); + this.accountType = Optional.ofNullable(accountType) + .orElse(JsonNullable.undefined()); + this.iban = Optional.ofNullable(iban) + .orElse(JsonNullable.undefined()); + this.bic = Optional.ofNullable(bic) + .orElse(JsonNullable.undefined()); + this.routingNumber = Optional.ofNullable(routingNumber) + .orElse(JsonNullable.undefined()); + this.bsbNumber = Optional.ofNullable(bsbNumber) + .orElse(JsonNullable.undefined()); + this.branchIdentifier = Optional.ofNullable(branchIdentifier) + .orElse(JsonNullable.undefined()); + this.bankCode = Optional.ofNullable(bankCode) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.country = Optional.ofNullable(country) + .orElse(JsonNullable.undefined()); } public BankAccount1() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * The name of the bank */ - @JsonIgnore public JsonNullable bankName() { - return bankName; + return this.bankName; } /** * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. */ - @JsonIgnore public JsonNullable accountNumber() { - return accountNumber; + return this.accountNumber; } /** * The name which you used in opening your bank account. */ - @JsonIgnore public JsonNullable accountName() { - return accountName; + return this.accountName; } /** * The type of bank account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable accountType() { - return (JsonNullable) accountType; + return this.accountType; } /** * The International Bank Account Number (IBAN). */ - @JsonIgnore public JsonNullable iban() { - return iban; + return this.iban; } /** * The Bank Identifier Code (BIC). */ - @JsonIgnore public JsonNullable bic() { - return bic; + return this.bic; } /** * A routing number is a nine-digit code used to identify a financial institution in the United States. */ - @JsonIgnore public JsonNullable routingNumber() { - return routingNumber; + return this.routingNumber; } /** * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. */ - @JsonIgnore public JsonNullable bsbNumber() { - return bsbNumber; + return this.bsbNumber; } /** * A branch identifier is a unique identifier for a branch of a bank or financial institution. */ - @JsonIgnore public JsonNullable branchIdentifier() { - return branchIdentifier; + return this.branchIdentifier; } /** * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. */ - @JsonIgnore public JsonNullable bankCode() { - return bankCode; + return this.bankCode; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Country code according to ISO 3166-1 alpha-2. */ - @JsonIgnore public JsonNullable country() { - return country; + return this.country; } public static Builder builder() { @@ -253,218 +239,110 @@ public static Builder builder() { /** * The name of the bank */ - public BankAccount1 withBankName(String bankName) { - Utils.checkNotNull(bankName, "bankName"); + public BankAccount1 withBankName(@Nullable String bankName) { this.bankName = JsonNullable.of(bankName); return this; } - /** - * The name of the bank - */ - public BankAccount1 withBankName(JsonNullable bankName) { - Utils.checkNotNull(bankName, "bankName"); - this.bankName = bankName; - return this; - } /** * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. */ - public BankAccount1 withAccountNumber(String accountNumber) { - Utils.checkNotNull(accountNumber, "accountNumber"); + public BankAccount1 withAccountNumber(@Nullable String accountNumber) { this.accountNumber = JsonNullable.of(accountNumber); return this; } - /** - * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. - */ - public BankAccount1 withAccountNumber(JsonNullable accountNumber) { - Utils.checkNotNull(accountNumber, "accountNumber"); - this.accountNumber = accountNumber; - return this; - } /** * The name which you used in opening your bank account. */ - public BankAccount1 withAccountName(String accountName) { - Utils.checkNotNull(accountName, "accountName"); + public BankAccount1 withAccountName(@Nullable String accountName) { this.accountName = JsonNullable.of(accountName); return this; } - /** - * The name which you used in opening your bank account. - */ - public BankAccount1 withAccountName(JsonNullable accountName) { - Utils.checkNotNull(accountName, "accountName"); - this.accountName = accountName; - return this; - } /** * The type of bank account. */ - public BankAccount1 withAccountType(BankAccount1AccountType accountType) { - Utils.checkNotNull(accountType, "accountType"); + public BankAccount1 withAccountType(@Nullable BankAccount1AccountType accountType) { this.accountType = JsonNullable.of(accountType); return this; } - /** - * The type of bank account. - */ - public BankAccount1 withAccountType(JsonNullable accountType) { - Utils.checkNotNull(accountType, "accountType"); - this.accountType = accountType; - return this; - } /** * The International Bank Account Number (IBAN). */ - public BankAccount1 withIban(String iban) { - Utils.checkNotNull(iban, "iban"); + public BankAccount1 withIban(@Nullable String iban) { this.iban = JsonNullable.of(iban); return this; } - /** - * The International Bank Account Number (IBAN). - */ - public BankAccount1 withIban(JsonNullable iban) { - Utils.checkNotNull(iban, "iban"); - this.iban = iban; - return this; - } /** * The Bank Identifier Code (BIC). */ - public BankAccount1 withBic(String bic) { - Utils.checkNotNull(bic, "bic"); + public BankAccount1 withBic(@Nullable String bic) { this.bic = JsonNullable.of(bic); return this; } - /** - * The Bank Identifier Code (BIC). - */ - public BankAccount1 withBic(JsonNullable bic) { - Utils.checkNotNull(bic, "bic"); - this.bic = bic; - return this; - } /** * A routing number is a nine-digit code used to identify a financial institution in the United States. */ - public BankAccount1 withRoutingNumber(String routingNumber) { - Utils.checkNotNull(routingNumber, "routingNumber"); + public BankAccount1 withRoutingNumber(@Nullable String routingNumber) { this.routingNumber = JsonNullable.of(routingNumber); return this; } - /** - * A routing number is a nine-digit code used to identify a financial institution in the United States. - */ - public BankAccount1 withRoutingNumber(JsonNullable routingNumber) { - Utils.checkNotNull(routingNumber, "routingNumber"); - this.routingNumber = routingNumber; - return this; - } /** * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. */ - public BankAccount1 withBsbNumber(String bsbNumber) { - Utils.checkNotNull(bsbNumber, "bsbNumber"); + public BankAccount1 withBsbNumber(@Nullable String bsbNumber) { this.bsbNumber = JsonNullable.of(bsbNumber); return this; } - /** - * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. - */ - public BankAccount1 withBsbNumber(JsonNullable bsbNumber) { - Utils.checkNotNull(bsbNumber, "bsbNumber"); - this.bsbNumber = bsbNumber; - return this; - } /** * A branch identifier is a unique identifier for a branch of a bank or financial institution. */ - public BankAccount1 withBranchIdentifier(String branchIdentifier) { - Utils.checkNotNull(branchIdentifier, "branchIdentifier"); + public BankAccount1 withBranchIdentifier(@Nullable String branchIdentifier) { this.branchIdentifier = JsonNullable.of(branchIdentifier); return this; } - /** - * A branch identifier is a unique identifier for a branch of a bank or financial institution. - */ - public BankAccount1 withBranchIdentifier(JsonNullable branchIdentifier) { - Utils.checkNotNull(branchIdentifier, "branchIdentifier"); - this.branchIdentifier = branchIdentifier; - return this; - } /** * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. */ - public BankAccount1 withBankCode(String bankCode) { - Utils.checkNotNull(bankCode, "bankCode"); + public BankAccount1 withBankCode(@Nullable String bankCode) { this.bankCode = JsonNullable.of(bankCode); return this; } - /** - * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. - */ - public BankAccount1 withBankCode(JsonNullable bankCode) { - Utils.checkNotNull(bankCode, "bankCode"); - this.bankCode = bankCode; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public BankAccount1 withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public BankAccount1 withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public BankAccount1 withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Country code according to ISO 3166-1 alpha-2. */ - public BankAccount1 withCountry(String country) { - Utils.checkNotNull(country, "country"); + public BankAccount1 withCountry(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public BankAccount1 withCountry(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -519,264 +397,131 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable bankName = JsonNullable.undefined(); + private JsonNullable bankName; - private JsonNullable accountNumber = JsonNullable.undefined(); + private JsonNullable accountNumber; - private JsonNullable accountName = JsonNullable.undefined(); + private JsonNullable accountName; - private JsonNullable accountType = JsonNullable.undefined(); + private JsonNullable accountType; - private JsonNullable iban = JsonNullable.undefined(); + private JsonNullable iban; - private JsonNullable bic = JsonNullable.undefined(); + private JsonNullable bic; - private JsonNullable routingNumber = JsonNullable.undefined(); + private JsonNullable routingNumber; - private JsonNullable bsbNumber = JsonNullable.undefined(); + private JsonNullable bsbNumber; - private JsonNullable branchIdentifier = JsonNullable.undefined(); + private JsonNullable branchIdentifier; - private JsonNullable bankCode = JsonNullable.undefined(); + private JsonNullable bankCode; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable country = JsonNullable.undefined(); + private JsonNullable country; private Builder() { // force use of static builder() method } - /** * The name of the bank */ - public Builder bankName(String bankName) { - Utils.checkNotNull(bankName, "bankName"); + public Builder bankName(@Nullable String bankName) { this.bankName = JsonNullable.of(bankName); return this; } - /** - * The name of the bank - */ - public Builder bankName(JsonNullable bankName) { - Utils.checkNotNull(bankName, "bankName"); - this.bankName = bankName; - return this; - } - - /** * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. */ - public Builder accountNumber(String accountNumber) { - Utils.checkNotNull(accountNumber, "accountNumber"); + public Builder accountNumber(@Nullable String accountNumber) { this.accountNumber = JsonNullable.of(accountNumber); return this; } - /** - * A bank account number is a number that is tied to your bank account. If you have several bank accounts, such as personal, joint, business (and so on), each account will have a different account number. - */ - public Builder accountNumber(JsonNullable accountNumber) { - Utils.checkNotNull(accountNumber, "accountNumber"); - this.accountNumber = accountNumber; - return this; - } - - /** * The name which you used in opening your bank account. */ - public Builder accountName(String accountName) { - Utils.checkNotNull(accountName, "accountName"); + public Builder accountName(@Nullable String accountName) { this.accountName = JsonNullable.of(accountName); return this; } - /** - * The name which you used in opening your bank account. - */ - public Builder accountName(JsonNullable accountName) { - Utils.checkNotNull(accountName, "accountName"); - this.accountName = accountName; - return this; - } - - /** * The type of bank account. */ - public Builder accountType(BankAccount1AccountType accountType) { - Utils.checkNotNull(accountType, "accountType"); + public Builder accountType(@Nullable BankAccount1AccountType accountType) { this.accountType = JsonNullable.of(accountType); return this; } - /** - * The type of bank account. - */ - public Builder accountType(JsonNullable accountType) { - Utils.checkNotNull(accountType, "accountType"); - this.accountType = accountType; - return this; - } - - /** * The International Bank Account Number (IBAN). */ - public Builder iban(String iban) { - Utils.checkNotNull(iban, "iban"); + public Builder iban(@Nullable String iban) { this.iban = JsonNullable.of(iban); return this; } - /** - * The International Bank Account Number (IBAN). - */ - public Builder iban(JsonNullable iban) { - Utils.checkNotNull(iban, "iban"); - this.iban = iban; - return this; - } - - /** * The Bank Identifier Code (BIC). */ - public Builder bic(String bic) { - Utils.checkNotNull(bic, "bic"); + public Builder bic(@Nullable String bic) { this.bic = JsonNullable.of(bic); return this; } - /** - * The Bank Identifier Code (BIC). - */ - public Builder bic(JsonNullable bic) { - Utils.checkNotNull(bic, "bic"); - this.bic = bic; - return this; - } - - /** * A routing number is a nine-digit code used to identify a financial institution in the United States. */ - public Builder routingNumber(String routingNumber) { - Utils.checkNotNull(routingNumber, "routingNumber"); + public Builder routingNumber(@Nullable String routingNumber) { this.routingNumber = JsonNullable.of(routingNumber); return this; } - /** - * A routing number is a nine-digit code used to identify a financial institution in the United States. - */ - public Builder routingNumber(JsonNullable routingNumber) { - Utils.checkNotNull(routingNumber, "routingNumber"); - this.routingNumber = routingNumber; - return this; - } - - /** * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. */ - public Builder bsbNumber(String bsbNumber) { - Utils.checkNotNull(bsbNumber, "bsbNumber"); + public Builder bsbNumber(@Nullable String bsbNumber) { this.bsbNumber = JsonNullable.of(bsbNumber); return this; } - /** - * A BSB is a 6 digit numeric code used for identifying the branch of an Australian or New Zealand bank or financial institution. - */ - public Builder bsbNumber(JsonNullable bsbNumber) { - Utils.checkNotNull(bsbNumber, "bsbNumber"); - this.bsbNumber = bsbNumber; - return this; - } - - /** * A branch identifier is a unique identifier for a branch of a bank or financial institution. */ - public Builder branchIdentifier(String branchIdentifier) { - Utils.checkNotNull(branchIdentifier, "branchIdentifier"); + public Builder branchIdentifier(@Nullable String branchIdentifier) { this.branchIdentifier = JsonNullable.of(branchIdentifier); return this; } - /** - * A branch identifier is a unique identifier for a branch of a bank or financial institution. - */ - public Builder branchIdentifier(JsonNullable branchIdentifier) { - Utils.checkNotNull(branchIdentifier, "branchIdentifier"); - this.branchIdentifier = branchIdentifier; - return this; - } - - /** * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. */ - public Builder bankCode(String bankCode) { - Utils.checkNotNull(bankCode, "bankCode"); + public Builder bankCode(@Nullable String bankCode) { this.bankCode = JsonNullable.of(bankCode); return this; } - /** - * A bank code is a code assigned by a central bank, a bank supervisory body or a Bankers Association in a country to all its licensed member banks or financial institutions. - */ - public Builder bankCode(JsonNullable bankCode) { - Utils.checkNotNull(bankCode, "bankCode"); - this.bankCode = bankCode; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Country code according to ISO 3166-1 alpha-2. */ - public Builder country(String country) { - Utils.checkNotNull(country, "country"); + public Builder country(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public Builder country(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - public BankAccount1 build() { - return new BankAccount1( bankName, accountNumber, accountName, accountType, iban, bic, diff --git a/src/main/java/com/apideck/unify/models/components/BankFeedAccount.java b/src/main/java/com/apideck/unify/models/components/BankFeedAccount.java index 5a185f18..5a77d940 100644 --- a/src/main/java/com/apideck/unify/models/components/BankFeedAccount.java +++ b/src/main/java/com/apideck/unify/models/components/BankFeedAccount.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -32,49 +32,49 @@ public class BankFeedAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_account_type") - private Optional bankAccountType; + private BankAccountType bankAccountType; /** * The source account's unique identifier. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("source_account_id") - private Optional sourceAccountId; + private String sourceAccountId; /** * The target account's unique identifier in the accounting connector. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("target_account_id") - private Optional targetAccountId; + private String targetAccountId; /** * Name associated with the target account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("target_account_name") - private Optional targetAccountName; + private String targetAccountName; /** * Account number of the destination bank account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("target_account_number") - private Optional targetAccountNumber; + private String targetAccountNumber; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Current status of the bank feed. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("feed_status") - private Optional feedStatus; + private FeedStatus feedStatus; /** * Country code according to ISO 3166-1 alpha-2. @@ -86,14 +86,14 @@ public class BankFeedAccount { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The date and time when the object was created. @@ -125,182 +125,155 @@ public class BankFeedAccount { @JsonCreator public BankFeedAccount( - @JsonProperty("id") String id, - @JsonProperty("bank_account_type") Optional bankAccountType, - @JsonProperty("source_account_id") Optional sourceAccountId, - @JsonProperty("target_account_id") Optional targetAccountId, - @JsonProperty("target_account_name") Optional targetAccountName, - @JsonProperty("target_account_number") Optional targetAccountNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("feed_status") Optional feedStatus, - @JsonProperty("country") JsonNullable country, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(bankAccountType, "bankAccountType"); - Utils.checkNotNull(sourceAccountId, "sourceAccountId"); - Utils.checkNotNull(targetAccountId, "targetAccountId"); - Utils.checkNotNull(targetAccountName, "targetAccountName"); - Utils.checkNotNull(targetAccountNumber, "targetAccountNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(feedStatus, "feedStatus"); - Utils.checkNotNull(country, "country"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - this.id = id; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("bank_account_type") @Nullable BankAccountType bankAccountType, + @JsonProperty("source_account_id") @Nullable String sourceAccountId, + @JsonProperty("target_account_id") @Nullable String targetAccountId, + @JsonProperty("target_account_name") @Nullable String targetAccountName, + @JsonProperty("target_account_number") @Nullable String targetAccountNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("feed_status") @Nullable FeedStatus feedStatus, + @JsonProperty("country") @Nullable JsonNullable country, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.bankAccountType = bankAccountType; this.sourceAccountId = sourceAccountId; this.targetAccountId = targetAccountId; this.targetAccountName = targetAccountName; this.targetAccountNumber = targetAccountNumber; - this.currency = currency; + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); this.feedStatus = feedStatus; - this.country = country; + this.country = Optional.ofNullable(country) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.customMappings = customMappings; - this.createdAt = createdAt; - this.updatedAt = updatedAt; - this.updatedBy = updatedBy; - this.createdBy = createdBy; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); } public BankFeedAccount( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Type of the bank account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional bankAccountType() { - return (Optional) bankAccountType; + return Optional.ofNullable(this.bankAccountType); } /** * The source account's unique identifier. */ - @JsonIgnore public Optional sourceAccountId() { - return sourceAccountId; + return Optional.ofNullable(this.sourceAccountId); } /** * The target account's unique identifier in the accounting connector. */ - @JsonIgnore public Optional targetAccountId() { - return targetAccountId; + return Optional.ofNullable(this.targetAccountId); } /** * Name associated with the target account. */ - @JsonIgnore public Optional targetAccountName() { - return targetAccountName; + return Optional.ofNullable(this.targetAccountName); } /** * Account number of the destination bank account. */ - @JsonIgnore public Optional targetAccountNumber() { - return targetAccountNumber; + return Optional.ofNullable(this.targetAccountNumber); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Current status of the bank feed. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional feedStatus() { - return (Optional) feedStatus; + return Optional.ofNullable(this.feedStatus); } /** * Country code according to ISO 3166-1 alpha-2. */ - @JsonIgnore public JsonNullable country() { - return country; + return this.country; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } public static Builder builder() { @@ -311,18 +284,8 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public BankFeedAccount withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * Type of the bank account. - */ - public BankFeedAccount withBankAccountType(BankAccountType bankAccountType) { - Utils.checkNotNull(bankAccountType, "bankAccountType"); - this.bankAccountType = Optional.ofNullable(bankAccountType); + public BankFeedAccount withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -330,112 +293,53 @@ public BankFeedAccount withBankAccountType(BankAccountType bankAccountType) { /** * Type of the bank account. */ - public BankFeedAccount withBankAccountType(Optional bankAccountType) { - Utils.checkNotNull(bankAccountType, "bankAccountType"); + public BankFeedAccount withBankAccountType(@Nullable BankAccountType bankAccountType) { this.bankAccountType = bankAccountType; return this; } - /** - * The source account's unique identifier. - */ - public BankFeedAccount withSourceAccountId(String sourceAccountId) { - Utils.checkNotNull(sourceAccountId, "sourceAccountId"); - this.sourceAccountId = Optional.ofNullable(sourceAccountId); - return this; - } - /** * The source account's unique identifier. */ - public BankFeedAccount withSourceAccountId(Optional sourceAccountId) { - Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + public BankFeedAccount withSourceAccountId(@Nullable String sourceAccountId) { this.sourceAccountId = sourceAccountId; return this; } - /** - * The target account's unique identifier in the accounting connector. - */ - public BankFeedAccount withTargetAccountId(String targetAccountId) { - Utils.checkNotNull(targetAccountId, "targetAccountId"); - this.targetAccountId = Optional.ofNullable(targetAccountId); - return this; - } - /** * The target account's unique identifier in the accounting connector. */ - public BankFeedAccount withTargetAccountId(Optional targetAccountId) { - Utils.checkNotNull(targetAccountId, "targetAccountId"); + public BankFeedAccount withTargetAccountId(@Nullable String targetAccountId) { this.targetAccountId = targetAccountId; return this; } - /** - * Name associated with the target account. - */ - public BankFeedAccount withTargetAccountName(String targetAccountName) { - Utils.checkNotNull(targetAccountName, "targetAccountName"); - this.targetAccountName = Optional.ofNullable(targetAccountName); - return this; - } - /** * Name associated with the target account. */ - public BankFeedAccount withTargetAccountName(Optional targetAccountName) { - Utils.checkNotNull(targetAccountName, "targetAccountName"); + public BankFeedAccount withTargetAccountName(@Nullable String targetAccountName) { this.targetAccountName = targetAccountName; return this; } - /** - * Account number of the destination bank account. - */ - public BankFeedAccount withTargetAccountNumber(String targetAccountNumber) { - Utils.checkNotNull(targetAccountNumber, "targetAccountNumber"); - this.targetAccountNumber = Optional.ofNullable(targetAccountNumber); - return this; - } - /** * Account number of the destination bank account. */ - public BankFeedAccount withTargetAccountNumber(Optional targetAccountNumber) { - Utils.checkNotNull(targetAccountNumber, "targetAccountNumber"); + public BankFeedAccount withTargetAccountNumber(@Nullable String targetAccountNumber) { this.targetAccountNumber = targetAccountNumber; return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public BankFeedAccount withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = JsonNullable.of(currency); - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public BankFeedAccount withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** - * Current status of the bank feed. - */ - public BankFeedAccount withFeedStatus(FeedStatus feedStatus) { - Utils.checkNotNull(feedStatus, "feedStatus"); - this.feedStatus = Optional.ofNullable(feedStatus); + public BankFeedAccount withCurrency(@Nullable Currency currency) { + this.currency = JsonNullable.of(currency); return this; } @@ -443,132 +347,71 @@ public BankFeedAccount withFeedStatus(FeedStatus feedStatus) { /** * Current status of the bank feed. */ - public BankFeedAccount withFeedStatus(Optional feedStatus) { - Utils.checkNotNull(feedStatus, "feedStatus"); + public BankFeedAccount withFeedStatus(@Nullable FeedStatus feedStatus) { this.feedStatus = feedStatus; return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public BankFeedAccount withCountry(String country) { - Utils.checkNotNull(country, "country"); - this.country = JsonNullable.of(country); - return this; - } /** * Country code according to ISO 3166-1 alpha-2. */ - public BankFeedAccount withCountry(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - - public BankFeedAccount withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); + public BankFeedAccount withCountry(@Nullable String country) { + this.country = JsonNullable.of(country); return this; } - public BankFeedAccount withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public BankFeedAccount withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public BankFeedAccount withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public BankFeedAccount withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public BankFeedAccount withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The date and time when the object was created. */ - public BankFeedAccount withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public BankFeedAccount withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public BankFeedAccount withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The date and time when the object was last updated. */ - public BankFeedAccount withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public BankFeedAccount withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public BankFeedAccount withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The user who last updated the object. */ - public BankFeedAccount withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public BankFeedAccount withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public BankFeedAccount withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public BankFeedAccount withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public BankFeedAccount withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public BankFeedAccount withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -632,310 +475,156 @@ public final static class Builder { private String id; - private Optional bankAccountType = Optional.empty(); + private BankAccountType bankAccountType; - private Optional sourceAccountId = Optional.empty(); + private String sourceAccountId; - private Optional targetAccountId = Optional.empty(); + private String targetAccountId; - private Optional targetAccountName = Optional.empty(); + private String targetAccountName; - private Optional targetAccountNumber = Optional.empty(); + private String targetAccountNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private Optional feedStatus = Optional.empty(); + private FeedStatus feedStatus; - private JsonNullable country = JsonNullable.undefined(); + private JsonNullable country; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * Type of the bank account. */ - public Builder bankAccountType(BankAccountType bankAccountType) { - Utils.checkNotNull(bankAccountType, "bankAccountType"); - this.bankAccountType = Optional.ofNullable(bankAccountType); - return this; - } - - /** - * Type of the bank account. - */ - public Builder bankAccountType(Optional bankAccountType) { - Utils.checkNotNull(bankAccountType, "bankAccountType"); + public Builder bankAccountType(@Nullable BankAccountType bankAccountType) { this.bankAccountType = bankAccountType; return this; } - - /** - * The source account's unique identifier. - */ - public Builder sourceAccountId(String sourceAccountId) { - Utils.checkNotNull(sourceAccountId, "sourceAccountId"); - this.sourceAccountId = Optional.ofNullable(sourceAccountId); - return this; - } - /** * The source account's unique identifier. */ - public Builder sourceAccountId(Optional sourceAccountId) { - Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + public Builder sourceAccountId(@Nullable String sourceAccountId) { this.sourceAccountId = sourceAccountId; return this; } - - /** - * The target account's unique identifier in the accounting connector. - */ - public Builder targetAccountId(String targetAccountId) { - Utils.checkNotNull(targetAccountId, "targetAccountId"); - this.targetAccountId = Optional.ofNullable(targetAccountId); - return this; - } - /** * The target account's unique identifier in the accounting connector. */ - public Builder targetAccountId(Optional targetAccountId) { - Utils.checkNotNull(targetAccountId, "targetAccountId"); + public Builder targetAccountId(@Nullable String targetAccountId) { this.targetAccountId = targetAccountId; return this; } - /** * Name associated with the target account. */ - public Builder targetAccountName(String targetAccountName) { - Utils.checkNotNull(targetAccountName, "targetAccountName"); - this.targetAccountName = Optional.ofNullable(targetAccountName); - return this; - } - - /** - * Name associated with the target account. - */ - public Builder targetAccountName(Optional targetAccountName) { - Utils.checkNotNull(targetAccountName, "targetAccountName"); + public Builder targetAccountName(@Nullable String targetAccountName) { this.targetAccountName = targetAccountName; return this; } - - /** - * Account number of the destination bank account. - */ - public Builder targetAccountNumber(String targetAccountNumber) { - Utils.checkNotNull(targetAccountNumber, "targetAccountNumber"); - this.targetAccountNumber = Optional.ofNullable(targetAccountNumber); - return this; - } - /** * Account number of the destination bank account. */ - public Builder targetAccountNumber(Optional targetAccountNumber) { - Utils.checkNotNull(targetAccountNumber, "targetAccountNumber"); + public Builder targetAccountNumber(@Nullable String targetAccountNumber) { this.targetAccountNumber = targetAccountNumber; return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Current status of the bank feed. */ - public Builder feedStatus(FeedStatus feedStatus) { - Utils.checkNotNull(feedStatus, "feedStatus"); - this.feedStatus = Optional.ofNullable(feedStatus); - return this; - } - - /** - * Current status of the bank feed. - */ - public Builder feedStatus(Optional feedStatus) { - Utils.checkNotNull(feedStatus, "feedStatus"); + public Builder feedStatus(@Nullable FeedStatus feedStatus) { this.feedStatus = feedStatus; return this; } - /** * Country code according to ISO 3166-1 alpha-2. */ - public Builder country(String country) { - Utils.checkNotNull(country, "country"); + public Builder country(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public Builder country(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - public BankFeedAccount build() { - return new BankFeedAccount( id, bankAccountType, sourceAccountId, targetAccountId, targetAccountName, targetAccountNumber, diff --git a/src/main/java/com/apideck/unify/models/components/BankFeedAccountInput.java b/src/main/java/com/apideck/unify/models/components/BankFeedAccountInput.java index 10ec324b..9716b734 100644 --- a/src/main/java/com/apideck/unify/models/components/BankFeedAccountInput.java +++ b/src/main/java/com/apideck/unify/models/components/BankFeedAccountInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,49 +22,49 @@ public class BankFeedAccountInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_account_type") - private Optional bankAccountType; + private BankAccountType bankAccountType; /** * The source account's unique identifier. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("source_account_id") - private Optional sourceAccountId; + private String sourceAccountId; /** * The target account's unique identifier in the accounting connector. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("target_account_id") - private Optional targetAccountId; + private String targetAccountId; /** * Name associated with the target account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("target_account_name") - private Optional targetAccountName; + private String targetAccountName; /** * Account number of the destination bank account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("target_account_number") - private Optional targetAccountNumber; + private String targetAccountNumber; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Current status of the bank feed. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("feed_status") - private Optional feedStatus; + private FeedStatus feedStatus; /** * Country code according to ISO 3166-1 alpha-2. @@ -77,116 +76,96 @@ public class BankFeedAccountInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonCreator public BankFeedAccountInput( - @JsonProperty("bank_account_type") Optional bankAccountType, - @JsonProperty("source_account_id") Optional sourceAccountId, - @JsonProperty("target_account_id") Optional targetAccountId, - @JsonProperty("target_account_name") Optional targetAccountName, - @JsonProperty("target_account_number") Optional targetAccountNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("feed_status") Optional feedStatus, - @JsonProperty("country") JsonNullable country, - @JsonProperty("custom_fields") Optional> customFields) { - Utils.checkNotNull(bankAccountType, "bankAccountType"); - Utils.checkNotNull(sourceAccountId, "sourceAccountId"); - Utils.checkNotNull(targetAccountId, "targetAccountId"); - Utils.checkNotNull(targetAccountName, "targetAccountName"); - Utils.checkNotNull(targetAccountNumber, "targetAccountNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(feedStatus, "feedStatus"); - Utils.checkNotNull(country, "country"); - Utils.checkNotNull(customFields, "customFields"); + @JsonProperty("bank_account_type") @Nullable BankAccountType bankAccountType, + @JsonProperty("source_account_id") @Nullable String sourceAccountId, + @JsonProperty("target_account_id") @Nullable String targetAccountId, + @JsonProperty("target_account_name") @Nullable String targetAccountName, + @JsonProperty("target_account_number") @Nullable String targetAccountNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("feed_status") @Nullable FeedStatus feedStatus, + @JsonProperty("country") @Nullable JsonNullable country, + @JsonProperty("custom_fields") @Nullable List customFields) { this.bankAccountType = bankAccountType; this.sourceAccountId = sourceAccountId; this.targetAccountId = targetAccountId; this.targetAccountName = targetAccountName; this.targetAccountNumber = targetAccountNumber; - this.currency = currency; + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); this.feedStatus = feedStatus; - this.country = country; + this.country = Optional.ofNullable(country) + .orElse(JsonNullable.undefined()); this.customFields = customFields; } public BankFeedAccountInput() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null); } /** * Type of the bank account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional bankAccountType() { - return (Optional) bankAccountType; + return Optional.ofNullable(this.bankAccountType); } /** * The source account's unique identifier. */ - @JsonIgnore public Optional sourceAccountId() { - return sourceAccountId; + return Optional.ofNullable(this.sourceAccountId); } /** * The target account's unique identifier in the accounting connector. */ - @JsonIgnore public Optional targetAccountId() { - return targetAccountId; + return Optional.ofNullable(this.targetAccountId); } /** * Name associated with the target account. */ - @JsonIgnore public Optional targetAccountName() { - return targetAccountName; + return Optional.ofNullable(this.targetAccountName); } /** * Account number of the destination bank account. */ - @JsonIgnore public Optional targetAccountNumber() { - return targetAccountNumber; + return Optional.ofNullable(this.targetAccountNumber); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Current status of the bank feed. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional feedStatus() { - return (Optional) feedStatus; + return Optional.ofNullable(this.feedStatus); } /** * Country code according to ISO 3166-1 alpha-2. */ - @JsonIgnore public JsonNullable country() { - return country; + return this.country; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } public static Builder builder() { @@ -197,122 +176,53 @@ public static Builder builder() { /** * Type of the bank account. */ - public BankFeedAccountInput withBankAccountType(BankAccountType bankAccountType) { - Utils.checkNotNull(bankAccountType, "bankAccountType"); - this.bankAccountType = Optional.ofNullable(bankAccountType); - return this; - } - - - /** - * Type of the bank account. - */ - public BankFeedAccountInput withBankAccountType(Optional bankAccountType) { - Utils.checkNotNull(bankAccountType, "bankAccountType"); + public BankFeedAccountInput withBankAccountType(@Nullable BankAccountType bankAccountType) { this.bankAccountType = bankAccountType; return this; } - /** - * The source account's unique identifier. - */ - public BankFeedAccountInput withSourceAccountId(String sourceAccountId) { - Utils.checkNotNull(sourceAccountId, "sourceAccountId"); - this.sourceAccountId = Optional.ofNullable(sourceAccountId); - return this; - } - /** * The source account's unique identifier. */ - public BankFeedAccountInput withSourceAccountId(Optional sourceAccountId) { - Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + public BankFeedAccountInput withSourceAccountId(@Nullable String sourceAccountId) { this.sourceAccountId = sourceAccountId; return this; } - /** - * The target account's unique identifier in the accounting connector. - */ - public BankFeedAccountInput withTargetAccountId(String targetAccountId) { - Utils.checkNotNull(targetAccountId, "targetAccountId"); - this.targetAccountId = Optional.ofNullable(targetAccountId); - return this; - } - /** * The target account's unique identifier in the accounting connector. */ - public BankFeedAccountInput withTargetAccountId(Optional targetAccountId) { - Utils.checkNotNull(targetAccountId, "targetAccountId"); + public BankFeedAccountInput withTargetAccountId(@Nullable String targetAccountId) { this.targetAccountId = targetAccountId; return this; } - /** - * Name associated with the target account. - */ - public BankFeedAccountInput withTargetAccountName(String targetAccountName) { - Utils.checkNotNull(targetAccountName, "targetAccountName"); - this.targetAccountName = Optional.ofNullable(targetAccountName); - return this; - } - /** * Name associated with the target account. */ - public BankFeedAccountInput withTargetAccountName(Optional targetAccountName) { - Utils.checkNotNull(targetAccountName, "targetAccountName"); + public BankFeedAccountInput withTargetAccountName(@Nullable String targetAccountName) { this.targetAccountName = targetAccountName; return this; } - /** - * Account number of the destination bank account. - */ - public BankFeedAccountInput withTargetAccountNumber(String targetAccountNumber) { - Utils.checkNotNull(targetAccountNumber, "targetAccountNumber"); - this.targetAccountNumber = Optional.ofNullable(targetAccountNumber); - return this; - } - /** * Account number of the destination bank account. */ - public BankFeedAccountInput withTargetAccountNumber(Optional targetAccountNumber) { - Utils.checkNotNull(targetAccountNumber, "targetAccountNumber"); + public BankFeedAccountInput withTargetAccountNumber(@Nullable String targetAccountNumber) { this.targetAccountNumber = targetAccountNumber; return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public BankFeedAccountInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = JsonNullable.of(currency); - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public BankFeedAccountInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** - * Current status of the bank feed. - */ - public BankFeedAccountInput withFeedStatus(FeedStatus feedStatus) { - Utils.checkNotNull(feedStatus, "feedStatus"); - this.feedStatus = Optional.ofNullable(feedStatus); + public BankFeedAccountInput withCurrency(@Nullable Currency currency) { + this.currency = JsonNullable.of(currency); return this; } @@ -320,43 +230,27 @@ public BankFeedAccountInput withFeedStatus(FeedStatus feedStatus) { /** * Current status of the bank feed. */ - public BankFeedAccountInput withFeedStatus(Optional feedStatus) { - Utils.checkNotNull(feedStatus, "feedStatus"); + public BankFeedAccountInput withFeedStatus(@Nullable FeedStatus feedStatus) { this.feedStatus = feedStatus; return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public BankFeedAccountInput withCountry(String country) { - Utils.checkNotNull(country, "country"); - this.country = JsonNullable.of(country); - return this; - } /** * Country code according to ISO 3166-1 alpha-2. */ - public BankFeedAccountInput withCountry(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - - public BankFeedAccountInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); + public BankFeedAccountInput withCountry(@Nullable String country) { + this.country = JsonNullable.of(country); return this; } - public BankFeedAccountInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public BankFeedAccountInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -403,195 +297,98 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional bankAccountType = Optional.empty(); + private BankAccountType bankAccountType; - private Optional sourceAccountId = Optional.empty(); + private String sourceAccountId; - private Optional targetAccountId = Optional.empty(); + private String targetAccountId; - private Optional targetAccountName = Optional.empty(); + private String targetAccountName; - private Optional targetAccountNumber = Optional.empty(); + private String targetAccountNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private Optional feedStatus = Optional.empty(); + private FeedStatus feedStatus; - private JsonNullable country = JsonNullable.undefined(); + private JsonNullable country; - private Optional> customFields = Optional.empty(); + private List customFields; private Builder() { // force use of static builder() method } - - /** - * Type of the bank account. - */ - public Builder bankAccountType(BankAccountType bankAccountType) { - Utils.checkNotNull(bankAccountType, "bankAccountType"); - this.bankAccountType = Optional.ofNullable(bankAccountType); - return this; - } - /** * Type of the bank account. */ - public Builder bankAccountType(Optional bankAccountType) { - Utils.checkNotNull(bankAccountType, "bankAccountType"); + public Builder bankAccountType(@Nullable BankAccountType bankAccountType) { this.bankAccountType = bankAccountType; return this; } - /** * The source account's unique identifier. */ - public Builder sourceAccountId(String sourceAccountId) { - Utils.checkNotNull(sourceAccountId, "sourceAccountId"); - this.sourceAccountId = Optional.ofNullable(sourceAccountId); - return this; - } - - /** - * The source account's unique identifier. - */ - public Builder sourceAccountId(Optional sourceAccountId) { - Utils.checkNotNull(sourceAccountId, "sourceAccountId"); + public Builder sourceAccountId(@Nullable String sourceAccountId) { this.sourceAccountId = sourceAccountId; return this; } - /** * The target account's unique identifier in the accounting connector. */ - public Builder targetAccountId(String targetAccountId) { - Utils.checkNotNull(targetAccountId, "targetAccountId"); - this.targetAccountId = Optional.ofNullable(targetAccountId); - return this; - } - - /** - * The target account's unique identifier in the accounting connector. - */ - public Builder targetAccountId(Optional targetAccountId) { - Utils.checkNotNull(targetAccountId, "targetAccountId"); + public Builder targetAccountId(@Nullable String targetAccountId) { this.targetAccountId = targetAccountId; return this; } - - /** - * Name associated with the target account. - */ - public Builder targetAccountName(String targetAccountName) { - Utils.checkNotNull(targetAccountName, "targetAccountName"); - this.targetAccountName = Optional.ofNullable(targetAccountName); - return this; - } - /** * Name associated with the target account. */ - public Builder targetAccountName(Optional targetAccountName) { - Utils.checkNotNull(targetAccountName, "targetAccountName"); + public Builder targetAccountName(@Nullable String targetAccountName) { this.targetAccountName = targetAccountName; return this; } - - /** - * Account number of the destination bank account. - */ - public Builder targetAccountNumber(String targetAccountNumber) { - Utils.checkNotNull(targetAccountNumber, "targetAccountNumber"); - this.targetAccountNumber = Optional.ofNullable(targetAccountNumber); - return this; - } - /** * Account number of the destination bank account. */ - public Builder targetAccountNumber(Optional targetAccountNumber) { - Utils.checkNotNull(targetAccountNumber, "targetAccountNumber"); + public Builder targetAccountNumber(@Nullable String targetAccountNumber) { this.targetAccountNumber = targetAccountNumber; return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Current status of the bank feed. */ - public Builder feedStatus(FeedStatus feedStatus) { - Utils.checkNotNull(feedStatus, "feedStatus"); - this.feedStatus = Optional.ofNullable(feedStatus); - return this; - } - - /** - * Current status of the bank feed. - */ - public Builder feedStatus(Optional feedStatus) { - Utils.checkNotNull(feedStatus, "feedStatus"); + public Builder feedStatus(@Nullable FeedStatus feedStatus) { this.feedStatus = feedStatus; return this; } - /** * Country code according to ISO 3166-1 alpha-2. */ - public Builder country(String country) { - Utils.checkNotNull(country, "country"); + public Builder country(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public Builder country(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } public BankFeedAccountInput build() { - return new BankFeedAccountInput( bankAccountType, sourceAccountId, targetAccountId, targetAccountName, targetAccountNumber, currency, diff --git a/src/main/java/com/apideck/unify/models/components/BankFeedStatement.java b/src/main/java/com/apideck/unify/models/components/BankFeedStatement.java index d4302333..5adc3286 100644 --- a/src/main/java/com/apideck/unify/models/components/BankFeedStatement.java +++ b/src/main/java/com/apideck/unify/models/components/BankFeedStatement.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -31,63 +31,63 @@ public class BankFeedStatement { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_feed_account_id") - private Optional bankFeedAccountId; + private String bankFeedAccountId; /** * The current status of the bank feed statement. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private StatementStatus status; /** * Start date of the bank feed statement. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("start_date") - private Optional startDate; + private OffsetDateTime startDate; /** * End date of the bank feed statement. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("end_date") - private Optional endDate; + private OffsetDateTime endDate; /** * Balance amount at the start of the period. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("start_balance") - private Optional startBalance; + private Double startBalance; /** * Whether the amount is a credit or debit. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("start_balance_credit_or_debit") - private Optional startBalanceCreditOrDebit; + private CreditOrDebit startBalanceCreditOrDebit; /** * Balance amount at the end of the period. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("end_balance") - private Optional endBalance; + private Double endBalance; /** * Whether the amount is a credit or debit. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("end_balance_credit_or_debit") - private Optional endBalanceCreditOrDebit; + private CreditOrDebit endBalanceCreditOrDebit; /** * List of transactions in the bank feed statement. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("transactions") - private Optional> transactions; + private List transactions; /** * The date and time when the object was created. @@ -119,35 +119,22 @@ public class BankFeedStatement { @JsonCreator public BankFeedStatement( - @JsonProperty("id") String id, - @JsonProperty("bank_feed_account_id") Optional bankFeedAccountId, - @JsonProperty("status") Optional status, - @JsonProperty("start_date") Optional startDate, - @JsonProperty("end_date") Optional endDate, - @JsonProperty("start_balance") Optional startBalance, - @JsonProperty("start_balance_credit_or_debit") Optional startBalanceCreditOrDebit, - @JsonProperty("end_balance") Optional endBalance, - @JsonProperty("end_balance_credit_or_debit") Optional endBalanceCreditOrDebit, - @JsonProperty("transactions") Optional> transactions, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("updated_by") JsonNullable updatedBy) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(bankFeedAccountId, "bankFeedAccountId"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(startBalance, "startBalance"); - Utils.checkNotNull(startBalanceCreditOrDebit, "startBalanceCreditOrDebit"); - Utils.checkNotNull(endBalance, "endBalance"); - Utils.checkNotNull(endBalanceCreditOrDebit, "endBalanceCreditOrDebit"); - Utils.checkNotNull(transactions, "transactions"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(updatedBy, "updatedBy"); - this.id = id; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("bank_feed_account_id") @Nullable String bankFeedAccountId, + @JsonProperty("status") @Nullable StatementStatus status, + @JsonProperty("start_date") @Nullable OffsetDateTime startDate, + @JsonProperty("end_date") @Nullable OffsetDateTime endDate, + @JsonProperty("start_balance") @Nullable Double startBalance, + @JsonProperty("start_balance_credit_or_debit") @Nullable CreditOrDebit startBalanceCreditOrDebit, + @JsonProperty("end_balance") @Nullable Double endBalance, + @JsonProperty("end_balance_credit_or_debit") @Nullable CreditOrDebit endBalanceCreditOrDebit, + @JsonProperty("transactions") @Nullable List transactions, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.bankFeedAccountId = bankFeedAccountId; this.status = status; this.startDate = startDate; @@ -157,135 +144,121 @@ public BankFeedStatement( this.endBalance = endBalance; this.endBalanceCreditOrDebit = endBalanceCreditOrDebit; this.transactions = transactions; - this.createdAt = createdAt; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.updatedBy = updatedBy; + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); } public BankFeedStatement( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The ID of the bank feed account this statement belongs to. */ - @JsonIgnore public Optional bankFeedAccountId() { - return bankFeedAccountId; + return Optional.ofNullable(this.bankFeedAccountId); } /** * The current status of the bank feed statement. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Start date of the bank feed statement. */ - @JsonIgnore public Optional startDate() { - return startDate; + return Optional.ofNullable(this.startDate); } /** * End date of the bank feed statement. */ - @JsonIgnore public Optional endDate() { - return endDate; + return Optional.ofNullable(this.endDate); } /** * Balance amount at the start of the period. */ - @JsonIgnore public Optional startBalance() { - return startBalance; + return Optional.ofNullable(this.startBalance); } /** * Whether the amount is a credit or debit. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional startBalanceCreditOrDebit() { - return (Optional) startBalanceCreditOrDebit; + return Optional.ofNullable(this.startBalanceCreditOrDebit); } /** * Balance amount at the end of the period. */ - @JsonIgnore public Optional endBalance() { - return endBalance; + return Optional.ofNullable(this.endBalance); } /** * Whether the amount is a credit or debit. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional endBalanceCreditOrDebit() { - return (Optional) endBalanceCreditOrDebit; + return Optional.ofNullable(this.endBalanceCreditOrDebit); } /** * List of transactions in the bank feed statement. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> transactions() { - return (Optional>) transactions; + return Optional.ofNullable(this.transactions); } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } public static Builder builder() { @@ -296,18 +269,8 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public BankFeedStatement withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * The ID of the bank feed account this statement belongs to. - */ - public BankFeedStatement withBankFeedAccountId(String bankFeedAccountId) { - Utils.checkNotNull(bankFeedAccountId, "bankFeedAccountId"); - this.bankFeedAccountId = Optional.ofNullable(bankFeedAccountId); + public BankFeedStatement withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -315,235 +278,119 @@ public BankFeedStatement withBankFeedAccountId(String bankFeedAccountId) { /** * The ID of the bank feed account this statement belongs to. */ - public BankFeedStatement withBankFeedAccountId(Optional bankFeedAccountId) { - Utils.checkNotNull(bankFeedAccountId, "bankFeedAccountId"); + public BankFeedStatement withBankFeedAccountId(@Nullable String bankFeedAccountId) { this.bankFeedAccountId = bankFeedAccountId; return this; } - /** - * The current status of the bank feed statement. - */ - public BankFeedStatement withStatus(StatementStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * The current status of the bank feed statement. */ - public BankFeedStatement withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public BankFeedStatement withStatus(@Nullable StatementStatus status) { this.status = status; return this; } - /** - * Start date of the bank feed statement. - */ - public BankFeedStatement withStartDate(OffsetDateTime startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - /** * Start date of the bank feed statement. */ - public BankFeedStatement withStartDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public BankFeedStatement withStartDate(@Nullable OffsetDateTime startDate) { this.startDate = startDate; return this; } - /** - * End date of the bank feed statement. - */ - public BankFeedStatement withEndDate(OffsetDateTime endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * End date of the bank feed statement. */ - public BankFeedStatement withEndDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public BankFeedStatement withEndDate(@Nullable OffsetDateTime endDate) { this.endDate = endDate; return this; } - /** - * Balance amount at the start of the period. - */ - public BankFeedStatement withStartBalance(double startBalance) { - Utils.checkNotNull(startBalance, "startBalance"); - this.startBalance = Optional.ofNullable(startBalance); - return this; - } - /** * Balance amount at the start of the period. */ - public BankFeedStatement withStartBalance(Optional startBalance) { - Utils.checkNotNull(startBalance, "startBalance"); + public BankFeedStatement withStartBalance(@Nullable Double startBalance) { this.startBalance = startBalance; return this; } - /** - * Whether the amount is a credit or debit. - */ - public BankFeedStatement withStartBalanceCreditOrDebit(CreditOrDebit startBalanceCreditOrDebit) { - Utils.checkNotNull(startBalanceCreditOrDebit, "startBalanceCreditOrDebit"); - this.startBalanceCreditOrDebit = Optional.ofNullable(startBalanceCreditOrDebit); - return this; - } - /** * Whether the amount is a credit or debit. */ - public BankFeedStatement withStartBalanceCreditOrDebit(Optional startBalanceCreditOrDebit) { - Utils.checkNotNull(startBalanceCreditOrDebit, "startBalanceCreditOrDebit"); + public BankFeedStatement withStartBalanceCreditOrDebit(@Nullable CreditOrDebit startBalanceCreditOrDebit) { this.startBalanceCreditOrDebit = startBalanceCreditOrDebit; return this; } - /** - * Balance amount at the end of the period. - */ - public BankFeedStatement withEndBalance(double endBalance) { - Utils.checkNotNull(endBalance, "endBalance"); - this.endBalance = Optional.ofNullable(endBalance); - return this; - } - /** * Balance amount at the end of the period. */ - public BankFeedStatement withEndBalance(Optional endBalance) { - Utils.checkNotNull(endBalance, "endBalance"); + public BankFeedStatement withEndBalance(@Nullable Double endBalance) { this.endBalance = endBalance; return this; } - /** - * Whether the amount is a credit or debit. - */ - public BankFeedStatement withEndBalanceCreditOrDebit(CreditOrDebit endBalanceCreditOrDebit) { - Utils.checkNotNull(endBalanceCreditOrDebit, "endBalanceCreditOrDebit"); - this.endBalanceCreditOrDebit = Optional.ofNullable(endBalanceCreditOrDebit); - return this; - } - /** * Whether the amount is a credit or debit. */ - public BankFeedStatement withEndBalanceCreditOrDebit(Optional endBalanceCreditOrDebit) { - Utils.checkNotNull(endBalanceCreditOrDebit, "endBalanceCreditOrDebit"); + public BankFeedStatement withEndBalanceCreditOrDebit(@Nullable CreditOrDebit endBalanceCreditOrDebit) { this.endBalanceCreditOrDebit = endBalanceCreditOrDebit; return this; } - /** - * List of transactions in the bank feed statement. - */ - public BankFeedStatement withTransactions(List transactions) { - Utils.checkNotNull(transactions, "transactions"); - this.transactions = Optional.ofNullable(transactions); - return this; - } - /** * List of transactions in the bank feed statement. */ - public BankFeedStatement withTransactions(Optional> transactions) { - Utils.checkNotNull(transactions, "transactions"); + public BankFeedStatement withTransactions(@Nullable List transactions) { this.transactions = transactions; return this; } + /** * The date and time when the object was created. */ - public BankFeedStatement withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public BankFeedStatement withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public BankFeedStatement withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The user who created the object. */ - public BankFeedStatement withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public BankFeedStatement withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public BankFeedStatement withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public BankFeedStatement withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public BankFeedStatement withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public BankFeedStatement withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The user who last updated the object. */ - public BankFeedStatement withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public BankFeedStatement withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public BankFeedStatement withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -605,295 +452,149 @@ public final static class Builder { private String id; - private Optional bankFeedAccountId = Optional.empty(); + private String bankFeedAccountId; - private Optional status = Optional.empty(); + private StatementStatus status; - private Optional startDate = Optional.empty(); + private OffsetDateTime startDate; - private Optional endDate = Optional.empty(); + private OffsetDateTime endDate; - private Optional startBalance = Optional.empty(); + private Double startBalance; - private Optional startBalanceCreditOrDebit = Optional.empty(); + private CreditOrDebit startBalanceCreditOrDebit; - private Optional endBalance = Optional.empty(); + private Double endBalance; - private Optional endBalanceCreditOrDebit = Optional.empty(); + private CreditOrDebit endBalanceCreditOrDebit; - private Optional> transactions = Optional.empty(); + private List transactions; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * The ID of the bank feed account this statement belongs to. - */ - public Builder bankFeedAccountId(String bankFeedAccountId) { - Utils.checkNotNull(bankFeedAccountId, "bankFeedAccountId"); - this.bankFeedAccountId = Optional.ofNullable(bankFeedAccountId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * The ID of the bank feed account this statement belongs to. */ - public Builder bankFeedAccountId(Optional bankFeedAccountId) { - Utils.checkNotNull(bankFeedAccountId, "bankFeedAccountId"); + public Builder bankFeedAccountId(@Nullable String bankFeedAccountId) { this.bankFeedAccountId = bankFeedAccountId; return this; } - - /** - * The current status of the bank feed statement. - */ - public Builder status(StatementStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * The current status of the bank feed statement. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable StatementStatus status) { this.status = status; return this; } - /** * Start date of the bank feed statement. */ - public Builder startDate(OffsetDateTime startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - - /** - * Start date of the bank feed statement. - */ - public Builder startDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable OffsetDateTime startDate) { this.startDate = startDate; return this; } - - /** - * End date of the bank feed statement. - */ - public Builder endDate(OffsetDateTime endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * End date of the bank feed statement. */ - public Builder endDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable OffsetDateTime endDate) { this.endDate = endDate; return this; } - - /** - * Balance amount at the start of the period. - */ - public Builder startBalance(double startBalance) { - Utils.checkNotNull(startBalance, "startBalance"); - this.startBalance = Optional.ofNullable(startBalance); - return this; - } - /** * Balance amount at the start of the period. */ - public Builder startBalance(Optional startBalance) { - Utils.checkNotNull(startBalance, "startBalance"); + public Builder startBalance(@Nullable Double startBalance) { this.startBalance = startBalance; return this; } - /** * Whether the amount is a credit or debit. */ - public Builder startBalanceCreditOrDebit(CreditOrDebit startBalanceCreditOrDebit) { - Utils.checkNotNull(startBalanceCreditOrDebit, "startBalanceCreditOrDebit"); - this.startBalanceCreditOrDebit = Optional.ofNullable(startBalanceCreditOrDebit); - return this; - } - - /** - * Whether the amount is a credit or debit. - */ - public Builder startBalanceCreditOrDebit(Optional startBalanceCreditOrDebit) { - Utils.checkNotNull(startBalanceCreditOrDebit, "startBalanceCreditOrDebit"); + public Builder startBalanceCreditOrDebit(@Nullable CreditOrDebit startBalanceCreditOrDebit) { this.startBalanceCreditOrDebit = startBalanceCreditOrDebit; return this; } - - /** - * Balance amount at the end of the period. - */ - public Builder endBalance(double endBalance) { - Utils.checkNotNull(endBalance, "endBalance"); - this.endBalance = Optional.ofNullable(endBalance); - return this; - } - /** * Balance amount at the end of the period. */ - public Builder endBalance(Optional endBalance) { - Utils.checkNotNull(endBalance, "endBalance"); + public Builder endBalance(@Nullable Double endBalance) { this.endBalance = endBalance; return this; } - - /** - * Whether the amount is a credit or debit. - */ - public Builder endBalanceCreditOrDebit(CreditOrDebit endBalanceCreditOrDebit) { - Utils.checkNotNull(endBalanceCreditOrDebit, "endBalanceCreditOrDebit"); - this.endBalanceCreditOrDebit = Optional.ofNullable(endBalanceCreditOrDebit); - return this; - } - /** * Whether the amount is a credit or debit. */ - public Builder endBalanceCreditOrDebit(Optional endBalanceCreditOrDebit) { - Utils.checkNotNull(endBalanceCreditOrDebit, "endBalanceCreditOrDebit"); + public Builder endBalanceCreditOrDebit(@Nullable CreditOrDebit endBalanceCreditOrDebit) { this.endBalanceCreditOrDebit = endBalanceCreditOrDebit; return this; } - /** * List of transactions in the bank feed statement. */ - public Builder transactions(List transactions) { - Utils.checkNotNull(transactions, "transactions"); - this.transactions = Optional.ofNullable(transactions); - return this; - } - - /** - * List of transactions in the bank feed statement. - */ - public Builder transactions(Optional> transactions) { - Utils.checkNotNull(transactions, "transactions"); + public Builder transactions(@Nullable List transactions) { this.transactions = transactions; return this; } - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - public BankFeedStatement build() { - return new BankFeedStatement( id, bankFeedAccountId, status, startDate, endDate, startBalance, diff --git a/src/main/java/com/apideck/unify/models/components/BankFeedStatementInput.java b/src/main/java/com/apideck/unify/models/components/BankFeedStatementInput.java index 5b27f0ce..983a1d3e 100644 --- a/src/main/java/com/apideck/unify/models/components/BankFeedStatementInput.java +++ b/src/main/java/com/apideck/unify/models/components/BankFeedStatementInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -24,84 +23,75 @@ public class BankFeedStatementInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_feed_account_id") - private Optional bankFeedAccountId; + private String bankFeedAccountId; /** * The current status of the bank feed statement. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private StatementStatus status; /** * Start date of the bank feed statement. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("start_date") - private Optional startDate; + private OffsetDateTime startDate; /** * End date of the bank feed statement. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("end_date") - private Optional endDate; + private OffsetDateTime endDate; /** * Balance amount at the start of the period. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("start_balance") - private Optional startBalance; + private Double startBalance; /** * Whether the amount is a credit or debit. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("start_balance_credit_or_debit") - private Optional startBalanceCreditOrDebit; + private CreditOrDebit startBalanceCreditOrDebit; /** * Balance amount at the end of the period. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("end_balance") - private Optional endBalance; + private Double endBalance; /** * Whether the amount is a credit or debit. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("end_balance_credit_or_debit") - private Optional endBalanceCreditOrDebit; + private CreditOrDebit endBalanceCreditOrDebit; /** * List of transactions in the bank feed statement. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("transactions") - private Optional> transactions; + private List transactions; @JsonCreator public BankFeedStatementInput( - @JsonProperty("bank_feed_account_id") Optional bankFeedAccountId, - @JsonProperty("status") Optional status, - @JsonProperty("start_date") Optional startDate, - @JsonProperty("end_date") Optional endDate, - @JsonProperty("start_balance") Optional startBalance, - @JsonProperty("start_balance_credit_or_debit") Optional startBalanceCreditOrDebit, - @JsonProperty("end_balance") Optional endBalance, - @JsonProperty("end_balance_credit_or_debit") Optional endBalanceCreditOrDebit, - @JsonProperty("transactions") Optional> transactions) { - Utils.checkNotNull(bankFeedAccountId, "bankFeedAccountId"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(startBalance, "startBalance"); - Utils.checkNotNull(startBalanceCreditOrDebit, "startBalanceCreditOrDebit"); - Utils.checkNotNull(endBalance, "endBalance"); - Utils.checkNotNull(endBalanceCreditOrDebit, "endBalanceCreditOrDebit"); - Utils.checkNotNull(transactions, "transactions"); + @JsonProperty("bank_feed_account_id") @Nullable String bankFeedAccountId, + @JsonProperty("status") @Nullable StatementStatus status, + @JsonProperty("start_date") @Nullable OffsetDateTime startDate, + @JsonProperty("end_date") @Nullable OffsetDateTime endDate, + @JsonProperty("start_balance") @Nullable Double startBalance, + @JsonProperty("start_balance_credit_or_debit") @Nullable CreditOrDebit startBalanceCreditOrDebit, + @JsonProperty("end_balance") @Nullable Double endBalance, + @JsonProperty("end_balance_credit_or_debit") @Nullable CreditOrDebit endBalanceCreditOrDebit, + @JsonProperty("transactions") @Nullable List transactions) { this.bankFeedAccountId = bankFeedAccountId; this.status = status; this.startDate = startDate; @@ -114,85 +104,72 @@ public BankFeedStatementInput( } public BankFeedStatementInput() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null); } /** * The ID of the bank feed account this statement belongs to. */ - @JsonIgnore public Optional bankFeedAccountId() { - return bankFeedAccountId; + return Optional.ofNullable(this.bankFeedAccountId); } /** * The current status of the bank feed statement. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Start date of the bank feed statement. */ - @JsonIgnore public Optional startDate() { - return startDate; + return Optional.ofNullable(this.startDate); } /** * End date of the bank feed statement. */ - @JsonIgnore public Optional endDate() { - return endDate; + return Optional.ofNullable(this.endDate); } /** * Balance amount at the start of the period. */ - @JsonIgnore public Optional startBalance() { - return startBalance; + return Optional.ofNullable(this.startBalance); } /** * Whether the amount is a credit or debit. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional startBalanceCreditOrDebit() { - return (Optional) startBalanceCreditOrDebit; + return Optional.ofNullable(this.startBalanceCreditOrDebit); } /** * Balance amount at the end of the period. */ - @JsonIgnore public Optional endBalance() { - return endBalance; + return Optional.ofNullable(this.endBalance); } /** * Whether the amount is a credit or debit. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional endBalanceCreditOrDebit() { - return (Optional) endBalanceCreditOrDebit; + return Optional.ofNullable(this.endBalanceCreditOrDebit); } /** * List of transactions in the bank feed statement. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> transactions() { - return (Optional>) transactions; + return Optional.ofNullable(this.transactions); } public static Builder builder() { @@ -203,174 +180,84 @@ public static Builder builder() { /** * The ID of the bank feed account this statement belongs to. */ - public BankFeedStatementInput withBankFeedAccountId(String bankFeedAccountId) { - Utils.checkNotNull(bankFeedAccountId, "bankFeedAccountId"); - this.bankFeedAccountId = Optional.ofNullable(bankFeedAccountId); - return this; - } - - - /** - * The ID of the bank feed account this statement belongs to. - */ - public BankFeedStatementInput withBankFeedAccountId(Optional bankFeedAccountId) { - Utils.checkNotNull(bankFeedAccountId, "bankFeedAccountId"); + public BankFeedStatementInput withBankFeedAccountId(@Nullable String bankFeedAccountId) { this.bankFeedAccountId = bankFeedAccountId; return this; } - /** - * The current status of the bank feed statement. - */ - public BankFeedStatementInput withStatus(StatementStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * The current status of the bank feed statement. */ - public BankFeedStatementInput withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public BankFeedStatementInput withStatus(@Nullable StatementStatus status) { this.status = status; return this; } - /** - * Start date of the bank feed statement. - */ - public BankFeedStatementInput withStartDate(OffsetDateTime startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - /** * Start date of the bank feed statement. */ - public BankFeedStatementInput withStartDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public BankFeedStatementInput withStartDate(@Nullable OffsetDateTime startDate) { this.startDate = startDate; return this; } - /** - * End date of the bank feed statement. - */ - public BankFeedStatementInput withEndDate(OffsetDateTime endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * End date of the bank feed statement. */ - public BankFeedStatementInput withEndDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public BankFeedStatementInput withEndDate(@Nullable OffsetDateTime endDate) { this.endDate = endDate; return this; } - /** - * Balance amount at the start of the period. - */ - public BankFeedStatementInput withStartBalance(double startBalance) { - Utils.checkNotNull(startBalance, "startBalance"); - this.startBalance = Optional.ofNullable(startBalance); - return this; - } - /** * Balance amount at the start of the period. */ - public BankFeedStatementInput withStartBalance(Optional startBalance) { - Utils.checkNotNull(startBalance, "startBalance"); + public BankFeedStatementInput withStartBalance(@Nullable Double startBalance) { this.startBalance = startBalance; return this; } - /** - * Whether the amount is a credit or debit. - */ - public BankFeedStatementInput withStartBalanceCreditOrDebit(CreditOrDebit startBalanceCreditOrDebit) { - Utils.checkNotNull(startBalanceCreditOrDebit, "startBalanceCreditOrDebit"); - this.startBalanceCreditOrDebit = Optional.ofNullable(startBalanceCreditOrDebit); - return this; - } - /** * Whether the amount is a credit or debit. */ - public BankFeedStatementInput withStartBalanceCreditOrDebit(Optional startBalanceCreditOrDebit) { - Utils.checkNotNull(startBalanceCreditOrDebit, "startBalanceCreditOrDebit"); + public BankFeedStatementInput withStartBalanceCreditOrDebit(@Nullable CreditOrDebit startBalanceCreditOrDebit) { this.startBalanceCreditOrDebit = startBalanceCreditOrDebit; return this; } - /** - * Balance amount at the end of the period. - */ - public BankFeedStatementInput withEndBalance(double endBalance) { - Utils.checkNotNull(endBalance, "endBalance"); - this.endBalance = Optional.ofNullable(endBalance); - return this; - } - /** * Balance amount at the end of the period. */ - public BankFeedStatementInput withEndBalance(Optional endBalance) { - Utils.checkNotNull(endBalance, "endBalance"); + public BankFeedStatementInput withEndBalance(@Nullable Double endBalance) { this.endBalance = endBalance; return this; } - /** - * Whether the amount is a credit or debit. - */ - public BankFeedStatementInput withEndBalanceCreditOrDebit(CreditOrDebit endBalanceCreditOrDebit) { - Utils.checkNotNull(endBalanceCreditOrDebit, "endBalanceCreditOrDebit"); - this.endBalanceCreditOrDebit = Optional.ofNullable(endBalanceCreditOrDebit); - return this; - } - /** * Whether the amount is a credit or debit. */ - public BankFeedStatementInput withEndBalanceCreditOrDebit(Optional endBalanceCreditOrDebit) { - Utils.checkNotNull(endBalanceCreditOrDebit, "endBalanceCreditOrDebit"); + public BankFeedStatementInput withEndBalanceCreditOrDebit(@Nullable CreditOrDebit endBalanceCreditOrDebit) { this.endBalanceCreditOrDebit = endBalanceCreditOrDebit; return this; } - /** - * List of transactions in the bank feed statement. - */ - public BankFeedStatementInput withTransactions(List transactions) { - Utils.checkNotNull(transactions, "transactions"); - this.transactions = Optional.ofNullable(transactions); - return this; - } - /** * List of transactions in the bank feed statement. */ - public BankFeedStatementInput withTransactions(Optional> transactions) { - Utils.checkNotNull(transactions, "transactions"); + public BankFeedStatementInput withTransactions(@Nullable List transactions) { this.transactions = transactions; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -417,201 +304,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional bankFeedAccountId = Optional.empty(); + private String bankFeedAccountId; - private Optional status = Optional.empty(); + private StatementStatus status; - private Optional startDate = Optional.empty(); + private OffsetDateTime startDate; - private Optional endDate = Optional.empty(); + private OffsetDateTime endDate; - private Optional startBalance = Optional.empty(); + private Double startBalance; - private Optional startBalanceCreditOrDebit = Optional.empty(); + private CreditOrDebit startBalanceCreditOrDebit; - private Optional endBalance = Optional.empty(); + private Double endBalance; - private Optional endBalanceCreditOrDebit = Optional.empty(); + private CreditOrDebit endBalanceCreditOrDebit; - private Optional> transactions = Optional.empty(); + private List transactions; private Builder() { // force use of static builder() method } - - /** - * The ID of the bank feed account this statement belongs to. - */ - public Builder bankFeedAccountId(String bankFeedAccountId) { - Utils.checkNotNull(bankFeedAccountId, "bankFeedAccountId"); - this.bankFeedAccountId = Optional.ofNullable(bankFeedAccountId); - return this; - } - /** * The ID of the bank feed account this statement belongs to. */ - public Builder bankFeedAccountId(Optional bankFeedAccountId) { - Utils.checkNotNull(bankFeedAccountId, "bankFeedAccountId"); + public Builder bankFeedAccountId(@Nullable String bankFeedAccountId) { this.bankFeedAccountId = bankFeedAccountId; return this; } - /** * The current status of the bank feed statement. */ - public Builder status(StatementStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * The current status of the bank feed statement. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable StatementStatus status) { this.status = status; return this; } - - /** - * Start date of the bank feed statement. - */ - public Builder startDate(OffsetDateTime startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - /** * Start date of the bank feed statement. */ - public Builder startDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable OffsetDateTime startDate) { this.startDate = startDate; return this; } - /** * End date of the bank feed statement. */ - public Builder endDate(OffsetDateTime endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - - /** - * End date of the bank feed statement. - */ - public Builder endDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable OffsetDateTime endDate) { this.endDate = endDate; return this; } - - /** - * Balance amount at the start of the period. - */ - public Builder startBalance(double startBalance) { - Utils.checkNotNull(startBalance, "startBalance"); - this.startBalance = Optional.ofNullable(startBalance); - return this; - } - /** * Balance amount at the start of the period. */ - public Builder startBalance(Optional startBalance) { - Utils.checkNotNull(startBalance, "startBalance"); + public Builder startBalance(@Nullable Double startBalance) { this.startBalance = startBalance; return this; } - - /** - * Whether the amount is a credit or debit. - */ - public Builder startBalanceCreditOrDebit(CreditOrDebit startBalanceCreditOrDebit) { - Utils.checkNotNull(startBalanceCreditOrDebit, "startBalanceCreditOrDebit"); - this.startBalanceCreditOrDebit = Optional.ofNullable(startBalanceCreditOrDebit); - return this; - } - /** * Whether the amount is a credit or debit. */ - public Builder startBalanceCreditOrDebit(Optional startBalanceCreditOrDebit) { - Utils.checkNotNull(startBalanceCreditOrDebit, "startBalanceCreditOrDebit"); + public Builder startBalanceCreditOrDebit(@Nullable CreditOrDebit startBalanceCreditOrDebit) { this.startBalanceCreditOrDebit = startBalanceCreditOrDebit; return this; } - - /** - * Balance amount at the end of the period. - */ - public Builder endBalance(double endBalance) { - Utils.checkNotNull(endBalance, "endBalance"); - this.endBalance = Optional.ofNullable(endBalance); - return this; - } - /** * Balance amount at the end of the period. */ - public Builder endBalance(Optional endBalance) { - Utils.checkNotNull(endBalance, "endBalance"); + public Builder endBalance(@Nullable Double endBalance) { this.endBalance = endBalance; return this; } - - /** - * Whether the amount is a credit or debit. - */ - public Builder endBalanceCreditOrDebit(CreditOrDebit endBalanceCreditOrDebit) { - Utils.checkNotNull(endBalanceCreditOrDebit, "endBalanceCreditOrDebit"); - this.endBalanceCreditOrDebit = Optional.ofNullable(endBalanceCreditOrDebit); - return this; - } - /** * Whether the amount is a credit or debit. */ - public Builder endBalanceCreditOrDebit(Optional endBalanceCreditOrDebit) { - Utils.checkNotNull(endBalanceCreditOrDebit, "endBalanceCreditOrDebit"); + public Builder endBalanceCreditOrDebit(@Nullable CreditOrDebit endBalanceCreditOrDebit) { this.endBalanceCreditOrDebit = endBalanceCreditOrDebit; return this; } - /** * List of transactions in the bank feed statement. */ - public Builder transactions(List transactions) { - Utils.checkNotNull(transactions, "transactions"); - this.transactions = Optional.ofNullable(transactions); - return this; - } - - /** - * List of transactions in the bank feed statement. - */ - public Builder transactions(Optional> transactions) { - Utils.checkNotNull(transactions, "transactions"); + public Builder transactions(@Nullable List transactions) { this.transactions = transactions; return this; } public BankFeedStatementInput build() { - return new BankFeedStatementInput( bankFeedAccountId, status, startDate, endDate, startBalance, startBalanceCreditOrDebit, diff --git a/src/main/java/com/apideck/unify/models/components/Benefit.java b/src/main/java/com/apideck/unify/models/components/Benefit.java index 74c8d2ad..0aaa920b 100644 --- a/src/main/java/com/apideck/unify/models/components/Benefit.java +++ b/src/main/java/com/apideck/unify/models/components/Benefit.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -39,43 +40,40 @@ public class Benefit { @JsonCreator public Benefit( - @JsonProperty("name") JsonNullable name, - @JsonProperty("employee_deduction") JsonNullable employeeDeduction, - @JsonProperty("employer_contribution") JsonNullable employerContribution) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(employeeDeduction, "employeeDeduction"); - Utils.checkNotNull(employerContribution, "employerContribution"); - this.name = name; - this.employeeDeduction = employeeDeduction; - this.employerContribution = employerContribution; + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("employee_deduction") @Nullable JsonNullable employeeDeduction, + @JsonProperty("employer_contribution") @Nullable JsonNullable employerContribution) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.employeeDeduction = Optional.ofNullable(employeeDeduction) + .orElse(JsonNullable.undefined()); + this.employerContribution = Optional.ofNullable(employerContribution) + .orElse(JsonNullable.undefined()); } public Benefit() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * The name of the benefit. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The amount deducted for benefit. */ - @JsonIgnore public JsonNullable employeeDeduction() { - return employeeDeduction; + return this.employeeDeduction; } /** * The amount of employer contribution. */ - @JsonIgnore public JsonNullable employerContribution() { - return employerContribution; + return this.employerContribution; } public static Builder builder() { @@ -86,56 +84,29 @@ public static Builder builder() { /** * The name of the benefit. */ - public Benefit withName(String name) { - Utils.checkNotNull(name, "name"); + public Benefit withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the benefit. - */ - public Benefit withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The amount deducted for benefit. */ - public Benefit withEmployeeDeduction(double employeeDeduction) { - Utils.checkNotNull(employeeDeduction, "employeeDeduction"); + public Benefit withEmployeeDeduction(@Nullable Double employeeDeduction) { this.employeeDeduction = JsonNullable.of(employeeDeduction); return this; } - /** - * The amount deducted for benefit. - */ - public Benefit withEmployeeDeduction(JsonNullable employeeDeduction) { - Utils.checkNotNull(employeeDeduction, "employeeDeduction"); - this.employeeDeduction = employeeDeduction; - return this; - } /** * The amount of employer contribution. */ - public Benefit withEmployerContribution(double employerContribution) { - Utils.checkNotNull(employerContribution, "employerContribution"); + public Benefit withEmployerContribution(@Nullable Double employerContribution) { this.employerContribution = JsonNullable.of(employerContribution); return this; } - /** - * The amount of employer contribution. - */ - public Benefit withEmployerContribution(JsonNullable employerContribution) { - Utils.checkNotNull(employerContribution, "employerContribution"); - this.employerContribution = employerContribution; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -169,75 +140,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable employeeDeduction = JsonNullable.undefined(); + private JsonNullable employeeDeduction; - private JsonNullable employerContribution = JsonNullable.undefined(); + private JsonNullable employerContribution; private Builder() { // force use of static builder() method } - /** * The name of the benefit. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the benefit. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The amount deducted for benefit. */ - public Builder employeeDeduction(double employeeDeduction) { - Utils.checkNotNull(employeeDeduction, "employeeDeduction"); + public Builder employeeDeduction(@Nullable Double employeeDeduction) { this.employeeDeduction = JsonNullable.of(employeeDeduction); return this; } - /** - * The amount deducted for benefit. - */ - public Builder employeeDeduction(JsonNullable employeeDeduction) { - Utils.checkNotNull(employeeDeduction, "employeeDeduction"); - this.employeeDeduction = employeeDeduction; - return this; - } - - /** * The amount of employer contribution. */ - public Builder employerContribution(double employerContribution) { - Utils.checkNotNull(employerContribution, "employerContribution"); + public Builder employerContribution(@Nullable Double employerContribution) { this.employerContribution = JsonNullable.of(employerContribution); return this; } - /** - * The amount of employer contribution. - */ - public Builder employerContribution(JsonNullable employerContribution) { - Utils.checkNotNull(employerContribution, "employerContribution"); - this.employerContribution = employerContribution; - return this; - } - public Benefit build() { - return new Benefit( name, employeeDeduction, employerContribution); } diff --git a/src/main/java/com/apideck/unify/models/components/Bill.java b/src/main/java/com/apideck/unify/models/components/Bill.java index bd3f7432..4f19da94 100644 --- a/src/main/java/com/apideck/unify/models/components/Bill.java +++ b/src/main/java/com/apideck/unify/models/components/Bill.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -29,7 +28,7 @@ public class Bill { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The third-party API ID of original entity @@ -50,7 +49,7 @@ public class Bill { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier") - private JsonNullable supplier; + private JsonNullable supplier; /** * The company or subsidiary id the transaction belongs to @@ -64,7 +63,7 @@ public class Bill { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -118,7 +117,7 @@ public class Bill { @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; /** * Terms of payment. @@ -179,12 +178,12 @@ public class Bill { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("ledger_account") - private JsonNullable ledgerAccount; + private JsonNullable ledgerAccount; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check @@ -217,7 +216,7 @@ public class Bill { @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_account") - private Optional bankAccount; + private BankAccount bankAccount; /** * Discount percentage applied to this transaction. @@ -238,7 +237,7 @@ public class Bill { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; /** * The user who last updated the object. @@ -278,21 +277,21 @@ public class Bill { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; /** * Accounting period @@ -303,469 +302,413 @@ public class Bill { @JsonCreator public Bill( - @JsonProperty("id") Optional id, - @JsonProperty("downstream_id") JsonNullable downstreamId, - @JsonProperty("bill_number") JsonNullable billNumber, - @JsonProperty("supplier") JsonNullable supplier, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("bill_date") JsonNullable billDate, - @JsonProperty("due_date") JsonNullable dueDate, - @JsonProperty("paid_date") JsonNullable paidDate, - @JsonProperty("po_number") JsonNullable poNumber, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("terms") JsonNullable terms, - @JsonProperty("balance") JsonNullable balance, - @JsonProperty("deposit") JsonNullable deposit, - @JsonProperty("sub_total") JsonNullable subTotal, - @JsonProperty("total_tax") JsonNullable totalTax, - @JsonProperty("total") JsonNullable total, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("notes") JsonNullable notes, - @JsonProperty("status") JsonNullable status, - @JsonProperty("ledger_account") JsonNullable ledgerAccount, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("channel") JsonNullable channel, - @JsonProperty("language") JsonNullable language, - @JsonProperty("accounting_by_row") JsonNullable accountingByRow, - @JsonProperty("bank_account") Optional bankAccount, - @JsonProperty("discount_percentage") JsonNullable discountPercentage, - @JsonProperty("source_document_url") JsonNullable sourceDocumentUrl, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("pass_through") Optional> passThrough, - @JsonProperty("accounting_period") JsonNullable accountingPeriod) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(billNumber, "billNumber"); - Utils.checkNotNull(supplier, "supplier"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(billDate, "billDate"); - Utils.checkNotNull(dueDate, "dueDate"); - Utils.checkNotNull(paidDate, "paidDate"); - Utils.checkNotNull(poNumber, "poNumber"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(terms, "terms"); - Utils.checkNotNull(balance, "balance"); - Utils.checkNotNull(deposit, "deposit"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalTax, "totalTax"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(notes, "notes"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(channel, "channel"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(accountingByRow, "accountingByRow"); - Utils.checkNotNull(bankAccount, "bankAccount"); - Utils.checkNotNull(discountPercentage, "discountPercentage"); - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId, + @JsonProperty("bill_number") @Nullable JsonNullable billNumber, + @JsonProperty("supplier") @Nullable JsonNullable supplier, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("bill_date") @Nullable JsonNullable billDate, + @JsonProperty("due_date") @Nullable JsonNullable dueDate, + @JsonProperty("paid_date") @Nullable JsonNullable paidDate, + @JsonProperty("po_number") @Nullable JsonNullable poNumber, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("terms") @Nullable JsonNullable terms, + @JsonProperty("balance") @Nullable JsonNullable balance, + @JsonProperty("deposit") @Nullable JsonNullable deposit, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, + @JsonProperty("total_tax") @Nullable JsonNullable totalTax, + @JsonProperty("total") @Nullable JsonNullable total, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("notes") @Nullable JsonNullable notes, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("ledger_account") @Nullable JsonNullable ledgerAccount, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("channel") @Nullable JsonNullable channel, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("accounting_by_row") @Nullable JsonNullable accountingByRow, + @JsonProperty("bank_account") @Nullable BankAccount bankAccount, + @JsonProperty("discount_percentage") @Nullable JsonNullable discountPercentage, + @JsonProperty("source_document_url") @Nullable JsonNullable sourceDocumentUrl, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("pass_through") @Nullable List passThrough, + @JsonProperty("accounting_period") @Nullable JsonNullable accountingPeriod) { this.id = id; - this.downstreamId = downstreamId; - this.billNumber = billNumber; - this.supplier = supplier; - this.companyId = companyId; - this.currency = currency; - this.currencyRate = currencyRate; - this.taxInclusive = taxInclusive; - this.billDate = billDate; - this.dueDate = dueDate; - this.paidDate = paidDate; - this.poNumber = poNumber; - this.reference = reference; + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); + this.billNumber = Optional.ofNullable(billNumber) + .orElse(JsonNullable.undefined()); + this.supplier = Optional.ofNullable(supplier) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); + this.billDate = Optional.ofNullable(billDate) + .orElse(JsonNullable.undefined()); + this.dueDate = Optional.ofNullable(dueDate) + .orElse(JsonNullable.undefined()); + this.paidDate = Optional.ofNullable(paidDate) + .orElse(JsonNullable.undefined()); + this.poNumber = Optional.ofNullable(poNumber) + .orElse(JsonNullable.undefined()); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); this.lineItems = lineItems; - this.terms = terms; - this.balance = balance; - this.deposit = deposit; - this.subTotal = subTotal; - this.totalTax = totalTax; - this.total = total; - this.taxCode = taxCode; - this.notes = notes; - this.status = status; - this.ledgerAccount = ledgerAccount; - this.paymentMethod = paymentMethod; - this.channel = channel; - this.language = language; - this.accountingByRow = accountingByRow; + this.terms = Optional.ofNullable(terms) + .orElse(JsonNullable.undefined()); + this.balance = Optional.ofNullable(balance) + .orElse(JsonNullable.undefined()); + this.deposit = Optional.ofNullable(deposit) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); + this.totalTax = Optional.ofNullable(totalTax) + .orElse(JsonNullable.undefined()); + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.notes = Optional.ofNullable(notes) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.channel = Optional.ofNullable(channel) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.accountingByRow = Optional.ofNullable(accountingByRow) + .orElse(JsonNullable.undefined()); this.bankAccount = bankAccount; - this.discountPercentage = discountPercentage; - this.sourceDocumentUrl = sourceDocumentUrl; - this.trackingCategories = trackingCategories; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; - this.rowVersion = rowVersion; + this.discountPercentage = Optional.ofNullable(discountPercentage) + .orElse(JsonNullable.undefined()); + this.sourceDocumentUrl = Optional.ofNullable(sourceDocumentUrl) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.customMappings = customMappings; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; - this.accountingPeriod = accountingPeriod; + this.accountingPeriod = Optional.ofNullable(accountingPeriod) + .orElse(JsonNullable.undefined()); } public Bill() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } /** * Reference to supplier bill number */ - @JsonIgnore public JsonNullable billNumber() { - return billNumber; + return this.billNumber; } /** * The supplier this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable supplier() { - return (JsonNullable) supplier; + return this.supplier; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } /** * Date bill was issued - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable billDate() { - return billDate; + return this.billDate; } /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable dueDate() { - return dueDate; + return this.dueDate; } /** * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable paidDate() { - return paidDate; + return this.paidDate; } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - @JsonIgnore public JsonNullable poNumber() { - return poNumber; + return this.poNumber; } /** * Optional reference identifier for the transaction. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } /** * Terms of payment. */ - @JsonIgnore public JsonNullable terms() { - return terms; + return this.terms; } /** * Balance of bill due. */ - @JsonIgnore public JsonNullable balance() { - return balance; + return this.balance; } /** * Amount of deposit made to this bill. */ - @JsonIgnore public JsonNullable deposit() { - return deposit; + return this.deposit; } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Total tax amount applied to this bill. */ - @JsonIgnore public JsonNullable totalTax() { - return totalTax; + return this.totalTax; } /** * Total amount of bill, including tax. */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } - @JsonIgnore public JsonNullable notes() { - return notes; + return this.notes; } /** * Invoice status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable ledgerAccount() { - return (JsonNullable) ledgerAccount; + return this.ledgerAccount; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * The channel through which the transaction is processed. */ - @JsonIgnore public JsonNullable channel() { - return channel; + return this.channel; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - @JsonIgnore public JsonNullable accountingByRow() { - return accountingByRow; + return this.accountingByRow; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional bankAccount() { - return (Optional) bankAccount; + return Optional.ofNullable(this.bankAccount); } /** * Discount percentage applied to this transaction. */ - @JsonIgnore public JsonNullable discountPercentage() { - return discountPercentage; + return this.discountPercentage; } /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - @JsonIgnore public JsonNullable sourceDocumentUrl() { - return sourceDocumentUrl; + return this.sourceDocumentUrl; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * Accounting period */ - @JsonIgnore public JsonNullable accountingPeriod() { - return accountingPeriod; + return this.accountingPeriod; } public static Builder builder() { @@ -776,685 +719,335 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Bill withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Bill withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Bill withId(@Nullable String id) { this.id = id; return this; } + /** * The third-party API ID of original entity */ - public Bill withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Bill withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Bill withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } /** * Reference to supplier bill number */ - public Bill withBillNumber(String billNumber) { - Utils.checkNotNull(billNumber, "billNumber"); + public Bill withBillNumber(@Nullable String billNumber) { this.billNumber = JsonNullable.of(billNumber); return this; } - /** - * Reference to supplier bill number - */ - public Bill withBillNumber(JsonNullable billNumber) { - Utils.checkNotNull(billNumber, "billNumber"); - this.billNumber = billNumber; - return this; - } /** * The supplier this entity is linked to. */ - public Bill withSupplier(LinkedSupplier supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Bill withSupplier(@Nullable LinkedSupplier supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public Bill withSupplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public Bill withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Bill withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Bill withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Bill withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Bill withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Bill withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Bill withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Bill withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Bill withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * Amounts are including tax */ - public Bill withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Bill withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Bill withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } /** * Date bill was issued - YYYY-MM-DD. */ - public Bill withBillDate(LocalDate billDate) { - Utils.checkNotNull(billDate, "billDate"); + public Bill withBillDate(@Nullable LocalDate billDate) { this.billDate = JsonNullable.of(billDate); return this; } - /** - * Date bill was issued - YYYY-MM-DD. - */ - public Bill withBillDate(JsonNullable billDate) { - Utils.checkNotNull(billDate, "billDate"); - this.billDate = billDate; - return this; - } /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - public Bill withDueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Bill withDueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - */ - public Bill withDueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } /** * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. */ - public Bill withPaidDate(LocalDate paidDate) { - Utils.checkNotNull(paidDate, "paidDate"); + public Bill withPaidDate(@Nullable LocalDate paidDate) { this.paidDate = JsonNullable.of(paidDate); return this; } - /** - * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. - */ - public Bill withPaidDate(JsonNullable paidDate) { - Utils.checkNotNull(paidDate, "paidDate"); - this.paidDate = paidDate; - return this; - } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - public Bill withPoNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public Bill withPoNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - */ - public Bill withPoNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } /** * Optional reference identifier for the transaction. */ - public Bill withReference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Bill withReference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference identifier for the transaction. - */ - public Bill withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - public Bill withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - - public Bill withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Bill withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } + /** * Terms of payment. */ - public Bill withTerms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Bill withTerms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public Bill withTerms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } /** * Balance of bill due. */ - public Bill withBalance(double balance) { - Utils.checkNotNull(balance, "balance"); + public Bill withBalance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * Balance of bill due. - */ - public Bill withBalance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } /** * Amount of deposit made to this bill. */ - public Bill withDeposit(double deposit) { - Utils.checkNotNull(deposit, "deposit"); + public Bill withDeposit(@Nullable Double deposit) { this.deposit = JsonNullable.of(deposit); return this; } - /** - * Amount of deposit made to this bill. - */ - public Bill withDeposit(JsonNullable deposit) { - Utils.checkNotNull(deposit, "deposit"); - this.deposit = deposit; - return this; - } /** * Sub-total amount, normally before tax. */ - public Bill withSubTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Bill withSubTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Bill withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Total tax amount applied to this bill. */ - public Bill withTotalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Bill withTotalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this bill. - */ - public Bill withTotalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } /** * Total amount of bill, including tax. */ - public Bill withTotal(double total) { - Utils.checkNotNull(total, "total"); + public Bill withTotal(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of bill, including tax. - */ - public Bill withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Bill withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Bill withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Bill withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - public Bill withNotes(String notes) { - Utils.checkNotNull(notes, "notes"); + public Bill withNotes(@Nullable String notes) { this.notes = JsonNullable.of(notes); return this; } - public Bill withNotes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } /** * Invoice status */ - public Bill withStatus(BillStatus status) { - Utils.checkNotNull(status, "status"); + public Bill withStatus(@Nullable BillStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Invoice status - */ - public Bill withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - public Bill withLedgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Bill withLedgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Bill withLedgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Bill withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Bill withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Bill withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * The channel through which the transaction is processed. */ - public Bill withChannel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Bill withChannel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Bill withChannel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public Bill withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public Bill withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Bill withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public Bill withAccountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public Bill withAccountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public Bill withAccountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } - - public Bill withBankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public Bill withBankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public Bill withBankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } + /** * Discount percentage applied to this transaction. */ - public Bill withDiscountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Bill withDiscountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this transaction. - */ - public Bill withDiscountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - public Bill withSourceDocumentUrl(String sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); + public Bill withSourceDocumentUrl(@Nullable String sourceDocumentUrl) { this.sourceDocumentUrl = JsonNullable.of(sourceDocumentUrl); return this; } - /** - * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - */ - public Bill withSourceDocumentUrl(JsonNullable sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - this.sourceDocumentUrl = sourceDocumentUrl; - return this; - } /** * A list of linked tracking categories. */ - public Bill withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Bill withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Bill withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } /** * The user who last updated the object. */ - public Bill withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Bill withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Bill withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Bill withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Bill withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Bill withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Bill withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Bill withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Bill withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Bill withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Bill withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Bill withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Bill withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Bill withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Bill withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - public Bill withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Bill withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Bill withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Bill withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = JsonNullable.of(customMappings); - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Bill withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Bill withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public Bill withCustomMappings(@Nullable Map customMappings) { + this.customMappings = JsonNullable.of(customMappings); return this; } @@ -1462,29 +1055,20 @@ public Bill withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Bill withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Bill withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + /** * Accounting period */ - public Bill withAccountingPeriod(String accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + public Bill withAccountingPeriod(@Nullable String accountingPeriod) { this.accountingPeriod = JsonNullable.of(accountingPeriod); return this; } - /** - * Accounting period - */ - public Bill withAccountingPeriod(JsonNullable accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - this.accountingPeriod = accountingPeriod; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -1607,843 +1191,406 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; - private JsonNullable billNumber = JsonNullable.undefined(); + private JsonNullable billNumber; - private JsonNullable supplier = JsonNullable.undefined(); + private JsonNullable supplier; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private JsonNullable billDate = JsonNullable.undefined(); + private JsonNullable billDate; - private JsonNullable dueDate = JsonNullable.undefined(); + private JsonNullable dueDate; - private JsonNullable paidDate = JsonNullable.undefined(); + private JsonNullable paidDate; - private JsonNullable poNumber = JsonNullable.undefined(); + private JsonNullable poNumber; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private JsonNullable terms = JsonNullable.undefined(); + private JsonNullable terms; - private JsonNullable balance = JsonNullable.undefined(); + private JsonNullable balance; - private JsonNullable deposit = JsonNullable.undefined(); + private JsonNullable deposit; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private JsonNullable totalTax = JsonNullable.undefined(); + private JsonNullable totalTax; - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable notes = JsonNullable.undefined(); + private JsonNullable notes; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable ledgerAccount = JsonNullable.undefined(); + private JsonNullable ledgerAccount; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable channel = JsonNullable.undefined(); + private JsonNullable channel; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable accountingByRow = JsonNullable.undefined(); + private JsonNullable accountingByRow; - private Optional bankAccount = Optional.empty(); + private BankAccount bankAccount; - private JsonNullable discountPercentage = JsonNullable.undefined(); + private JsonNullable discountPercentage; - private JsonNullable sourceDocumentUrl = JsonNullable.undefined(); + private JsonNullable sourceDocumentUrl; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private Optional> passThrough = Optional.empty(); + private List passThrough; - private JsonNullable accountingPeriod = JsonNullable.undefined(); + private JsonNullable accountingPeriod; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } - - /** * Reference to supplier bill number */ - public Builder billNumber(String billNumber) { - Utils.checkNotNull(billNumber, "billNumber"); + public Builder billNumber(@Nullable String billNumber) { this.billNumber = JsonNullable.of(billNumber); return this; } - /** - * Reference to supplier bill number - */ - public Builder billNumber(JsonNullable billNumber) { - Utils.checkNotNull(billNumber, "billNumber"); - this.billNumber = billNumber; - return this; - } - - /** * The supplier this entity is linked to. */ - public Builder supplier(LinkedSupplier supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Builder supplier(@Nullable LinkedSupplier supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public Builder supplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - /** * Date bill was issued - YYYY-MM-DD. */ - public Builder billDate(LocalDate billDate) { - Utils.checkNotNull(billDate, "billDate"); + public Builder billDate(@Nullable LocalDate billDate) { this.billDate = JsonNullable.of(billDate); return this; } - /** - * Date bill was issued - YYYY-MM-DD. - */ - public Builder billDate(JsonNullable billDate) { - Utils.checkNotNull(billDate, "billDate"); - this.billDate = billDate; - return this; - } - - /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - public Builder dueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Builder dueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - */ - public Builder dueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } - - /** * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. */ - public Builder paidDate(LocalDate paidDate) { - Utils.checkNotNull(paidDate, "paidDate"); + public Builder paidDate(@Nullable LocalDate paidDate) { this.paidDate = JsonNullable.of(paidDate); return this; } - /** - * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. - */ - public Builder paidDate(JsonNullable paidDate) { - Utils.checkNotNull(paidDate, "paidDate"); - this.paidDate = paidDate; - return this; - } - - /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - public Builder poNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public Builder poNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - */ - public Builder poNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } - - /** * Optional reference identifier for the transaction. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference identifier for the transaction. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - /** * Terms of payment. */ - public Builder terms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Builder terms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public Builder terms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } - - /** * Balance of bill due. */ - public Builder balance(double balance) { - Utils.checkNotNull(balance, "balance"); + public Builder balance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * Balance of bill due. - */ - public Builder balance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } - - /** * Amount of deposit made to this bill. */ - public Builder deposit(double deposit) { - Utils.checkNotNull(deposit, "deposit"); + public Builder deposit(@Nullable Double deposit) { this.deposit = JsonNullable.of(deposit); return this; } - /** - * Amount of deposit made to this bill. - */ - public Builder deposit(JsonNullable deposit) { - Utils.checkNotNull(deposit, "deposit"); - this.deposit = deposit; - return this; - } - - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Total tax amount applied to this bill. */ - public Builder totalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Builder totalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this bill. - */ - public Builder totalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } - - /** * Total amount of bill, including tax. */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of bill, including tax. - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - - /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - - public Builder notes(String notes) { - Utils.checkNotNull(notes, "notes"); + public Builder notes(@Nullable String notes) { this.notes = JsonNullable.of(notes); return this; } - public Builder notes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - /** * Invoice status */ - public Builder status(BillStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable BillStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Invoice status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - - public Builder ledgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Builder ledgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * The channel through which the transaction is processed. */ - public Builder channel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Builder channel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Builder channel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public Builder accountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public Builder accountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public Builder accountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } - - - public Builder bankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public Builder bankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public Builder bankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - /** * Discount percentage applied to this transaction. */ - public Builder discountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Builder discountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this transaction. - */ - public Builder discountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - public Builder sourceDocumentUrl(String sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); + public Builder sourceDocumentUrl(@Nullable String sourceDocumentUrl) { this.sourceDocumentUrl = JsonNullable.of(sourceDocumentUrl); return this; } - /** - * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - */ - public Builder sourceDocumentUrl(JsonNullable sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - this.sourceDocumentUrl = sourceDocumentUrl; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** * Accounting period */ - public Builder accountingPeriod(String accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + public Builder accountingPeriod(@Nullable String accountingPeriod) { this.accountingPeriod = JsonNullable.of(accountingPeriod); return this; } - /** - * Accounting period - */ - public Builder accountingPeriod(JsonNullable accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - this.accountingPeriod = accountingPeriod; - return this; - } - public Bill build() { - return new Bill( id, downstreamId, billNumber, supplier, companyId, currency, diff --git a/src/main/java/com/apideck/unify/models/components/BillInput.java b/src/main/java/com/apideck/unify/models/components/BillInput.java index b1215357..a7a0c71f 100644 --- a/src/main/java/com/apideck/unify/models/components/BillInput.java +++ b/src/main/java/com/apideck/unify/models/components/BillInput.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -33,7 +32,7 @@ public class BillInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier") - private JsonNullable supplier; + private JsonNullable supplier; /** * The company or subsidiary id the transaction belongs to @@ -47,7 +46,7 @@ public class BillInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -101,7 +100,7 @@ public class BillInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; /** * Terms of payment. @@ -162,12 +161,12 @@ public class BillInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("ledger_account") - private JsonNullable ledgerAccount; + private JsonNullable ledgerAccount; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check @@ -200,7 +199,7 @@ public class BillInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_account") - private Optional bankAccount; + private BankAccount bankAccount; /** * Discount percentage applied to this transaction. @@ -221,7 +220,7 @@ public class BillInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -233,14 +232,14 @@ public class BillInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; /** * Accounting period @@ -251,389 +250,342 @@ public class BillInput { @JsonCreator public BillInput( - @JsonProperty("bill_number") JsonNullable billNumber, - @JsonProperty("supplier") JsonNullable supplier, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("bill_date") JsonNullable billDate, - @JsonProperty("due_date") JsonNullable dueDate, - @JsonProperty("paid_date") JsonNullable paidDate, - @JsonProperty("po_number") JsonNullable poNumber, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("terms") JsonNullable terms, - @JsonProperty("balance") JsonNullable balance, - @JsonProperty("deposit") JsonNullable deposit, - @JsonProperty("sub_total") JsonNullable subTotal, - @JsonProperty("total_tax") JsonNullable totalTax, - @JsonProperty("total") JsonNullable total, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("notes") JsonNullable notes, - @JsonProperty("status") JsonNullable status, - @JsonProperty("ledger_account") JsonNullable ledgerAccount, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("channel") JsonNullable channel, - @JsonProperty("language") JsonNullable language, - @JsonProperty("accounting_by_row") JsonNullable accountingByRow, - @JsonProperty("bank_account") Optional bankAccount, - @JsonProperty("discount_percentage") JsonNullable discountPercentage, - @JsonProperty("source_document_url") JsonNullable sourceDocumentUrl, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("pass_through") Optional> passThrough, - @JsonProperty("accounting_period") JsonNullable accountingPeriod) { - Utils.checkNotNull(billNumber, "billNumber"); - Utils.checkNotNull(supplier, "supplier"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(billDate, "billDate"); - Utils.checkNotNull(dueDate, "dueDate"); - Utils.checkNotNull(paidDate, "paidDate"); - Utils.checkNotNull(poNumber, "poNumber"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(terms, "terms"); - Utils.checkNotNull(balance, "balance"); - Utils.checkNotNull(deposit, "deposit"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalTax, "totalTax"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(notes, "notes"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(channel, "channel"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(accountingByRow, "accountingByRow"); - Utils.checkNotNull(bankAccount, "bankAccount"); - Utils.checkNotNull(discountPercentage, "discountPercentage"); - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - this.billNumber = billNumber; - this.supplier = supplier; - this.companyId = companyId; - this.currency = currency; - this.currencyRate = currencyRate; - this.taxInclusive = taxInclusive; - this.billDate = billDate; - this.dueDate = dueDate; - this.paidDate = paidDate; - this.poNumber = poNumber; - this.reference = reference; + @JsonProperty("bill_number") @Nullable JsonNullable billNumber, + @JsonProperty("supplier") @Nullable JsonNullable supplier, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("bill_date") @Nullable JsonNullable billDate, + @JsonProperty("due_date") @Nullable JsonNullable dueDate, + @JsonProperty("paid_date") @Nullable JsonNullable paidDate, + @JsonProperty("po_number") @Nullable JsonNullable poNumber, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("terms") @Nullable JsonNullable terms, + @JsonProperty("balance") @Nullable JsonNullable balance, + @JsonProperty("deposit") @Nullable JsonNullable deposit, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, + @JsonProperty("total_tax") @Nullable JsonNullable totalTax, + @JsonProperty("total") @Nullable JsonNullable total, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("notes") @Nullable JsonNullable notes, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("ledger_account") @Nullable JsonNullable ledgerAccount, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("channel") @Nullable JsonNullable channel, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("accounting_by_row") @Nullable JsonNullable accountingByRow, + @JsonProperty("bank_account") @Nullable BankAccount bankAccount, + @JsonProperty("discount_percentage") @Nullable JsonNullable discountPercentage, + @JsonProperty("source_document_url") @Nullable JsonNullable sourceDocumentUrl, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("pass_through") @Nullable List passThrough, + @JsonProperty("accounting_period") @Nullable JsonNullable accountingPeriod) { + this.billNumber = Optional.ofNullable(billNumber) + .orElse(JsonNullable.undefined()); + this.supplier = Optional.ofNullable(supplier) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); + this.billDate = Optional.ofNullable(billDate) + .orElse(JsonNullable.undefined()); + this.dueDate = Optional.ofNullable(dueDate) + .orElse(JsonNullable.undefined()); + this.paidDate = Optional.ofNullable(paidDate) + .orElse(JsonNullable.undefined()); + this.poNumber = Optional.ofNullable(poNumber) + .orElse(JsonNullable.undefined()); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); this.lineItems = lineItems; - this.terms = terms; - this.balance = balance; - this.deposit = deposit; - this.subTotal = subTotal; - this.totalTax = totalTax; - this.total = total; - this.taxCode = taxCode; - this.notes = notes; - this.status = status; - this.ledgerAccount = ledgerAccount; - this.paymentMethod = paymentMethod; - this.channel = channel; - this.language = language; - this.accountingByRow = accountingByRow; + this.terms = Optional.ofNullable(terms) + .orElse(JsonNullable.undefined()); + this.balance = Optional.ofNullable(balance) + .orElse(JsonNullable.undefined()); + this.deposit = Optional.ofNullable(deposit) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); + this.totalTax = Optional.ofNullable(totalTax) + .orElse(JsonNullable.undefined()); + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.notes = Optional.ofNullable(notes) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.channel = Optional.ofNullable(channel) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.accountingByRow = Optional.ofNullable(accountingByRow) + .orElse(JsonNullable.undefined()); this.bankAccount = bankAccount; - this.discountPercentage = discountPercentage; - this.sourceDocumentUrl = sourceDocumentUrl; - this.trackingCategories = trackingCategories; - this.rowVersion = rowVersion; + this.discountPercentage = Optional.ofNullable(discountPercentage) + .orElse(JsonNullable.undefined()); + this.sourceDocumentUrl = Optional.ofNullable(sourceDocumentUrl) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.customFields = customFields; this.passThrough = passThrough; - this.accountingPeriod = accountingPeriod; + this.accountingPeriod = Optional.ofNullable(accountingPeriod) + .orElse(JsonNullable.undefined()); } public BillInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Reference to supplier bill number */ - @JsonIgnore public JsonNullable billNumber() { - return billNumber; + return this.billNumber; } /** * The supplier this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable supplier() { - return (JsonNullable) supplier; + return this.supplier; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } /** * Date bill was issued - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable billDate() { - return billDate; + return this.billDate; } /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable dueDate() { - return dueDate; + return this.dueDate; } /** * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable paidDate() { - return paidDate; + return this.paidDate; } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - @JsonIgnore public JsonNullable poNumber() { - return poNumber; + return this.poNumber; } /** * Optional reference identifier for the transaction. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } /** * Terms of payment. */ - @JsonIgnore public JsonNullable terms() { - return terms; + return this.terms; } /** * Balance of bill due. */ - @JsonIgnore public JsonNullable balance() { - return balance; + return this.balance; } /** * Amount of deposit made to this bill. */ - @JsonIgnore public JsonNullable deposit() { - return deposit; + return this.deposit; } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Total tax amount applied to this bill. */ - @JsonIgnore public JsonNullable totalTax() { - return totalTax; + return this.totalTax; } /** * Total amount of bill, including tax. */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } - @JsonIgnore public JsonNullable notes() { - return notes; + return this.notes; } /** * Invoice status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable ledgerAccount() { - return (JsonNullable) ledgerAccount; + return this.ledgerAccount; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * The channel through which the transaction is processed. */ - @JsonIgnore public JsonNullable channel() { - return channel; + return this.channel; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - @JsonIgnore public JsonNullable accountingByRow() { - return accountingByRow; + return this.accountingByRow; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional bankAccount() { - return (Optional) bankAccount; + return Optional.ofNullable(this.bankAccount); } /** * Discount percentage applied to this transaction. */ - @JsonIgnore public JsonNullable discountPercentage() { - return discountPercentage; + return this.discountPercentage; } /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - @JsonIgnore public JsonNullable sourceDocumentUrl() { - return sourceDocumentUrl; + return this.sourceDocumentUrl; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * Accounting period */ - @JsonIgnore public JsonNullable accountingPeriod() { - return accountingPeriod; + return this.accountingPeriod; } public static Builder builder() { @@ -644,588 +596,293 @@ public static Builder builder() { /** * Reference to supplier bill number */ - public BillInput withBillNumber(String billNumber) { - Utils.checkNotNull(billNumber, "billNumber"); + public BillInput withBillNumber(@Nullable String billNumber) { this.billNumber = JsonNullable.of(billNumber); return this; } - /** - * Reference to supplier bill number - */ - public BillInput withBillNumber(JsonNullable billNumber) { - Utils.checkNotNull(billNumber, "billNumber"); - this.billNumber = billNumber; - return this; - } /** * The supplier this entity is linked to. */ - public BillInput withSupplier(LinkedSupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); + public BillInput withSupplier(@Nullable LinkedSupplierInput supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public BillInput withSupplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public BillInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public BillInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public BillInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public BillInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public BillInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public BillInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public BillInput withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public BillInput withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public BillInput withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * Amounts are including tax */ - public BillInput withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public BillInput withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public BillInput withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } /** * Date bill was issued - YYYY-MM-DD. */ - public BillInput withBillDate(LocalDate billDate) { - Utils.checkNotNull(billDate, "billDate"); + public BillInput withBillDate(@Nullable LocalDate billDate) { this.billDate = JsonNullable.of(billDate); return this; } - /** - * Date bill was issued - YYYY-MM-DD. - */ - public BillInput withBillDate(JsonNullable billDate) { - Utils.checkNotNull(billDate, "billDate"); - this.billDate = billDate; - return this; - } /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - public BillInput withDueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public BillInput withDueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - */ - public BillInput withDueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } /** * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. */ - public BillInput withPaidDate(LocalDate paidDate) { - Utils.checkNotNull(paidDate, "paidDate"); + public BillInput withPaidDate(@Nullable LocalDate paidDate) { this.paidDate = JsonNullable.of(paidDate); return this; } - /** - * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. - */ - public BillInput withPaidDate(JsonNullable paidDate) { - Utils.checkNotNull(paidDate, "paidDate"); - this.paidDate = paidDate; - return this; - } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - public BillInput withPoNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public BillInput withPoNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - */ - public BillInput withPoNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } /** * Optional reference identifier for the transaction. */ - public BillInput withReference(String reference) { - Utils.checkNotNull(reference, "reference"); + public BillInput withReference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference identifier for the transaction. - */ - public BillInput withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - public BillInput withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - - public BillInput withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public BillInput withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } + /** * Terms of payment. */ - public BillInput withTerms(String terms) { - Utils.checkNotNull(terms, "terms"); + public BillInput withTerms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public BillInput withTerms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } /** * Balance of bill due. */ - public BillInput withBalance(double balance) { - Utils.checkNotNull(balance, "balance"); + public BillInput withBalance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * Balance of bill due. - */ - public BillInput withBalance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } /** * Amount of deposit made to this bill. */ - public BillInput withDeposit(double deposit) { - Utils.checkNotNull(deposit, "deposit"); + public BillInput withDeposit(@Nullable Double deposit) { this.deposit = JsonNullable.of(deposit); return this; } - /** - * Amount of deposit made to this bill. - */ - public BillInput withDeposit(JsonNullable deposit) { - Utils.checkNotNull(deposit, "deposit"); - this.deposit = deposit; - return this; - } /** * Sub-total amount, normally before tax. */ - public BillInput withSubTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public BillInput withSubTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public BillInput withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Total tax amount applied to this bill. */ - public BillInput withTotalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public BillInput withTotalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this bill. - */ - public BillInput withTotalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } /** * Total amount of bill, including tax. */ - public BillInput withTotal(double total) { - Utils.checkNotNull(total, "total"); + public BillInput withTotal(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of bill, including tax. - */ - public BillInput withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public BillInput withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public BillInput withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public BillInput withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - public BillInput withNotes(String notes) { - Utils.checkNotNull(notes, "notes"); + public BillInput withNotes(@Nullable String notes) { this.notes = JsonNullable.of(notes); return this; } - public BillInput withNotes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } /** * Invoice status */ - public BillInput withStatus(BillStatus status) { - Utils.checkNotNull(status, "status"); + public BillInput withStatus(@Nullable BillStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Invoice status - */ - public BillInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - public BillInput withLedgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public BillInput withLedgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public BillInput withLedgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public BillInput withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public BillInput withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public BillInput withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * The channel through which the transaction is processed. */ - public BillInput withChannel(String channel) { - Utils.checkNotNull(channel, "channel"); + public BillInput withChannel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public BillInput withChannel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public BillInput withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public BillInput withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public BillInput withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public BillInput withAccountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public BillInput withAccountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public BillInput withAccountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } - - public BillInput withBankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public BillInput withBankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public BillInput withBankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } + /** * Discount percentage applied to this transaction. */ - public BillInput withDiscountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public BillInput withDiscountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this transaction. - */ - public BillInput withDiscountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - public BillInput withSourceDocumentUrl(String sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); + public BillInput withSourceDocumentUrl(@Nullable String sourceDocumentUrl) { this.sourceDocumentUrl = JsonNullable.of(sourceDocumentUrl); return this; } - /** - * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - */ - public BillInput withSourceDocumentUrl(JsonNullable sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - this.sourceDocumentUrl = sourceDocumentUrl; - return this; - } /** * A list of linked tracking categories. */ - public BillInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public BillInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public BillInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public BillInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public BillInput withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public BillInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - public BillInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public BillInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public BillInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public BillInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public BillInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public BillInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + /** * Accounting period */ - public BillInput withAccountingPeriod(String accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + public BillInput withAccountingPeriod(@Nullable String accountingPeriod) { this.accountingPeriod = JsonNullable.of(accountingPeriod); return this; } - /** - * Accounting period - */ - public BillInput withAccountingPeriod(JsonNullable accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - this.accountingPeriod = accountingPeriod; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -1332,696 +989,336 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable billNumber = JsonNullable.undefined(); + private JsonNullable billNumber; - private JsonNullable supplier = JsonNullable.undefined(); + private JsonNullable supplier; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private JsonNullable billDate = JsonNullable.undefined(); + private JsonNullable billDate; - private JsonNullable dueDate = JsonNullable.undefined(); + private JsonNullable dueDate; - private JsonNullable paidDate = JsonNullable.undefined(); + private JsonNullable paidDate; - private JsonNullable poNumber = JsonNullable.undefined(); + private JsonNullable poNumber; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private JsonNullable terms = JsonNullable.undefined(); + private JsonNullable terms; - private JsonNullable balance = JsonNullable.undefined(); + private JsonNullable balance; - private JsonNullable deposit = JsonNullable.undefined(); + private JsonNullable deposit; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private JsonNullable totalTax = JsonNullable.undefined(); + private JsonNullable totalTax; - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable notes = JsonNullable.undefined(); + private JsonNullable notes; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable ledgerAccount = JsonNullable.undefined(); + private JsonNullable ledgerAccount; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable channel = JsonNullable.undefined(); + private JsonNullable channel; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable accountingByRow = JsonNullable.undefined(); + private JsonNullable accountingByRow; - private Optional bankAccount = Optional.empty(); + private BankAccount bankAccount; - private JsonNullable discountPercentage = JsonNullable.undefined(); + private JsonNullable discountPercentage; - private JsonNullable sourceDocumentUrl = JsonNullable.undefined(); + private JsonNullable sourceDocumentUrl; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> customFields = Optional.empty(); + private List customFields; - private Optional> passThrough = Optional.empty(); + private List passThrough; - private JsonNullable accountingPeriod = JsonNullable.undefined(); + private JsonNullable accountingPeriod; private Builder() { // force use of static builder() method } - /** * Reference to supplier bill number */ - public Builder billNumber(String billNumber) { - Utils.checkNotNull(billNumber, "billNumber"); + public Builder billNumber(@Nullable String billNumber) { this.billNumber = JsonNullable.of(billNumber); return this; } - /** - * Reference to supplier bill number - */ - public Builder billNumber(JsonNullable billNumber) { - Utils.checkNotNull(billNumber, "billNumber"); - this.billNumber = billNumber; - return this; - } - - /** * The supplier this entity is linked to. */ - public Builder supplier(LinkedSupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Builder supplier(@Nullable LinkedSupplierInput supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public Builder supplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - /** * Date bill was issued - YYYY-MM-DD. */ - public Builder billDate(LocalDate billDate) { - Utils.checkNotNull(billDate, "billDate"); + public Builder billDate(@Nullable LocalDate billDate) { this.billDate = JsonNullable.of(billDate); return this; } - /** - * Date bill was issued - YYYY-MM-DD. - */ - public Builder billDate(JsonNullable billDate) { - Utils.checkNotNull(billDate, "billDate"); - this.billDate = billDate; - return this; - } - - /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - public Builder dueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Builder dueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - */ - public Builder dueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } - - /** * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. */ - public Builder paidDate(LocalDate paidDate) { - Utils.checkNotNull(paidDate, "paidDate"); + public Builder paidDate(@Nullable LocalDate paidDate) { this.paidDate = JsonNullable.of(paidDate); return this; } - /** - * The paid date is the date on which a payment was sent to the supplier - YYYY-MM-DD. - */ - public Builder paidDate(JsonNullable paidDate) { - Utils.checkNotNull(paidDate, "paidDate"); - this.paidDate = paidDate; - return this; - } - - /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - public Builder poNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public Builder poNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - */ - public Builder poNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } - - /** * Optional reference identifier for the transaction. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference identifier for the transaction. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - /** * Terms of payment. */ - public Builder terms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Builder terms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public Builder terms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } - - /** * Balance of bill due. */ - public Builder balance(double balance) { - Utils.checkNotNull(balance, "balance"); + public Builder balance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * Balance of bill due. - */ - public Builder balance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } - - /** * Amount of deposit made to this bill. */ - public Builder deposit(double deposit) { - Utils.checkNotNull(deposit, "deposit"); + public Builder deposit(@Nullable Double deposit) { this.deposit = JsonNullable.of(deposit); return this; } - /** - * Amount of deposit made to this bill. - */ - public Builder deposit(JsonNullable deposit) { - Utils.checkNotNull(deposit, "deposit"); - this.deposit = deposit; - return this; - } - - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Total tax amount applied to this bill. */ - public Builder totalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Builder totalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this bill. - */ - public Builder totalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } - - /** * Total amount of bill, including tax. */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of bill, including tax. - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - - /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - - public Builder notes(String notes) { - Utils.checkNotNull(notes, "notes"); + public Builder notes(@Nullable String notes) { this.notes = JsonNullable.of(notes); return this; } - public Builder notes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - /** * Invoice status */ - public Builder status(BillStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable BillStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Invoice status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - - public Builder ledgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Builder ledgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * The channel through which the transaction is processed. */ - public Builder channel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Builder channel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Builder channel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public Builder accountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public Builder accountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public Builder accountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } - - - public Builder bankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public Builder bankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public Builder bankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - /** * Discount percentage applied to this transaction. */ - public Builder discountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Builder discountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this transaction. - */ - public Builder discountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - public Builder sourceDocumentUrl(String sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); + public Builder sourceDocumentUrl(@Nullable String sourceDocumentUrl) { this.sourceDocumentUrl = JsonNullable.of(sourceDocumentUrl); return this; } - /** - * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - */ - public Builder sourceDocumentUrl(JsonNullable sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - this.sourceDocumentUrl = sourceDocumentUrl; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** * Accounting period */ - public Builder accountingPeriod(String accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + public Builder accountingPeriod(@Nullable String accountingPeriod) { this.accountingPeriod = JsonNullable.of(accountingPeriod); return this; } - /** - * Accounting period - */ - public Builder accountingPeriod(JsonNullable accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - this.accountingPeriod = accountingPeriod; - return this; - } - public BillInput build() { - return new BillInput( billNumber, supplier, companyId, currency, currencyRate, taxInclusive, diff --git a/src/main/java/com/apideck/unify/models/components/BillLineItem.java b/src/main/java/com/apideck/unify/models/components/BillLineItem.java index 48381b48..a3b7edac 100644 --- a/src/main/java/com/apideck/unify/models/components/BillLineItem.java +++ b/src/main/java/com/apideck/unify/models/components/BillLineItem.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -26,14 +25,14 @@ public class BillLineItem { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Row ID */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("row_id") - private Optional rowId; + private String rowId; /** * User defined item code @@ -61,7 +60,7 @@ public class BillLineItem { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * Tax amount @@ -125,24 +124,24 @@ public class BillLineItem { @JsonInclude(Include.NON_ABSENT) @JsonProperty("item") - private Optional item; + private LinkedInvoiceItem item; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRate taxRate; @JsonInclude(Include.NON_ABSENT) @JsonProperty("ledger_account") - private JsonNullable ledgerAccount; + private JsonNullable ledgerAccount; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -181,271 +180,238 @@ public class BillLineItem { @JsonCreator public BillLineItem( - @JsonProperty("id") Optional id, - @JsonProperty("row_id") Optional rowId, - @JsonProperty("code") JsonNullable code, - @JsonProperty("line_number") JsonNullable lineNumber, - @JsonProperty("description") JsonNullable description, - @JsonProperty("type") JsonNullable type, - @JsonProperty("tax_amount") JsonNullable taxAmount, - @JsonProperty("total_amount") JsonNullable totalAmount, - @JsonProperty("quantity") JsonNullable quantity, - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("unit_of_measure") JsonNullable unitOfMeasure, - @JsonProperty("discount_percentage") JsonNullable discountPercentage, - @JsonProperty("discount_amount") JsonNullable discountAmount, - @JsonProperty("location_id") JsonNullable locationId, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("item") Optional item, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("ledger_account") JsonNullable ledgerAccount, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("updated_at") JsonNullable updatedAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(rowId, "rowId"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(lineNumber, "lineNumber"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(taxAmount, "taxAmount"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(quantity, "quantity"); - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - Utils.checkNotNull(discountPercentage, "discountPercentage"); - Utils.checkNotNull(discountAmount, "discountAmount"); - Utils.checkNotNull(locationId, "locationId"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(item, "item"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("row_id") @Nullable String rowId, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("line_number") @Nullable JsonNullable lineNumber, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("tax_amount") @Nullable JsonNullable taxAmount, + @JsonProperty("total_amount") @Nullable JsonNullable totalAmount, + @JsonProperty("quantity") @Nullable JsonNullable quantity, + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("unit_of_measure") @Nullable JsonNullable unitOfMeasure, + @JsonProperty("discount_percentage") @Nullable JsonNullable discountPercentage, + @JsonProperty("discount_amount") @Nullable JsonNullable discountAmount, + @JsonProperty("location_id") @Nullable JsonNullable locationId, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("item") @Nullable LinkedInvoiceItem item, + @JsonProperty("tax_rate") @Nullable LinkedTaxRate taxRate, + @JsonProperty("ledger_account") @Nullable JsonNullable ledgerAccount, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt) { this.id = id; this.rowId = rowId; - this.code = code; - this.lineNumber = lineNumber; - this.description = description; - this.type = type; - this.taxAmount = taxAmount; - this.totalAmount = totalAmount; - this.quantity = quantity; - this.unitPrice = unitPrice; - this.unitOfMeasure = unitOfMeasure; - this.discountPercentage = discountPercentage; - this.discountAmount = discountAmount; - this.locationId = locationId; - this.departmentId = departmentId; + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.lineNumber = Optional.ofNullable(lineNumber) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.taxAmount = Optional.ofNullable(taxAmount) + .orElse(JsonNullable.undefined()); + this.totalAmount = Optional.ofNullable(totalAmount) + .orElse(JsonNullable.undefined()); + this.quantity = Optional.ofNullable(quantity) + .orElse(JsonNullable.undefined()); + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.unitOfMeasure = Optional.ofNullable(unitOfMeasure) + .orElse(JsonNullable.undefined()); + this.discountPercentage = Optional.ofNullable(discountPercentage) + .orElse(JsonNullable.undefined()); + this.discountAmount = Optional.ofNullable(discountAmount) + .orElse(JsonNullable.undefined()); + this.locationId = Optional.ofNullable(locationId) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); this.item = item; this.taxRate = taxRate; - this.ledgerAccount = ledgerAccount; - this.trackingCategories = trackingCategories; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.createdAt = createdAt; - this.updatedAt = updatedAt; + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); } public BillLineItem() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Row ID */ - @JsonIgnore public Optional rowId() { - return rowId; + return Optional.ofNullable(this.rowId); } /** * User defined item code */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Line number in the invoice */ - @JsonIgnore public JsonNullable lineNumber() { - return lineNumber; + return this.lineNumber; } /** * User defined description */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Bill Line Item type */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * Tax amount */ - @JsonIgnore public JsonNullable taxAmount() { - return taxAmount; + return this.taxAmount; } /** * Total amount of the line item */ - @JsonIgnore public JsonNullable totalAmount() { - return totalAmount; + return this.totalAmount; } - @JsonIgnore public JsonNullable quantity() { - return quantity; + return this.quantity; } - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - @JsonIgnore public JsonNullable unitOfMeasure() { - return unitOfMeasure; + return this.unitOfMeasure; } /** * Discount percentage applied to the line item when supported downstream. */ - @JsonIgnore public JsonNullable discountPercentage() { - return discountPercentage; + return this.discountPercentage; } /** * Discount amount applied to the line item when supported downstream. */ - @JsonIgnore public JsonNullable discountAmount() { - return discountAmount; + return this.discountAmount; } /** * The ID of the location */ - @JsonIgnore public JsonNullable locationId() { - return locationId; + return this.locationId; } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional item() { - return (Optional) item; + return Optional.ofNullable(this.item); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable ledgerAccount() { - return (JsonNullable) ledgerAccount; + return this.ledgerAccount; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } public static Builder builder() { @@ -456,408 +422,203 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public BillLineItem withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public BillLineItem withId(Optional id) { - Utils.checkNotNull(id, "id"); + public BillLineItem withId(@Nullable String id) { this.id = id; return this; } - /** - * Row ID - */ - public BillLineItem withRowId(String rowId) { - Utils.checkNotNull(rowId, "rowId"); - this.rowId = Optional.ofNullable(rowId); - return this; - } - /** * Row ID */ - public BillLineItem withRowId(Optional rowId) { - Utils.checkNotNull(rowId, "rowId"); + public BillLineItem withRowId(@Nullable String rowId) { this.rowId = rowId; return this; } + /** * User defined item code */ - public BillLineItem withCode(String code) { - Utils.checkNotNull(code, "code"); + public BillLineItem withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public BillLineItem withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * Line number in the invoice */ - public BillLineItem withLineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public BillLineItem withLineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number in the invoice - */ - public BillLineItem withLineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } /** * User defined description */ - public BillLineItem withDescription(String description) { - Utils.checkNotNull(description, "description"); + public BillLineItem withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public BillLineItem withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * Bill Line Item type */ - public BillLineItem withType(BillLineItemType type) { - Utils.checkNotNull(type, "type"); + public BillLineItem withType(@Nullable BillLineItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * Bill Line Item type - */ - public BillLineItem withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Tax amount */ - public BillLineItem withTaxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public BillLineItem withTaxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public BillLineItem withTaxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } /** * Total amount of the line item */ - public BillLineItem withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public BillLineItem withTotalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Total amount of the line item - */ - public BillLineItem withTotalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - public BillLineItem withQuantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + public BillLineItem withQuantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public BillLineItem withQuantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - public BillLineItem withUnitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public BillLineItem withUnitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public BillLineItem withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public BillLineItem withUnitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public BillLineItem withUnitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public BillLineItem withUnitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } /** * Discount percentage applied to the line item when supported downstream. */ - public BillLineItem withDiscountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public BillLineItem withDiscountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to the line item when supported downstream. - */ - public BillLineItem withDiscountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } /** * Discount amount applied to the line item when supported downstream. */ - public BillLineItem withDiscountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public BillLineItem withDiscountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } - /** - * Discount amount applied to the line item when supported downstream. - */ - public BillLineItem withDiscountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; - return this; - } /** * The ID of the location */ - public BillLineItem withLocationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public BillLineItem withLocationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public BillLineItem withLocationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } /** * The ID of the department */ - public BillLineItem withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public BillLineItem withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public BillLineItem withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - public BillLineItem withItem(LinkedInvoiceItem item) { - Utils.checkNotNull(item, "item"); - this.item = Optional.ofNullable(item); - return this; - } - - public BillLineItem withItem(Optional item) { - Utils.checkNotNull(item, "item"); + public BillLineItem withItem(@Nullable LinkedInvoiceItem item) { this.item = item; return this; } - public BillLineItem withTaxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public BillLineItem withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public BillLineItem withTaxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - public BillLineItem withLedgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + + public BillLineItem withLedgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public BillLineItem withLedgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } /** * A list of linked tracking categories. */ - public BillLineItem withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public BillLineItem withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public BillLineItem withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public BillLineItem withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public BillLineItem withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public BillLineItem withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public BillLineItem withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public BillLineItem withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public BillLineItem withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public BillLineItem withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public BillLineItem withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public BillLineItem withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was created. */ - public BillLineItem withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public BillLineItem withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public BillLineItem withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The date and time when the object was last updated. */ - public BillLineItem withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public BillLineItem withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public BillLineItem withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -940,486 +701,236 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional rowId = Optional.empty(); + private String rowId; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable lineNumber = JsonNullable.undefined(); + private JsonNullable lineNumber; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable taxAmount = JsonNullable.undefined(); + private JsonNullable taxAmount; - private JsonNullable totalAmount = JsonNullable.undefined(); + private JsonNullable totalAmount; - private JsonNullable quantity = JsonNullable.undefined(); + private JsonNullable quantity; - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable unitOfMeasure = JsonNullable.undefined(); + private JsonNullable unitOfMeasure; - private JsonNullable discountPercentage = JsonNullable.undefined(); + private JsonNullable discountPercentage; - private JsonNullable discountAmount = JsonNullable.undefined(); + private JsonNullable discountAmount; - private JsonNullable locationId = JsonNullable.undefined(); + private JsonNullable locationId; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private Optional item = Optional.empty(); + private LinkedInvoiceItem item; - private Optional taxRate = Optional.empty(); + private LinkedTaxRate taxRate; - private JsonNullable ledgerAccount = JsonNullable.undefined(); + private JsonNullable ledgerAccount; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Row ID - */ - public Builder rowId(String rowId) { - Utils.checkNotNull(rowId, "rowId"); - this.rowId = Optional.ofNullable(rowId); - return this; - } - /** * Row ID */ - public Builder rowId(Optional rowId) { - Utils.checkNotNull(rowId, "rowId"); + public Builder rowId(@Nullable String rowId) { this.rowId = rowId; return this; } - /** * User defined item code */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Line number in the invoice */ - public Builder lineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public Builder lineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number in the invoice - */ - public Builder lineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } - - /** * User defined description */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * Bill Line Item type */ - public Builder type(BillLineItemType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable BillLineItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * Bill Line Item type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * Tax amount */ - public Builder taxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public Builder taxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public Builder taxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } - - /** * Total amount of the line item */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Total amount of the line item - */ - public Builder totalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - - public Builder quantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + public Builder quantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public Builder quantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - - - public Builder unitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public Builder unitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public Builder unitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public Builder unitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } - - /** * Discount percentage applied to the line item when supported downstream. */ - public Builder discountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Builder discountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to the line item when supported downstream. - */ - public Builder discountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - /** * Discount amount applied to the line item when supported downstream. */ - public Builder discountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public Builder discountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } - /** - * Discount amount applied to the line item when supported downstream. - */ - public Builder discountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; - return this; - } - - /** * The ID of the location */ - public Builder locationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public Builder locationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public Builder locationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } - - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - - public Builder item(LinkedInvoiceItem item) { - Utils.checkNotNull(item, "item"); - this.item = Optional.ofNullable(item); - return this; - } - - public Builder item(Optional item) { - Utils.checkNotNull(item, "item"); + public Builder item(@Nullable LinkedInvoiceItem item) { this.item = item; return this; } - - public Builder taxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - - public Builder ledgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Builder ledgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - public BillLineItem build() { - return new BillLineItem( id, rowId, code, lineNumber, description, type, diff --git a/src/main/java/com/apideck/unify/models/components/BillLineItemInput.java b/src/main/java/com/apideck/unify/models/components/BillLineItemInput.java index 727670c5..e235c975 100644 --- a/src/main/java/com/apideck/unify/models/components/BillLineItemInput.java +++ b/src/main/java/com/apideck/unify/models/components/BillLineItemInput.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,7 +24,7 @@ public class BillLineItemInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("row_id") - private Optional rowId; + private String rowId; /** * User defined item code @@ -53,7 +52,7 @@ public class BillLineItemInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * Tax amount @@ -117,24 +116,24 @@ public class BillLineItemInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("item") - private Optional item; + private LinkedInvoiceItem item; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRateInput taxRate; @JsonInclude(Include.NON_ABSENT) @JsonProperty("ledger_account") - private JsonNullable ledgerAccount; + private JsonNullable ledgerAccount; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -145,215 +144,188 @@ public class BillLineItemInput { @JsonCreator public BillLineItemInput( - @JsonProperty("row_id") Optional rowId, - @JsonProperty("code") JsonNullable code, - @JsonProperty("line_number") JsonNullable lineNumber, - @JsonProperty("description") JsonNullable description, - @JsonProperty("type") JsonNullable type, - @JsonProperty("tax_amount") JsonNullable taxAmount, - @JsonProperty("total_amount") JsonNullable totalAmount, - @JsonProperty("quantity") JsonNullable quantity, - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("unit_of_measure") JsonNullable unitOfMeasure, - @JsonProperty("discount_percentage") JsonNullable discountPercentage, - @JsonProperty("discount_amount") JsonNullable discountAmount, - @JsonProperty("location_id") JsonNullable locationId, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("item") Optional item, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("ledger_account") JsonNullable ledgerAccount, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("row_version") JsonNullable rowVersion) { - Utils.checkNotNull(rowId, "rowId"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(lineNumber, "lineNumber"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(taxAmount, "taxAmount"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(quantity, "quantity"); - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - Utils.checkNotNull(discountPercentage, "discountPercentage"); - Utils.checkNotNull(discountAmount, "discountAmount"); - Utils.checkNotNull(locationId, "locationId"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(item, "item"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(rowVersion, "rowVersion"); + @JsonProperty("row_id") @Nullable String rowId, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("line_number") @Nullable JsonNullable lineNumber, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("tax_amount") @Nullable JsonNullable taxAmount, + @JsonProperty("total_amount") @Nullable JsonNullable totalAmount, + @JsonProperty("quantity") @Nullable JsonNullable quantity, + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("unit_of_measure") @Nullable JsonNullable unitOfMeasure, + @JsonProperty("discount_percentage") @Nullable JsonNullable discountPercentage, + @JsonProperty("discount_amount") @Nullable JsonNullable discountAmount, + @JsonProperty("location_id") @Nullable JsonNullable locationId, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("item") @Nullable LinkedInvoiceItem item, + @JsonProperty("tax_rate") @Nullable LinkedTaxRateInput taxRate, + @JsonProperty("ledger_account") @Nullable JsonNullable ledgerAccount, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion) { this.rowId = rowId; - this.code = code; - this.lineNumber = lineNumber; - this.description = description; - this.type = type; - this.taxAmount = taxAmount; - this.totalAmount = totalAmount; - this.quantity = quantity; - this.unitPrice = unitPrice; - this.unitOfMeasure = unitOfMeasure; - this.discountPercentage = discountPercentage; - this.discountAmount = discountAmount; - this.locationId = locationId; - this.departmentId = departmentId; + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.lineNumber = Optional.ofNullable(lineNumber) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.taxAmount = Optional.ofNullable(taxAmount) + .orElse(JsonNullable.undefined()); + this.totalAmount = Optional.ofNullable(totalAmount) + .orElse(JsonNullable.undefined()); + this.quantity = Optional.ofNullable(quantity) + .orElse(JsonNullable.undefined()); + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.unitOfMeasure = Optional.ofNullable(unitOfMeasure) + .orElse(JsonNullable.undefined()); + this.discountPercentage = Optional.ofNullable(discountPercentage) + .orElse(JsonNullable.undefined()); + this.discountAmount = Optional.ofNullable(discountAmount) + .orElse(JsonNullable.undefined()); + this.locationId = Optional.ofNullable(locationId) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); this.item = item; this.taxRate = taxRate; - this.ledgerAccount = ledgerAccount; - this.trackingCategories = trackingCategories; - this.rowVersion = rowVersion; + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); } public BillLineItemInput() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Row ID */ - @JsonIgnore public Optional rowId() { - return rowId; + return Optional.ofNullable(this.rowId); } /** * User defined item code */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Line number in the invoice */ - @JsonIgnore public JsonNullable lineNumber() { - return lineNumber; + return this.lineNumber; } /** * User defined description */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Bill Line Item type */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * Tax amount */ - @JsonIgnore public JsonNullable taxAmount() { - return taxAmount; + return this.taxAmount; } /** * Total amount of the line item */ - @JsonIgnore public JsonNullable totalAmount() { - return totalAmount; + return this.totalAmount; } - @JsonIgnore public JsonNullable quantity() { - return quantity; + return this.quantity; } - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - @JsonIgnore public JsonNullable unitOfMeasure() { - return unitOfMeasure; + return this.unitOfMeasure; } /** * Discount percentage applied to the line item when supported downstream. */ - @JsonIgnore public JsonNullable discountPercentage() { - return discountPercentage; + return this.discountPercentage; } /** * Discount amount applied to the line item when supported downstream. */ - @JsonIgnore public JsonNullable discountAmount() { - return discountAmount; + return this.discountAmount; } /** * The ID of the location */ - @JsonIgnore public JsonNullable locationId() { - return locationId; + return this.locationId; } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional item() { - return (Optional) item; + return Optional.ofNullable(this.item); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable ledgerAccount() { - return (JsonNullable) ledgerAccount; + return this.ledgerAccount; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } public static Builder builder() { @@ -364,317 +336,158 @@ public static Builder builder() { /** * Row ID */ - public BillLineItemInput withRowId(String rowId) { - Utils.checkNotNull(rowId, "rowId"); - this.rowId = Optional.ofNullable(rowId); - return this; - } - - - /** - * Row ID - */ - public BillLineItemInput withRowId(Optional rowId) { - Utils.checkNotNull(rowId, "rowId"); + public BillLineItemInput withRowId(@Nullable String rowId) { this.rowId = rowId; return this; } + /** * User defined item code */ - public BillLineItemInput withCode(String code) { - Utils.checkNotNull(code, "code"); + public BillLineItemInput withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public BillLineItemInput withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * Line number in the invoice */ - public BillLineItemInput withLineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public BillLineItemInput withLineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number in the invoice - */ - public BillLineItemInput withLineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } /** * User defined description */ - public BillLineItemInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public BillLineItemInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public BillLineItemInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * Bill Line Item type */ - public BillLineItemInput withType(BillLineItemType type) { - Utils.checkNotNull(type, "type"); + public BillLineItemInput withType(@Nullable BillLineItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * Bill Line Item type - */ - public BillLineItemInput withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Tax amount */ - public BillLineItemInput withTaxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public BillLineItemInput withTaxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public BillLineItemInput withTaxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } /** * Total amount of the line item */ - public BillLineItemInput withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public BillLineItemInput withTotalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Total amount of the line item - */ - public BillLineItemInput withTotalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - public BillLineItemInput withQuantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + public BillLineItemInput withQuantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public BillLineItemInput withQuantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - public BillLineItemInput withUnitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public BillLineItemInput withUnitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public BillLineItemInput withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public BillLineItemInput withUnitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public BillLineItemInput withUnitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public BillLineItemInput withUnitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } /** * Discount percentage applied to the line item when supported downstream. */ - public BillLineItemInput withDiscountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public BillLineItemInput withDiscountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to the line item when supported downstream. - */ - public BillLineItemInput withDiscountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } /** * Discount amount applied to the line item when supported downstream. */ - public BillLineItemInput withDiscountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public BillLineItemInput withDiscountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } - /** - * Discount amount applied to the line item when supported downstream. - */ - public BillLineItemInput withDiscountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; - return this; - } /** * The ID of the location */ - public BillLineItemInput withLocationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public BillLineItemInput withLocationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public BillLineItemInput withLocationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } /** * The ID of the department */ - public BillLineItemInput withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public BillLineItemInput withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public BillLineItemInput withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - public BillLineItemInput withItem(LinkedInvoiceItem item) { - Utils.checkNotNull(item, "item"); - this.item = Optional.ofNullable(item); - return this; - } - - public BillLineItemInput withItem(Optional item) { - Utils.checkNotNull(item, "item"); + public BillLineItemInput withItem(@Nullable LinkedInvoiceItem item) { this.item = item; return this; } - public BillLineItemInput withTaxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public BillLineItemInput withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public BillLineItemInput withTaxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - public BillLineItemInput withLedgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + + public BillLineItemInput withLedgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public BillLineItemInput withLedgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } /** * A list of linked tracking categories. */ - public BillLineItemInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public BillLineItemInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public BillLineItemInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public BillLineItemInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public BillLineItemInput withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public BillLineItemInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -746,381 +559,186 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional rowId = Optional.empty(); + private String rowId; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable lineNumber = JsonNullable.undefined(); + private JsonNullable lineNumber; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable taxAmount = JsonNullable.undefined(); + private JsonNullable taxAmount; - private JsonNullable totalAmount = JsonNullable.undefined(); + private JsonNullable totalAmount; - private JsonNullable quantity = JsonNullable.undefined(); + private JsonNullable quantity; - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable unitOfMeasure = JsonNullable.undefined(); + private JsonNullable unitOfMeasure; - private JsonNullable discountPercentage = JsonNullable.undefined(); + private JsonNullable discountPercentage; - private JsonNullable discountAmount = JsonNullable.undefined(); + private JsonNullable discountAmount; - private JsonNullable locationId = JsonNullable.undefined(); + private JsonNullable locationId; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private Optional item = Optional.empty(); + private LinkedInvoiceItem item; - private Optional taxRate = Optional.empty(); + private LinkedTaxRateInput taxRate; - private JsonNullable ledgerAccount = JsonNullable.undefined(); + private JsonNullable ledgerAccount; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; private Builder() { // force use of static builder() method } - /** * Row ID */ - public Builder rowId(String rowId) { - Utils.checkNotNull(rowId, "rowId"); - this.rowId = Optional.ofNullable(rowId); - return this; - } - - /** - * Row ID - */ - public Builder rowId(Optional rowId) { - Utils.checkNotNull(rowId, "rowId"); + public Builder rowId(@Nullable String rowId) { this.rowId = rowId; return this; } - /** * User defined item code */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Line number in the invoice */ - public Builder lineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public Builder lineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number in the invoice - */ - public Builder lineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } - - /** * User defined description */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * Bill Line Item type */ - public Builder type(BillLineItemType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable BillLineItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * Bill Line Item type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * Tax amount */ - public Builder taxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public Builder taxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public Builder taxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } - - /** * Total amount of the line item */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Total amount of the line item - */ - public Builder totalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - - public Builder quantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + public Builder quantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public Builder quantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - - - public Builder unitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public Builder unitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public Builder unitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public Builder unitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } - - /** * Discount percentage applied to the line item when supported downstream. */ - public Builder discountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Builder discountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to the line item when supported downstream. - */ - public Builder discountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - /** * Discount amount applied to the line item when supported downstream. */ - public Builder discountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public Builder discountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } - /** - * Discount amount applied to the line item when supported downstream. - */ - public Builder discountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; - return this; - } - - /** * The ID of the location */ - public Builder locationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public Builder locationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public Builder locationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } - - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - - public Builder item(LinkedInvoiceItem item) { - Utils.checkNotNull(item, "item"); - this.item = Optional.ofNullable(item); - return this; - } - - public Builder item(Optional item) { - Utils.checkNotNull(item, "item"); + public Builder item(@Nullable LinkedInvoiceItem item) { this.item = item; return this; } - - public Builder taxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - - public Builder ledgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Builder ledgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - public BillLineItemInput build() { - return new BillLineItemInput( rowId, code, lineNumber, description, type, taxAmount, diff --git a/src/main/java/com/apideck/unify/models/components/BillPayment.java b/src/main/java/com/apideck/unify/models/components/BillPayment.java index db4cbf43..f82f3e95 100644 --- a/src/main/java/com/apideck/unify/models/components/BillPayment.java +++ b/src/main/java/com/apideck/unify/models/components/BillPayment.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -41,7 +41,7 @@ public class BillPayment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -55,7 +55,7 @@ public class BillPayment { */ @JsonInclude(Include.ALWAYS) @JsonProperty("total_amount") - private Optional totalAmount; + private JsonNullable totalAmount; /** * Optional transaction reference message ie: Debit remittance detail. @@ -88,21 +88,21 @@ public class BillPayment { @JsonInclude(Include.NON_ABSENT) @JsonProperty("account") - private JsonNullable account; + private JsonNullable account; /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ @JsonInclude(Include.ALWAYS) @JsonProperty("transaction_date") - private Optional transactionDate; + private JsonNullable transactionDate; /** * The supplier this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier") - private JsonNullable supplier; + private JsonNullable supplier; /** * The company or subsidiary id the transaction belongs to @@ -123,19 +123,19 @@ public class BillPayment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private PaymentStatus status; /** * Type of payment */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private BillPaymentType type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("allocations") - private Optional> allocations; + private List allocations; /** * Note associated with the transaction @@ -156,12 +156,12 @@ public class BillPayment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -182,7 +182,7 @@ public class BillPayment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -217,344 +217,298 @@ public class BillPayment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public BillPayment( - @JsonProperty("id") String id, - @JsonProperty("downstream_id") JsonNullable downstreamId, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("total_amount") Optional totalAmount, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("payment_method_reference") JsonNullable paymentMethodReference, - @JsonProperty("payment_method_id") JsonNullable paymentMethodId, - @JsonProperty("account") JsonNullable account, - @JsonProperty("transaction_date") Optional transactionDate, - @JsonProperty("supplier") JsonNullable supplier, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("reconciled") JsonNullable reconciled, - @JsonProperty("status") Optional status, - @JsonProperty("type") Optional type, - @JsonProperty("allocations") Optional> allocations, - @JsonProperty("note") JsonNullable note, - @JsonProperty("number") JsonNullable number, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - Utils.checkNotNull(account, "account"); - Utils.checkNotNull(transactionDate, "transactionDate"); - Utils.checkNotNull(supplier, "supplier"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(reconciled, "reconciled"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(allocations, "allocations"); - Utils.checkNotNull(note, "note"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(passThrough, "passThrough"); - this.id = id; - this.downstreamId = downstreamId; - this.currency = currency; - this.currencyRate = currencyRate; - this.totalAmount = totalAmount; - this.reference = reference; - this.paymentMethod = paymentMethod; - this.paymentMethodReference = paymentMethodReference; - this.paymentMethodId = paymentMethodId; - this.account = account; - this.transactionDate = transactionDate; - this.supplier = supplier; - this.companyId = companyId; - this.reconciled = reconciled; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("total_amount") @Nullable Double totalAmount, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("payment_method_reference") @Nullable JsonNullable paymentMethodReference, + @JsonProperty("payment_method_id") @Nullable JsonNullable paymentMethodId, + @JsonProperty("account") @Nullable JsonNullable account, + @JsonProperty("transaction_date") @Nullable OffsetDateTime transactionDate, + @JsonProperty("supplier") @Nullable JsonNullable supplier, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("reconciled") @Nullable JsonNullable reconciled, + @JsonProperty("status") @Nullable PaymentStatus status, + @JsonProperty("type") @Nullable BillPaymentType type, + @JsonProperty("allocations") @Nullable List allocations, + @JsonProperty("note") @Nullable JsonNullable note, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.totalAmount = JsonNullable.of(totalAmount); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.paymentMethodReference = Optional.ofNullable(paymentMethodReference) + .orElse(JsonNullable.undefined()); + this.paymentMethodId = Optional.ofNullable(paymentMethodId) + .orElse(JsonNullable.undefined()); + this.account = Optional.ofNullable(account) + .orElse(JsonNullable.undefined()); + this.transactionDate = JsonNullable.of(transactionDate); + this.supplier = Optional.ofNullable(supplier) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.reconciled = Optional.ofNullable(reconciled) + .orElse(JsonNullable.undefined()); this.status = status; this.type = type; this.allocations = allocations; - this.note = note; - this.number = number; - this.trackingCategories = trackingCategories; + this.note = Optional.ofNullable(note) + .orElse(JsonNullable.undefined()); + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; - this.displayId = displayId; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.createdAt = createdAt; - this.updatedAt = updatedAt; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public BillPayment( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * The total amount of the transaction or record */ - @JsonIgnore - public Optional totalAmount() { - return totalAmount; + public JsonNullable totalAmount() { + return this.totalAmount; } /** * Optional transaction reference message ie: Debit remittance detail. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * Optional reference message returned by payment method on processing */ - @JsonIgnore public JsonNullable paymentMethodReference() { - return paymentMethodReference; + return this.paymentMethodReference; } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable paymentMethodId() { - return paymentMethodId; + return this.paymentMethodId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable account() { - return (JsonNullable) account; + return this.account; } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore - public Optional transactionDate() { - return transactionDate; + public JsonNullable transactionDate() { + return this.transactionDate; } /** * The supplier this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable supplier() { - return (JsonNullable) supplier; + return this.supplier; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Indicates if the transaction has been reconciled. */ - @JsonIgnore public JsonNullable reconciled() { - return reconciled; + return this.reconciled; } /** * Status of payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Type of payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> allocations() { - return (Optional>) allocations; + return Optional.ofNullable(this.allocations); } /** * Note associated with the transaction */ - @JsonIgnore public JsonNullable note() { - return note; + return this.note; } /** * Number associated with the transaction */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * Id to be displayed. */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -565,505 +519,255 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public BillPayment withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public BillPayment withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The third-party API ID of original entity */ - public BillPayment withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public BillPayment withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public BillPayment withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public BillPayment withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public BillPayment withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public BillPayment withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public BillPayment withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public BillPayment withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public BillPayment withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * The total amount of the transaction or record */ - public BillPayment withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); + public BillPayment withTotalAmount(@Nullable Double totalAmount) { + this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * The total amount of the transaction or record - */ - public BillPayment withTotalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - /** * Optional transaction reference message ie: Debit remittance detail. */ - public BillPayment withReference(String reference) { - Utils.checkNotNull(reference, "reference"); + public BillPayment withReference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional transaction reference message ie: Debit remittance detail. - */ - public BillPayment withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public BillPayment withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public BillPayment withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public BillPayment withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * Optional reference message returned by payment method on processing */ - public BillPayment withPaymentMethodReference(String paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); + public BillPayment withPaymentMethodReference(@Nullable String paymentMethodReference) { this.paymentMethodReference = JsonNullable.of(paymentMethodReference); return this; } - /** - * Optional reference message returned by payment method on processing - */ - public BillPayment withPaymentMethodReference(JsonNullable paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - this.paymentMethodReference = paymentMethodReference; - return this; - } /** * A unique identifier for an object. */ - public BillPayment withPaymentMethodId(String paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + public BillPayment withPaymentMethodId(@Nullable String paymentMethodId) { this.paymentMethodId = JsonNullable.of(paymentMethodId); return this; } - /** - * A unique identifier for an object. - */ - public BillPayment withPaymentMethodId(JsonNullable paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - this.paymentMethodId = paymentMethodId; - return this; - } - public BillPayment withAccount(LinkedLedgerAccount account) { - Utils.checkNotNull(account, "account"); + public BillPayment withAccount(@Nullable LinkedLedgerAccount account) { this.account = JsonNullable.of(account); return this; } - public BillPayment withAccount(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public BillPayment withTransactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); + public BillPayment withTransactionDate(@Nullable OffsetDateTime transactionDate) { + this.transactionDate = JsonNullable.of(transactionDate); return this; } - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public BillPayment withTransactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = transactionDate; - return this; - } - /** * The supplier this entity is linked to. */ - public BillPayment withSupplier(LinkedSupplier supplier) { - Utils.checkNotNull(supplier, "supplier"); + public BillPayment withSupplier(@Nullable LinkedSupplier supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public BillPayment withSupplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public BillPayment withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public BillPayment withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public BillPayment withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Indicates if the transaction has been reconciled. */ - public BillPayment withReconciled(boolean reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); + public BillPayment withReconciled(@Nullable Boolean reconciled) { this.reconciled = JsonNullable.of(reconciled); return this; } - /** - * Indicates if the transaction has been reconciled. - */ - public BillPayment withReconciled(JsonNullable reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); - this.reconciled = reconciled; - return this; - } - - /** - * Status of payment - */ - public BillPayment withStatus(PaymentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of payment */ - public BillPayment withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public BillPayment withStatus(@Nullable PaymentStatus status) { this.status = status; return this; } - /** - * Type of payment - */ - public BillPayment withType(BillPaymentType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of payment */ - public BillPayment withType(Optional type) { - Utils.checkNotNull(type, "type"); + public BillPayment withType(@Nullable BillPaymentType type) { this.type = type; return this; } - public BillPayment withAllocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public BillPayment withAllocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public BillPayment withAllocations(@Nullable List allocations) { this.allocations = allocations; return this; } + /** * Note associated with the transaction */ - public BillPayment withNote(String note) { - Utils.checkNotNull(note, "note"); + public BillPayment withNote(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Note associated with the transaction - */ - public BillPayment withNote(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } /** * Number associated with the transaction */ - public BillPayment withNumber(String number) { - Utils.checkNotNull(number, "number"); + public BillPayment withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number associated with the transaction - */ - public BillPayment withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * A list of linked tracking categories. */ - public BillPayment withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public BillPayment withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public BillPayment withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - public BillPayment withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public BillPayment withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public BillPayment withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public BillPayment withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public BillPayment withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public BillPayment withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * Id to be displayed. */ - public BillPayment withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public BillPayment withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Id to be displayed. - */ - public BillPayment withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public BillPayment withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public BillPayment withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public BillPayment withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public BillPayment withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public BillPayment withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public BillPayment withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public BillPayment withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public BillPayment withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public BillPayment withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was created. */ - public BillPayment withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public BillPayment withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public BillPayment withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The date and time when the object was last updated. */ - public BillPayment withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public BillPayment withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public BillPayment withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public BillPayment withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public BillPayment withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public BillPayment withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1159,592 +863,290 @@ public final static class Builder { private String id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private Optional totalAmount = Optional.empty(); + private Double totalAmount; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable paymentMethodReference = JsonNullable.undefined(); + private JsonNullable paymentMethodReference; - private JsonNullable paymentMethodId = JsonNullable.undefined(); + private JsonNullable paymentMethodId; - private JsonNullable account = JsonNullable.undefined(); + private JsonNullable account; - private Optional transactionDate = Optional.empty(); + private OffsetDateTime transactionDate; - private JsonNullable supplier = JsonNullable.undefined(); + private JsonNullable supplier; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable reconciled = JsonNullable.undefined(); + private JsonNullable reconciled; - private Optional status = Optional.empty(); + private PaymentStatus status; - private Optional type = Optional.empty(); + private BillPaymentType type; - private Optional> allocations = Optional.empty(); + private List allocations; - private JsonNullable note = JsonNullable.undefined(); + private JsonNullable note; - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * The total amount of the transaction or record */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - - /** - * The total amount of the transaction or record - */ - public Builder totalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = totalAmount; return this; } - /** * Optional transaction reference message ie: Debit remittance detail. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional transaction reference message ie: Debit remittance detail. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * Optional reference message returned by payment method on processing */ - public Builder paymentMethodReference(String paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); + public Builder paymentMethodReference(@Nullable String paymentMethodReference) { this.paymentMethodReference = JsonNullable.of(paymentMethodReference); return this; } - /** - * Optional reference message returned by payment method on processing - */ - public Builder paymentMethodReference(JsonNullable paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - this.paymentMethodReference = paymentMethodReference; - return this; - } - - /** * A unique identifier for an object. */ - public Builder paymentMethodId(String paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + public Builder paymentMethodId(@Nullable String paymentMethodId) { this.paymentMethodId = JsonNullable.of(paymentMethodId); return this; } - /** - * A unique identifier for an object. - */ - public Builder paymentMethodId(JsonNullable paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - this.paymentMethodId = paymentMethodId; - return this; - } - - - public Builder account(LinkedLedgerAccount account) { - Utils.checkNotNull(account, "account"); + public Builder account(@Nullable LinkedLedgerAccount account) { this.account = JsonNullable.of(account); return this; } - public Builder account(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - - - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Builder transactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); - return this; - } - /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder transactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); + public Builder transactionDate(@Nullable OffsetDateTime transactionDate) { this.transactionDate = transactionDate; return this; } - /** * The supplier this entity is linked to. */ - public Builder supplier(LinkedSupplier supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Builder supplier(@Nullable LinkedSupplier supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public Builder supplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Indicates if the transaction has been reconciled. */ - public Builder reconciled(boolean reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); + public Builder reconciled(@Nullable Boolean reconciled) { this.reconciled = JsonNullable.of(reconciled); return this; } - /** - * Indicates if the transaction has been reconciled. - */ - public Builder reconciled(JsonNullable reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); - this.reconciled = reconciled; - return this; - } - - - /** - * Status of payment - */ - public Builder status(PaymentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of payment */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable PaymentStatus status) { this.status = status; return this; } - - /** - * Type of payment - */ - public Builder type(BillPaymentType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of payment */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable BillPaymentType type) { this.type = type; return this; } - - public Builder allocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public Builder allocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public Builder allocations(@Nullable List allocations) { this.allocations = allocations; return this; } - /** * Note associated with the transaction */ - public Builder note(String note) { - Utils.checkNotNull(note, "note"); + public Builder note(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Note associated with the transaction - */ - public Builder note(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } - - /** * Number associated with the transaction */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number associated with the transaction - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * Id to be displayed. */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Id to be displayed. - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public BillPayment build() { - return new BillPayment( id, downstreamId, currency, currencyRate, totalAmount, reference, diff --git a/src/main/java/com/apideck/unify/models/components/BillPaymentAllocations.java b/src/main/java/com/apideck/unify/models/components/BillPaymentAllocations.java index 2fb42afd..c6eafad1 100644 --- a/src/main/java/com/apideck/unify/models/components/BillPaymentAllocations.java +++ b/src/main/java/com/apideck/unify/models/components/BillPaymentAllocations.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +29,7 @@ public class BillPaymentAllocations { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private BillPaymentAllocationType type; /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. @@ -44,60 +43,53 @@ public class BillPaymentAllocations { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("allocation_id") - private Optional allocationId; + private String allocationId; @JsonCreator public BillPaymentAllocations( - @JsonProperty("id") JsonNullable id, - @JsonProperty("type") Optional type, - @JsonProperty("amount") JsonNullable amount, - @JsonProperty("allocation_id") Optional allocationId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(amount, "amount"); - Utils.checkNotNull(allocationId, "allocationId"); - this.id = id; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("type") @Nullable BillPaymentAllocationType type, + @JsonProperty("amount") @Nullable JsonNullable amount, + @JsonProperty("allocation_id") @Nullable String allocationId) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); this.type = type; - this.amount = amount; + this.amount = Optional.ofNullable(amount) + .orElse(JsonNullable.undefined()); this.allocationId = allocationId; } public BillPaymentAllocations() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Type of entity this payment should be attributed to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - @JsonIgnore public JsonNullable amount() { - return amount; + return this.amount; } /** * Unique identifier of the allocation */ - @JsonIgnore public Optional allocationId() { - return allocationId; + return Optional.ofNullable(this.allocationId); } public static Builder builder() { @@ -108,64 +100,26 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public BillPaymentAllocations withId(String id) { - Utils.checkNotNull(id, "id"); + public BillPaymentAllocations withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public BillPaymentAllocations withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * Type of entity this payment should be attributed to. - */ - public BillPaymentAllocations withType(BillPaymentAllocationType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of entity this payment should be attributed to. */ - public BillPaymentAllocations withType(Optional type) { - Utils.checkNotNull(type, "type"); + public BillPaymentAllocations withType(@Nullable BillPaymentAllocationType type) { this.type = type; return this; } - /** - * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - */ - public BillPaymentAllocations withAmount(double amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = JsonNullable.of(amount); - return this; - } /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - public BillPaymentAllocations withAmount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** - * Unique identifier of the allocation - */ - public BillPaymentAllocations withAllocationId(String allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); - this.allocationId = Optional.ofNullable(allocationId); + public BillPaymentAllocations withAmount(@Nullable Double amount) { + this.amount = JsonNullable.of(amount); return this; } @@ -173,12 +127,12 @@ public BillPaymentAllocations withAllocationId(String allocationId) { /** * Unique identifier of the allocation */ - public BillPaymentAllocations withAllocationId(Optional allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); + public BillPaymentAllocations withAllocationId(@Nullable String allocationId) { this.allocationId = allocationId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -214,96 +168,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private Optional type = Optional.empty(); + private BillPaymentAllocationType type; - private JsonNullable amount = JsonNullable.undefined(); + private JsonNullable amount; - private Optional allocationId = Optional.empty(); + private String allocationId; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * Type of entity this payment should be attributed to. - */ - public Builder type(BillPaymentAllocationType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of entity this payment should be attributed to. */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable BillPaymentAllocationType type) { this.type = type; return this; } - /** * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. */ - public Builder amount(double amount) { - Utils.checkNotNull(amount, "amount"); + public Builder amount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * Amount of payment that should be attributed to this allocation. If null, the total_amount will be used. - */ - public Builder amount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** * Unique identifier of the allocation */ - public Builder allocationId(String allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); - this.allocationId = Optional.ofNullable(allocationId); - return this; - } - - /** - * Unique identifier of the allocation - */ - public Builder allocationId(Optional allocationId) { - Utils.checkNotNull(allocationId, "allocationId"); + public Builder allocationId(@Nullable String allocationId) { this.allocationId = allocationId; return this; } public BillPaymentAllocations build() { - return new BillPaymentAllocations( id, type, amount, allocationId); diff --git a/src/main/java/com/apideck/unify/models/components/BillPaymentInput.java b/src/main/java/com/apideck/unify/models/components/BillPaymentInput.java index 2477b974..af41cd9a 100644 --- a/src/main/java/com/apideck/unify/models/components/BillPaymentInput.java +++ b/src/main/java/com/apideck/unify/models/components/BillPaymentInput.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -26,7 +25,7 @@ public class BillPaymentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -40,7 +39,7 @@ public class BillPaymentInput { */ @JsonInclude(Include.ALWAYS) @JsonProperty("total_amount") - private Optional totalAmount; + private JsonNullable totalAmount; /** * Optional transaction reference message ie: Debit remittance detail. @@ -73,21 +72,21 @@ public class BillPaymentInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("account") - private JsonNullable account; + private JsonNullable account; /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ @JsonInclude(Include.ALWAYS) @JsonProperty("transaction_date") - private Optional transactionDate; + private JsonNullable transactionDate; /** * The supplier this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier") - private JsonNullable supplier; + private JsonNullable supplier; /** * The company or subsidiary id the transaction belongs to @@ -108,19 +107,19 @@ public class BillPaymentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private PaymentStatus status; /** * Type of payment */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private BillPaymentType type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("allocations") - private Optional> allocations; + private List allocations; /** * Note associated with the transaction @@ -141,12 +140,12 @@ public class BillPaymentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -167,263 +166,225 @@ public class BillPaymentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public BillPaymentInput( - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("total_amount") Optional totalAmount, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("payment_method_reference") JsonNullable paymentMethodReference, - @JsonProperty("payment_method_id") JsonNullable paymentMethodId, - @JsonProperty("account") JsonNullable account, - @JsonProperty("transaction_date") Optional transactionDate, - @JsonProperty("supplier") JsonNullable supplier, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("reconciled") JsonNullable reconciled, - @JsonProperty("status") Optional status, - @JsonProperty("type") Optional type, - @JsonProperty("allocations") Optional> allocations, - @JsonProperty("note") JsonNullable note, - @JsonProperty("number") JsonNullable number, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - Utils.checkNotNull(account, "account"); - Utils.checkNotNull(transactionDate, "transactionDate"); - Utils.checkNotNull(supplier, "supplier"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(reconciled, "reconciled"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(allocations, "allocations"); - Utils.checkNotNull(note, "note"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(passThrough, "passThrough"); - this.currency = currency; - this.currencyRate = currencyRate; - this.totalAmount = totalAmount; - this.reference = reference; - this.paymentMethod = paymentMethod; - this.paymentMethodReference = paymentMethodReference; - this.paymentMethodId = paymentMethodId; - this.account = account; - this.transactionDate = transactionDate; - this.supplier = supplier; - this.companyId = companyId; - this.reconciled = reconciled; + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("total_amount") @Nullable Double totalAmount, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("payment_method_reference") @Nullable JsonNullable paymentMethodReference, + @JsonProperty("payment_method_id") @Nullable JsonNullable paymentMethodId, + @JsonProperty("account") @Nullable JsonNullable account, + @JsonProperty("transaction_date") @Nullable OffsetDateTime transactionDate, + @JsonProperty("supplier") @Nullable JsonNullable supplier, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("reconciled") @Nullable JsonNullable reconciled, + @JsonProperty("status") @Nullable PaymentStatus status, + @JsonProperty("type") @Nullable BillPaymentType type, + @JsonProperty("allocations") @Nullable List allocations, + @JsonProperty("note") @Nullable JsonNullable note, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.totalAmount = JsonNullable.of(totalAmount); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.paymentMethodReference = Optional.ofNullable(paymentMethodReference) + .orElse(JsonNullable.undefined()); + this.paymentMethodId = Optional.ofNullable(paymentMethodId) + .orElse(JsonNullable.undefined()); + this.account = Optional.ofNullable(account) + .orElse(JsonNullable.undefined()); + this.transactionDate = JsonNullable.of(transactionDate); + this.supplier = Optional.ofNullable(supplier) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.reconciled = Optional.ofNullable(reconciled) + .orElse(JsonNullable.undefined()); this.status = status; this.type = type; this.allocations = allocations; - this.note = note; - this.number = number; - this.trackingCategories = trackingCategories; + this.note = Optional.ofNullable(note) + .orElse(JsonNullable.undefined()); + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; - this.displayId = displayId; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public BillPaymentInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * The total amount of the transaction or record */ - @JsonIgnore - public Optional totalAmount() { - return totalAmount; + public JsonNullable totalAmount() { + return this.totalAmount; } /** * Optional transaction reference message ie: Debit remittance detail. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * Optional reference message returned by payment method on processing */ - @JsonIgnore public JsonNullable paymentMethodReference() { - return paymentMethodReference; + return this.paymentMethodReference; } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable paymentMethodId() { - return paymentMethodId; + return this.paymentMethodId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable account() { - return (JsonNullable) account; + return this.account; } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore - public Optional transactionDate() { - return transactionDate; + public JsonNullable transactionDate() { + return this.transactionDate; } /** * The supplier this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable supplier() { - return (JsonNullable) supplier; + return this.supplier; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Indicates if the transaction has been reconciled. */ - @JsonIgnore public JsonNullable reconciled() { - return reconciled; + return this.reconciled; } /** * Status of payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Type of payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> allocations() { - return (Optional>) allocations; + return Optional.ofNullable(this.allocations); } /** * Note associated with the transaction */ - @JsonIgnore public JsonNullable note() { - return note; + return this.note; } /** * Number associated with the transaction */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * Id to be displayed. */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -434,388 +395,192 @@ public static Builder builder() { /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public BillPaymentInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public BillPaymentInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public BillPaymentInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public BillPaymentInput withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public BillPaymentInput withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public BillPaymentInput withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * The total amount of the transaction or record */ - public BillPaymentInput withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); + public BillPaymentInput withTotalAmount(@Nullable Double totalAmount) { + this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * The total amount of the transaction or record - */ - public BillPaymentInput withTotalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - /** * Optional transaction reference message ie: Debit remittance detail. */ - public BillPaymentInput withReference(String reference) { - Utils.checkNotNull(reference, "reference"); + public BillPaymentInput withReference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional transaction reference message ie: Debit remittance detail. - */ - public BillPaymentInput withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public BillPaymentInput withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public BillPaymentInput withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public BillPaymentInput withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * Optional reference message returned by payment method on processing */ - public BillPaymentInput withPaymentMethodReference(String paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); + public BillPaymentInput withPaymentMethodReference(@Nullable String paymentMethodReference) { this.paymentMethodReference = JsonNullable.of(paymentMethodReference); return this; } - /** - * Optional reference message returned by payment method on processing - */ - public BillPaymentInput withPaymentMethodReference(JsonNullable paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - this.paymentMethodReference = paymentMethodReference; - return this; - } /** * A unique identifier for an object. */ - public BillPaymentInput withPaymentMethodId(String paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + public BillPaymentInput withPaymentMethodId(@Nullable String paymentMethodId) { this.paymentMethodId = JsonNullable.of(paymentMethodId); return this; } - /** - * A unique identifier for an object. - */ - public BillPaymentInput withPaymentMethodId(JsonNullable paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - this.paymentMethodId = paymentMethodId; - return this; - } - public BillPaymentInput withAccount(LinkedLedgerAccountInput account) { - Utils.checkNotNull(account, "account"); + public BillPaymentInput withAccount(@Nullable LinkedLedgerAccountInput account) { this.account = JsonNullable.of(account); return this; } - public BillPaymentInput withAccount(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public BillPaymentInput withTransactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); + public BillPaymentInput withTransactionDate(@Nullable OffsetDateTime transactionDate) { + this.transactionDate = JsonNullable.of(transactionDate); return this; } - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public BillPaymentInput withTransactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = transactionDate; - return this; - } - /** * The supplier this entity is linked to. */ - public BillPaymentInput withSupplier(LinkedSupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); + public BillPaymentInput withSupplier(@Nullable LinkedSupplierInput supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public BillPaymentInput withSupplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public BillPaymentInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public BillPaymentInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public BillPaymentInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Indicates if the transaction has been reconciled. */ - public BillPaymentInput withReconciled(boolean reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); + public BillPaymentInput withReconciled(@Nullable Boolean reconciled) { this.reconciled = JsonNullable.of(reconciled); return this; } - /** - * Indicates if the transaction has been reconciled. - */ - public BillPaymentInput withReconciled(JsonNullable reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); - this.reconciled = reconciled; - return this; - } - - /** - * Status of payment - */ - public BillPaymentInput withStatus(PaymentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of payment */ - public BillPaymentInput withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public BillPaymentInput withStatus(@Nullable PaymentStatus status) { this.status = status; return this; } - /** - * Type of payment - */ - public BillPaymentInput withType(BillPaymentType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of payment */ - public BillPaymentInput withType(Optional type) { - Utils.checkNotNull(type, "type"); + public BillPaymentInput withType(@Nullable BillPaymentType type) { this.type = type; return this; } - public BillPaymentInput withAllocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public BillPaymentInput withAllocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public BillPaymentInput withAllocations(@Nullable List allocations) { this.allocations = allocations; return this; } + /** * Note associated with the transaction */ - public BillPaymentInput withNote(String note) { - Utils.checkNotNull(note, "note"); + public BillPaymentInput withNote(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Note associated with the transaction - */ - public BillPaymentInput withNote(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } /** * Number associated with the transaction */ - public BillPaymentInput withNumber(String number) { - Utils.checkNotNull(number, "number"); + public BillPaymentInput withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number associated with the transaction - */ - public BillPaymentInput withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * A list of linked tracking categories. */ - public BillPaymentInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public BillPaymentInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public BillPaymentInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - public BillPaymentInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public BillPaymentInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public BillPaymentInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public BillPaymentInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public BillPaymentInput withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public BillPaymentInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * Id to be displayed. */ - public BillPaymentInput withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public BillPaymentInput withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Id to be displayed. - */ - public BillPaymentInput withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public BillPaymentInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public BillPaymentInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public BillPaymentInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -893,456 +658,222 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private Optional totalAmount = Optional.empty(); + private Double totalAmount; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable paymentMethodReference = JsonNullable.undefined(); + private JsonNullable paymentMethodReference; - private JsonNullable paymentMethodId = JsonNullable.undefined(); + private JsonNullable paymentMethodId; - private JsonNullable account = JsonNullable.undefined(); + private JsonNullable account; - private Optional transactionDate = Optional.empty(); + private OffsetDateTime transactionDate; - private JsonNullable supplier = JsonNullable.undefined(); + private JsonNullable supplier; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable reconciled = JsonNullable.undefined(); + private JsonNullable reconciled; - private Optional status = Optional.empty(); + private PaymentStatus status; - private Optional type = Optional.empty(); + private BillPaymentType type; - private Optional> allocations = Optional.empty(); + private List allocations; - private JsonNullable note = JsonNullable.undefined(); + private JsonNullable note; - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - - /** - * The total amount of the transaction or record - */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - /** * The total amount of the transaction or record */ - public Builder totalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = totalAmount; return this; } - /** * Optional transaction reference message ie: Debit remittance detail. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional transaction reference message ie: Debit remittance detail. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * Optional reference message returned by payment method on processing */ - public Builder paymentMethodReference(String paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); + public Builder paymentMethodReference(@Nullable String paymentMethodReference) { this.paymentMethodReference = JsonNullable.of(paymentMethodReference); return this; } - /** - * Optional reference message returned by payment method on processing - */ - public Builder paymentMethodReference(JsonNullable paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - this.paymentMethodReference = paymentMethodReference; - return this; - } - - /** * A unique identifier for an object. */ - public Builder paymentMethodId(String paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + public Builder paymentMethodId(@Nullable String paymentMethodId) { this.paymentMethodId = JsonNullable.of(paymentMethodId); return this; } - /** - * A unique identifier for an object. - */ - public Builder paymentMethodId(JsonNullable paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - this.paymentMethodId = paymentMethodId; - return this; - } - - - public Builder account(LinkedLedgerAccountInput account) { - Utils.checkNotNull(account, "account"); + public Builder account(@Nullable LinkedLedgerAccountInput account) { this.account = JsonNullable.of(account); return this; } - public Builder account(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - - - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Builder transactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); - return this; - } - /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder transactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); + public Builder transactionDate(@Nullable OffsetDateTime transactionDate) { this.transactionDate = transactionDate; return this; } - /** * The supplier this entity is linked to. */ - public Builder supplier(LinkedSupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Builder supplier(@Nullable LinkedSupplierInput supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public Builder supplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Indicates if the transaction has been reconciled. */ - public Builder reconciled(boolean reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); + public Builder reconciled(@Nullable Boolean reconciled) { this.reconciled = JsonNullable.of(reconciled); return this; } - /** - * Indicates if the transaction has been reconciled. - */ - public Builder reconciled(JsonNullable reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); - this.reconciled = reconciled; - return this; - } - - /** * Status of payment */ - public Builder status(PaymentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * Status of payment - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable PaymentStatus status) { this.status = status; return this; } - /** * Type of payment */ - public Builder type(BillPaymentType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - /** - * Type of payment - */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable BillPaymentType type) { this.type = type; return this; } - - public Builder allocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public Builder allocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public Builder allocations(@Nullable List allocations) { this.allocations = allocations; return this; } - /** * Note associated with the transaction */ - public Builder note(String note) { - Utils.checkNotNull(note, "note"); + public Builder note(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Note associated with the transaction - */ - public Builder note(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } - - /** * Number associated with the transaction */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number associated with the transaction - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * Id to be displayed. */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Id to be displayed. - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public BillPaymentInput build() { - return new BillPaymentInput( currency, currencyRate, totalAmount, reference, paymentMethod, paymentMethodReference, diff --git a/src/main/java/com/apideck/unify/models/components/BillsFilter.java b/src/main/java/com/apideck/unify/models/components/BillsFilter.java index cbc0d88c..87f2a4d9 100644 --- a/src/main/java/com/apideck/unify/models/components/BillsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/BillsFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; @@ -16,22 +16,20 @@ public class BillsFilter { @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private OffsetDateTime updatedSince; @JsonCreator public BillsFilter( - Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + @Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; } public BillsFilter() { - this(Optional.empty()); + this(null); } - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } public static Builder builder() { @@ -39,19 +37,12 @@ public static Builder builder() { } - public BillsFilter withUpdatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - - public BillsFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public BillsFilter withUpdatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -80,27 +71,18 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional updatedSince = Optional.empty(); + private OffsetDateTime updatedSince; private Builder() { // force use of static builder() method } - - public Builder updatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } public BillsFilter build() { - return new BillsFilter( updatedSince); } diff --git a/src/main/java/com/apideck/unify/models/components/BillsSort.java b/src/main/java/com/apideck/unify/models/components/BillsSort.java index e2b06c41..0c29c259 100644 --- a/src/main/java/com/apideck/unify/models/components/BillsSort.java +++ b/src/main/java/com/apideck/unify/models/components/BillsSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class BillsSort { * The field on which to sort the Bills */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private By by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public BillsSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable By by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public BillsSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Bills */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Bills */ - public BillsSort withBy(By by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Bills - */ - public BillsSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public BillsSort withBy(@Nullable By by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public BillsSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public BillsSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public BillsSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private By by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Bills - */ - public Builder by(By by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Bills */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable By by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public BillsSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new BillsSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/Blocks.java b/src/main/java/com/apideck/unify/models/components/Blocks.java index cf3a2c52..924fc9e8 100644 --- a/src/main/java/com/apideck/unify/models/components/Blocks.java +++ b/src/main/java/com/apideck/unify/models/components/Blocks.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,35 +18,31 @@ public class Blocks { @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") - private Optional title; + private String title; @JsonInclude(Include.NON_ABSENT) @JsonProperty("content") - private Optional content; + private String content; @JsonCreator public Blocks( - @JsonProperty("title") Optional title, - @JsonProperty("content") Optional content) { - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(content, "content"); + @JsonProperty("title") @Nullable String title, + @JsonProperty("content") @Nullable String content) { this.title = title; this.content = content; } public Blocks() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @JsonIgnore public Optional title() { - return title; + return Optional.ofNullable(this.title); } - @JsonIgnore public Optional content() { - return content; + return Optional.ofNullable(this.content); } public static Builder builder() { @@ -54,32 +50,18 @@ public static Builder builder() { } - public Blocks withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - - public Blocks withTitle(Optional title) { - Utils.checkNotNull(title, "title"); + public Blocks withTitle(@Nullable String title) { this.title = title; return this; } - public Blocks withContent(String content) { - Utils.checkNotNull(content, "content"); - this.content = Optional.ofNullable(content); - return this; - } - - public Blocks withContent(Optional content) { - Utils.checkNotNull(content, "content"); + public Blocks withContent(@Nullable String content) { this.content = content; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,42 +92,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional title = Optional.empty(); + private String title; - private Optional content = Optional.empty(); + private String content; private Builder() { // force use of static builder() method } - - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = title; return this; } - - public Builder content(String content) { - Utils.checkNotNull(content, "content"); - this.content = Optional.ofNullable(content); - return this; - } - - public Builder content(Optional content) { - Utils.checkNotNull(content, "content"); + public Builder content(@Nullable String content) { this.content = content; return this; } public Blocks build() { - return new Blocks( title, content); } diff --git a/src/main/java/com/apideck/unify/models/components/Branch.java b/src/main/java/com/apideck/unify/models/components/Branch.java index 0d099c38..2690dabb 100644 --- a/src/main/java/com/apideck/unify/models/components/Branch.java +++ b/src/main/java/com/apideck/unify/models/components/Branch.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -24,43 +24,39 @@ public class Branch { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Name of the branch. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; @JsonCreator public Branch( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name) { this.id = id; this.name = name; } public Branch() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Name of the branch. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } public static Builder builder() { @@ -71,41 +67,21 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Branch withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Branch withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Branch withId(@Nullable String id) { this.id = id; return this; } - /** - * Name of the branch. - */ - public Branch withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the branch. */ - public Branch withName(Optional name) { - Utils.checkNotNull(name, "name"); + public Branch withName(@Nullable String name) { this.name = name; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -136,54 +112,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Name of the branch. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the branch. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } public Branch build() { - return new Branch( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/Categories.java b/src/main/java/com/apideck/unify/models/components/Categories.java index 4b2c96b9..897b1ecf 100644 --- a/src/main/java/com/apideck/unify/models/components/Categories.java +++ b/src/main/java/com/apideck/unify/models/components/Categories.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,40 +18,36 @@ public class Categories { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the category. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; @JsonCreator public Categories( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name) { this.id = id; this.name = name; } public Categories() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the category. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } public static Builder builder() { @@ -59,38 +55,21 @@ public static Builder builder() { } - public Categories withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - public Categories withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Categories withId(@Nullable String id) { this.id = id; return this; } - /** - * The name of the category. - */ - public Categories withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the category. */ - public Categories withName(Optional name) { - Utils.checkNotNull(name, "name"); + public Categories withName(@Nullable String name) { this.name = name; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,48 +100,28 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; private Builder() { // force use of static builder() method } - - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the category. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * The name of the category. - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } public Categories build() { - return new Categories( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/CategoriesFilter.java b/src/main/java/com/apideck/unify/models/components/CategoriesFilter.java new file mode 100644 index 00000000..6698d7e3 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/CategoriesFilter.java @@ -0,0 +1,101 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.apideck.unify.utils.SpeakeasyMetadata; +import com.apideck.unify.utils.Utils; +import com.fasterxml.jackson.annotation.JsonCreator; +import jakarta.annotation.Nullable; +import java.lang.Override; +import java.lang.String; +import java.util.Optional; + + +public class CategoriesFilter { + /** + * The type of the category. + */ + @SpeakeasyMetadata("queryParam:name=type") + private CategoriesFilterType type; + + @JsonCreator + public CategoriesFilter( + @Nullable CategoriesFilterType type) { + this.type = type; + } + + public CategoriesFilter() { + this(null); + } + + /** + * The type of the category. + */ + public Optional type() { + return Optional.ofNullable(this.type); + } + + public static Builder builder() { + return new Builder(); + } + + + /** + * The type of the category. + */ + public CategoriesFilter withType(@Nullable CategoriesFilterType type) { + this.type = type; + return this; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CategoriesFilter other = (CategoriesFilter) o; + return + Utils.enhancedDeepEquals(this.type, other.type); + } + + @Override + public int hashCode() { + return Utils.enhancedHash( + type); + } + + @Override + public String toString() { + return Utils.toString(CategoriesFilter.class, + "type", type); + } + + @SuppressWarnings("UnusedReturnValue") + public final static class Builder { + + private CategoriesFilterType type; + + private Builder() { + // force use of static builder() method + } + + /** + * The type of the category. + */ + public Builder type(@Nullable CategoriesFilterType type) { + this.type = type; + return this; + } + + public CategoriesFilter build() { + return new CategoriesFilter( + type); + } + + } +} diff --git a/src/main/java/com/apideck/unify/models/components/CategoriesFilterType.java b/src/main/java/com/apideck/unify/models/components/CategoriesFilterType.java new file mode 100644 index 00000000..09179102 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/CategoriesFilterType.java @@ -0,0 +1,41 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + +/** + * CategoriesFilterType + * + *

The type of the category. + */ +public enum CategoriesFilterType { + SUPPLIER("supplier"), + EXPENSE("expense"), + REVENUE("revenue"); + + @JsonValue + private final String value; + + CategoriesFilterType(String value) { + this.value = value; + } + + public String value() { + return value; + } + + public static Optional fromValue(String value) { + for (CategoriesFilterType o: CategoriesFilterType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } +} + diff --git a/src/main/java/com/apideck/unify/models/components/Category.java b/src/main/java/com/apideck/unify/models/components/Category.java index 50c0e138..0ef6be06 100644 --- a/src/main/java/com/apideck/unify/models/components/Category.java +++ b/src/main/java/com/apideck/unify/models/components/Category.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -26,28 +25,35 @@ public class Category { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the category. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; + + /** + * The type of the category. + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("type") + private CategoryType type; /** * Based on the status some functionality is enabled or disabled. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private CategoryStatus status; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -89,130 +95,122 @@ public class Category { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Category( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("status") Optional status, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("type") @Nullable CategoryType type, + @JsonProperty("status") @Nullable CategoryStatus status, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; this.name = name; + this.type = type; this.status = status; - this.customMappings = customMappings; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Category() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the category. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); + } + + /** + * The type of the category. + */ + public Optional type() { + return Optional.ofNullable(this.type); } /** * Based on the status some functionality is enabled or disabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -223,47 +221,26 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Category withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Category withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Category withId(@Nullable String id) { this.id = id; return this; } - /** - * The name of the category. - */ - public Category withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the category. */ - public Category withName(Optional name) { - Utils.checkNotNull(name, "name"); + public Category withName(@Nullable String name) { this.name = name; return this; } + /** - * Based on the status some functionality is enabled or disabled. + * The type of the category. */ - public Category withStatus(CategoryStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); + public Category withType(@Nullable CategoryType type) { + this.type = type; return this; } @@ -271,139 +248,75 @@ public Category withStatus(CategoryStatus status) { /** * Based on the status some functionality is enabled or disabled. */ - public Category withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public Category withStatus(@Nullable CategoryStatus status) { this.status = status; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public Category withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Category withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Category withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Category withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Category withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Category withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public Category withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Category withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Category withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Category withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Category withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Category withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Category withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Category withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Category withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Category withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Category withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Category withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Category withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Category withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Category withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -416,6 +329,7 @@ public boolean equals(java.lang.Object o) { return Utils.enhancedDeepEquals(this.id, other.id) && Utils.enhancedDeepEquals(this.name, other.name) && + Utils.enhancedDeepEquals(this.type, other.type) && Utils.enhancedDeepEquals(this.status, other.status) && Utils.enhancedDeepEquals(this.customMappings, other.customMappings) && Utils.enhancedDeepEquals(this.rowVersion, other.rowVersion) && @@ -429,10 +343,10 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { return Utils.enhancedHash( - id, name, status, - customMappings, rowVersion, updatedBy, - createdBy, updatedAt, createdAt, - passThrough); + id, name, type, + status, customMappings, rowVersion, + updatedBy, createdBy, updatedAt, + createdAt, passThrough); } @Override @@ -440,6 +354,7 @@ public String toString() { return Utils.toString(Category.class, "id", id, "name", name, + "type", type, "status", status, "customMappings", customMappings, "rowVersion", rowVersion, @@ -453,227 +368,126 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; + + private String name; - private Optional name = Optional.empty(); + private CategoryType type; - private Optional status = Optional.empty(); + private CategoryStatus status; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * The name of the category. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the category. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** - * Based on the status some functionality is enabled or disabled. + * The type of the category. */ - public Builder status(CategoryStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); + public Builder type(@Nullable CategoryType type) { + this.type = type; return this; } /** * Based on the status some functionality is enabled or disabled. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable CategoryStatus status) { this.status = status; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Category build() { - return new Category( - id, name, status, - customMappings, rowVersion, updatedBy, - createdBy, updatedAt, createdAt, - passThrough); + id, name, type, + status, customMappings, rowVersion, + updatedBy, createdBy, updatedAt, + createdAt, passThrough); } } diff --git a/src/main/java/com/apideck/unify/models/components/CategoryType.java b/src/main/java/com/apideck/unify/models/components/CategoryType.java new file mode 100644 index 00000000..82161998 --- /dev/null +++ b/src/main/java/com/apideck/unify/models/components/CategoryType.java @@ -0,0 +1,41 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ +package com.apideck.unify.models.components; + +import com.fasterxml.jackson.annotation.JsonValue; +import java.lang.String; +import java.util.Objects; +import java.util.Optional; + +/** + * CategoryType + * + *

The type of the category. + */ +public enum CategoryType { + SUPPLIER("supplier"), + EXPENSE("expense"), + REVENUE("revenue"); + + @JsonValue + private final String value; + + CategoryType(String value) { + this.value = value; + } + + public String value() { + return value; + } + + public static Optional fromValue(String value) { + for (CategoryType o: CategoryType.values()) { + if (Objects.deepEquals(o.value, value)) { + return Optional.of(o); + } + } + return Optional.empty(); + } +} + diff --git a/src/main/java/com/apideck/unify/models/components/Collection.java b/src/main/java/com/apideck/unify/models/components/Collection.java index 320c4fe6..214512f1 100644 --- a/src/main/java/com/apideck/unify/models/components/Collection.java +++ b/src/main/java/com/apideck/unify/models/components/Collection.java @@ -5,16 +5,17 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -58,7 +59,7 @@ public class Collection { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The date and time when the object was last updated. @@ -76,102 +77,93 @@ public class Collection { @JsonCreator public Collection( - @JsonProperty("id") String id, - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("type") JsonNullable type, - @JsonProperty("name") JsonNullable name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - this.id = id; - this.parentId = parentId; - this.type = type; - this.name = name; - this.description = description; - this.customMappings = customMappings; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); } public Collection( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The collections's parent ID */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The collections's type */ - @JsonIgnore public JsonNullable type() { - return type; + return this.type; } /** * Name of the collection */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * Description of the collection */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } public static Builder builder() { @@ -182,137 +174,74 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Collection withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Collection withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The collections's parent ID */ - public Collection withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Collection withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * The collections's parent ID - */ - public Collection withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The collections's type */ - public Collection withType(String type) { - Utils.checkNotNull(type, "type"); + public Collection withType(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * The collections's type - */ - public Collection withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Name of the collection */ - public Collection withName(String name) { - Utils.checkNotNull(name, "name"); + public Collection withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Name of the collection - */ - public Collection withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * Description of the collection */ - public Collection withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Collection withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of the collection - */ - public Collection withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Collection withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Collection withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Collection withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The date and time when the object was last updated. */ - public Collection withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Collection withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Collection withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Collection withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Collection withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Collection withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -360,169 +289,89 @@ public final static class Builder { private String id; - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The collections's parent ID */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * The collections's parent ID - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The collections's type */ - public Builder type(String type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * The collections's type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * Name of the collection */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Name of the collection - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * Description of the collection */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of the collection - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - public Collection build() { - return new Collection( id, parentId, type, name, description, customMappings, diff --git a/src/main/java/com/apideck/unify/models/components/CollectionTag.java b/src/main/java/com/apideck/unify/models/components/CollectionTag.java index ad5a7f32..343201ce 100644 --- a/src/main/java/com/apideck/unify/models/components/CollectionTag.java +++ b/src/main/java/com/apideck/unify/models/components/CollectionTag.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,7 +23,7 @@ public class CollectionTag { */ @JsonInclude(Include.ALWAYS) @JsonProperty("id") - private Optional id; + private JsonNullable id; /** * The name of the tag. @@ -38,48 +37,43 @@ public class CollectionTag { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; @JsonCreator public CollectionTag( - @JsonProperty("id") Optional id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("custom_mappings") JsonNullable> customMappings) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(customMappings, "customMappings"); - this.id = id; - this.name = name; - this.customMappings = customMappings; + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings) { + this.id = JsonNullable.of(id); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); } public CollectionTag() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore - public Optional id() { - return id; + public JsonNullable id() { + return this.id; } /** * The name of the tag. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } public static Builder builder() { @@ -90,57 +84,29 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public CollectionTag withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); + public CollectionTag withId(@Nullable String id) { + this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public CollectionTag withId(Optional id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - /** * The name of the tag. */ - public CollectionTag withName(String name) { - Utils.checkNotNull(name, "name"); + public CollectionTag withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the tag. - */ - public CollectionTag withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public CollectionTag withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public CollectionTag withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public CollectionTag withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -174,75 +140,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the tag. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the tag. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - public CollectionTag build() { - return new CollectionTag( id, name, customMappings); } diff --git a/src/main/java/com/apideck/unify/models/components/CollectionTagInput.java b/src/main/java/com/apideck/unify/models/components/CollectionTagInput.java index cbedb9c9..f2d5c1e5 100644 --- a/src/main/java/com/apideck/unify/models/components/CollectionTagInput.java +++ b/src/main/java/com/apideck/unify/models/components/CollectionTagInput.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; public class CollectionTagInput { @@ -20,25 +20,23 @@ public class CollectionTagInput { */ @JsonInclude(Include.ALWAYS) @JsonProperty("id") - private Optional id; + private JsonNullable id; @JsonCreator public CollectionTagInput( - @JsonProperty("id") Optional id) { - Utils.checkNotNull(id, "id"); - this.id = id; + @JsonProperty("id") @Nullable String id) { + this.id = JsonNullable.of(id); } public CollectionTagInput() { - this(Optional.empty()); + this(null); } /** * A unique identifier for an object. */ - @JsonIgnore - public Optional id() { - return id; + public JsonNullable id() { + return this.id; } public static Builder builder() { @@ -49,22 +47,12 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public CollectionTagInput withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); + public CollectionTagInput withId(@Nullable String id) { + this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public CollectionTagInput withId(Optional id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -93,33 +81,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } public CollectionTagInput build() { - return new CollectionTagInput( id); } diff --git a/src/main/java/com/apideck/unify/models/components/CollectionTicketComment.java b/src/main/java/com/apideck/unify/models/components/CollectionTicketComment.java index a32434ac..6c2df634 100644 --- a/src/main/java/com/apideck/unify/models/components/CollectionTicketComment.java +++ b/src/main/java/com/apideck/unify/models/components/CollectionTicketComment.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -26,7 +25,7 @@ public class CollectionTicketComment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Body of the comment @@ -40,7 +39,7 @@ public class CollectionTicketComment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who created the object. @@ -68,95 +67,84 @@ public class CollectionTicketComment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CollectionTicketComment( - @JsonProperty("id") Optional id, - @JsonProperty("body") JsonNullable body, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(body, "body"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("body") @Nullable JsonNullable body, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.body = body; - this.customMappings = customMappings; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.body = Optional.ofNullable(body) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public CollectionTicketComment() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Body of the comment */ - @JsonIgnore public JsonNullable body() { - return body; + return this.body; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -167,131 +155,66 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public CollectionTicketComment withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public CollectionTicketComment withId(Optional id) { - Utils.checkNotNull(id, "id"); + public CollectionTicketComment withId(@Nullable String id) { this.id = id; return this; } + /** * Body of the comment */ - public CollectionTicketComment withBody(String body) { - Utils.checkNotNull(body, "body"); + public CollectionTicketComment withBody(@Nullable String body) { this.body = JsonNullable.of(body); return this; } - /** - * Body of the comment - */ - public CollectionTicketComment withBody(JsonNullable body) { - Utils.checkNotNull(body, "body"); - this.body = body; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public CollectionTicketComment withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public CollectionTicketComment withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public CollectionTicketComment withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who created the object. */ - public CollectionTicketComment withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public CollectionTicketComment withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public CollectionTicketComment withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public CollectionTicketComment withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public CollectionTicketComment withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public CollectionTicketComment withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public CollectionTicketComment withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public CollectionTicketComment withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public CollectionTicketComment withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CollectionTicketComment withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CollectionTicketComment withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CollectionTicketComment withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -334,159 +257,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable body = JsonNullable.undefined(); + private JsonNullable body; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Body of the comment */ - public Builder body(String body) { - Utils.checkNotNull(body, "body"); + public Builder body(@Nullable String body) { this.body = JsonNullable.of(body); return this; } - /** - * Body of the comment - */ - public Builder body(JsonNullable body) { - Utils.checkNotNull(body, "body"); - this.body = body; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CollectionTicketComment build() { - return new CollectionTicketComment( id, body, customMappings, createdBy, updatedAt, createdAt, diff --git a/src/main/java/com/apideck/unify/models/components/CollectionTicketCommentInput.java b/src/main/java/com/apideck/unify/models/components/CollectionTicketCommentInput.java index 08aa7333..741c25b3 100644 --- a/src/main/java/com/apideck/unify/models/components/CollectionTicketCommentInput.java +++ b/src/main/java/com/apideck/unify/models/components/CollectionTicketCommentInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,37 +29,33 @@ public class CollectionTicketCommentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CollectionTicketCommentInput( - @JsonProperty("body") JsonNullable body, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(body, "body"); - Utils.checkNotNull(passThrough, "passThrough"); - this.body = body; + @JsonProperty("body") @Nullable JsonNullable body, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.body = Optional.ofNullable(body) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public CollectionTicketCommentInput() { - this(JsonNullable.undefined(), Optional.empty()); + this(null, null); } /** * Body of the comment */ - @JsonIgnore public JsonNullable body() { - return body; + return this.body; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -71,40 +66,21 @@ public static Builder builder() { /** * Body of the comment */ - public CollectionTicketCommentInput withBody(String body) { - Utils.checkNotNull(body, "body"); + public CollectionTicketCommentInput withBody(@Nullable String body) { this.body = JsonNullable.of(body); return this; } - /** - * Body of the comment - */ - public CollectionTicketCommentInput withBody(JsonNullable body) { - Utils.checkNotNull(body, "body"); - this.body = body; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CollectionTicketCommentInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CollectionTicketCommentInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CollectionTicketCommentInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -135,54 +111,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable body = JsonNullable.undefined(); + private JsonNullable body; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Body of the comment */ - public Builder body(String body) { - Utils.checkNotNull(body, "body"); + public Builder body(@Nullable String body) { this.body = JsonNullable.of(body); return this; } - /** - * Body of the comment - */ - public Builder body(JsonNullable body) { - Utils.checkNotNull(body, "body"); - this.body = body; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CollectionTicketCommentInput build() { - return new CollectionTicketCommentInput( body, passThrough); } diff --git a/src/main/java/com/apideck/unify/models/components/CollectionUser.java b/src/main/java/com/apideck/unify/models/components/CollectionUser.java index a45becd9..506d3037 100644 --- a/src/main/java/com/apideck/unify/models/components/CollectionUser.java +++ b/src/main/java/com/apideck/unify/models/components/CollectionUser.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -66,7 +66,7 @@ public class CollectionUser { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The date and time when the object was last updated. @@ -84,112 +84,102 @@ public class CollectionUser { @JsonCreator public CollectionUser( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("email") JsonNullable email, - @JsonProperty("photo_url") JsonNullable photoUrl, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(photoUrl, "photoUrl"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - this.id = id; - this.name = name; - this.firstName = firstName; - this.lastName = lastName; - this.email = email; - this.photoUrl = photoUrl; - this.customMappings = customMappings; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("email") @Nullable JsonNullable email, + @JsonProperty("photo_url") @Nullable JsonNullable photoUrl, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.email = Optional.ofNullable(email) + .orElse(JsonNullable.undefined()); + this.photoUrl = Optional.ofNullable(photoUrl) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); } public CollectionUser() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Full name of the user */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * First name of the user */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * Last name of the user */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Email address of the user */ - @JsonIgnore public JsonNullable email() { - return email; + return this.email; } /** * The URL of the photo of a person. */ - @JsonIgnore public JsonNullable photoUrl() { - return photoUrl; + return this.photoUrl; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } public static Builder builder() { @@ -200,164 +190,83 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public CollectionUser withId(String id) { - Utils.checkNotNull(id, "id"); + public CollectionUser withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public CollectionUser withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * Full name of the user */ - public CollectionUser withName(String name) { - Utils.checkNotNull(name, "name"); + public CollectionUser withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the user - */ - public CollectionUser withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * First name of the user */ - public CollectionUser withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public CollectionUser withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * First name of the user - */ - public CollectionUser withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * Last name of the user */ - public CollectionUser withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public CollectionUser withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * Last name of the user - */ - public CollectionUser withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Email address of the user */ - public CollectionUser withEmail(String email) { - Utils.checkNotNull(email, "email"); + public CollectionUser withEmail(@Nullable String email) { this.email = JsonNullable.of(email); return this; } - /** - * Email address of the user - */ - public CollectionUser withEmail(JsonNullable email) { - Utils.checkNotNull(email, "email"); - this.email = email; - return this; - } /** * The URL of the photo of a person. */ - public CollectionUser withPhotoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public CollectionUser withPhotoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public CollectionUser withPhotoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public CollectionUser withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public CollectionUser withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public CollectionUser withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The date and time when the object was last updated. */ - public CollectionUser withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public CollectionUser withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public CollectionUser withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public CollectionUser withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public CollectionUser withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public CollectionUser withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -405,201 +314,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable email = JsonNullable.undefined(); + private JsonNullable email; - private JsonNullable photoUrl = JsonNullable.undefined(); + private JsonNullable photoUrl; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * Full name of the user */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the user - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * First name of the user */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * First name of the user - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * Last name of the user */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * Last name of the user - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Email address of the user */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = JsonNullable.of(email); return this; } - /** - * Email address of the user - */ - public Builder email(JsonNullable email) { - Utils.checkNotNull(email, "email"); - this.email = email; - return this; - } - - /** * The URL of the photo of a person. */ - public Builder photoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public Builder photoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public Builder photoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - public CollectionUser build() { - return new CollectionUser( id, name, firstName, lastName, email, photoUrl, diff --git a/src/main/java/com/apideck/unify/models/components/CollectionsSort.java b/src/main/java/com/apideck/unify/models/components/CollectionsSort.java index 8bbdbb81..c420082e 100644 --- a/src/main/java/com/apideck/unify/models/components/CollectionsSort.java +++ b/src/main/java/com/apideck/unify/models/components/CollectionsSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class CollectionsSort { * The field on which to sort the Collections */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private CollectionsSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public CollectionsSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable CollectionsSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public CollectionsSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Collections */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Collections */ - public CollectionsSort withBy(CollectionsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Collections - */ - public CollectionsSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public CollectionsSort withBy(@Nullable CollectionsSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public CollectionsSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public CollectionsSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public CollectionsSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private CollectionsSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Collections - */ - public Builder by(CollectionsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Collections */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable CollectionsSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public CollectionsSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new CollectionsSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/CommentsSort.java b/src/main/java/com/apideck/unify/models/components/CommentsSort.java index 702c2183..f4b73c15 100644 --- a/src/main/java/com/apideck/unify/models/components/CommentsSort.java +++ b/src/main/java/com/apideck/unify/models/components/CommentsSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class CommentsSort { * The field on which to sort the Comments */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private CommentsSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public CommentsSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable CommentsSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public CommentsSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Comments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Comments */ - public CommentsSort withBy(CommentsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Comments - */ - public CommentsSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public CommentsSort withBy(@Nullable CommentsSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public CommentsSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public CommentsSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public CommentsSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private CommentsSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Comments - */ - public Builder by(CommentsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Comments */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable CommentsSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public CommentsSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new CommentsSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/CompaniesFilter.java b/src/main/java/com/apideck/unify/models/components/CompaniesFilter.java index e43d8835..577bd71d 100644 --- a/src/main/java/com/apideck/unify/models/components/CompaniesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/CompaniesFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,25 +17,23 @@ public class CompaniesFilter { * Name of the company to filter on */ @SpeakeasyMetadata("queryParam:name=name") - private Optional name; + private String name; @JsonCreator public CompaniesFilter( - Optional name) { - Utils.checkNotNull(name, "name"); + @Nullable String name) { this.name = name; } public CompaniesFilter() { - this(Optional.empty()); + this(null); } /** * Name of the company to filter on */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } public static Builder builder() { @@ -46,22 +44,12 @@ public static Builder builder() { /** * Name of the company to filter on */ - public CompaniesFilter withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - /** - * Name of the company to filter on - */ - public CompaniesFilter withName(Optional name) { - Utils.checkNotNull(name, "name"); + public CompaniesFilter withName(@Nullable String name) { this.name = name; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,33 +78,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional name = Optional.empty(); + private String name; private Builder() { // force use of static builder() method } - - /** - * Name of the company to filter on - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the company to filter on */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } public CompaniesFilter build() { - return new CompaniesFilter( name); } diff --git a/src/main/java/com/apideck/unify/models/components/CompaniesSort.java b/src/main/java/com/apideck/unify/models/components/CompaniesSort.java index 3f55ccd6..c6898897 100644 --- a/src/main/java/com/apideck/unify/models/components/CompaniesSort.java +++ b/src/main/java/com/apideck/unify/models/components/CompaniesSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class CompaniesSort { * The field on which to sort the Companies */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private CompaniesSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public CompaniesSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable CompaniesSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public CompaniesSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Companies */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Companies */ - public CompaniesSort withBy(CompaniesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Companies - */ - public CompaniesSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public CompaniesSort withBy(@Nullable CompaniesSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public CompaniesSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public CompaniesSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public CompaniesSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private CompaniesSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Companies - */ - public Builder by(CompaniesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Companies */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable CompaniesSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public CompaniesSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new CompaniesSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/Company1.java b/src/main/java/com/apideck/unify/models/components/Company1.java index 07ac1f12..c534c29c 100644 --- a/src/main/java/com/apideck/unify/models/components/Company1.java +++ b/src/main/java/com/apideck/unify/models/components/Company1.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -29,14 +28,14 @@ public class Company1 { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Name of the company */ @JsonInclude(Include.ALWAYS) @JsonProperty("name") - private Optional name; + private JsonNullable name; /** * Number of interactions @@ -78,7 +77,7 @@ public class Company1 { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The status of the company @@ -181,47 +180,47 @@ public class Company1 { @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_accounts") - private Optional> bankAccounts; + private List bankAccounts; @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List

addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("social_links") - private Optional> socialLinks; + private List socialLinks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("row_type") - private Optional rowType; + private CompanyRowType rowType; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; /** * Whether the company is read-only or not @@ -242,7 +241,7 @@ public class Company1 { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("deleted") - private Optional deleted; + private Boolean deleted; /** * A formal salutation for the person. For example, 'Mr', 'Mrs' @@ -263,7 +262,7 @@ public class Company1 { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * Updated by user ID @@ -298,116 +297,94 @@ public class Company1 { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Company1( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("interaction_count") JsonNullable interactionCount, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("image") JsonNullable image, - @JsonProperty("description") JsonNullable description, - @JsonProperty("vat_number") JsonNullable vatNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("status") JsonNullable status, - @JsonProperty("fax") JsonNullable fax, - @JsonProperty("annual_revenue") JsonNullable annualRevenue, - @JsonProperty("number_of_employees") JsonNullable numberOfEmployees, - @JsonProperty("industry") JsonNullable industry, - @JsonProperty("ownership") JsonNullable ownership, - @JsonProperty("sales_tax_number") JsonNullable salesTaxNumber, - @JsonProperty("payee_number") JsonNullable payeeNumber, - @JsonProperty("abn_or_tfn") JsonNullable abnOrTfn, - @JsonProperty("abn_branch") JsonNullable abnBranch, - @JsonProperty("acn") JsonNullable acn, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("bank_accounts") Optional> bankAccounts, - @JsonProperty("websites") Optional> websites, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("social_links") Optional> socialLinks, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("row_type") Optional rowType, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("read_only") JsonNullable readOnly, - @JsonProperty("last_activity_at") JsonNullable lastActivityAt, - @JsonProperty("deleted") Optional deleted, - @JsonProperty("salutation") JsonNullable salutation, - @JsonProperty("birthday") JsonNullable birthday, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(interactionCount, "interactionCount"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(image, "image"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(vatNumber, "vatNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(fax, "fax"); - Utils.checkNotNull(annualRevenue, "annualRevenue"); - Utils.checkNotNull(numberOfEmployees, "numberOfEmployees"); - Utils.checkNotNull(industry, "industry"); - Utils.checkNotNull(ownership, "ownership"); - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); - Utils.checkNotNull(payeeNumber, "payeeNumber"); - Utils.checkNotNull(abnOrTfn, "abnOrTfn"); - Utils.checkNotNull(abnBranch, "abnBranch"); - Utils.checkNotNull(acn, "acn"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(bankAccounts, "bankAccounts"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(socialLinks, "socialLinks"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(rowType, "rowType"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(readOnly, "readOnly"); - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); - Utils.checkNotNull(deleted, "deleted"); - Utils.checkNotNull(salutation, "salutation"); - Utils.checkNotNull(birthday, "birthday"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("interaction_count") @Nullable JsonNullable interactionCount, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("image") @Nullable JsonNullable image, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("vat_number") @Nullable JsonNullable vatNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("fax") @Nullable JsonNullable fax, + @JsonProperty("annual_revenue") @Nullable JsonNullable annualRevenue, + @JsonProperty("number_of_employees") @Nullable JsonNullable numberOfEmployees, + @JsonProperty("industry") @Nullable JsonNullable industry, + @JsonProperty("ownership") @Nullable JsonNullable ownership, + @JsonProperty("sales_tax_number") @Nullable JsonNullable salesTaxNumber, + @JsonProperty("payee_number") @Nullable JsonNullable payeeNumber, + @JsonProperty("abn_or_tfn") @Nullable JsonNullable abnOrTfn, + @JsonProperty("abn_branch") @Nullable JsonNullable abnBranch, + @JsonProperty("acn") @Nullable JsonNullable acn, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("bank_accounts") @Nullable List bankAccounts, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("social_links") @Nullable List socialLinks, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("row_type") @Nullable CompanyRowType rowType, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("read_only") @Nullable JsonNullable readOnly, + @JsonProperty("last_activity_at") @Nullable JsonNullable lastActivityAt, + @JsonProperty("deleted") @Nullable Boolean deleted, + @JsonProperty("salutation") @Nullable JsonNullable salutation, + @JsonProperty("birthday") @Nullable JsonNullable birthday, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.name = name; - this.interactionCount = interactionCount; - this.ownerId = ownerId; - this.image = image; - this.description = description; - this.vatNumber = vatNumber; - this.currency = currency; - this.status = status; - this.fax = fax; - this.annualRevenue = annualRevenue; - this.numberOfEmployees = numberOfEmployees; - this.industry = industry; - this.ownership = ownership; - this.salesTaxNumber = salesTaxNumber; - this.payeeNumber = payeeNumber; - this.abnOrTfn = abnOrTfn; - this.abnBranch = abnBranch; - this.acn = acn; - this.firstName = firstName; - this.lastName = lastName; - this.parentId = parentId; + this.name = JsonNullable.of(name); + this.interactionCount = Optional.ofNullable(interactionCount) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.image = Optional.ofNullable(image) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.vatNumber = Optional.ofNullable(vatNumber) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.fax = Optional.ofNullable(fax) + .orElse(JsonNullable.undefined()); + this.annualRevenue = Optional.ofNullable(annualRevenue) + .orElse(JsonNullable.undefined()); + this.numberOfEmployees = Optional.ofNullable(numberOfEmployees) + .orElse(JsonNullable.undefined()); + this.industry = Optional.ofNullable(industry) + .orElse(JsonNullable.undefined()); + this.ownership = Optional.ofNullable(ownership) + .orElse(JsonNullable.undefined()); + this.salesTaxNumber = Optional.ofNullable(salesTaxNumber) + .orElse(JsonNullable.undefined()); + this.payeeNumber = Optional.ofNullable(payeeNumber) + .orElse(JsonNullable.undefined()); + this.abnOrTfn = Optional.ofNullable(abnOrTfn) + .orElse(JsonNullable.undefined()); + this.abnBranch = Optional.ofNullable(abnBranch) + .orElse(JsonNullable.undefined()); + this.acn = Optional.ofNullable(acn) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); this.bankAccounts = bankAccounts; this.websites = websites; this.addresses = addresses; @@ -416,356 +393,312 @@ public Company1( this.emails = emails; this.rowType = rowType; this.customFields = customFields; - this.tags = tags; - this.readOnly = readOnly; - this.lastActivityAt = lastActivityAt; + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); + this.readOnly = Optional.ofNullable(readOnly) + .orElse(JsonNullable.undefined()); + this.lastActivityAt = Optional.ofNullable(lastActivityAt) + .orElse(JsonNullable.undefined()); this.deleted = deleted; - this.salutation = salutation; - this.birthday = birthday; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.salutation = Optional.ofNullable(salutation) + .orElse(JsonNullable.undefined()); + this.birthday = Optional.ofNullable(birthday) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Company1() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * Unique identifier for the company */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Name of the company */ - @JsonIgnore - public Optional name() { - return name; + public JsonNullable name() { + return this.name; } /** * Number of interactions */ - @JsonIgnore public JsonNullable interactionCount() { - return interactionCount; + return this.interactionCount; } /** * Owner ID */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The Image URL of the company */ - @JsonIgnore public JsonNullable image() { - return image; + return this.image; } /** * A description of the company */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The VAT number of the company */ - @JsonIgnore public JsonNullable vatNumber() { - return vatNumber; + return this.vatNumber; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The status of the company */ - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * The fax number of the company */ - @JsonIgnore public JsonNullable fax() { - return fax; + return this.fax; } /** * The annual revenue of the company */ - @JsonIgnore public JsonNullable annualRevenue() { - return annualRevenue; + return this.annualRevenue; } /** * Number of employees */ - @JsonIgnore public JsonNullable numberOfEmployees() { - return numberOfEmployees; + return this.numberOfEmployees; } /** * The industry represents the type of business the company is in. */ - @JsonIgnore public JsonNullable industry() { - return industry; + return this.industry; } /** * The ownership indicates the type of ownership of the company. */ - @JsonIgnore public JsonNullable ownership() { - return ownership; + return this.ownership; } /** * A sales tax number is a unique number that identifies a company for tax purposes. */ - @JsonIgnore public JsonNullable salesTaxNumber() { - return salesTaxNumber; + return this.salesTaxNumber; } /** * A payee number is a unique number that identifies a payee for tax purposes. */ - @JsonIgnore public JsonNullable payeeNumber() { - return payeeNumber; + return this.payeeNumber; } /** * An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. */ - @JsonIgnore public JsonNullable abnOrTfn() { - return abnOrTfn; + return this.abnOrTfn; } /** * An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. */ - @JsonIgnore public JsonNullable abnBranch() { - return abnBranch; + return this.abnBranch; } /** * The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. */ - @JsonIgnore public JsonNullable acn() { - return acn; + return this.acn; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Parent ID */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> bankAccounts() { - return (Optional>) bankAccounts; + return Optional.ofNullable(this.bankAccounts); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> socialLinks() { - return (Optional>) socialLinks; + return Optional.ofNullable(this.socialLinks); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional rowType() { - return (Optional) rowType; + return Optional.ofNullable(this.rowType); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } /** * Whether the company is read-only or not */ - @JsonIgnore public JsonNullable readOnly() { - return readOnly; + return this.readOnly; } /** * Last activity date */ - @JsonIgnore public JsonNullable lastActivityAt() { - return lastActivityAt; + return this.lastActivityAt; } /** * Whether the company is deleted or not */ - @JsonIgnore public Optional deleted() { - return deleted; + return Optional.ofNullable(this.deleted); } /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - @JsonIgnore public JsonNullable salutation() { - return salutation; + return this.salutation; } /** * The date of birth of the person. */ - @JsonIgnore public JsonNullable birthday() { - return birthday; + return this.birthday; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * Updated by user ID */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * Created by user ID */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * Last updated date */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * Creation date */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -776,717 +709,354 @@ public static Builder builder() { /** * Unique identifier for the company */ - public Company1 withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * Unique identifier for the company - */ - public Company1 withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Company1 withId(@Nullable String id) { this.id = id; return this; } - /** - * Name of the company - */ - public Company1 withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the company */ - public Company1 withName(Optional name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Company1 withName(@Nullable String name) { + this.name = JsonNullable.of(name); return this; } + /** * Number of interactions */ - public Company1 withInteractionCount(long interactionCount) { - Utils.checkNotNull(interactionCount, "interactionCount"); + public Company1 withInteractionCount(@Nullable Long interactionCount) { this.interactionCount = JsonNullable.of(interactionCount); return this; } - /** - * Number of interactions - */ - public Company1 withInteractionCount(JsonNullable interactionCount) { - Utils.checkNotNull(interactionCount, "interactionCount"); - this.interactionCount = interactionCount; - return this; - } /** * Owner ID */ - public Company1 withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Company1 withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * Owner ID - */ - public Company1 withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The Image URL of the company */ - public Company1 withImage(String image) { - Utils.checkNotNull(image, "image"); + public Company1 withImage(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * The Image URL of the company - */ - public Company1 withImage(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } /** * A description of the company */ - public Company1 withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Company1 withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the company - */ - public Company1 withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The VAT number of the company */ - public Company1 withVatNumber(String vatNumber) { - Utils.checkNotNull(vatNumber, "vatNumber"); + public Company1 withVatNumber(@Nullable String vatNumber) { this.vatNumber = JsonNullable.of(vatNumber); return this; } - /** - * The VAT number of the company - */ - public Company1 withVatNumber(JsonNullable vatNumber) { - Utils.checkNotNull(vatNumber, "vatNumber"); - this.vatNumber = vatNumber; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Company1 withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Company1 withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Company1 withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The status of the company */ - public Company1 withStatus(String status) { - Utils.checkNotNull(status, "status"); + public Company1 withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the company - */ - public Company1 withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The fax number of the company */ - public Company1 withFax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Company1 withFax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the company - */ - public Company1 withFax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } /** * The annual revenue of the company */ - public Company1 withAnnualRevenue(String annualRevenue) { - Utils.checkNotNull(annualRevenue, "annualRevenue"); + public Company1 withAnnualRevenue(@Nullable String annualRevenue) { this.annualRevenue = JsonNullable.of(annualRevenue); return this; } - /** - * The annual revenue of the company - */ - public Company1 withAnnualRevenue(JsonNullable annualRevenue) { - Utils.checkNotNull(annualRevenue, "annualRevenue"); - this.annualRevenue = annualRevenue; - return this; - } /** * Number of employees */ - public Company1 withNumberOfEmployees(String numberOfEmployees) { - Utils.checkNotNull(numberOfEmployees, "numberOfEmployees"); + public Company1 withNumberOfEmployees(@Nullable String numberOfEmployees) { this.numberOfEmployees = JsonNullable.of(numberOfEmployees); return this; } - /** - * Number of employees - */ - public Company1 withNumberOfEmployees(JsonNullable numberOfEmployees) { - Utils.checkNotNull(numberOfEmployees, "numberOfEmployees"); - this.numberOfEmployees = numberOfEmployees; - return this; - } /** * The industry represents the type of business the company is in. */ - public Company1 withIndustry(String industry) { - Utils.checkNotNull(industry, "industry"); + public Company1 withIndustry(@Nullable String industry) { this.industry = JsonNullable.of(industry); return this; } - /** - * The industry represents the type of business the company is in. - */ - public Company1 withIndustry(JsonNullable industry) { - Utils.checkNotNull(industry, "industry"); - this.industry = industry; - return this; - } /** * The ownership indicates the type of ownership of the company. */ - public Company1 withOwnership(String ownership) { - Utils.checkNotNull(ownership, "ownership"); + public Company1 withOwnership(@Nullable String ownership) { this.ownership = JsonNullable.of(ownership); return this; } - /** - * The ownership indicates the type of ownership of the company. - */ - public Company1 withOwnership(JsonNullable ownership) { - Utils.checkNotNull(ownership, "ownership"); - this.ownership = ownership; - return this; - } /** * A sales tax number is a unique number that identifies a company for tax purposes. */ - public Company1 withSalesTaxNumber(String salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); + public Company1 withSalesTaxNumber(@Nullable String salesTaxNumber) { this.salesTaxNumber = JsonNullable.of(salesTaxNumber); return this; } - /** - * A sales tax number is a unique number that identifies a company for tax purposes. - */ - public Company1 withSalesTaxNumber(JsonNullable salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); - this.salesTaxNumber = salesTaxNumber; - return this; - } /** * A payee number is a unique number that identifies a payee for tax purposes. */ - public Company1 withPayeeNumber(String payeeNumber) { - Utils.checkNotNull(payeeNumber, "payeeNumber"); + public Company1 withPayeeNumber(@Nullable String payeeNumber) { this.payeeNumber = JsonNullable.of(payeeNumber); return this; } - /** - * A payee number is a unique number that identifies a payee for tax purposes. - */ - public Company1 withPayeeNumber(JsonNullable payeeNumber) { - Utils.checkNotNull(payeeNumber, "payeeNumber"); - this.payeeNumber = payeeNumber; - return this; - } /** * An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. */ - public Company1 withAbnOrTfn(String abnOrTfn) { - Utils.checkNotNull(abnOrTfn, "abnOrTfn"); + public Company1 withAbnOrTfn(@Nullable String abnOrTfn) { this.abnOrTfn = JsonNullable.of(abnOrTfn); return this; } - /** - * An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. - */ - public Company1 withAbnOrTfn(JsonNullable abnOrTfn) { - Utils.checkNotNull(abnOrTfn, "abnOrTfn"); - this.abnOrTfn = abnOrTfn; - return this; - } /** * An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. */ - public Company1 withAbnBranch(String abnBranch) { - Utils.checkNotNull(abnBranch, "abnBranch"); + public Company1 withAbnBranch(@Nullable String abnBranch) { this.abnBranch = JsonNullable.of(abnBranch); return this; } - /** - * An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. - */ - public Company1 withAbnBranch(JsonNullable abnBranch) { - Utils.checkNotNull(abnBranch, "abnBranch"); - this.abnBranch = abnBranch; - return this; - } /** * The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. */ - public Company1 withAcn(String acn) { - Utils.checkNotNull(acn, "acn"); + public Company1 withAcn(@Nullable String acn) { this.acn = JsonNullable.of(acn); return this; } - /** - * The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. - */ - public Company1 withAcn(JsonNullable acn) { - Utils.checkNotNull(acn, "acn"); - this.acn = acn; - return this; - } /** * The first name of the person. */ - public Company1 withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Company1 withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Company1 withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public Company1 withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Company1 withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Company1 withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Parent ID */ - public Company1 withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Company1 withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * Parent ID - */ - public Company1 withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - public Company1 withBankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Company1 withBankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Company1 withBankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - public Company1 withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Company1 withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Company1 withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public Company1 withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Company1 withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Company1 withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public Company1 withSocialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Company1 withSocialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Company1 withSocialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - public Company1 withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Company1 withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Company1 withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Company1 withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Company1 withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Company1 withEmails(@Nullable List emails) { this.emails = emails; return this; } - public Company1 withRowType(CompanyRowType rowType) { - Utils.checkNotNull(rowType, "rowType"); - this.rowType = Optional.ofNullable(rowType); - return this; - } - - public Company1 withRowType(Optional rowType) { - Utils.checkNotNull(rowType, "rowType"); + public Company1 withRowType(@Nullable CompanyRowType rowType) { this.rowType = rowType; return this; } - public Company1 withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Company1 withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Company1 withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - public Company1 withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + + public Company1 withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Company1 withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } /** * Whether the company is read-only or not */ - public Company1 withReadOnly(boolean readOnly) { - Utils.checkNotNull(readOnly, "readOnly"); + public Company1 withReadOnly(@Nullable Boolean readOnly) { this.readOnly = JsonNullable.of(readOnly); return this; } - /** - * Whether the company is read-only or not - */ - public Company1 withReadOnly(JsonNullable readOnly) { - Utils.checkNotNull(readOnly, "readOnly"); - this.readOnly = readOnly; - return this; - } /** * Last activity date */ - public Company1 withLastActivityAt(OffsetDateTime lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); + public Company1 withLastActivityAt(@Nullable OffsetDateTime lastActivityAt) { this.lastActivityAt = JsonNullable.of(lastActivityAt); return this; } - /** - * Last activity date - */ - public Company1 withLastActivityAt(JsonNullable lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); - this.lastActivityAt = lastActivityAt; - return this; - } /** * Whether the company is deleted or not */ - public Company1 withDeleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = Optional.ofNullable(deleted); - return this; - } - - - /** - * Whether the company is deleted or not - */ - public Company1 withDeleted(Optional deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Company1 withDeleted(@Nullable Boolean deleted) { this.deleted = deleted; return this; } + /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - public Company1 withSalutation(String salutation) { - Utils.checkNotNull(salutation, "salutation"); + public Company1 withSalutation(@Nullable String salutation) { this.salutation = JsonNullable.of(salutation); return this; } - /** - * A formal salutation for the person. For example, 'Mr', 'Mrs' - */ - public Company1 withSalutation(JsonNullable salutation) { - Utils.checkNotNull(salutation, "salutation"); - this.salutation = salutation; - return this; - } /** * The date of birth of the person. */ - public Company1 withBirthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Company1 withBirthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public Company1 withBirthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Company1 withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Company1 withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Company1 withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * Updated by user ID */ - public Company1 withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Company1 withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * Updated by user ID - */ - public Company1 withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * Created by user ID */ - public Company1 withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Company1 withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * Created by user ID - */ - public Company1 withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * Last updated date */ - public Company1 withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Company1 withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * Last updated date - */ - public Company1 withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * Creation date */ - public Company1 withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Company1 withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * Creation date - */ - public Company1 withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Company1 withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Company1 withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Company1 withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1610,840 +1180,404 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private JsonNullable interactionCount = JsonNullable.undefined(); + private JsonNullable interactionCount; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable image = JsonNullable.undefined(); + private JsonNullable image; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable vatNumber = JsonNullable.undefined(); + private JsonNullable vatNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable fax = JsonNullable.undefined(); + private JsonNullable fax; - private JsonNullable annualRevenue = JsonNullable.undefined(); + private JsonNullable annualRevenue; - private JsonNullable numberOfEmployees = JsonNullable.undefined(); + private JsonNullable numberOfEmployees; - private JsonNullable industry = JsonNullable.undefined(); + private JsonNullable industry; - private JsonNullable ownership = JsonNullable.undefined(); + private JsonNullable ownership; - private JsonNullable salesTaxNumber = JsonNullable.undefined(); + private JsonNullable salesTaxNumber; - private JsonNullable payeeNumber = JsonNullable.undefined(); + private JsonNullable payeeNumber; - private JsonNullable abnOrTfn = JsonNullable.undefined(); + private JsonNullable abnOrTfn; - private JsonNullable abnBranch = JsonNullable.undefined(); + private JsonNullable abnBranch; - private JsonNullable acn = JsonNullable.undefined(); + private JsonNullable acn; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private Optional> bankAccounts = Optional.empty(); + private List bankAccounts; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> socialLinks = Optional.empty(); + private List socialLinks; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private Optional rowType = Optional.empty(); + private CompanyRowType rowType; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private JsonNullable readOnly = JsonNullable.undefined(); + private JsonNullable readOnly; - private JsonNullable lastActivityAt = JsonNullable.undefined(); + private JsonNullable lastActivityAt; - private Optional deleted = Optional.empty(); + private Boolean deleted; - private JsonNullable salutation = JsonNullable.undefined(); + private JsonNullable salutation; - private JsonNullable birthday = JsonNullable.undefined(); + private JsonNullable birthday; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Unique identifier for the company */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * Unique identifier for the company - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Name of the company */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * Name of the company - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * Number of interactions */ - public Builder interactionCount(long interactionCount) { - Utils.checkNotNull(interactionCount, "interactionCount"); + public Builder interactionCount(@Nullable Long interactionCount) { this.interactionCount = JsonNullable.of(interactionCount); return this; } - /** - * Number of interactions - */ - public Builder interactionCount(JsonNullable interactionCount) { - Utils.checkNotNull(interactionCount, "interactionCount"); - this.interactionCount = interactionCount; - return this; - } - - /** * Owner ID */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * Owner ID - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The Image URL of the company */ - public Builder image(String image) { - Utils.checkNotNull(image, "image"); + public Builder image(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * The Image URL of the company - */ - public Builder image(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } - - /** * A description of the company */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the company - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The VAT number of the company */ - public Builder vatNumber(String vatNumber) { - Utils.checkNotNull(vatNumber, "vatNumber"); + public Builder vatNumber(@Nullable String vatNumber) { this.vatNumber = JsonNullable.of(vatNumber); return this; } - /** - * The VAT number of the company - */ - public Builder vatNumber(JsonNullable vatNumber) { - Utils.checkNotNull(vatNumber, "vatNumber"); - this.vatNumber = vatNumber; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The status of the company */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the company - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The fax number of the company */ - public Builder fax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Builder fax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the company - */ - public Builder fax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } - - /** * The annual revenue of the company */ - public Builder annualRevenue(String annualRevenue) { - Utils.checkNotNull(annualRevenue, "annualRevenue"); + public Builder annualRevenue(@Nullable String annualRevenue) { this.annualRevenue = JsonNullable.of(annualRevenue); return this; } - /** - * The annual revenue of the company - */ - public Builder annualRevenue(JsonNullable annualRevenue) { - Utils.checkNotNull(annualRevenue, "annualRevenue"); - this.annualRevenue = annualRevenue; - return this; - } - - /** * Number of employees */ - public Builder numberOfEmployees(String numberOfEmployees) { - Utils.checkNotNull(numberOfEmployees, "numberOfEmployees"); + public Builder numberOfEmployees(@Nullable String numberOfEmployees) { this.numberOfEmployees = JsonNullable.of(numberOfEmployees); return this; } - /** - * Number of employees - */ - public Builder numberOfEmployees(JsonNullable numberOfEmployees) { - Utils.checkNotNull(numberOfEmployees, "numberOfEmployees"); - this.numberOfEmployees = numberOfEmployees; - return this; - } - - /** * The industry represents the type of business the company is in. */ - public Builder industry(String industry) { - Utils.checkNotNull(industry, "industry"); + public Builder industry(@Nullable String industry) { this.industry = JsonNullable.of(industry); return this; } - /** - * The industry represents the type of business the company is in. - */ - public Builder industry(JsonNullable industry) { - Utils.checkNotNull(industry, "industry"); - this.industry = industry; - return this; - } - - /** * The ownership indicates the type of ownership of the company. */ - public Builder ownership(String ownership) { - Utils.checkNotNull(ownership, "ownership"); + public Builder ownership(@Nullable String ownership) { this.ownership = JsonNullable.of(ownership); return this; } - /** - * The ownership indicates the type of ownership of the company. - */ - public Builder ownership(JsonNullable ownership) { - Utils.checkNotNull(ownership, "ownership"); - this.ownership = ownership; - return this; - } - - /** * A sales tax number is a unique number that identifies a company for tax purposes. */ - public Builder salesTaxNumber(String salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); + public Builder salesTaxNumber(@Nullable String salesTaxNumber) { this.salesTaxNumber = JsonNullable.of(salesTaxNumber); return this; } - /** - * A sales tax number is a unique number that identifies a company for tax purposes. - */ - public Builder salesTaxNumber(JsonNullable salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); - this.salesTaxNumber = salesTaxNumber; - return this; - } - - /** * A payee number is a unique number that identifies a payee for tax purposes. */ - public Builder payeeNumber(String payeeNumber) { - Utils.checkNotNull(payeeNumber, "payeeNumber"); + public Builder payeeNumber(@Nullable String payeeNumber) { this.payeeNumber = JsonNullable.of(payeeNumber); return this; } - /** - * A payee number is a unique number that identifies a payee for tax purposes. - */ - public Builder payeeNumber(JsonNullable payeeNumber) { - Utils.checkNotNull(payeeNumber, "payeeNumber"); - this.payeeNumber = payeeNumber; - return this; - } - - /** * An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. */ - public Builder abnOrTfn(String abnOrTfn) { - Utils.checkNotNull(abnOrTfn, "abnOrTfn"); + public Builder abnOrTfn(@Nullable String abnOrTfn) { this.abnOrTfn = JsonNullable.of(abnOrTfn); return this; } - /** - * An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. - */ - public Builder abnOrTfn(JsonNullable abnOrTfn) { - Utils.checkNotNull(abnOrTfn, "abnOrTfn"); - this.abnOrTfn = abnOrTfn; - return this; - } - - /** * An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. */ - public Builder abnBranch(String abnBranch) { - Utils.checkNotNull(abnBranch, "abnBranch"); + public Builder abnBranch(@Nullable String abnBranch) { this.abnBranch = JsonNullable.of(abnBranch); return this; } - /** - * An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. - */ - public Builder abnBranch(JsonNullable abnBranch) { - Utils.checkNotNull(abnBranch, "abnBranch"); - this.abnBranch = abnBranch; - return this; - } - - /** * The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. */ - public Builder acn(String acn) { - Utils.checkNotNull(acn, "acn"); + public Builder acn(@Nullable String acn) { this.acn = JsonNullable.of(acn); return this; } - /** - * The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. - */ - public Builder acn(JsonNullable acn) { - Utils.checkNotNull(acn, "acn"); - this.acn = acn; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Parent ID */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * Parent ID - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - - public Builder bankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Builder bankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Builder bankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder socialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Builder socialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Builder socialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder rowType(CompanyRowType rowType) { - Utils.checkNotNull(rowType, "rowType"); - this.rowType = Optional.ofNullable(rowType); - return this; - } - - public Builder rowType(Optional rowType) { - Utils.checkNotNull(rowType, "rowType"); + public Builder rowType(@Nullable CompanyRowType rowType) { this.rowType = rowType; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** * Whether the company is read-only or not */ - public Builder readOnly(boolean readOnly) { - Utils.checkNotNull(readOnly, "readOnly"); + public Builder readOnly(@Nullable Boolean readOnly) { this.readOnly = JsonNullable.of(readOnly); return this; } - /** - * Whether the company is read-only or not - */ - public Builder readOnly(JsonNullable readOnly) { - Utils.checkNotNull(readOnly, "readOnly"); - this.readOnly = readOnly; - return this; - } - - /** * Last activity date */ - public Builder lastActivityAt(OffsetDateTime lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); + public Builder lastActivityAt(@Nullable OffsetDateTime lastActivityAt) { this.lastActivityAt = JsonNullable.of(lastActivityAt); return this; } - /** - * Last activity date - */ - public Builder lastActivityAt(JsonNullable lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); - this.lastActivityAt = lastActivityAt; - return this; - } - - /** * Whether the company is deleted or not */ - public Builder deleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = Optional.ofNullable(deleted); - return this; - } - - /** - * Whether the company is deleted or not - */ - public Builder deleted(Optional deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Builder deleted(@Nullable Boolean deleted) { this.deleted = deleted; return this; } - /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - public Builder salutation(String salutation) { - Utils.checkNotNull(salutation, "salutation"); + public Builder salutation(@Nullable String salutation) { this.salutation = JsonNullable.of(salutation); return this; } - /** - * A formal salutation for the person. For example, 'Mr', 'Mrs' - */ - public Builder salutation(JsonNullable salutation) { - Utils.checkNotNull(salutation, "salutation"); - this.salutation = salutation; - return this; - } - - /** * The date of birth of the person. */ - public Builder birthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Builder birthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public Builder birthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * Updated by user ID */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * Updated by user ID - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * Created by user ID */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * Created by user ID - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * Last updated date */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * Last updated date - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * Creation date */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * Creation date - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Company1 build() { - return new Company1( id, name, interactionCount, ownerId, image, description, diff --git a/src/main/java/com/apideck/unify/models/components/Company1Input.java b/src/main/java/com/apideck/unify/models/components/Company1Input.java index 7b79aa95..f3624d87 100644 --- a/src/main/java/com/apideck/unify/models/components/Company1Input.java +++ b/src/main/java/com/apideck/unify/models/components/Company1Input.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -25,7 +24,7 @@ public class Company1Input { */ @JsonInclude(Include.ALWAYS) @JsonProperty("name") - private Optional name; + private JsonNullable name; /** * Owner ID @@ -60,7 +59,7 @@ public class Company1Input { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The status of the company @@ -156,47 +155,47 @@ public class Company1Input { @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_accounts") - private Optional> bankAccounts; + private List bankAccounts; @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("social_links") - private Optional> socialLinks; + private List socialLinks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("row_type") - private Optional rowType; + private CompanyRowType rowType; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; /** * Whether the company is read-only or not @@ -224,93 +223,79 @@ public class Company1Input { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Company1Input( - @JsonProperty("name") Optional name, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("image") JsonNullable image, - @JsonProperty("description") JsonNullable description, - @JsonProperty("vat_number") JsonNullable vatNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("status") JsonNullable status, - @JsonProperty("fax") JsonNullable fax, - @JsonProperty("annual_revenue") JsonNullable annualRevenue, - @JsonProperty("number_of_employees") JsonNullable numberOfEmployees, - @JsonProperty("industry") JsonNullable industry, - @JsonProperty("ownership") JsonNullable ownership, - @JsonProperty("sales_tax_number") JsonNullable salesTaxNumber, - @JsonProperty("payee_number") JsonNullable payeeNumber, - @JsonProperty("abn_or_tfn") JsonNullable abnOrTfn, - @JsonProperty("abn_branch") JsonNullable abnBranch, - @JsonProperty("acn") JsonNullable acn, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("bank_accounts") Optional> bankAccounts, - @JsonProperty("websites") Optional> websites, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("social_links") Optional> socialLinks, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("row_type") Optional rowType, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("read_only") JsonNullable readOnly, - @JsonProperty("salutation") JsonNullable salutation, - @JsonProperty("birthday") JsonNullable birthday, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(image, "image"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(vatNumber, "vatNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(fax, "fax"); - Utils.checkNotNull(annualRevenue, "annualRevenue"); - Utils.checkNotNull(numberOfEmployees, "numberOfEmployees"); - Utils.checkNotNull(industry, "industry"); - Utils.checkNotNull(ownership, "ownership"); - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); - Utils.checkNotNull(payeeNumber, "payeeNumber"); - Utils.checkNotNull(abnOrTfn, "abnOrTfn"); - Utils.checkNotNull(abnBranch, "abnBranch"); - Utils.checkNotNull(acn, "acn"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(bankAccounts, "bankAccounts"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(socialLinks, "socialLinks"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(rowType, "rowType"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(readOnly, "readOnly"); - Utils.checkNotNull(salutation, "salutation"); - Utils.checkNotNull(birthday, "birthday"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; - this.ownerId = ownerId; - this.image = image; - this.description = description; - this.vatNumber = vatNumber; - this.currency = currency; - this.status = status; - this.fax = fax; - this.annualRevenue = annualRevenue; - this.numberOfEmployees = numberOfEmployees; - this.industry = industry; - this.ownership = ownership; - this.salesTaxNumber = salesTaxNumber; - this.payeeNumber = payeeNumber; - this.abnOrTfn = abnOrTfn; - this.abnBranch = abnBranch; - this.acn = acn; - this.firstName = firstName; - this.lastName = lastName; + @JsonProperty("name") @Nullable String name, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("image") @Nullable JsonNullable image, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("vat_number") @Nullable JsonNullable vatNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("fax") @Nullable JsonNullable fax, + @JsonProperty("annual_revenue") @Nullable JsonNullable annualRevenue, + @JsonProperty("number_of_employees") @Nullable JsonNullable numberOfEmployees, + @JsonProperty("industry") @Nullable JsonNullable industry, + @JsonProperty("ownership") @Nullable JsonNullable ownership, + @JsonProperty("sales_tax_number") @Nullable JsonNullable salesTaxNumber, + @JsonProperty("payee_number") @Nullable JsonNullable payeeNumber, + @JsonProperty("abn_or_tfn") @Nullable JsonNullable abnOrTfn, + @JsonProperty("abn_branch") @Nullable JsonNullable abnBranch, + @JsonProperty("acn") @Nullable JsonNullable acn, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("bank_accounts") @Nullable List bankAccounts, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("social_links") @Nullable List socialLinks, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("row_type") @Nullable CompanyRowType rowType, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("read_only") @Nullable JsonNullable readOnly, + @JsonProperty("salutation") @Nullable JsonNullable salutation, + @JsonProperty("birthday") @Nullable JsonNullable birthday, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = JsonNullable.of(name); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.image = Optional.ofNullable(image) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.vatNumber = Optional.ofNullable(vatNumber) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.fax = Optional.ofNullable(fax) + .orElse(JsonNullable.undefined()); + this.annualRevenue = Optional.ofNullable(annualRevenue) + .orElse(JsonNullable.undefined()); + this.numberOfEmployees = Optional.ofNullable(numberOfEmployees) + .orElse(JsonNullable.undefined()); + this.industry = Optional.ofNullable(industry) + .orElse(JsonNullable.undefined()); + this.ownership = Optional.ofNullable(ownership) + .orElse(JsonNullable.undefined()); + this.salesTaxNumber = Optional.ofNullable(salesTaxNumber) + .orElse(JsonNullable.undefined()); + this.payeeNumber = Optional.ofNullable(payeeNumber) + .orElse(JsonNullable.undefined()); + this.abnOrTfn = Optional.ofNullable(abnOrTfn) + .orElse(JsonNullable.undefined()); + this.abnBranch = Optional.ofNullable(abnBranch) + .orElse(JsonNullable.undefined()); + this.acn = Optional.ofNullable(acn) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); this.bankAccounts = bankAccounts; this.websites = websites; this.addresses = addresses; @@ -319,265 +304,226 @@ public Company1Input( this.emails = emails; this.rowType = rowType; this.customFields = customFields; - this.tags = tags; - this.readOnly = readOnly; - this.salutation = salutation; - this.birthday = birthday; + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); + this.readOnly = Optional.ofNullable(readOnly) + .orElse(JsonNullable.undefined()); + this.salutation = Optional.ofNullable(salutation) + .orElse(JsonNullable.undefined()); + this.birthday = Optional.ofNullable(birthday) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Company1Input() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * Name of the company */ - @JsonIgnore - public Optional name() { - return name; + public JsonNullable name() { + return this.name; } /** * Owner ID */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The Image URL of the company */ - @JsonIgnore public JsonNullable image() { - return image; + return this.image; } /** * A description of the company */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The VAT number of the company */ - @JsonIgnore public JsonNullable vatNumber() { - return vatNumber; + return this.vatNumber; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The status of the company */ - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * The fax number of the company */ - @JsonIgnore public JsonNullable fax() { - return fax; + return this.fax; } /** * The annual revenue of the company */ - @JsonIgnore public JsonNullable annualRevenue() { - return annualRevenue; + return this.annualRevenue; } /** * Number of employees */ - @JsonIgnore public JsonNullable numberOfEmployees() { - return numberOfEmployees; + return this.numberOfEmployees; } /** * The industry represents the type of business the company is in. */ - @JsonIgnore public JsonNullable industry() { - return industry; + return this.industry; } /** * The ownership indicates the type of ownership of the company. */ - @JsonIgnore public JsonNullable ownership() { - return ownership; + return this.ownership; } /** * A sales tax number is a unique number that identifies a company for tax purposes. */ - @JsonIgnore public JsonNullable salesTaxNumber() { - return salesTaxNumber; + return this.salesTaxNumber; } /** * A payee number is a unique number that identifies a payee for tax purposes. */ - @JsonIgnore public JsonNullable payeeNumber() { - return payeeNumber; + return this.payeeNumber; } /** * An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. */ - @JsonIgnore public JsonNullable abnOrTfn() { - return abnOrTfn; + return this.abnOrTfn; } /** * An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. */ - @JsonIgnore public JsonNullable abnBranch() { - return abnBranch; + return this.abnBranch; } /** * The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. */ - @JsonIgnore public JsonNullable acn() { - return acn; + return this.acn; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> bankAccounts() { - return (Optional>) bankAccounts; + return Optional.ofNullable(this.bankAccounts); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> socialLinks() { - return (Optional>) socialLinks; + return Optional.ofNullable(this.socialLinks); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional rowType() { - return (Optional) rowType; + return Optional.ofNullable(this.rowType); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } /** * Whether the company is read-only or not */ - @JsonIgnore public JsonNullable readOnly() { - return readOnly; + return this.readOnly; } /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - @JsonIgnore public JsonNullable salutation() { - return salutation; + return this.salutation; } /** * The date of birth of the person. */ - @JsonIgnore public JsonNullable birthday() { - return birthday; + return this.birthday; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -588,535 +534,264 @@ public static Builder builder() { /** * Name of the company */ - public Company1Input withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); + public Company1Input withName(@Nullable String name) { + this.name = JsonNullable.of(name); return this; } - /** - * Name of the company - */ - public Company1Input withName(Optional name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - /** * Owner ID */ - public Company1Input withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Company1Input withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * Owner ID - */ - public Company1Input withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The Image URL of the company */ - public Company1Input withImage(String image) { - Utils.checkNotNull(image, "image"); + public Company1Input withImage(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * The Image URL of the company - */ - public Company1Input withImage(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } /** * A description of the company */ - public Company1Input withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Company1Input withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the company - */ - public Company1Input withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The VAT number of the company */ - public Company1Input withVatNumber(String vatNumber) { - Utils.checkNotNull(vatNumber, "vatNumber"); + public Company1Input withVatNumber(@Nullable String vatNumber) { this.vatNumber = JsonNullable.of(vatNumber); return this; } - /** - * The VAT number of the company - */ - public Company1Input withVatNumber(JsonNullable vatNumber) { - Utils.checkNotNull(vatNumber, "vatNumber"); - this.vatNumber = vatNumber; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Company1Input withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Company1Input withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Company1Input withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The status of the company */ - public Company1Input withStatus(String status) { - Utils.checkNotNull(status, "status"); + public Company1Input withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the company - */ - public Company1Input withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The fax number of the company */ - public Company1Input withFax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Company1Input withFax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the company - */ - public Company1Input withFax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } /** * The annual revenue of the company */ - public Company1Input withAnnualRevenue(String annualRevenue) { - Utils.checkNotNull(annualRevenue, "annualRevenue"); + public Company1Input withAnnualRevenue(@Nullable String annualRevenue) { this.annualRevenue = JsonNullable.of(annualRevenue); return this; } - /** - * The annual revenue of the company - */ - public Company1Input withAnnualRevenue(JsonNullable annualRevenue) { - Utils.checkNotNull(annualRevenue, "annualRevenue"); - this.annualRevenue = annualRevenue; - return this; - } /** * Number of employees */ - public Company1Input withNumberOfEmployees(String numberOfEmployees) { - Utils.checkNotNull(numberOfEmployees, "numberOfEmployees"); + public Company1Input withNumberOfEmployees(@Nullable String numberOfEmployees) { this.numberOfEmployees = JsonNullable.of(numberOfEmployees); return this; } - /** - * Number of employees - */ - public Company1Input withNumberOfEmployees(JsonNullable numberOfEmployees) { - Utils.checkNotNull(numberOfEmployees, "numberOfEmployees"); - this.numberOfEmployees = numberOfEmployees; - return this; - } /** * The industry represents the type of business the company is in. */ - public Company1Input withIndustry(String industry) { - Utils.checkNotNull(industry, "industry"); + public Company1Input withIndustry(@Nullable String industry) { this.industry = JsonNullable.of(industry); return this; } - /** - * The industry represents the type of business the company is in. - */ - public Company1Input withIndustry(JsonNullable industry) { - Utils.checkNotNull(industry, "industry"); - this.industry = industry; - return this; - } /** * The ownership indicates the type of ownership of the company. */ - public Company1Input withOwnership(String ownership) { - Utils.checkNotNull(ownership, "ownership"); + public Company1Input withOwnership(@Nullable String ownership) { this.ownership = JsonNullable.of(ownership); return this; } - /** - * The ownership indicates the type of ownership of the company. - */ - public Company1Input withOwnership(JsonNullable ownership) { - Utils.checkNotNull(ownership, "ownership"); - this.ownership = ownership; - return this; - } /** * A sales tax number is a unique number that identifies a company for tax purposes. */ - public Company1Input withSalesTaxNumber(String salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); + public Company1Input withSalesTaxNumber(@Nullable String salesTaxNumber) { this.salesTaxNumber = JsonNullable.of(salesTaxNumber); return this; } - /** - * A sales tax number is a unique number that identifies a company for tax purposes. - */ - public Company1Input withSalesTaxNumber(JsonNullable salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); - this.salesTaxNumber = salesTaxNumber; - return this; - } /** * A payee number is a unique number that identifies a payee for tax purposes. */ - public Company1Input withPayeeNumber(String payeeNumber) { - Utils.checkNotNull(payeeNumber, "payeeNumber"); + public Company1Input withPayeeNumber(@Nullable String payeeNumber) { this.payeeNumber = JsonNullable.of(payeeNumber); return this; } - /** - * A payee number is a unique number that identifies a payee for tax purposes. - */ - public Company1Input withPayeeNumber(JsonNullable payeeNumber) { - Utils.checkNotNull(payeeNumber, "payeeNumber"); - this.payeeNumber = payeeNumber; - return this; - } /** * An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. */ - public Company1Input withAbnOrTfn(String abnOrTfn) { - Utils.checkNotNull(abnOrTfn, "abnOrTfn"); + public Company1Input withAbnOrTfn(@Nullable String abnOrTfn) { this.abnOrTfn = JsonNullable.of(abnOrTfn); return this; } - /** - * An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. - */ - public Company1Input withAbnOrTfn(JsonNullable abnOrTfn) { - Utils.checkNotNull(abnOrTfn, "abnOrTfn"); - this.abnOrTfn = abnOrTfn; - return this; - } /** * An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. */ - public Company1Input withAbnBranch(String abnBranch) { - Utils.checkNotNull(abnBranch, "abnBranch"); + public Company1Input withAbnBranch(@Nullable String abnBranch) { this.abnBranch = JsonNullable.of(abnBranch); return this; } - /** - * An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. - */ - public Company1Input withAbnBranch(JsonNullable abnBranch) { - Utils.checkNotNull(abnBranch, "abnBranch"); - this.abnBranch = abnBranch; - return this; - } /** * The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. */ - public Company1Input withAcn(String acn) { - Utils.checkNotNull(acn, "acn"); + public Company1Input withAcn(@Nullable String acn) { this.acn = JsonNullable.of(acn); return this; } - /** - * The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. - */ - public Company1Input withAcn(JsonNullable acn) { - Utils.checkNotNull(acn, "acn"); - this.acn = acn; - return this; - } /** * The first name of the person. */ - public Company1Input withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Company1Input withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Company1Input withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public Company1Input withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Company1Input withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Company1Input withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - public Company1Input withBankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Company1Input withBankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Company1Input withBankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - public Company1Input withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Company1Input withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Company1Input withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public Company1Input withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Company1Input withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Company1Input withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public Company1Input withSocialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Company1Input withSocialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Company1Input withSocialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - public Company1Input withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Company1Input withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Company1Input withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Company1Input withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Company1Input withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Company1Input withEmails(@Nullable List emails) { this.emails = emails; return this; } - public Company1Input withRowType(CompanyRowType rowType) { - Utils.checkNotNull(rowType, "rowType"); - this.rowType = Optional.ofNullable(rowType); - return this; - } - - public Company1Input withRowType(Optional rowType) { - Utils.checkNotNull(rowType, "rowType"); + public Company1Input withRowType(@Nullable CompanyRowType rowType) { this.rowType = rowType; return this; } - public Company1Input withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Company1Input withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Company1Input withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - public Company1Input withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + + public Company1Input withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Company1Input withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } /** * Whether the company is read-only or not */ - public Company1Input withReadOnly(boolean readOnly) { - Utils.checkNotNull(readOnly, "readOnly"); + public Company1Input withReadOnly(@Nullable Boolean readOnly) { this.readOnly = JsonNullable.of(readOnly); return this; } - /** - * Whether the company is read-only or not - */ - public Company1Input withReadOnly(JsonNullable readOnly) { - Utils.checkNotNull(readOnly, "readOnly"); - this.readOnly = readOnly; - return this; - } /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - public Company1Input withSalutation(String salutation) { - Utils.checkNotNull(salutation, "salutation"); + public Company1Input withSalutation(@Nullable String salutation) { this.salutation = JsonNullable.of(salutation); return this; } - /** - * A formal salutation for the person. For example, 'Mr', 'Mrs' - */ - public Company1Input withSalutation(JsonNullable salutation) { - Utils.checkNotNull(salutation, "salutation"); - this.salutation = salutation; - return this; - } /** * The date of birth of the person. */ - public Company1Input withBirthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Company1Input withBirthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public Company1Input withBirthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Company1Input withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Company1Input withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Company1Input withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1217,630 +892,304 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional name = Optional.empty(); + private String name; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable image = JsonNullable.undefined(); + private JsonNullable image; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable vatNumber = JsonNullable.undefined(); + private JsonNullable vatNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable fax = JsonNullable.undefined(); + private JsonNullable fax; - private JsonNullable annualRevenue = JsonNullable.undefined(); + private JsonNullable annualRevenue; - private JsonNullable numberOfEmployees = JsonNullable.undefined(); + private JsonNullable numberOfEmployees; - private JsonNullable industry = JsonNullable.undefined(); + private JsonNullable industry; - private JsonNullable ownership = JsonNullable.undefined(); + private JsonNullable ownership; - private JsonNullable salesTaxNumber = JsonNullable.undefined(); + private JsonNullable salesTaxNumber; - private JsonNullable payeeNumber = JsonNullable.undefined(); + private JsonNullable payeeNumber; - private JsonNullable abnOrTfn = JsonNullable.undefined(); + private JsonNullable abnOrTfn; - private JsonNullable abnBranch = JsonNullable.undefined(); + private JsonNullable abnBranch; - private JsonNullable acn = JsonNullable.undefined(); + private JsonNullable acn; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private Optional> bankAccounts = Optional.empty(); + private List bankAccounts; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> socialLinks = Optional.empty(); + private List socialLinks; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private Optional rowType = Optional.empty(); + private CompanyRowType rowType; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private JsonNullable readOnly = JsonNullable.undefined(); + private JsonNullable readOnly; - private JsonNullable salutation = JsonNullable.undefined(); + private JsonNullable salutation; - private JsonNullable birthday = JsonNullable.undefined(); + private JsonNullable birthday; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Name of the company */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * Name of the company - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * Owner ID */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * Owner ID - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The Image URL of the company */ - public Builder image(String image) { - Utils.checkNotNull(image, "image"); + public Builder image(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * The Image URL of the company - */ - public Builder image(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } - - /** * A description of the company */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the company - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The VAT number of the company */ - public Builder vatNumber(String vatNumber) { - Utils.checkNotNull(vatNumber, "vatNumber"); + public Builder vatNumber(@Nullable String vatNumber) { this.vatNumber = JsonNullable.of(vatNumber); return this; } - /** - * The VAT number of the company - */ - public Builder vatNumber(JsonNullable vatNumber) { - Utils.checkNotNull(vatNumber, "vatNumber"); - this.vatNumber = vatNumber; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The status of the company */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the company - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The fax number of the company */ - public Builder fax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Builder fax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the company - */ - public Builder fax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } - - /** * The annual revenue of the company */ - public Builder annualRevenue(String annualRevenue) { - Utils.checkNotNull(annualRevenue, "annualRevenue"); + public Builder annualRevenue(@Nullable String annualRevenue) { this.annualRevenue = JsonNullable.of(annualRevenue); return this; } - /** - * The annual revenue of the company - */ - public Builder annualRevenue(JsonNullable annualRevenue) { - Utils.checkNotNull(annualRevenue, "annualRevenue"); - this.annualRevenue = annualRevenue; - return this; - } - - /** * Number of employees */ - public Builder numberOfEmployees(String numberOfEmployees) { - Utils.checkNotNull(numberOfEmployees, "numberOfEmployees"); + public Builder numberOfEmployees(@Nullable String numberOfEmployees) { this.numberOfEmployees = JsonNullable.of(numberOfEmployees); return this; } - /** - * Number of employees - */ - public Builder numberOfEmployees(JsonNullable numberOfEmployees) { - Utils.checkNotNull(numberOfEmployees, "numberOfEmployees"); - this.numberOfEmployees = numberOfEmployees; - return this; - } - - /** * The industry represents the type of business the company is in. */ - public Builder industry(String industry) { - Utils.checkNotNull(industry, "industry"); + public Builder industry(@Nullable String industry) { this.industry = JsonNullable.of(industry); return this; } - /** - * The industry represents the type of business the company is in. - */ - public Builder industry(JsonNullable industry) { - Utils.checkNotNull(industry, "industry"); - this.industry = industry; - return this; - } - - /** * The ownership indicates the type of ownership of the company. */ - public Builder ownership(String ownership) { - Utils.checkNotNull(ownership, "ownership"); + public Builder ownership(@Nullable String ownership) { this.ownership = JsonNullable.of(ownership); return this; } - /** - * The ownership indicates the type of ownership of the company. - */ - public Builder ownership(JsonNullable ownership) { - Utils.checkNotNull(ownership, "ownership"); - this.ownership = ownership; - return this; - } - - /** * A sales tax number is a unique number that identifies a company for tax purposes. */ - public Builder salesTaxNumber(String salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); + public Builder salesTaxNumber(@Nullable String salesTaxNumber) { this.salesTaxNumber = JsonNullable.of(salesTaxNumber); return this; } - /** - * A sales tax number is a unique number that identifies a company for tax purposes. - */ - public Builder salesTaxNumber(JsonNullable salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); - this.salesTaxNumber = salesTaxNumber; - return this; - } - - /** * A payee number is a unique number that identifies a payee for tax purposes. */ - public Builder payeeNumber(String payeeNumber) { - Utils.checkNotNull(payeeNumber, "payeeNumber"); + public Builder payeeNumber(@Nullable String payeeNumber) { this.payeeNumber = JsonNullable.of(payeeNumber); return this; } - /** - * A payee number is a unique number that identifies a payee for tax purposes. - */ - public Builder payeeNumber(JsonNullable payeeNumber) { - Utils.checkNotNull(payeeNumber, "payeeNumber"); - this.payeeNumber = payeeNumber; - return this; - } - - /** * An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. */ - public Builder abnOrTfn(String abnOrTfn) { - Utils.checkNotNull(abnOrTfn, "abnOrTfn"); + public Builder abnOrTfn(@Nullable String abnOrTfn) { this.abnOrTfn = JsonNullable.of(abnOrTfn); return this; } - /** - * An ABN is necessary for operating a business, while a TFN (Tax File Number) is required for any person working in Australia. - */ - public Builder abnOrTfn(JsonNullable abnOrTfn) { - Utils.checkNotNull(abnOrTfn, "abnOrTfn"); - this.abnOrTfn = abnOrTfn; - return this; - } - - /** * An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. */ - public Builder abnBranch(String abnBranch) { - Utils.checkNotNull(abnBranch, "abnBranch"); + public Builder abnBranch(@Nullable String abnBranch) { this.abnBranch = JsonNullable.of(abnBranch); return this; } - /** - * An ABN Branch (also known as a GST Branch) is used if part of your business needs to account for GST separately from its parent entity. - */ - public Builder abnBranch(JsonNullable abnBranch) { - Utils.checkNotNull(abnBranch, "abnBranch"); - this.abnBranch = abnBranch; - return this; - } - - /** * The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. */ - public Builder acn(String acn) { - Utils.checkNotNull(acn, "acn"); + public Builder acn(@Nullable String acn) { this.acn = JsonNullable.of(acn); return this; } - /** - * The Australian Company Number (ACN) is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation. ASIC has adopted a convention of always printing and displaying the ACN in the format XXX XXX XXX; three blocks of three characters, each block separated by a blank. - */ - public Builder acn(JsonNullable acn) { - Utils.checkNotNull(acn, "acn"); - this.acn = acn; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - - public Builder bankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Builder bankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Builder bankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder socialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Builder socialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Builder socialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder rowType(CompanyRowType rowType) { - Utils.checkNotNull(rowType, "rowType"); - this.rowType = Optional.ofNullable(rowType); - return this; - } - - public Builder rowType(Optional rowType) { - Utils.checkNotNull(rowType, "rowType"); + public Builder rowType(@Nullable CompanyRowType rowType) { this.rowType = rowType; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** * Whether the company is read-only or not */ - public Builder readOnly(boolean readOnly) { - Utils.checkNotNull(readOnly, "readOnly"); + public Builder readOnly(@Nullable Boolean readOnly) { this.readOnly = JsonNullable.of(readOnly); return this; } - /** - * Whether the company is read-only or not - */ - public Builder readOnly(JsonNullable readOnly) { - Utils.checkNotNull(readOnly, "readOnly"); - this.readOnly = readOnly; - return this; - } - - /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - public Builder salutation(String salutation) { - Utils.checkNotNull(salutation, "salutation"); + public Builder salutation(@Nullable String salutation) { this.salutation = JsonNullable.of(salutation); return this; } - /** - * A formal salutation for the person. For example, 'Mr', 'Mrs' - */ - public Builder salutation(JsonNullable salutation) { - Utils.checkNotNull(salutation, "salutation"); - this.salutation = salutation; - return this; - } - - /** * The date of birth of the person. */ - public Builder birthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Builder birthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public Builder birthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Company1Input build() { - return new Company1Input( name, ownerId, image, description, vatNumber, currency, diff --git a/src/main/java/com/apideck/unify/models/components/CompanyInfo.java b/src/main/java/com/apideck/unify/models/components/CompanyInfo.java index a073811f..c78da492 100644 --- a/src/main/java/com/apideck/unify/models/components/CompanyInfo.java +++ b/src/main/java/com/apideck/unify/models/components/CompanyInfo.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -28,7 +27,7 @@ public class CompanyInfo { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the company. @@ -42,14 +41,14 @@ public class CompanyInfo { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private CompanyStatus status; /** * The legal name of the company */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("legal_name") - private Optional legalName; + private String legalName; /** * country code according to ISO 3166-1 alpha-2. @@ -68,26 +67,26 @@ public class CompanyInfo { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("automated_sales_tax") - private Optional automatedSalesTax; + private Boolean automatedSalesTax; /** * Whether sales tax is enabled for the company */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("sales_tax_enabled") - private Optional salesTaxEnabled; + private Boolean salesTaxEnabled; @JsonInclude(Include.NON_ABSENT) @JsonProperty("default_sales_tax") - private Optional defaultSalesTax; + private TaxRate defaultSalesTax; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * language code according to ISO 639-1. For the United States - EN @@ -101,43 +100,43 @@ public class CompanyInfo { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("fiscal_year_start_month") - private Optional fiscalYearStartMonth; + private TheStartMonthOfFiscalYear fiscalYearStartMonth; /** * Date when company file was created */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("company_start_date") - private Optional companyStartDate; + private LocalDate companyStartDate; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * Whether tracking categories are enabled for the company on transactions */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories_enabled") - private Optional trackingCategoriesEnabled; + private Boolean trackingCategoriesEnabled; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -176,263 +175,220 @@ public class CompanyInfo { @JsonCreator public CompanyInfo( - @JsonProperty("id") Optional id, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("status") Optional status, - @JsonProperty("legal_name") Optional legalName, - @JsonProperty("country") JsonNullable country, - @JsonProperty("sales_tax_number") JsonNullable salesTaxNumber, - @JsonProperty("automated_sales_tax") Optional automatedSalesTax, - @JsonProperty("sales_tax_enabled") Optional salesTaxEnabled, - @JsonProperty("default_sales_tax") Optional defaultSalesTax, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("language") JsonNullable language, - @JsonProperty("fiscal_year_start_month") Optional fiscalYearStartMonth, - @JsonProperty("company_start_date") Optional companyStartDate, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("tracking_categories_enabled") Optional trackingCategoriesEnabled, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(legalName, "legalName"); - Utils.checkNotNull(country, "country"); - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); - Utils.checkNotNull(automatedSalesTax, "automatedSalesTax"); - Utils.checkNotNull(salesTaxEnabled, "salesTaxEnabled"); - Utils.checkNotNull(defaultSalesTax, "defaultSalesTax"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(fiscalYearStartMonth, "fiscalYearStartMonth"); - Utils.checkNotNull(companyStartDate, "companyStartDate"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(trackingCategoriesEnabled, "trackingCategoriesEnabled"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("status") @Nullable CompanyStatus status, + @JsonProperty("legal_name") @Nullable String legalName, + @JsonProperty("country") @Nullable JsonNullable country, + @JsonProperty("sales_tax_number") @Nullable JsonNullable salesTaxNumber, + @JsonProperty("automated_sales_tax") @Nullable Boolean automatedSalesTax, + @JsonProperty("sales_tax_enabled") @Nullable Boolean salesTaxEnabled, + @JsonProperty("default_sales_tax") @Nullable TaxRate defaultSalesTax, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("fiscal_year_start_month") @Nullable TheStartMonthOfFiscalYear fiscalYearStartMonth, + @JsonProperty("company_start_date") @Nullable LocalDate companyStartDate, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("tracking_categories_enabled") @Nullable Boolean trackingCategoriesEnabled, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt) { this.id = id; - this.companyName = companyName; + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); this.status = status; this.legalName = legalName; - this.country = country; - this.salesTaxNumber = salesTaxNumber; + this.country = Optional.ofNullable(country) + .orElse(JsonNullable.undefined()); + this.salesTaxNumber = Optional.ofNullable(salesTaxNumber) + .orElse(JsonNullable.undefined()); this.automatedSalesTax = automatedSalesTax; this.salesTaxEnabled = salesTaxEnabled; this.defaultSalesTax = defaultSalesTax; - this.currency = currency; - this.language = language; + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); this.fiscalYearStartMonth = fiscalYearStartMonth; this.companyStartDate = companyStartDate; this.addresses = addresses; this.phoneNumbers = phoneNumbers; this.emails = emails; - this.customMappings = customMappings; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); this.trackingCategoriesEnabled = trackingCategoriesEnabled; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); } public CompanyInfo() { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * Based on the status some functionality is enabled or disabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * The legal name of the company */ - @JsonIgnore public Optional legalName() { - return legalName; + return Optional.ofNullable(this.legalName); } /** * country code according to ISO 3166-1 alpha-2. */ - @JsonIgnore public JsonNullable country() { - return country; + return this.country; } - @JsonIgnore public JsonNullable salesTaxNumber() { - return salesTaxNumber; + return this.salesTaxNumber; } /** * Whether sales tax is calculated automatically for the company */ - @JsonIgnore public Optional automatedSalesTax() { - return automatedSalesTax; + return Optional.ofNullable(this.automatedSalesTax); } /** * Whether sales tax is enabled for the company */ - @JsonIgnore public Optional salesTaxEnabled() { - return salesTaxEnabled; + return Optional.ofNullable(this.salesTaxEnabled); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional defaultSalesTax() { - return (Optional) defaultSalesTax; + return Optional.ofNullable(this.defaultSalesTax); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } /** * The start month of fiscal year. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional fiscalYearStartMonth() { - return (Optional) fiscalYearStartMonth; + return Optional.ofNullable(this.fiscalYearStartMonth); } /** * Date when company file was created */ - @JsonIgnore public Optional companyStartDate() { - return companyStartDate; + return Optional.ofNullable(this.companyStartDate); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * Whether tracking categories are enabled for the company on transactions */ - @JsonIgnore public Optional trackingCategoriesEnabled() { - return trackingCategoriesEnabled; + return Optional.ofNullable(this.trackingCategoriesEnabled); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } public static Builder builder() { @@ -443,46 +399,17 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public CompanyInfo withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public CompanyInfo withId(Optional id) { - Utils.checkNotNull(id, "id"); + public CompanyInfo withId(@Nullable String id) { this.id = id; return this; } - /** - * The name of the company. - */ - public CompanyInfo withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = JsonNullable.of(companyName); - return this; - } /** * The name of the company. */ - public CompanyInfo withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public CompanyInfo withStatus(CompanyStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); + public CompanyInfo withCompanyName(@Nullable String companyName) { + this.companyName = JsonNullable.of(companyName); return this; } @@ -490,249 +417,119 @@ public CompanyInfo withStatus(CompanyStatus status) { /** * Based on the status some functionality is enabled or disabled. */ - public CompanyInfo withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public CompanyInfo withStatus(@Nullable CompanyStatus status) { this.status = status; return this; } - /** - * The legal name of the company - */ - public CompanyInfo withLegalName(String legalName) { - Utils.checkNotNull(legalName, "legalName"); - this.legalName = Optional.ofNullable(legalName); - return this; - } - /** * The legal name of the company */ - public CompanyInfo withLegalName(Optional legalName) { - Utils.checkNotNull(legalName, "legalName"); + public CompanyInfo withLegalName(@Nullable String legalName) { this.legalName = legalName; return this; } + /** * country code according to ISO 3166-1 alpha-2. */ - public CompanyInfo withCountry(String country) { - Utils.checkNotNull(country, "country"); + public CompanyInfo withCountry(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * country code according to ISO 3166-1 alpha-2. - */ - public CompanyInfo withCountry(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - public CompanyInfo withSalesTaxNumber(String salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); + public CompanyInfo withSalesTaxNumber(@Nullable String salesTaxNumber) { this.salesTaxNumber = JsonNullable.of(salesTaxNumber); return this; } - public CompanyInfo withSalesTaxNumber(JsonNullable salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); - this.salesTaxNumber = salesTaxNumber; - return this; - } - - /** - * Whether sales tax is calculated automatically for the company - */ - public CompanyInfo withAutomatedSalesTax(boolean automatedSalesTax) { - Utils.checkNotNull(automatedSalesTax, "automatedSalesTax"); - this.automatedSalesTax = Optional.ofNullable(automatedSalesTax); - return this; - } - /** * Whether sales tax is calculated automatically for the company */ - public CompanyInfo withAutomatedSalesTax(Optional automatedSalesTax) { - Utils.checkNotNull(automatedSalesTax, "automatedSalesTax"); + public CompanyInfo withAutomatedSalesTax(@Nullable Boolean automatedSalesTax) { this.automatedSalesTax = automatedSalesTax; return this; } - /** - * Whether sales tax is enabled for the company - */ - public CompanyInfo withSalesTaxEnabled(boolean salesTaxEnabled) { - Utils.checkNotNull(salesTaxEnabled, "salesTaxEnabled"); - this.salesTaxEnabled = Optional.ofNullable(salesTaxEnabled); - return this; - } - /** * Whether sales tax is enabled for the company */ - public CompanyInfo withSalesTaxEnabled(Optional salesTaxEnabled) { - Utils.checkNotNull(salesTaxEnabled, "salesTaxEnabled"); + public CompanyInfo withSalesTaxEnabled(@Nullable Boolean salesTaxEnabled) { this.salesTaxEnabled = salesTaxEnabled; return this; } - public CompanyInfo withDefaultSalesTax(TaxRate defaultSalesTax) { - Utils.checkNotNull(defaultSalesTax, "defaultSalesTax"); - this.defaultSalesTax = Optional.ofNullable(defaultSalesTax); - return this; - } - - public CompanyInfo withDefaultSalesTax(Optional defaultSalesTax) { - Utils.checkNotNull(defaultSalesTax, "defaultSalesTax"); + public CompanyInfo withDefaultSalesTax(@Nullable TaxRate defaultSalesTax) { this.defaultSalesTax = defaultSalesTax; return this; } + /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public CompanyInfo withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public CompanyInfo withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public CompanyInfo withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public CompanyInfo withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public CompanyInfo withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public CompanyInfo withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - /** - * The start month of fiscal year. - */ - public CompanyInfo withFiscalYearStartMonth(TheStartMonthOfFiscalYear fiscalYearStartMonth) { - Utils.checkNotNull(fiscalYearStartMonth, "fiscalYearStartMonth"); - this.fiscalYearStartMonth = Optional.ofNullable(fiscalYearStartMonth); - return this; - } - /** * The start month of fiscal year. */ - public CompanyInfo withFiscalYearStartMonth(Optional fiscalYearStartMonth) { - Utils.checkNotNull(fiscalYearStartMonth, "fiscalYearStartMonth"); + public CompanyInfo withFiscalYearStartMonth(@Nullable TheStartMonthOfFiscalYear fiscalYearStartMonth) { this.fiscalYearStartMonth = fiscalYearStartMonth; return this; } - /** - * Date when company file was created - */ - public CompanyInfo withCompanyStartDate(LocalDate companyStartDate) { - Utils.checkNotNull(companyStartDate, "companyStartDate"); - this.companyStartDate = Optional.ofNullable(companyStartDate); - return this; - } - /** * Date when company file was created */ - public CompanyInfo withCompanyStartDate(Optional companyStartDate) { - Utils.checkNotNull(companyStartDate, "companyStartDate"); + public CompanyInfo withCompanyStartDate(@Nullable LocalDate companyStartDate) { this.companyStartDate = companyStartDate; return this; } - public CompanyInfo withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public CompanyInfo withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public CompanyInfo withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public CompanyInfo withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public CompanyInfo withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public CompanyInfo withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public CompanyInfo withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public CompanyInfo withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public CompanyInfo withEmails(@Nullable List emails) { this.emails = emails; return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public CompanyInfo withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = JsonNullable.of(customMappings); - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public CompanyInfo withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** - * Whether tracking categories are enabled for the company on transactions - */ - public CompanyInfo withTrackingCategoriesEnabled(boolean trackingCategoriesEnabled) { - Utils.checkNotNull(trackingCategoriesEnabled, "trackingCategoriesEnabled"); - this.trackingCategoriesEnabled = Optional.ofNullable(trackingCategoriesEnabled); + public CompanyInfo withCustomMappings(@Nullable Map customMappings) { + this.customMappings = JsonNullable.of(customMappings); return this; } @@ -740,101 +537,56 @@ public CompanyInfo withTrackingCategoriesEnabled(boolean trackingCategoriesEnabl /** * Whether tracking categories are enabled for the company on transactions */ - public CompanyInfo withTrackingCategoriesEnabled(Optional trackingCategoriesEnabled) { - Utils.checkNotNull(trackingCategoriesEnabled, "trackingCategoriesEnabled"); + public CompanyInfo withTrackingCategoriesEnabled(@Nullable Boolean trackingCategoriesEnabled) { this.trackingCategoriesEnabled = trackingCategoriesEnabled; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public CompanyInfo withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public CompanyInfo withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public CompanyInfo withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public CompanyInfo withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public CompanyInfo withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public CompanyInfo withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public CompanyInfo withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public CompanyInfo withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public CompanyInfo withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public CompanyInfo withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public CompanyInfo withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public CompanyInfo withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public CompanyInfo withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public CompanyInfo withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public CompanyInfo withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -915,465 +667,226 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private Optional status = Optional.empty(); + private CompanyStatus status; - private Optional legalName = Optional.empty(); + private String legalName; - private JsonNullable country = JsonNullable.undefined(); + private JsonNullable country; - private JsonNullable salesTaxNumber = JsonNullable.undefined(); + private JsonNullable salesTaxNumber; - private Optional automatedSalesTax = Optional.empty(); + private Boolean automatedSalesTax; - private Optional salesTaxEnabled = Optional.empty(); + private Boolean salesTaxEnabled; - private Optional defaultSalesTax = Optional.empty(); + private TaxRate defaultSalesTax; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private Optional fiscalYearStartMonth = Optional.empty(); + private TheStartMonthOfFiscalYear fiscalYearStartMonth; - private Optional companyStartDate = Optional.empty(); + private LocalDate companyStartDate; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private Optional trackingCategoriesEnabled = Optional.empty(); + private Boolean trackingCategoriesEnabled; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * Based on the status some functionality is enabled or disabled. */ - public Builder status(CompanyStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable CompanyStatus status) { this.status = status; return this; } - /** * The legal name of the company */ - public Builder legalName(String legalName) { - Utils.checkNotNull(legalName, "legalName"); - this.legalName = Optional.ofNullable(legalName); - return this; - } - - /** - * The legal name of the company - */ - public Builder legalName(Optional legalName) { - Utils.checkNotNull(legalName, "legalName"); + public Builder legalName(@Nullable String legalName) { this.legalName = legalName; return this; } - /** * country code according to ISO 3166-1 alpha-2. */ - public Builder country(String country) { - Utils.checkNotNull(country, "country"); + public Builder country(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * country code according to ISO 3166-1 alpha-2. - */ - public Builder country(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - - - public Builder salesTaxNumber(String salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); + public Builder salesTaxNumber(@Nullable String salesTaxNumber) { this.salesTaxNumber = JsonNullable.of(salesTaxNumber); return this; } - public Builder salesTaxNumber(JsonNullable salesTaxNumber) { - Utils.checkNotNull(salesTaxNumber, "salesTaxNumber"); - this.salesTaxNumber = salesTaxNumber; - return this; - } - - - /** - * Whether sales tax is calculated automatically for the company - */ - public Builder automatedSalesTax(boolean automatedSalesTax) { - Utils.checkNotNull(automatedSalesTax, "automatedSalesTax"); - this.automatedSalesTax = Optional.ofNullable(automatedSalesTax); - return this; - } - /** * Whether sales tax is calculated automatically for the company */ - public Builder automatedSalesTax(Optional automatedSalesTax) { - Utils.checkNotNull(automatedSalesTax, "automatedSalesTax"); + public Builder automatedSalesTax(@Nullable Boolean automatedSalesTax) { this.automatedSalesTax = automatedSalesTax; return this; } - /** * Whether sales tax is enabled for the company */ - public Builder salesTaxEnabled(boolean salesTaxEnabled) { - Utils.checkNotNull(salesTaxEnabled, "salesTaxEnabled"); - this.salesTaxEnabled = Optional.ofNullable(salesTaxEnabled); - return this; - } - - /** - * Whether sales tax is enabled for the company - */ - public Builder salesTaxEnabled(Optional salesTaxEnabled) { - Utils.checkNotNull(salesTaxEnabled, "salesTaxEnabled"); + public Builder salesTaxEnabled(@Nullable Boolean salesTaxEnabled) { this.salesTaxEnabled = salesTaxEnabled; return this; } - - public Builder defaultSalesTax(TaxRate defaultSalesTax) { - Utils.checkNotNull(defaultSalesTax, "defaultSalesTax"); - this.defaultSalesTax = Optional.ofNullable(defaultSalesTax); - return this; - } - - public Builder defaultSalesTax(Optional defaultSalesTax) { - Utils.checkNotNull(defaultSalesTax, "defaultSalesTax"); + public Builder defaultSalesTax(@Nullable TaxRate defaultSalesTax) { this.defaultSalesTax = defaultSalesTax; return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - - /** - * The start month of fiscal year. - */ - public Builder fiscalYearStartMonth(TheStartMonthOfFiscalYear fiscalYearStartMonth) { - Utils.checkNotNull(fiscalYearStartMonth, "fiscalYearStartMonth"); - this.fiscalYearStartMonth = Optional.ofNullable(fiscalYearStartMonth); - return this; - } - /** * The start month of fiscal year. */ - public Builder fiscalYearStartMonth(Optional fiscalYearStartMonth) { - Utils.checkNotNull(fiscalYearStartMonth, "fiscalYearStartMonth"); + public Builder fiscalYearStartMonth(@Nullable TheStartMonthOfFiscalYear fiscalYearStartMonth) { this.fiscalYearStartMonth = fiscalYearStartMonth; return this; } - - /** - * Date when company file was created - */ - public Builder companyStartDate(LocalDate companyStartDate) { - Utils.checkNotNull(companyStartDate, "companyStartDate"); - this.companyStartDate = Optional.ofNullable(companyStartDate); - return this; - } - /** * Date when company file was created */ - public Builder companyStartDate(Optional companyStartDate) { - Utils.checkNotNull(companyStartDate, "companyStartDate"); + public Builder companyStartDate(@Nullable LocalDate companyStartDate) { this.companyStartDate = companyStartDate; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * Whether tracking categories are enabled for the company on transactions */ - public Builder trackingCategoriesEnabled(boolean trackingCategoriesEnabled) { - Utils.checkNotNull(trackingCategoriesEnabled, "trackingCategoriesEnabled"); - this.trackingCategoriesEnabled = Optional.ofNullable(trackingCategoriesEnabled); - return this; - } - - /** - * Whether tracking categories are enabled for the company on transactions - */ - public Builder trackingCategoriesEnabled(Optional trackingCategoriesEnabled) { - Utils.checkNotNull(trackingCategoriesEnabled, "trackingCategoriesEnabled"); + public Builder trackingCategoriesEnabled(@Nullable Boolean trackingCategoriesEnabled) { this.trackingCategoriesEnabled = trackingCategoriesEnabled; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - public CompanyInfo build() { - return new CompanyInfo( id, companyName, status, legalName, country, salesTaxNumber, diff --git a/src/main/java/com/apideck/unify/models/components/CompanyRowType.java b/src/main/java/com/apideck/unify/models/components/CompanyRowType.java index 730a573a..dd122c79 100644 --- a/src/main/java/com/apideck/unify/models/components/CompanyRowType.java +++ b/src/main/java/com/apideck/unify/models/components/CompanyRowType.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,26 +28,24 @@ public class CompanyRowType { @JsonCreator public CompanyRowType( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - this.id = id; - this.name = name; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public CompanyRowType() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -54,29 +53,17 @@ public static Builder builder() { } - public CompanyRowType withId(String id) { - Utils.checkNotNull(id, "id"); + public CompanyRowType withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - public CompanyRowType withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - public CompanyRowType withName(String name) { - Utils.checkNotNull(name, "name"); + public CompanyRowType withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - public CompanyRowType withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -108,42 +95,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public CompanyRowType build() { - return new CompanyRowType( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/Compensation.java b/src/main/java/com/apideck/unify/models/components/Compensation.java index 411ede3b..d1231d59 100644 --- a/src/main/java/com/apideck/unify/models/components/Compensation.java +++ b/src/main/java/com/apideck/unify/models/components/Compensation.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,7 +23,7 @@ public class Compensation { */ @JsonInclude(Include.ALWAYS) @JsonProperty("employee_id") - private Optional employeeId; + private JsonNullable employeeId; /** * The employee's net pay. Only available when payroll has been processed @@ -45,98 +44,88 @@ public class Compensation { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("taxes") - private JsonNullable> taxes; + private JsonNullable> taxes; /** * An array of employee deductions for the pay period. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("deductions") - private JsonNullable> deductions; + private JsonNullable> deductions; /** * An array of employee benefits for the pay period. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("benefits") - private JsonNullable> benefits; + private JsonNullable> benefits; @JsonCreator public Compensation( - @JsonProperty("employee_id") Optional employeeId, - @JsonProperty("net_pay") JsonNullable netPay, - @JsonProperty("gross_pay") JsonNullable grossPay, - @JsonProperty("taxes") JsonNullable> taxes, - @JsonProperty("deductions") JsonNullable> deductions, - @JsonProperty("benefits") JsonNullable> benefits) { - Utils.checkNotNull(employeeId, "employeeId"); - Utils.checkNotNull(netPay, "netPay"); - Utils.checkNotNull(grossPay, "grossPay"); - Utils.checkNotNull(taxes, "taxes"); - Utils.checkNotNull(deductions, "deductions"); - Utils.checkNotNull(benefits, "benefits"); - this.employeeId = employeeId; - this.netPay = netPay; - this.grossPay = grossPay; - this.taxes = taxes; - this.deductions = deductions; - this.benefits = benefits; + @JsonProperty("employee_id") @Nullable String employeeId, + @JsonProperty("net_pay") @Nullable JsonNullable netPay, + @JsonProperty("gross_pay") @Nullable JsonNullable grossPay, + @JsonProperty("taxes") @Nullable JsonNullable> taxes, + @JsonProperty("deductions") @Nullable JsonNullable> deductions, + @JsonProperty("benefits") @Nullable JsonNullable> benefits) { + this.employeeId = JsonNullable.of(employeeId); + this.netPay = Optional.ofNullable(netPay) + .orElse(JsonNullable.undefined()); + this.grossPay = Optional.ofNullable(grossPay) + .orElse(JsonNullable.undefined()); + this.taxes = Optional.ofNullable(taxes) + .orElse(JsonNullable.undefined()); + this.deductions = Optional.ofNullable(deductions) + .orElse(JsonNullable.undefined()); + this.benefits = Optional.ofNullable(benefits) + .orElse(JsonNullable.undefined()); } public Compensation() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore - public Optional employeeId() { - return employeeId; + public JsonNullable employeeId() { + return this.employeeId; } /** * The employee's net pay. Only available when payroll has been processed */ - @JsonIgnore public JsonNullable netPay() { - return netPay; + return this.netPay; } /** * The employee's gross pay. Only available when payroll has been processed */ - @JsonIgnore public JsonNullable grossPay() { - return grossPay; + return this.grossPay; } /** * An array of employer and employee taxes for the pay period. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> taxes() { - return (JsonNullable>) taxes; + return this.taxes; } /** * An array of employee deductions for the pay period. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> deductions() { - return (JsonNullable>) deductions; + return this.deductions; } /** * An array of employee benefits for the pay period. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> benefits() { - return (JsonNullable>) benefits; + return this.benefits; } public static Builder builder() { @@ -147,111 +136,56 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Compensation withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = Optional.ofNullable(employeeId); + public Compensation withEmployeeId(@Nullable String employeeId) { + this.employeeId = JsonNullable.of(employeeId); return this; } - /** - * A unique identifier for an object. - */ - public Compensation withEmployeeId(Optional employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } - /** * The employee's net pay. Only available when payroll has been processed */ - public Compensation withNetPay(double netPay) { - Utils.checkNotNull(netPay, "netPay"); + public Compensation withNetPay(@Nullable Double netPay) { this.netPay = JsonNullable.of(netPay); return this; } - /** - * The employee's net pay. Only available when payroll has been processed - */ - public Compensation withNetPay(JsonNullable netPay) { - Utils.checkNotNull(netPay, "netPay"); - this.netPay = netPay; - return this; - } /** * The employee's gross pay. Only available when payroll has been processed */ - public Compensation withGrossPay(double grossPay) { - Utils.checkNotNull(grossPay, "grossPay"); + public Compensation withGrossPay(@Nullable Double grossPay) { this.grossPay = JsonNullable.of(grossPay); return this; } - /** - * The employee's gross pay. Only available when payroll has been processed - */ - public Compensation withGrossPay(JsonNullable grossPay) { - Utils.checkNotNull(grossPay, "grossPay"); - this.grossPay = grossPay; - return this; - } /** * An array of employer and employee taxes for the pay period. */ - public Compensation withTaxes(List taxes) { - Utils.checkNotNull(taxes, "taxes"); + public Compensation withTaxes(@Nullable List taxes) { this.taxes = JsonNullable.of(taxes); return this; } - /** - * An array of employer and employee taxes for the pay period. - */ - public Compensation withTaxes(JsonNullable> taxes) { - Utils.checkNotNull(taxes, "taxes"); - this.taxes = taxes; - return this; - } /** * An array of employee deductions for the pay period. */ - public Compensation withDeductions(List deductions) { - Utils.checkNotNull(deductions, "deductions"); + public Compensation withDeductions(@Nullable List deductions) { this.deductions = JsonNullable.of(deductions); return this; } - /** - * An array of employee deductions for the pay period. - */ - public Compensation withDeductions(JsonNullable> deductions) { - Utils.checkNotNull(deductions, "deductions"); - this.deductions = deductions; - return this; - } /** * An array of employee benefits for the pay period. */ - public Compensation withBenefits(List benefits) { - Utils.checkNotNull(benefits, "benefits"); + public Compensation withBenefits(@Nullable List benefits) { this.benefits = JsonNullable.of(benefits); return this; } - /** - * An array of employee benefits for the pay period. - */ - public Compensation withBenefits(JsonNullable> benefits) { - Utils.checkNotNull(benefits, "benefits"); - this.benefits = benefits; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -292,138 +226,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional employeeId = Optional.empty(); + private String employeeId; - private JsonNullable netPay = JsonNullable.undefined(); + private JsonNullable netPay; - private JsonNullable grossPay = JsonNullable.undefined(); + private JsonNullable grossPay; - private JsonNullable> taxes = JsonNullable.undefined(); + private JsonNullable> taxes; - private JsonNullable> deductions = JsonNullable.undefined(); + private JsonNullable> deductions; - private JsonNullable> benefits = JsonNullable.undefined(); + private JsonNullable> benefits; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = Optional.ofNullable(employeeId); - return this; - } - /** * A unique identifier for an object. */ - public Builder employeeId(Optional employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public Builder employeeId(@Nullable String employeeId) { this.employeeId = employeeId; return this; } - /** * The employee's net pay. Only available when payroll has been processed */ - public Builder netPay(double netPay) { - Utils.checkNotNull(netPay, "netPay"); + public Builder netPay(@Nullable Double netPay) { this.netPay = JsonNullable.of(netPay); return this; } - /** - * The employee's net pay. Only available when payroll has been processed - */ - public Builder netPay(JsonNullable netPay) { - Utils.checkNotNull(netPay, "netPay"); - this.netPay = netPay; - return this; - } - - /** * The employee's gross pay. Only available when payroll has been processed */ - public Builder grossPay(double grossPay) { - Utils.checkNotNull(grossPay, "grossPay"); + public Builder grossPay(@Nullable Double grossPay) { this.grossPay = JsonNullable.of(grossPay); return this; } - /** - * The employee's gross pay. Only available when payroll has been processed - */ - public Builder grossPay(JsonNullable grossPay) { - Utils.checkNotNull(grossPay, "grossPay"); - this.grossPay = grossPay; - return this; - } - - /** * An array of employer and employee taxes for the pay period. */ - public Builder taxes(List taxes) { - Utils.checkNotNull(taxes, "taxes"); + public Builder taxes(@Nullable List taxes) { this.taxes = JsonNullable.of(taxes); return this; } - /** - * An array of employer and employee taxes for the pay period. - */ - public Builder taxes(JsonNullable> taxes) { - Utils.checkNotNull(taxes, "taxes"); - this.taxes = taxes; - return this; - } - - /** * An array of employee deductions for the pay period. */ - public Builder deductions(List deductions) { - Utils.checkNotNull(deductions, "deductions"); + public Builder deductions(@Nullable List deductions) { this.deductions = JsonNullable.of(deductions); return this; } - /** - * An array of employee deductions for the pay period. - */ - public Builder deductions(JsonNullable> deductions) { - Utils.checkNotNull(deductions, "deductions"); - this.deductions = deductions; - return this; - } - - /** * An array of employee benefits for the pay period. */ - public Builder benefits(List benefits) { - Utils.checkNotNull(benefits, "benefits"); + public Builder benefits(@Nullable List benefits) { this.benefits = JsonNullable.of(benefits); return this; } - /** - * An array of employee benefits for the pay period. - */ - public Builder benefits(JsonNullable> benefits) { - Utils.checkNotNull(benefits, "benefits"); - this.benefits = benefits; - return this; - } - public Compensation build() { - return new Compensation( employeeId, netPay, grossPay, taxes, deductions, benefits); diff --git a/src/main/java/com/apideck/unify/models/components/Components.java b/src/main/java/com/apideck/unify/models/components/Components.java index b2440586..e1500966 100644 --- a/src/main/java/com/apideck/unify/models/components/Components.java +++ b/src/main/java/com/apideck/unify/models/components/Components.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; @@ -26,7 +26,7 @@ public class Components { @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; @JsonInclude(Include.NON_ABSENT) @@ -40,43 +40,38 @@ public class Components { @JsonCreator public Components( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") Optional name, - @JsonProperty("rate") JsonNullable rate, - @JsonProperty("compound") JsonNullable compound) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(rate, "rate"); - Utils.checkNotNull(compound, "compound"); - this.id = id; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("rate") @Nullable JsonNullable rate, + @JsonProperty("compound") @Nullable JsonNullable compound) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); this.name = name; - this.rate = rate; - this.compound = compound; + this.rate = Optional.ofNullable(rate) + .orElse(JsonNullable.undefined()); + this.compound = Optional.ofNullable(compound) + .orElse(JsonNullable.undefined()); } public Components() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null); } - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } - @JsonIgnore public JsonNullable rate() { - return rate; + return this.rate; } - @JsonIgnore public JsonNullable compound() { - return compound; + return this.compound; } public static Builder builder() { @@ -84,54 +79,29 @@ public static Builder builder() { } - public Components withId(String id) { - Utils.checkNotNull(id, "id"); + public Components withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - public Components withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - public Components withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - public Components withName(Optional name) { - Utils.checkNotNull(name, "name"); + public Components withName(@Nullable String name) { this.name = name; return this; } - public Components withRate(double rate) { - Utils.checkNotNull(rate, "rate"); + + public Components withRate(@Nullable Double rate) { this.rate = JsonNullable.of(rate); return this; } - public Components withRate(JsonNullable rate) { - Utils.checkNotNull(rate, "rate"); - this.rate = rate; - return this; - } - public Components withCompound(boolean compound) { - Utils.checkNotNull(compound, "compound"); + public Components withCompound(@Nullable Boolean compound) { this.compound = JsonNullable.of(compound); return this; } - public Components withCompound(JsonNullable compound) { - Utils.checkNotNull(compound, "compound"); - this.compound = compound; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -168,72 +138,39 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private Optional name = Optional.empty(); + private String name; - private JsonNullable rate = JsonNullable.undefined(); + private JsonNullable rate; - private JsonNullable compound = JsonNullable.undefined(); + private JsonNullable compound; private Builder() { // force use of static builder() method } - - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - public Builder rate(double rate) { - Utils.checkNotNull(rate, "rate"); + public Builder rate(@Nullable Double rate) { this.rate = JsonNullable.of(rate); return this; } - public Builder rate(JsonNullable rate) { - Utils.checkNotNull(rate, "rate"); - this.rate = rate; - return this; - } - - - public Builder compound(boolean compound) { - Utils.checkNotNull(compound, "compound"); + public Builder compound(@Nullable Boolean compound) { this.compound = JsonNullable.of(compound); return this; } - public Builder compound(JsonNullable compound) { - Utils.checkNotNull(compound, "compound"); - this.compound = compound; - return this; - } - public Components build() { - return new Components( id, name, rate, compound); diff --git a/src/main/java/com/apideck/unify/models/components/Configuration.java b/src/main/java/com/apideck/unify/models/components/Configuration.java index 812b67f8..4a9a38ac 100644 --- a/src/main/java/com/apideck/unify/models/components/Configuration.java +++ b/src/main/java/com/apideck/unify/models/components/Configuration.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -20,36 +19,31 @@ public class Configuration { @JsonInclude(Include.NON_ABSENT) @JsonProperty("resource") - private Optional resource; + private String resource; @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaults") - private Optional> defaults; + private List defaults; @JsonCreator public Configuration( - @JsonProperty("resource") Optional resource, - @JsonProperty("defaults") Optional> defaults) { - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(defaults, "defaults"); + @JsonProperty("resource") @Nullable String resource, + @JsonProperty("defaults") @Nullable List defaults) { this.resource = resource; this.defaults = defaults; } public Configuration() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @JsonIgnore public Optional resource() { - return resource; + return Optional.ofNullable(this.resource); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> defaults() { - return (Optional>) defaults; + return Optional.ofNullable(this.defaults); } public static Builder builder() { @@ -57,32 +51,18 @@ public static Builder builder() { } - public Configuration withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = Optional.ofNullable(resource); - return this; - } - - - public Configuration withResource(Optional resource) { - Utils.checkNotNull(resource, "resource"); + public Configuration withResource(@Nullable String resource) { this.resource = resource; return this; } - public Configuration withDefaults(List defaults) { - Utils.checkNotNull(defaults, "defaults"); - this.defaults = Optional.ofNullable(defaults); - return this; - } - - public Configuration withDefaults(Optional> defaults) { - Utils.checkNotNull(defaults, "defaults"); + public Configuration withDefaults(@Nullable List defaults) { this.defaults = defaults; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -113,42 +93,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional resource = Optional.empty(); + private String resource; - private Optional> defaults = Optional.empty(); + private List defaults; private Builder() { // force use of static builder() method } - - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = Optional.ofNullable(resource); - return this; - } - - public Builder resource(Optional resource) { - Utils.checkNotNull(resource, "resource"); + public Builder resource(@Nullable String resource) { this.resource = resource; return this; } - - public Builder defaults(List defaults) { - Utils.checkNotNull(defaults, "defaults"); - this.defaults = Optional.ofNullable(defaults); - return this; - } - - public Builder defaults(Optional> defaults) { - Utils.checkNotNull(defaults, "defaults"); + public Builder defaults(@Nullable List defaults) { this.defaults = defaults; return this; } public Configuration build() { - return new Configuration( resource, defaults); } diff --git a/src/main/java/com/apideck/unify/models/components/Connection.java b/src/main/java/com/apideck/unify/models/components/Connection.java index ae986c01..cdd31296 100644 --- a/src/main/java/com/apideck/unify/models/components/Connection.java +++ b/src/main/java/com/apideck/unify/models/components/Connection.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -27,96 +26,96 @@ public class Connection { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The ID of the service this connection belongs to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("service_id") - private Optional serviceId; + private String serviceId; /** * The name of the connection */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag_line") - private Optional tagLine; + private String tagLine; /** * The unified API category where the connection belongs to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("unified_api") - private Optional unifiedApi; + private String unifiedApi; /** * [Connection state flow](#section/Connection-state) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("state") - private Optional state; + private ConnectionState state; /** * The current state of the Integration. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("integration_state") - private Optional integrationState; + private IntegrationState integrationState; /** * Type of authorization used by the connector */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("auth_type") - private Optional authType; + private AuthType authType; /** * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("oauth_grant_type") - private Optional oauthGrantType; + private OAuthGrantType oauthGrantType; /** * Status of the connection. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private ConnectionStatus status; /** * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("enabled") - private Optional enabled; + private Boolean enabled; /** * The website URL of the connection */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("website") - private Optional website; + private String website; /** * A visual icon of the connection, that will be shown in the Vault */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("icon") - private Optional icon; + private String icon; /** * The logo of the connection, that will be shown in the Vault */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("logo") - private Optional logo; + private String logo; /** * The OAuth redirect URI. Redirect your users to this URI to let them authorize your app in the connector's UI. Before you can use this URI, you must add `redirect_uri` as a query parameter to the `authorize_url`. Be sure to URL encode the `redirect_uri` part. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. @@ -137,82 +136,82 @@ public class Connection { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("settings") - private JsonNullable> settings; + private JsonNullable> settings; /** * Attach your own consumer specific metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("metadata") - private JsonNullable> metadata; + private JsonNullable> metadata; /** * The settings that are wanted to create a connection. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("form_fields") - private Optional> formFields; + private List formFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("configuration") - private Optional> configuration; + private List configuration; @JsonInclude(Include.NON_ABSENT) @JsonProperty("configurable_resources") - private Optional> configurableResources; + private List configurableResources; @JsonInclude(Include.NON_ABSENT) @JsonProperty("resource_schema_support") - private Optional> resourceSchemaSupport; + private List resourceSchemaSupport; @JsonInclude(Include.NON_ABSENT) @JsonProperty("resource_settings_support") - private Optional> resourceSettingsSupport; + private List resourceSettingsSupport; @JsonInclude(Include.NON_ABSENT) @JsonProperty("validation_support") - private Optional validationSupport; + private Boolean validationSupport; @JsonInclude(Include.NON_ABSENT) @JsonProperty("schema_support") - private Optional schemaSupport; + private Boolean schemaSupport; /** * List of settings that are required to be configured on integration before authorization can occur */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("settings_required_for_authorization") - private Optional> settingsRequiredForAuthorization; + private List settingsRequiredForAuthorization; @JsonInclude(Include.NON_ABSENT) @JsonProperty("subscriptions") - private Optional> subscriptions; + private List subscriptions; /** * Whether the connector has a guide available in the developer docs or not (https://docs.apideck.com/connectors/{service_id}/docs/consumer+connection). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("has_guide") - private Optional hasGuide; + private Boolean hasGuide; @JsonInclude(Include.NON_ABSENT) @JsonProperty("created_at") - private Optional createdAt; + private Double createdAt; /** * List of custom mappings configured for this connection */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private Optional> customMappings; + private List customMappings; @JsonInclude(Include.NON_ABSENT) @@ -221,68 +220,37 @@ public class Connection { @JsonCreator public Connection( - @JsonProperty("id") Optional id, - @JsonProperty("service_id") Optional serviceId, - @JsonProperty("name") Optional name, - @JsonProperty("tag_line") Optional tagLine, - @JsonProperty("unified_api") Optional unifiedApi, - @JsonProperty("state") Optional state, - @JsonProperty("integration_state") Optional integrationState, - @JsonProperty("auth_type") Optional authType, - @JsonProperty("oauth_grant_type") Optional oauthGrantType, - @JsonProperty("status") Optional status, - @JsonProperty("enabled") Optional enabled, - @JsonProperty("website") Optional website, - @JsonProperty("icon") Optional icon, - @JsonProperty("logo") Optional logo, - @JsonProperty("authorize_url") JsonNullable authorizeUrl, - @JsonProperty("revoke_url") JsonNullable revokeUrl, - @JsonProperty("settings") JsonNullable> settings, - @JsonProperty("metadata") JsonNullable> metadata, - @JsonProperty("form_fields") Optional> formFields, - @JsonProperty("configuration") Optional> configuration, - @JsonProperty("configurable_resources") Optional> configurableResources, - @JsonProperty("resource_schema_support") Optional> resourceSchemaSupport, - @JsonProperty("resource_settings_support") Optional> resourceSettingsSupport, - @JsonProperty("validation_support") Optional validationSupport, - @JsonProperty("schema_support") Optional schemaSupport, - @JsonProperty("settings_required_for_authorization") Optional> settingsRequiredForAuthorization, - @JsonProperty("subscriptions") Optional> subscriptions, - @JsonProperty("has_guide") Optional hasGuide, - @JsonProperty("created_at") Optional createdAt, - @JsonProperty("custom_mappings") Optional> customMappings, - @JsonProperty("updated_at") JsonNullable updatedAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(tagLine, "tagLine"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(state, "state"); - Utils.checkNotNull(integrationState, "integrationState"); - Utils.checkNotNull(authType, "authType"); - Utils.checkNotNull(oauthGrantType, "oauthGrantType"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(enabled, "enabled"); - Utils.checkNotNull(website, "website"); - Utils.checkNotNull(icon, "icon"); - Utils.checkNotNull(logo, "logo"); - Utils.checkNotNull(authorizeUrl, "authorizeUrl"); - Utils.checkNotNull(revokeUrl, "revokeUrl"); - Utils.checkNotNull(settings, "settings"); - Utils.checkNotNull(metadata, "metadata"); - Utils.checkNotNull(formFields, "formFields"); - Utils.checkNotNull(configuration, "configuration"); - Utils.checkNotNull(configurableResources, "configurableResources"); - Utils.checkNotNull(resourceSchemaSupport, "resourceSchemaSupport"); - Utils.checkNotNull(resourceSettingsSupport, "resourceSettingsSupport"); - Utils.checkNotNull(validationSupport, "validationSupport"); - Utils.checkNotNull(schemaSupport, "schemaSupport"); - Utils.checkNotNull(settingsRequiredForAuthorization, "settingsRequiredForAuthorization"); - Utils.checkNotNull(subscriptions, "subscriptions"); - Utils.checkNotNull(hasGuide, "hasGuide"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedAt, "updatedAt"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("service_id") @Nullable String serviceId, + @JsonProperty("name") @Nullable String name, + @JsonProperty("tag_line") @Nullable String tagLine, + @JsonProperty("unified_api") @Nullable String unifiedApi, + @JsonProperty("state") @Nullable ConnectionState state, + @JsonProperty("integration_state") @Nullable IntegrationState integrationState, + @JsonProperty("auth_type") @Nullable AuthType authType, + @JsonProperty("oauth_grant_type") @Nullable OAuthGrantType oauthGrantType, + @JsonProperty("status") @Nullable ConnectionStatus status, + @JsonProperty("enabled") @Nullable Boolean enabled, + @JsonProperty("website") @Nullable String website, + @JsonProperty("icon") @Nullable String icon, + @JsonProperty("logo") @Nullable String logo, + @JsonProperty("authorize_url") @Nullable JsonNullable authorizeUrl, + @JsonProperty("revoke_url") @Nullable JsonNullable revokeUrl, + @JsonProperty("settings") @Nullable JsonNullable> settings, + @JsonProperty("metadata") @Nullable JsonNullable> metadata, + @JsonProperty("form_fields") @Nullable List formFields, + @JsonProperty("configuration") @Nullable List configuration, + @JsonProperty("configurable_resources") @Nullable List configurableResources, + @JsonProperty("resource_schema_support") @Nullable List resourceSchemaSupport, + @JsonProperty("resource_settings_support") @Nullable List resourceSettingsSupport, + @JsonProperty("validation_support") @Nullable Boolean validationSupport, + @JsonProperty("schema_support") @Nullable Boolean schemaSupport, + @JsonProperty("settings_required_for_authorization") @Nullable List settingsRequiredForAuthorization, + @JsonProperty("subscriptions") @Nullable List subscriptions, + @JsonProperty("has_guide") @Nullable Boolean hasGuide, + @JsonProperty("created_at") @Nullable Double createdAt, + @JsonProperty("custom_mappings") @Nullable List customMappings, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt) { this.id = id; this.serviceId = serviceId; this.name = name; @@ -297,10 +265,14 @@ public Connection( this.website = website; this.icon = icon; this.logo = logo; - this.authorizeUrl = authorizeUrl; - this.revokeUrl = revokeUrl; - this.settings = settings; - this.metadata = metadata; + this.authorizeUrl = Optional.ofNullable(authorizeUrl) + .orElse(JsonNullable.undefined()); + this.revokeUrl = Optional.ofNullable(revokeUrl) + .orElse(JsonNullable.undefined()); + this.settings = Optional.ofNullable(settings) + .orElse(JsonNullable.undefined()); + this.metadata = Optional.ofNullable(metadata) + .orElse(JsonNullable.undefined()); this.formFields = formFields; this.configuration = configuration; this.configurableResources = configurableResources; @@ -313,254 +285,209 @@ public Connection( this.hasGuide = hasGuide; this.createdAt = createdAt; this.customMappings = customMappings; - this.updatedAt = updatedAt; + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); } public Connection() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * The unique identifier of the connection. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The ID of the service this connection belongs to. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The name of the connection */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } - @JsonIgnore public Optional tagLine() { - return tagLine; + return Optional.ofNullable(this.tagLine); } /** * The unified API category where the connection belongs to. */ - @JsonIgnore public Optional unifiedApi() { - return unifiedApi; + return Optional.ofNullable(this.unifiedApi); } /** * [Connection state flow](#section/Connection-state) */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional state() { - return (Optional) state; + return Optional.ofNullable(this.state); } /** * The current state of the Integration. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional integrationState() { - return (Optional) integrationState; + return Optional.ofNullable(this.integrationState); } /** * Type of authorization used by the connector */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional authType() { - return (Optional) authType; + return Optional.ofNullable(this.authType); } /** * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional oauthGrantType() { - return (Optional) oauthGrantType; + return Optional.ofNullable(this.oauthGrantType); } /** * Status of the connection. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. */ - @JsonIgnore public Optional enabled() { - return enabled; + return Optional.ofNullable(this.enabled); } /** * The website URL of the connection */ - @JsonIgnore public Optional website() { - return website; + return Optional.ofNullable(this.website); } /** * A visual icon of the connection, that will be shown in the Vault */ - @JsonIgnore public Optional icon() { - return icon; + return Optional.ofNullable(this.icon); } /** * The logo of the connection, that will be shown in the Vault */ - @JsonIgnore public Optional logo() { - return logo; + return Optional.ofNullable(this.logo); } /** * The OAuth redirect URI. Redirect your users to this URI to let them authorize your app in the connector's UI. Before you can use this URI, you must add `redirect_uri` as a query parameter to the `authorize_url`. Be sure to URL encode the `redirect_uri` part. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. */ - @JsonIgnore public JsonNullable authorizeUrl() { - return authorizeUrl; + return this.authorizeUrl; } /** * The OAuth revoke URI. Redirect your users to this URI to revoke this connection. Before you can use this URI, you must add `redirect_uri` as a query parameter. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. */ - @JsonIgnore public JsonNullable revokeUrl() { - return revokeUrl; + return this.revokeUrl; } /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> settings() { - return (JsonNullable>) settings; + return this.settings; } /** * Attach your own consumer specific metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> metadata() { - return (JsonNullable>) metadata; + return this.metadata; } /** * The settings that are wanted to create a connection. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> formFields() { - return (Optional>) formFields; + return Optional.ofNullable(this.formFields); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> configuration() { - return (Optional>) configuration; + return Optional.ofNullable(this.configuration); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> configurableResources() { - return (Optional>) configurableResources; + return Optional.ofNullable(this.configurableResources); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> resourceSchemaSupport() { - return (Optional>) resourceSchemaSupport; + return Optional.ofNullable(this.resourceSchemaSupport); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> resourceSettingsSupport() { - return (Optional>) resourceSettingsSupport; + return Optional.ofNullable(this.resourceSettingsSupport); } - @JsonIgnore public Optional validationSupport() { - return validationSupport; + return Optional.ofNullable(this.validationSupport); } - @JsonIgnore public Optional schemaSupport() { - return schemaSupport; + return Optional.ofNullable(this.schemaSupport); } /** * List of settings that are required to be configured on integration before authorization can occur */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> settingsRequiredForAuthorization() { - return (Optional>) settingsRequiredForAuthorization; + return Optional.ofNullable(this.settingsRequiredForAuthorization); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subscriptions() { - return (Optional>) subscriptions; + return Optional.ofNullable(this.subscriptions); } /** * Whether the connector has a guide available in the developer docs or not (https://docs.apideck.com/connectors/{service_id}/docs/consumer+connection). */ - @JsonIgnore public Optional hasGuide() { - return hasGuide; + return Optional.ofNullable(this.hasGuide); } - @JsonIgnore public Optional createdAt() { - return createdAt; + return Optional.ofNullable(this.createdAt); } /** * List of custom mappings configured for this connection */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customMappings() { - return (Optional>) customMappings; + return Optional.ofNullable(this.customMappings); } - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } public static Builder builder() { @@ -571,526 +498,251 @@ public static Builder builder() { /** * The unique identifier of the connection. */ - public Connection withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier of the connection. - */ - public Connection withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Connection withId(@Nullable String id) { this.id = id; return this; } - /** - * The ID of the service this connection belongs to. - */ - public Connection withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * The ID of the service this connection belongs to. */ - public Connection withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Connection withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * The name of the connection - */ - public Connection withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the connection */ - public Connection withName(Optional name) { - Utils.checkNotNull(name, "name"); + public Connection withName(@Nullable String name) { this.name = name; return this; } - public Connection withTagLine(String tagLine) { - Utils.checkNotNull(tagLine, "tagLine"); - this.tagLine = Optional.ofNullable(tagLine); - return this; - } - - public Connection withTagLine(Optional tagLine) { - Utils.checkNotNull(tagLine, "tagLine"); + public Connection withTagLine(@Nullable String tagLine) { this.tagLine = tagLine; return this; } - /** - * The unified API category where the connection belongs to. - */ - public Connection withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = Optional.ofNullable(unifiedApi); - return this; - } - /** * The unified API category where the connection belongs to. */ - public Connection withUnifiedApi(Optional unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); + public Connection withUnifiedApi(@Nullable String unifiedApi) { this.unifiedApi = unifiedApi; return this; } - /** - * [Connection state flow](#section/Connection-state) - */ - public Connection withState(ConnectionState state) { - Utils.checkNotNull(state, "state"); - this.state = Optional.ofNullable(state); - return this; - } - /** * [Connection state flow](#section/Connection-state) */ - public Connection withState(Optional state) { - Utils.checkNotNull(state, "state"); + public Connection withState(@Nullable ConnectionState state) { this.state = state; return this; } - /** - * The current state of the Integration. - */ - public Connection withIntegrationState(IntegrationState integrationState) { - Utils.checkNotNull(integrationState, "integrationState"); - this.integrationState = Optional.ofNullable(integrationState); - return this; - } - /** * The current state of the Integration. */ - public Connection withIntegrationState(Optional integrationState) { - Utils.checkNotNull(integrationState, "integrationState"); + public Connection withIntegrationState(@Nullable IntegrationState integrationState) { this.integrationState = integrationState; return this; } - /** - * Type of authorization used by the connector - */ - public Connection withAuthType(AuthType authType) { - Utils.checkNotNull(authType, "authType"); - this.authType = Optional.ofNullable(authType); - return this; - } - /** * Type of authorization used by the connector */ - public Connection withAuthType(Optional authType) { - Utils.checkNotNull(authType, "authType"); + public Connection withAuthType(@Nullable AuthType authType) { this.authType = authType; return this; } - /** - * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types - */ - public Connection withOauthGrantType(OAuthGrantType oauthGrantType) { - Utils.checkNotNull(oauthGrantType, "oauthGrantType"); - this.oauthGrantType = Optional.ofNullable(oauthGrantType); - return this; - } - /** * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types */ - public Connection withOauthGrantType(Optional oauthGrantType) { - Utils.checkNotNull(oauthGrantType, "oauthGrantType"); + public Connection withOauthGrantType(@Nullable OAuthGrantType oauthGrantType) { this.oauthGrantType = oauthGrantType; return this; } - /** - * Status of the connection. - */ - public Connection withStatus(ConnectionStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the connection. */ - public Connection withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public Connection withStatus(@Nullable ConnectionStatus status) { this.status = status; return this; } - /** - * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. - */ - public Connection withEnabled(boolean enabled) { - Utils.checkNotNull(enabled, "enabled"); - this.enabled = Optional.ofNullable(enabled); - return this; - } - /** * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. */ - public Connection withEnabled(Optional enabled) { - Utils.checkNotNull(enabled, "enabled"); + public Connection withEnabled(@Nullable Boolean enabled) { this.enabled = enabled; return this; } - /** - * The website URL of the connection - */ - public Connection withWebsite(String website) { - Utils.checkNotNull(website, "website"); - this.website = Optional.ofNullable(website); - return this; - } - /** * The website URL of the connection */ - public Connection withWebsite(Optional website) { - Utils.checkNotNull(website, "website"); + public Connection withWebsite(@Nullable String website) { this.website = website; return this; } - /** - * A visual icon of the connection, that will be shown in the Vault - */ - public Connection withIcon(String icon) { - Utils.checkNotNull(icon, "icon"); - this.icon = Optional.ofNullable(icon); - return this; - } - /** * A visual icon of the connection, that will be shown in the Vault */ - public Connection withIcon(Optional icon) { - Utils.checkNotNull(icon, "icon"); + public Connection withIcon(@Nullable String icon) { this.icon = icon; return this; } - /** - * The logo of the connection, that will be shown in the Vault - */ - public Connection withLogo(String logo) { - Utils.checkNotNull(logo, "logo"); - this.logo = Optional.ofNullable(logo); - return this; - } - /** * The logo of the connection, that will be shown in the Vault */ - public Connection withLogo(Optional logo) { - Utils.checkNotNull(logo, "logo"); + public Connection withLogo(@Nullable String logo) { this.logo = logo; return this; } + /** * The OAuth redirect URI. Redirect your users to this URI to let them authorize your app in the connector's UI. Before you can use this URI, you must add `redirect_uri` as a query parameter to the `authorize_url`. Be sure to URL encode the `redirect_uri` part. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. */ - public Connection withAuthorizeUrl(String authorizeUrl) { - Utils.checkNotNull(authorizeUrl, "authorizeUrl"); + public Connection withAuthorizeUrl(@Nullable String authorizeUrl) { this.authorizeUrl = JsonNullable.of(authorizeUrl); return this; } - /** - * The OAuth redirect URI. Redirect your users to this URI to let them authorize your app in the connector's UI. Before you can use this URI, you must add `redirect_uri` as a query parameter to the `authorize_url`. Be sure to URL encode the `redirect_uri` part. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. - */ - public Connection withAuthorizeUrl(JsonNullable authorizeUrl) { - Utils.checkNotNull(authorizeUrl, "authorizeUrl"); - this.authorizeUrl = authorizeUrl; - return this; - } /** * The OAuth revoke URI. Redirect your users to this URI to revoke this connection. Before you can use this URI, you must add `redirect_uri` as a query parameter. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. */ - public Connection withRevokeUrl(String revokeUrl) { - Utils.checkNotNull(revokeUrl, "revokeUrl"); + public Connection withRevokeUrl(@Nullable String revokeUrl) { this.revokeUrl = JsonNullable.of(revokeUrl); return this; } - /** - * The OAuth revoke URI. Redirect your users to this URI to revoke this connection. Before you can use this URI, you must add `redirect_uri` as a query parameter. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. - */ - public Connection withRevokeUrl(JsonNullable revokeUrl) { - Utils.checkNotNull(revokeUrl, "revokeUrl"); - this.revokeUrl = revokeUrl; - return this; - } /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - public Connection withSettings(Map settings) { - Utils.checkNotNull(settings, "settings"); + public Connection withSettings(@Nullable Map settings) { this.settings = JsonNullable.of(settings); return this; } - /** - * Connection settings. Values will persist to `form_fields` with corresponding id - */ - public Connection withSettings(JsonNullable> settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = settings; - return this; - } /** * Attach your own consumer specific metadata */ - public Connection withMetadata(Map metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Connection withMetadata(@Nullable Map metadata) { this.metadata = JsonNullable.of(metadata); return this; } - /** - * Attach your own consumer specific metadata - */ - public Connection withMetadata(JsonNullable> metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = metadata; - return this; - } /** * The settings that are wanted to create a connection. */ - public Connection withFormFields(List formFields) { - Utils.checkNotNull(formFields, "formFields"); - this.formFields = Optional.ofNullable(formFields); - return this; - } - - - /** - * The settings that are wanted to create a connection. - */ - public Connection withFormFields(Optional> formFields) { - Utils.checkNotNull(formFields, "formFields"); + public Connection withFormFields(@Nullable List formFields) { this.formFields = formFields; return this; } - public Connection withConfiguration(List configuration) { - Utils.checkNotNull(configuration, "configuration"); - this.configuration = Optional.ofNullable(configuration); - return this; - } - - public Connection withConfiguration(Optional> configuration) { - Utils.checkNotNull(configuration, "configuration"); + public Connection withConfiguration(@Nullable List configuration) { this.configuration = configuration; return this; } - public Connection withConfigurableResources(List configurableResources) { - Utils.checkNotNull(configurableResources, "configurableResources"); - this.configurableResources = Optional.ofNullable(configurableResources); - return this; - } - - public Connection withConfigurableResources(Optional> configurableResources) { - Utils.checkNotNull(configurableResources, "configurableResources"); + public Connection withConfigurableResources(@Nullable List configurableResources) { this.configurableResources = configurableResources; return this; } - public Connection withResourceSchemaSupport(List resourceSchemaSupport) { - Utils.checkNotNull(resourceSchemaSupport, "resourceSchemaSupport"); - this.resourceSchemaSupport = Optional.ofNullable(resourceSchemaSupport); - return this; - } - - public Connection withResourceSchemaSupport(Optional> resourceSchemaSupport) { - Utils.checkNotNull(resourceSchemaSupport, "resourceSchemaSupport"); + public Connection withResourceSchemaSupport(@Nullable List resourceSchemaSupport) { this.resourceSchemaSupport = resourceSchemaSupport; return this; } - public Connection withResourceSettingsSupport(List resourceSettingsSupport) { - Utils.checkNotNull(resourceSettingsSupport, "resourceSettingsSupport"); - this.resourceSettingsSupport = Optional.ofNullable(resourceSettingsSupport); - return this; - } - - public Connection withResourceSettingsSupport(Optional> resourceSettingsSupport) { - Utils.checkNotNull(resourceSettingsSupport, "resourceSettingsSupport"); + public Connection withResourceSettingsSupport(@Nullable List resourceSettingsSupport) { this.resourceSettingsSupport = resourceSettingsSupport; return this; } - public Connection withValidationSupport(boolean validationSupport) { - Utils.checkNotNull(validationSupport, "validationSupport"); - this.validationSupport = Optional.ofNullable(validationSupport); - return this; - } - - public Connection withValidationSupport(Optional validationSupport) { - Utils.checkNotNull(validationSupport, "validationSupport"); + public Connection withValidationSupport(@Nullable Boolean validationSupport) { this.validationSupport = validationSupport; return this; } - public Connection withSchemaSupport(boolean schemaSupport) { - Utils.checkNotNull(schemaSupport, "schemaSupport"); - this.schemaSupport = Optional.ofNullable(schemaSupport); - return this; - } - - public Connection withSchemaSupport(Optional schemaSupport) { - Utils.checkNotNull(schemaSupport, "schemaSupport"); + public Connection withSchemaSupport(@Nullable Boolean schemaSupport) { this.schemaSupport = schemaSupport; return this; } - /** - * List of settings that are required to be configured on integration before authorization can occur - */ - public Connection withSettingsRequiredForAuthorization(List settingsRequiredForAuthorization) { - Utils.checkNotNull(settingsRequiredForAuthorization, "settingsRequiredForAuthorization"); - this.settingsRequiredForAuthorization = Optional.ofNullable(settingsRequiredForAuthorization); - return this; - } - /** * List of settings that are required to be configured on integration before authorization can occur */ - public Connection withSettingsRequiredForAuthorization(Optional> settingsRequiredForAuthorization) { - Utils.checkNotNull(settingsRequiredForAuthorization, "settingsRequiredForAuthorization"); + public Connection withSettingsRequiredForAuthorization(@Nullable List settingsRequiredForAuthorization) { this.settingsRequiredForAuthorization = settingsRequiredForAuthorization; return this; } - public Connection withSubscriptions(List subscriptions) { - Utils.checkNotNull(subscriptions, "subscriptions"); - this.subscriptions = Optional.ofNullable(subscriptions); - return this; - } - - public Connection withSubscriptions(Optional> subscriptions) { - Utils.checkNotNull(subscriptions, "subscriptions"); + public Connection withSubscriptions(@Nullable List subscriptions) { this.subscriptions = subscriptions; return this; } - /** - * Whether the connector has a guide available in the developer docs or not (https://docs.apideck.com/connectors/{service_id}/docs/consumer+connection). - */ - public Connection withHasGuide(boolean hasGuide) { - Utils.checkNotNull(hasGuide, "hasGuide"); - this.hasGuide = Optional.ofNullable(hasGuide); - return this; - } - /** * Whether the connector has a guide available in the developer docs or not (https://docs.apideck.com/connectors/{service_id}/docs/consumer+connection). */ - public Connection withHasGuide(Optional hasGuide) { - Utils.checkNotNull(hasGuide, "hasGuide"); + public Connection withHasGuide(@Nullable Boolean hasGuide) { this.hasGuide = hasGuide; return this; } - public Connection withCreatedAt(double createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - public Connection withCreatedAt(Optional createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Connection withCreatedAt(@Nullable Double createdAt) { this.createdAt = createdAt; return this; } - /** - * List of custom mappings configured for this connection - */ - public Connection withCustomMappings(List customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = Optional.ofNullable(customMappings); - return this; - } - /** * List of custom mappings configured for this connection */ - public Connection withCustomMappings(Optional> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Connection withCustomMappings(@Nullable List customMappings) { this.customMappings = customMappings; return this; } - public Connection withUpdatedAt(double updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + + public Connection withUpdatedAt(@Nullable Double updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - public Connection withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -1190,603 +842,291 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional name = Optional.empty(); + private String name; - private Optional tagLine = Optional.empty(); + private String tagLine; - private Optional unifiedApi = Optional.empty(); + private String unifiedApi; - private Optional state = Optional.empty(); + private ConnectionState state; - private Optional integrationState = Optional.empty(); + private IntegrationState integrationState; - private Optional authType = Optional.empty(); + private AuthType authType; - private Optional oauthGrantType = Optional.empty(); + private OAuthGrantType oauthGrantType; - private Optional status = Optional.empty(); + private ConnectionStatus status; - private Optional enabled = Optional.empty(); + private Boolean enabled; - private Optional website = Optional.empty(); + private String website; - private Optional icon = Optional.empty(); + private String icon; - private Optional logo = Optional.empty(); + private String logo; - private JsonNullable authorizeUrl = JsonNullable.undefined(); + private JsonNullable authorizeUrl; - private JsonNullable revokeUrl = JsonNullable.undefined(); + private JsonNullable revokeUrl; - private JsonNullable> settings = JsonNullable.undefined(); + private JsonNullable> settings; - private JsonNullable> metadata = JsonNullable.undefined(); + private JsonNullable> metadata; - private Optional> formFields = Optional.empty(); + private List formFields; - private Optional> configuration = Optional.empty(); + private List configuration; - private Optional> configurableResources = Optional.empty(); + private List configurableResources; - private Optional> resourceSchemaSupport = Optional.empty(); + private List resourceSchemaSupport; - private Optional> resourceSettingsSupport = Optional.empty(); + private List resourceSettingsSupport; - private Optional validationSupport = Optional.empty(); + private Boolean validationSupport; - private Optional schemaSupport = Optional.empty(); + private Boolean schemaSupport; - private Optional> settingsRequiredForAuthorization = Optional.empty(); + private List settingsRequiredForAuthorization; - private Optional> subscriptions = Optional.empty(); + private List subscriptions; - private Optional hasGuide = Optional.empty(); + private Boolean hasGuide; - private Optional createdAt = Optional.empty(); + private Double createdAt; - private Optional> customMappings = Optional.empty(); + private List customMappings; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; private Builder() { // force use of static builder() method } - - /** - * The unique identifier of the connection. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The unique identifier of the connection. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * The ID of the service this connection belongs to. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * The ID of the service this connection belongs to. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The name of the connection */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * The name of the connection - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - public Builder tagLine(String tagLine) { - Utils.checkNotNull(tagLine, "tagLine"); - this.tagLine = Optional.ofNullable(tagLine); - return this; - } - - public Builder tagLine(Optional tagLine) { - Utils.checkNotNull(tagLine, "tagLine"); + public Builder tagLine(@Nullable String tagLine) { this.tagLine = tagLine; return this; } - - /** - * The unified API category where the connection belongs to. - */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = Optional.ofNullable(unifiedApi); - return this; - } - /** * The unified API category where the connection belongs to. */ - public Builder unifiedApi(Optional unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); + public Builder unifiedApi(@Nullable String unifiedApi) { this.unifiedApi = unifiedApi; return this; } - - /** - * [Connection state flow](#section/Connection-state) - */ - public Builder state(ConnectionState state) { - Utils.checkNotNull(state, "state"); - this.state = Optional.ofNullable(state); - return this; - } - /** * [Connection state flow](#section/Connection-state) */ - public Builder state(Optional state) { - Utils.checkNotNull(state, "state"); + public Builder state(@Nullable ConnectionState state) { this.state = state; return this; } - /** * The current state of the Integration. */ - public Builder integrationState(IntegrationState integrationState) { - Utils.checkNotNull(integrationState, "integrationState"); - this.integrationState = Optional.ofNullable(integrationState); - return this; - } - - /** - * The current state of the Integration. - */ - public Builder integrationState(Optional integrationState) { - Utils.checkNotNull(integrationState, "integrationState"); + public Builder integrationState(@Nullable IntegrationState integrationState) { this.integrationState = integrationState; return this; } - /** * Type of authorization used by the connector */ - public Builder authType(AuthType authType) { - Utils.checkNotNull(authType, "authType"); - this.authType = Optional.ofNullable(authType); - return this; - } - - /** - * Type of authorization used by the connector - */ - public Builder authType(Optional authType) { - Utils.checkNotNull(authType, "authType"); + public Builder authType(@Nullable AuthType authType) { this.authType = authType; return this; } - - /** - * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types - */ - public Builder oauthGrantType(OAuthGrantType oauthGrantType) { - Utils.checkNotNull(oauthGrantType, "oauthGrantType"); - this.oauthGrantType = Optional.ofNullable(oauthGrantType); - return this; - } - /** * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types */ - public Builder oauthGrantType(Optional oauthGrantType) { - Utils.checkNotNull(oauthGrantType, "oauthGrantType"); + public Builder oauthGrantType(@Nullable OAuthGrantType oauthGrantType) { this.oauthGrantType = oauthGrantType; return this; } - /** * Status of the connection. */ - public Builder status(ConnectionStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * Status of the connection. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ConnectionStatus status) { this.status = status; return this; } - - /** - * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. - */ - public Builder enabled(boolean enabled) { - Utils.checkNotNull(enabled, "enabled"); - this.enabled = Optional.ofNullable(enabled); - return this; - } - /** * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. */ - public Builder enabled(Optional enabled) { - Utils.checkNotNull(enabled, "enabled"); + public Builder enabled(@Nullable Boolean enabled) { this.enabled = enabled; return this; } - /** * The website URL of the connection */ - public Builder website(String website) { - Utils.checkNotNull(website, "website"); - this.website = Optional.ofNullable(website); - return this; - } - - /** - * The website URL of the connection - */ - public Builder website(Optional website) { - Utils.checkNotNull(website, "website"); + public Builder website(@Nullable String website) { this.website = website; return this; } - /** * A visual icon of the connection, that will be shown in the Vault */ - public Builder icon(String icon) { - Utils.checkNotNull(icon, "icon"); - this.icon = Optional.ofNullable(icon); - return this; - } - - /** - * A visual icon of the connection, that will be shown in the Vault - */ - public Builder icon(Optional icon) { - Utils.checkNotNull(icon, "icon"); + public Builder icon(@Nullable String icon) { this.icon = icon; return this; } - /** * The logo of the connection, that will be shown in the Vault */ - public Builder logo(String logo) { - Utils.checkNotNull(logo, "logo"); - this.logo = Optional.ofNullable(logo); - return this; - } - - /** - * The logo of the connection, that will be shown in the Vault - */ - public Builder logo(Optional logo) { - Utils.checkNotNull(logo, "logo"); + public Builder logo(@Nullable String logo) { this.logo = logo; return this; } - /** * The OAuth redirect URI. Redirect your users to this URI to let them authorize your app in the connector's UI. Before you can use this URI, you must add `redirect_uri` as a query parameter to the `authorize_url`. Be sure to URL encode the `redirect_uri` part. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. */ - public Builder authorizeUrl(String authorizeUrl) { - Utils.checkNotNull(authorizeUrl, "authorizeUrl"); + public Builder authorizeUrl(@Nullable String authorizeUrl) { this.authorizeUrl = JsonNullable.of(authorizeUrl); return this; } - /** - * The OAuth redirect URI. Redirect your users to this URI to let them authorize your app in the connector's UI. Before you can use this URI, you must add `redirect_uri` as a query parameter to the `authorize_url`. Be sure to URL encode the `redirect_uri` part. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. - */ - public Builder authorizeUrl(JsonNullable authorizeUrl) { - Utils.checkNotNull(authorizeUrl, "authorizeUrl"); - this.authorizeUrl = authorizeUrl; - return this; - } - - /** * The OAuth revoke URI. Redirect your users to this URI to revoke this connection. Before you can use this URI, you must add `redirect_uri` as a query parameter. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. */ - public Builder revokeUrl(String revokeUrl) { - Utils.checkNotNull(revokeUrl, "revokeUrl"); + public Builder revokeUrl(@Nullable String revokeUrl) { this.revokeUrl = JsonNullable.of(revokeUrl); return this; } - /** - * The OAuth revoke URI. Redirect your users to this URI to revoke this connection. Before you can use this URI, you must add `redirect_uri` as a query parameter. Your users will be redirected to this `redirect_uri` after they granted access to your app in the connector's UI. - */ - public Builder revokeUrl(JsonNullable revokeUrl) { - Utils.checkNotNull(revokeUrl, "revokeUrl"); - this.revokeUrl = revokeUrl; - return this; - } - - /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - public Builder settings(Map settings) { - Utils.checkNotNull(settings, "settings"); + public Builder settings(@Nullable Map settings) { this.settings = JsonNullable.of(settings); return this; } - /** - * Connection settings. Values will persist to `form_fields` with corresponding id - */ - public Builder settings(JsonNullable> settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = settings; - return this; - } - - /** * Attach your own consumer specific metadata */ - public Builder metadata(Map metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Builder metadata(@Nullable Map metadata) { this.metadata = JsonNullable.of(metadata); return this; } - /** - * Attach your own consumer specific metadata - */ - public Builder metadata(JsonNullable> metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = metadata; - return this; - } - - /** * The settings that are wanted to create a connection. */ - public Builder formFields(List formFields) { - Utils.checkNotNull(formFields, "formFields"); - this.formFields = Optional.ofNullable(formFields); - return this; - } - - /** - * The settings that are wanted to create a connection. - */ - public Builder formFields(Optional> formFields) { - Utils.checkNotNull(formFields, "formFields"); + public Builder formFields(@Nullable List formFields) { this.formFields = formFields; return this; } - - public Builder configuration(List configuration) { - Utils.checkNotNull(configuration, "configuration"); - this.configuration = Optional.ofNullable(configuration); - return this; - } - - public Builder configuration(Optional> configuration) { - Utils.checkNotNull(configuration, "configuration"); + public Builder configuration(@Nullable List configuration) { this.configuration = configuration; return this; } - - public Builder configurableResources(List configurableResources) { - Utils.checkNotNull(configurableResources, "configurableResources"); - this.configurableResources = Optional.ofNullable(configurableResources); - return this; - } - - public Builder configurableResources(Optional> configurableResources) { - Utils.checkNotNull(configurableResources, "configurableResources"); + public Builder configurableResources(@Nullable List configurableResources) { this.configurableResources = configurableResources; return this; } - - public Builder resourceSchemaSupport(List resourceSchemaSupport) { - Utils.checkNotNull(resourceSchemaSupport, "resourceSchemaSupport"); - this.resourceSchemaSupport = Optional.ofNullable(resourceSchemaSupport); - return this; - } - - public Builder resourceSchemaSupport(Optional> resourceSchemaSupport) { - Utils.checkNotNull(resourceSchemaSupport, "resourceSchemaSupport"); + public Builder resourceSchemaSupport(@Nullable List resourceSchemaSupport) { this.resourceSchemaSupport = resourceSchemaSupport; return this; } - - public Builder resourceSettingsSupport(List resourceSettingsSupport) { - Utils.checkNotNull(resourceSettingsSupport, "resourceSettingsSupport"); - this.resourceSettingsSupport = Optional.ofNullable(resourceSettingsSupport); - return this; - } - - public Builder resourceSettingsSupport(Optional> resourceSettingsSupport) { - Utils.checkNotNull(resourceSettingsSupport, "resourceSettingsSupport"); + public Builder resourceSettingsSupport(@Nullable List resourceSettingsSupport) { this.resourceSettingsSupport = resourceSettingsSupport; return this; } - - public Builder validationSupport(boolean validationSupport) { - Utils.checkNotNull(validationSupport, "validationSupport"); - this.validationSupport = Optional.ofNullable(validationSupport); - return this; - } - - public Builder validationSupport(Optional validationSupport) { - Utils.checkNotNull(validationSupport, "validationSupport"); + public Builder validationSupport(@Nullable Boolean validationSupport) { this.validationSupport = validationSupport; return this; } - - public Builder schemaSupport(boolean schemaSupport) { - Utils.checkNotNull(schemaSupport, "schemaSupport"); - this.schemaSupport = Optional.ofNullable(schemaSupport); - return this; - } - - public Builder schemaSupport(Optional schemaSupport) { - Utils.checkNotNull(schemaSupport, "schemaSupport"); + public Builder schemaSupport(@Nullable Boolean schemaSupport) { this.schemaSupport = schemaSupport; return this; } - /** * List of settings that are required to be configured on integration before authorization can occur */ - public Builder settingsRequiredForAuthorization(List settingsRequiredForAuthorization) { - Utils.checkNotNull(settingsRequiredForAuthorization, "settingsRequiredForAuthorization"); - this.settingsRequiredForAuthorization = Optional.ofNullable(settingsRequiredForAuthorization); - return this; - } - - /** - * List of settings that are required to be configured on integration before authorization can occur - */ - public Builder settingsRequiredForAuthorization(Optional> settingsRequiredForAuthorization) { - Utils.checkNotNull(settingsRequiredForAuthorization, "settingsRequiredForAuthorization"); + public Builder settingsRequiredForAuthorization(@Nullable List settingsRequiredForAuthorization) { this.settingsRequiredForAuthorization = settingsRequiredForAuthorization; return this; } - - public Builder subscriptions(List subscriptions) { - Utils.checkNotNull(subscriptions, "subscriptions"); - this.subscriptions = Optional.ofNullable(subscriptions); - return this; - } - - public Builder subscriptions(Optional> subscriptions) { - Utils.checkNotNull(subscriptions, "subscriptions"); + public Builder subscriptions(@Nullable List subscriptions) { this.subscriptions = subscriptions; return this; } - - /** - * Whether the connector has a guide available in the developer docs or not (https://docs.apideck.com/connectors/{service_id}/docs/consumer+connection). - */ - public Builder hasGuide(boolean hasGuide) { - Utils.checkNotNull(hasGuide, "hasGuide"); - this.hasGuide = Optional.ofNullable(hasGuide); - return this; - } - /** * Whether the connector has a guide available in the developer docs or not (https://docs.apideck.com/connectors/{service_id}/docs/consumer+connection). */ - public Builder hasGuide(Optional hasGuide) { - Utils.checkNotNull(hasGuide, "hasGuide"); + public Builder hasGuide(@Nullable Boolean hasGuide) { this.hasGuide = hasGuide; return this; } - - public Builder createdAt(double createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - public Builder createdAt(Optional createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable Double createdAt) { this.createdAt = createdAt; return this; } - /** * List of custom mappings configured for this connection */ - public Builder customMappings(List customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = Optional.ofNullable(customMappings); - return this; - } - - /** - * List of custom mappings configured for this connection - */ - public Builder customMappings(Optional> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable List customMappings) { this.customMappings = customMappings; return this; } - - public Builder updatedAt(double updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable Double updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - public Connection build() { - return new Connection( id, serviceId, name, tagLine, unifiedApi, state, diff --git a/src/main/java/com/apideck/unify/models/components/ConnectionConfiguration.java b/src/main/java/com/apideck/unify/models/components/ConnectionConfiguration.java index b3846f16..b3c20289 100644 --- a/src/main/java/com/apideck/unify/models/components/ConnectionConfiguration.java +++ b/src/main/java/com/apideck/unify/models/components/ConnectionConfiguration.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -20,36 +19,31 @@ public class ConnectionConfiguration { @JsonInclude(Include.NON_ABSENT) @JsonProperty("resource") - private Optional resource; + private String resource; @JsonInclude(Include.NON_ABSENT) @JsonProperty("defaults") - private Optional> defaults; + private List defaults; @JsonCreator public ConnectionConfiguration( - @JsonProperty("resource") Optional resource, - @JsonProperty("defaults") Optional> defaults) { - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(defaults, "defaults"); + @JsonProperty("resource") @Nullable String resource, + @JsonProperty("defaults") @Nullable List defaults) { this.resource = resource; this.defaults = defaults; } public ConnectionConfiguration() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @JsonIgnore public Optional resource() { - return resource; + return Optional.ofNullable(this.resource); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> defaults() { - return (Optional>) defaults; + return Optional.ofNullable(this.defaults); } public static Builder builder() { @@ -57,32 +51,18 @@ public static Builder builder() { } - public ConnectionConfiguration withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = Optional.ofNullable(resource); - return this; - } - - - public ConnectionConfiguration withResource(Optional resource) { - Utils.checkNotNull(resource, "resource"); + public ConnectionConfiguration withResource(@Nullable String resource) { this.resource = resource; return this; } - public ConnectionConfiguration withDefaults(List defaults) { - Utils.checkNotNull(defaults, "defaults"); - this.defaults = Optional.ofNullable(defaults); - return this; - } - - public ConnectionConfiguration withDefaults(Optional> defaults) { - Utils.checkNotNull(defaults, "defaults"); + public ConnectionConfiguration withDefaults(@Nullable List defaults) { this.defaults = defaults; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -113,42 +93,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional resource = Optional.empty(); + private String resource; - private Optional> defaults = Optional.empty(); + private List defaults; private Builder() { // force use of static builder() method } - - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = Optional.ofNullable(resource); - return this; - } - - public Builder resource(Optional resource) { - Utils.checkNotNull(resource, "resource"); + public Builder resource(@Nullable String resource) { this.resource = resource; return this; } - - public Builder defaults(List defaults) { - Utils.checkNotNull(defaults, "defaults"); - this.defaults = Optional.ofNullable(defaults); - return this; - } - - public Builder defaults(Optional> defaults) { - Utils.checkNotNull(defaults, "defaults"); + public Builder defaults(@Nullable List defaults) { this.defaults = defaults; return this; } public ConnectionConfiguration build() { - return new ConnectionConfiguration( resource, defaults); } diff --git a/src/main/java/com/apideck/unify/models/components/ConnectionDefaults.java b/src/main/java/com/apideck/unify/models/components/ConnectionDefaults.java index 62753051..17dd952f 100644 --- a/src/main/java/com/apideck/unify/models/components/ConnectionDefaults.java +++ b/src/main/java/com/apideck/unify/models/components/ConnectionDefaults.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -20,50 +19,42 @@ public class ConnectionDefaults { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonInclude(Include.NON_ABSENT) @JsonProperty("options") - private Optional> options; + private List options; @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private ConnectionValue value; @JsonCreator public ConnectionDefaults( - @JsonProperty("id") Optional id, - @JsonProperty("options") Optional> options, - @JsonProperty("value") Optional value) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(options, "options"); - Utils.checkNotNull(value, "value"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("options") @Nullable List options, + @JsonProperty("value") @Nullable ConnectionValue value) { this.id = id; this.options = options; this.value = value; } public ConnectionDefaults() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> options() { - return (Optional>) options; + return Optional.ofNullable(this.options); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional value() { - return (Optional) value; + return Optional.ofNullable(this.value); } public static Builder builder() { @@ -71,45 +62,24 @@ public static Builder builder() { } - public ConnectionDefaults withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - public ConnectionDefaults withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ConnectionDefaults withId(@Nullable String id) { this.id = id; return this; } - public ConnectionDefaults withOptions(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - - public ConnectionDefaults withOptions(Optional> options) { - Utils.checkNotNull(options, "options"); + public ConnectionDefaults withOptions(@Nullable List options) { this.options = options; return this; } - public ConnectionDefaults withValue(ConnectionValue value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - - public ConnectionDefaults withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public ConnectionDefaults withValue(@Nullable ConnectionValue value) { this.value = value; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,57 +112,32 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional> options = Optional.empty(); + private List options; - private Optional value = Optional.empty(); + private ConnectionValue value; private Builder() { // force use of static builder() method } - - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - public Builder options(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - - public Builder options(Optional> options) { - Utils.checkNotNull(options, "options"); + public Builder options(@Nullable List options) { this.options = options; return this; } - - public Builder value(ConnectionValue value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable ConnectionValue value) { this.value = value; return this; } public ConnectionDefaults build() { - return new ConnectionDefaults( id, options, value); } diff --git a/src/main/java/com/apideck/unify/models/components/ConnectionImportData.java b/src/main/java/com/apideck/unify/models/components/ConnectionImportData.java index 73e0884a..ca2aacf9 100644 --- a/src/main/java/com/apideck/unify/models/components/ConnectionImportData.java +++ b/src/main/java/com/apideck/unify/models/components/ConnectionImportData.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -22,61 +21,54 @@ public class ConnectionImportData { @JsonInclude(Include.NON_ABSENT) @JsonProperty("credentials") - private Optional credentials; + private Credentials credentials; /** * Connection settings. Values will persist to `form_fields` with corresponding id */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("settings") - private JsonNullable> settings; + private JsonNullable> settings; /** * Attach your own consumer specific metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("metadata") - private JsonNullable> metadata; + private JsonNullable> metadata; @JsonCreator public ConnectionImportData( - @JsonProperty("credentials") Optional credentials, - @JsonProperty("settings") JsonNullable> settings, - @JsonProperty("metadata") JsonNullable> metadata) { - Utils.checkNotNull(credentials, "credentials"); - Utils.checkNotNull(settings, "settings"); - Utils.checkNotNull(metadata, "metadata"); + @JsonProperty("credentials") @Nullable Credentials credentials, + @JsonProperty("settings") @Nullable JsonNullable> settings, + @JsonProperty("metadata") @Nullable JsonNullable> metadata) { this.credentials = credentials; - this.settings = settings; - this.metadata = metadata; + this.settings = Optional.ofNullable(settings) + .orElse(JsonNullable.undefined()); + this.metadata = Optional.ofNullable(metadata) + .orElse(JsonNullable.undefined()); } public ConnectionImportData() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional credentials() { - return (Optional) credentials; + return Optional.ofNullable(this.credentials); } /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> settings() { - return (JsonNullable>) settings; + return this.settings; } /** * Attach your own consumer specific metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> metadata() { - return (JsonNullable>) metadata; + return this.metadata; } public static Builder builder() { @@ -84,54 +76,29 @@ public static Builder builder() { } - public ConnectionImportData withCredentials(Credentials credentials) { - Utils.checkNotNull(credentials, "credentials"); - this.credentials = Optional.ofNullable(credentials); - return this; - } - - - public ConnectionImportData withCredentials(Optional credentials) { - Utils.checkNotNull(credentials, "credentials"); + public ConnectionImportData withCredentials(@Nullable Credentials credentials) { this.credentials = credentials; return this; } + /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - public ConnectionImportData withSettings(Map settings) { - Utils.checkNotNull(settings, "settings"); + public ConnectionImportData withSettings(@Nullable Map settings) { this.settings = JsonNullable.of(settings); return this; } - /** - * Connection settings. Values will persist to `form_fields` with corresponding id - */ - public ConnectionImportData withSettings(JsonNullable> settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = settings; - return this; - } /** * Attach your own consumer specific metadata */ - public ConnectionImportData withMetadata(Map metadata) { - Utils.checkNotNull(metadata, "metadata"); + public ConnectionImportData withMetadata(@Nullable Map metadata) { this.metadata = JsonNullable.of(metadata); return this; } - /** - * Attach your own consumer specific metadata - */ - public ConnectionImportData withMetadata(JsonNullable> metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = metadata; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -165,69 +132,38 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional credentials = Optional.empty(); + private Credentials credentials; - private JsonNullable> settings = JsonNullable.undefined(); + private JsonNullable> settings; - private JsonNullable> metadata = JsonNullable.undefined(); + private JsonNullable> metadata; private Builder() { // force use of static builder() method } - - public Builder credentials(Credentials credentials) { - Utils.checkNotNull(credentials, "credentials"); - this.credentials = Optional.ofNullable(credentials); - return this; - } - - public Builder credentials(Optional credentials) { - Utils.checkNotNull(credentials, "credentials"); + public Builder credentials(@Nullable Credentials credentials) { this.credentials = credentials; return this; } - /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - public Builder settings(Map settings) { - Utils.checkNotNull(settings, "settings"); + public Builder settings(@Nullable Map settings) { this.settings = JsonNullable.of(settings); return this; } - /** - * Connection settings. Values will persist to `form_fields` with corresponding id - */ - public Builder settings(JsonNullable> settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = settings; - return this; - } - - /** * Attach your own consumer specific metadata */ - public Builder metadata(Map metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Builder metadata(@Nullable Map metadata) { this.metadata = JsonNullable.of(metadata); return this; } - /** - * Attach your own consumer specific metadata - */ - public Builder metadata(JsonNullable> metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = metadata; - return this; - } - public ConnectionImportData build() { - return new ConnectionImportData( credentials, settings, metadata); } diff --git a/src/main/java/com/apideck/unify/models/components/ConnectionInput.java b/src/main/java/com/apideck/unify/models/components/ConnectionInput.java index 9b590a80..18440aef 100644 --- a/src/main/java/com/apideck/unify/models/components/ConnectionInput.java +++ b/src/main/java/com/apideck/unify/models/components/ConnectionInput.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -26,97 +25,85 @@ public class ConnectionInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("enabled") - private Optional enabled; + private Boolean enabled; /** * Connection settings. Values will persist to `form_fields` with corresponding id */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("settings") - private JsonNullable> settings; + private JsonNullable> settings; /** * Attach your own consumer specific metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("metadata") - private JsonNullable> metadata; + private JsonNullable> metadata; @JsonInclude(Include.NON_ABSENT) @JsonProperty("configuration") - private Optional> configuration; + private List configuration; /** * List of custom mappings configured for this connection */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private Optional> customMappings; + private List customMappings; @JsonCreator public ConnectionInput( - @JsonProperty("enabled") Optional enabled, - @JsonProperty("settings") JsonNullable> settings, - @JsonProperty("metadata") JsonNullable> metadata, - @JsonProperty("configuration") Optional> configuration, - @JsonProperty("custom_mappings") Optional> customMappings) { - Utils.checkNotNull(enabled, "enabled"); - Utils.checkNotNull(settings, "settings"); - Utils.checkNotNull(metadata, "metadata"); - Utils.checkNotNull(configuration, "configuration"); - Utils.checkNotNull(customMappings, "customMappings"); + @JsonProperty("enabled") @Nullable Boolean enabled, + @JsonProperty("settings") @Nullable JsonNullable> settings, + @JsonProperty("metadata") @Nullable JsonNullable> metadata, + @JsonProperty("configuration") @Nullable List configuration, + @JsonProperty("custom_mappings") @Nullable List customMappings) { this.enabled = enabled; - this.settings = settings; - this.metadata = metadata; + this.settings = Optional.ofNullable(settings) + .orElse(JsonNullable.undefined()); + this.metadata = Optional.ofNullable(metadata) + .orElse(JsonNullable.undefined()); this.configuration = configuration; this.customMappings = customMappings; } public ConnectionInput() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. */ - @JsonIgnore public Optional enabled() { - return enabled; + return Optional.ofNullable(this.enabled); } /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> settings() { - return (JsonNullable>) settings; + return this.settings; } /** * Attach your own consumer specific metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> metadata() { - return (JsonNullable>) metadata; + return this.metadata; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> configuration() { - return (Optional>) configuration; + return Optional.ofNullable(this.configuration); } /** * List of custom mappings configured for this connection */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customMappings() { - return (Optional>) customMappings; + return Optional.ofNullable(this.customMappings); } public static Builder builder() { @@ -127,90 +114,45 @@ public static Builder builder() { /** * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. */ - public ConnectionInput withEnabled(boolean enabled) { - Utils.checkNotNull(enabled, "enabled"); - this.enabled = Optional.ofNullable(enabled); - return this; - } - - - /** - * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. - */ - public ConnectionInput withEnabled(Optional enabled) { - Utils.checkNotNull(enabled, "enabled"); + public ConnectionInput withEnabled(@Nullable Boolean enabled) { this.enabled = enabled; return this; } + /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - public ConnectionInput withSettings(Map settings) { - Utils.checkNotNull(settings, "settings"); + public ConnectionInput withSettings(@Nullable Map settings) { this.settings = JsonNullable.of(settings); return this; } - /** - * Connection settings. Values will persist to `form_fields` with corresponding id - */ - public ConnectionInput withSettings(JsonNullable> settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = settings; - return this; - } /** * Attach your own consumer specific metadata */ - public ConnectionInput withMetadata(Map metadata) { - Utils.checkNotNull(metadata, "metadata"); + public ConnectionInput withMetadata(@Nullable Map metadata) { this.metadata = JsonNullable.of(metadata); return this; } - /** - * Attach your own consumer specific metadata - */ - public ConnectionInput withMetadata(JsonNullable> metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = metadata; - return this; - } - - public ConnectionInput withConfiguration(List configuration) { - Utils.checkNotNull(configuration, "configuration"); - this.configuration = Optional.ofNullable(configuration); - return this; - } - - public ConnectionInput withConfiguration(Optional> configuration) { - Utils.checkNotNull(configuration, "configuration"); + public ConnectionInput withConfiguration(@Nullable List configuration) { this.configuration = configuration; return this; } - /** - * List of custom mappings configured for this connection - */ - public ConnectionInput withCustomMappings(List customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = Optional.ofNullable(customMappings); - return this; - } - /** * List of custom mappings configured for this connection */ - public ConnectionInput withCustomMappings(Optional> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public ConnectionInput withCustomMappings(@Nullable List customMappings) { this.customMappings = customMappings; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -248,111 +190,58 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional enabled = Optional.empty(); + private Boolean enabled; - private JsonNullable> settings = JsonNullable.undefined(); + private JsonNullable> settings; - private JsonNullable> metadata = JsonNullable.undefined(); + private JsonNullable> metadata; - private Optional> configuration = Optional.empty(); + private List configuration; - private Optional> customMappings = Optional.empty(); + private List customMappings; private Builder() { // force use of static builder() method } - - /** - * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. - */ - public Builder enabled(boolean enabled) { - Utils.checkNotNull(enabled, "enabled"); - this.enabled = Optional.ofNullable(enabled); - return this; - } - /** * Whether the connection is enabled or not. You can enable or disable a connection using the Update Connection API. */ - public Builder enabled(Optional enabled) { - Utils.checkNotNull(enabled, "enabled"); + public Builder enabled(@Nullable Boolean enabled) { this.enabled = enabled; return this; } - /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - public Builder settings(Map settings) { - Utils.checkNotNull(settings, "settings"); + public Builder settings(@Nullable Map settings) { this.settings = JsonNullable.of(settings); return this; } - /** - * Connection settings. Values will persist to `form_fields` with corresponding id - */ - public Builder settings(JsonNullable> settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = settings; - return this; - } - - /** * Attach your own consumer specific metadata */ - public Builder metadata(Map metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Builder metadata(@Nullable Map metadata) { this.metadata = JsonNullable.of(metadata); return this; } - /** - * Attach your own consumer specific metadata - */ - public Builder metadata(JsonNullable> metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = metadata; - return this; - } - - - public Builder configuration(List configuration) { - Utils.checkNotNull(configuration, "configuration"); - this.configuration = Optional.ofNullable(configuration); - return this; - } - - public Builder configuration(Optional> configuration) { - Utils.checkNotNull(configuration, "configuration"); + public Builder configuration(@Nullable List configuration) { this.configuration = configuration; return this; } - /** * List of custom mappings configured for this connection */ - public Builder customMappings(List customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = Optional.ofNullable(customMappings); - return this; - } - - /** - * List of custom mappings configured for this connection - */ - public Builder customMappings(Optional> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable List customMappings) { this.customMappings = customMappings; return this; } public ConnectionInput build() { - return new ConnectionInput( enabled, settings, metadata, configuration, customMappings); diff --git a/src/main/java/com/apideck/unify/models/components/Connector.java b/src/main/java/com/apideck/unify/models/components/Connector.java index ff89ec70..b03226a8 100644 --- a/src/main/java/com/apideck/unify/models/components/Connector.java +++ b/src/main/java/com/apideck/unify/models/components/Connector.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,21 +23,21 @@ public class Connector { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Name of the connector. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Status of the connector. Connectors with status live or beta are callable. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private ConnectorStatus status; /** * A description of the object. @@ -52,225 +51,198 @@ public class Connector { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("icon_url") - private Optional iconUrl; + private String iconUrl; /** * Link to the full logo for the connector. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("logo_url") - private Optional logoUrl; + private String logoUrl; /** * Link to the connector's website. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("website_url") - private Optional websiteUrl; + private String websiteUrl; /** * Link to the connector's signup page. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("signup_url") - private Optional signupUrl; + private String signupUrl; /** * Link to the connector's partner program signup page. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("partner_signup_url") - private Optional partnerSignupUrl; + private String partnerSignupUrl; /** * Set to `true` when the connector offers a free trial. Use `signup_url` to sign up for a free trial */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("free_trial_available") - private Optional freeTrialAvailable; + private Boolean freeTrialAvailable; /** * Type of authorization used by the connector */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("auth_type") - private Optional authType; + private ConnectorAuthType authType; /** * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("auth_only") - private Optional authOnly; + private Boolean authOnly; /** * Set to `true` when connector was implemented from downstream docs only and without API access. This state indicates that integration will require Apideck support, and access to downstream API to validate mapping quality. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("blind_mapped") - private Optional blindMapped; + private Boolean blindMapped; /** * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("oauth_grant_type") - private Optional oauthGrantType; + private ConnectorOauthGrantType oauthGrantType; /** * Location of the OAuth client credentials. For most connectors the OAuth client credentials are stored on integration and managed by the application owner. For others they are stored on connection and managed by the consumer in Vault. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("oauth_credentials_source") - private Optional oauthCredentialsSource; + private OauthCredentialsSource oauthCredentialsSource; /** * List of OAuth Scopes available for this connector. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("oauth_scopes") - private Optional> oauthScopes; + private List oauthScopes; /** * Set to `true` when connector allows the definition of custom scopes. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_scopes") - private Optional customScopes; + private Boolean customScopes; /** * Indicates whether Apideck Sandbox OAuth credentials are available. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("has_sandbox_credentials") - private Optional hasSandboxCredentials; + private Boolean hasSandboxCredentials; @JsonInclude(Include.NON_ABSENT) @JsonProperty("settings") - private Optional> settings; + private List settings; /** * Service provider identifier */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("service_id") - private Optional serviceId; + private String serviceId; /** * List of Unified APIs that feature this connector. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("unified_apis") - private Optional> unifiedApis; + private List unifiedApis; /** * List of resources that are supported on the connector. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_resources") - private Optional> supportedResources; + private List supportedResources; /** * List of resources that have settings that can be configured. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("configurable_resources") - private Optional> configurableResources; + private List configurableResources; /** * List of events that are supported on the connector across all Unified APIs. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_events") - private Optional> supportedEvents; + private List supportedEvents; /** * How webhooks are supported for the connector. Sometimes the connector natively supports webhooks, other times Apideck virtualizes them based on polling. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("webhook_support") - private Optional webhookSupport; + private WebhookSupport webhookSupport; /** * When a connector has schema_support, a call can be made to retrieve a json schema that describes a downstream resource. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("schema_support") - private Optional schemaSupport; + private SchemaSupport schemaSupport; @JsonInclude(Include.NON_ABSENT) @JsonProperty("docs") - private Optional> docs; + private List docs; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tls_support") - private Optional tlsSupport; + private TlsSupport tlsSupport; @JsonCreator public Connector( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("status") Optional status, - @JsonProperty("description") JsonNullable description, - @JsonProperty("icon_url") Optional iconUrl, - @JsonProperty("logo_url") Optional logoUrl, - @JsonProperty("website_url") Optional websiteUrl, - @JsonProperty("signup_url") Optional signupUrl, - @JsonProperty("partner_signup_url") Optional partnerSignupUrl, - @JsonProperty("free_trial_available") Optional freeTrialAvailable, - @JsonProperty("auth_type") Optional authType, - @JsonProperty("auth_only") Optional authOnly, - @JsonProperty("blind_mapped") Optional blindMapped, - @JsonProperty("oauth_grant_type") Optional oauthGrantType, - @JsonProperty("oauth_credentials_source") Optional oauthCredentialsSource, - @JsonProperty("oauth_scopes") Optional> oauthScopes, - @JsonProperty("custom_scopes") Optional customScopes, - @JsonProperty("has_sandbox_credentials") Optional hasSandboxCredentials, - @JsonProperty("settings") Optional> settings, - @JsonProperty("service_id") Optional serviceId, - @JsonProperty("unified_apis") Optional> unifiedApis, - @JsonProperty("supported_resources") Optional> supportedResources, - @JsonProperty("configurable_resources") Optional> configurableResources, - @JsonProperty("supported_events") Optional> supportedEvents, - @JsonProperty("webhook_support") Optional webhookSupport, - @JsonProperty("schema_support") Optional schemaSupport, - @JsonProperty("docs") Optional> docs, - @JsonProperty("tls_support") Optional tlsSupport) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(iconUrl, "iconUrl"); - Utils.checkNotNull(logoUrl, "logoUrl"); - Utils.checkNotNull(websiteUrl, "websiteUrl"); - Utils.checkNotNull(signupUrl, "signupUrl"); - Utils.checkNotNull(partnerSignupUrl, "partnerSignupUrl"); - Utils.checkNotNull(freeTrialAvailable, "freeTrialAvailable"); - Utils.checkNotNull(authType, "authType"); - Utils.checkNotNull(authOnly, "authOnly"); - Utils.checkNotNull(blindMapped, "blindMapped"); - Utils.checkNotNull(oauthGrantType, "oauthGrantType"); - Utils.checkNotNull(oauthCredentialsSource, "oauthCredentialsSource"); - Utils.checkNotNull(oauthScopes, "oauthScopes"); - Utils.checkNotNull(customScopes, "customScopes"); - Utils.checkNotNull(hasSandboxCredentials, "hasSandboxCredentials"); - Utils.checkNotNull(settings, "settings"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(unifiedApis, "unifiedApis"); - Utils.checkNotNull(supportedResources, "supportedResources"); - Utils.checkNotNull(configurableResources, "configurableResources"); - Utils.checkNotNull(supportedEvents, "supportedEvents"); - Utils.checkNotNull(webhookSupport, "webhookSupport"); - Utils.checkNotNull(schemaSupport, "schemaSupport"); - Utils.checkNotNull(docs, "docs"); - Utils.checkNotNull(tlsSupport, "tlsSupport"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("status") @Nullable ConnectorStatus status, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("icon_url") @Nullable String iconUrl, + @JsonProperty("logo_url") @Nullable String logoUrl, + @JsonProperty("website_url") @Nullable String websiteUrl, + @JsonProperty("signup_url") @Nullable String signupUrl, + @JsonProperty("partner_signup_url") @Nullable String partnerSignupUrl, + @JsonProperty("free_trial_available") @Nullable Boolean freeTrialAvailable, + @JsonProperty("auth_type") @Nullable ConnectorAuthType authType, + @JsonProperty("auth_only") @Nullable Boolean authOnly, + @JsonProperty("blind_mapped") @Nullable Boolean blindMapped, + @JsonProperty("oauth_grant_type") @Nullable ConnectorOauthGrantType oauthGrantType, + @JsonProperty("oauth_credentials_source") @Nullable OauthCredentialsSource oauthCredentialsSource, + @JsonProperty("oauth_scopes") @Nullable List oauthScopes, + @JsonProperty("custom_scopes") @Nullable Boolean customScopes, + @JsonProperty("has_sandbox_credentials") @Nullable Boolean hasSandboxCredentials, + @JsonProperty("settings") @Nullable List settings, + @JsonProperty("service_id") @Nullable String serviceId, + @JsonProperty("unified_apis") @Nullable List unifiedApis, + @JsonProperty("supported_resources") @Nullable List supportedResources, + @JsonProperty("configurable_resources") @Nullable List configurableResources, + @JsonProperty("supported_events") @Nullable List supportedEvents, + @JsonProperty("webhook_support") @Nullable WebhookSupport webhookSupport, + @JsonProperty("schema_support") @Nullable SchemaSupport schemaSupport, + @JsonProperty("docs") @Nullable List docs, + @JsonProperty("tls_support") @Nullable TlsSupport tlsSupport) { this.id = id; this.name = name; this.status = status; - this.description = description; + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.iconUrl = iconUrl; this.logoUrl = logoUrl; this.websiteUrl = websiteUrl; @@ -298,245 +270,203 @@ public Connector( } public Connector() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * ID of the connector. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Name of the connector. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Status of the connector. Connectors with status live or beta are callable. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Link to a small square icon for the connector. */ - @JsonIgnore public Optional iconUrl() { - return iconUrl; + return Optional.ofNullable(this.iconUrl); } /** * Link to the full logo for the connector. */ - @JsonIgnore public Optional logoUrl() { - return logoUrl; + return Optional.ofNullable(this.logoUrl); } /** * Link to the connector's website. */ - @JsonIgnore public Optional websiteUrl() { - return websiteUrl; + return Optional.ofNullable(this.websiteUrl); } /** * Link to the connector's signup page. */ - @JsonIgnore public Optional signupUrl() { - return signupUrl; + return Optional.ofNullable(this.signupUrl); } /** * Link to the connector's partner program signup page. */ - @JsonIgnore public Optional partnerSignupUrl() { - return partnerSignupUrl; + return Optional.ofNullable(this.partnerSignupUrl); } /** * Set to `true` when the connector offers a free trial. Use `signup_url` to sign up for a free trial */ - @JsonIgnore public Optional freeTrialAvailable() { - return freeTrialAvailable; + return Optional.ofNullable(this.freeTrialAvailable); } /** * Type of authorization used by the connector */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional authType() { - return (Optional) authType; + return Optional.ofNullable(this.authType); } /** * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API */ - @JsonIgnore public Optional authOnly() { - return authOnly; + return Optional.ofNullable(this.authOnly); } /** * Set to `true` when connector was implemented from downstream docs only and without API access. This state indicates that integration will require Apideck support, and access to downstream API to validate mapping quality. */ - @JsonIgnore public Optional blindMapped() { - return blindMapped; + return Optional.ofNullable(this.blindMapped); } /** * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional oauthGrantType() { - return (Optional) oauthGrantType; + return Optional.ofNullable(this.oauthGrantType); } /** * Location of the OAuth client credentials. For most connectors the OAuth client credentials are stored on integration and managed by the application owner. For others they are stored on connection and managed by the consumer in Vault. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional oauthCredentialsSource() { - return (Optional) oauthCredentialsSource; + return Optional.ofNullable(this.oauthCredentialsSource); } /** * List of OAuth Scopes available for this connector. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> oauthScopes() { - return (Optional>) oauthScopes; + return Optional.ofNullable(this.oauthScopes); } /** * Set to `true` when connector allows the definition of custom scopes. */ - @JsonIgnore public Optional customScopes() { - return customScopes; + return Optional.ofNullable(this.customScopes); } /** * Indicates whether Apideck Sandbox OAuth credentials are available. */ - @JsonIgnore public Optional hasSandboxCredentials() { - return hasSandboxCredentials; + return Optional.ofNullable(this.hasSandboxCredentials); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> settings() { - return (Optional>) settings; + return Optional.ofNullable(this.settings); } /** * Service provider identifier */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * List of Unified APIs that feature this connector. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> unifiedApis() { - return (Optional>) unifiedApis; + return Optional.ofNullable(this.unifiedApis); } /** * List of resources that are supported on the connector. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedResources() { - return (Optional>) supportedResources; + return Optional.ofNullable(this.supportedResources); } /** * List of resources that have settings that can be configured. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> configurableResources() { - return (Optional>) configurableResources; + return Optional.ofNullable(this.configurableResources); } /** * List of events that are supported on the connector across all Unified APIs. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedEvents() { - return (Optional>) supportedEvents; + return Optional.ofNullable(this.supportedEvents); } /** * How webhooks are supported for the connector. Sometimes the connector natively supports webhooks, other times Apideck virtualizes them based on polling. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional webhookSupport() { - return (Optional) webhookSupport; + return Optional.ofNullable(this.webhookSupport); } /** * When a connector has schema_support, a call can be made to retrieve a json schema that describes a downstream resource. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional schemaSupport() { - return (Optional) schemaSupport; + return Optional.ofNullable(this.schemaSupport); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> docs() { - return (Optional>) docs; + return Optional.ofNullable(this.docs); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional tlsSupport() { - return (Optional) tlsSupport; + return Optional.ofNullable(this.tlsSupport); } public static Builder builder() { @@ -547,84 +477,35 @@ public static Builder builder() { /** * ID of the connector. */ - public Connector withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the connector. - */ - public Connector withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Connector withId(@Nullable String id) { this.id = id; return this; } - /** - * Name of the connector. - */ - public Connector withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the connector. */ - public Connector withName(Optional name) { - Utils.checkNotNull(name, "name"); + public Connector withName(@Nullable String name) { this.name = name; return this; } - /** - * Status of the connector. Connectors with status live or beta are callable. - */ - public Connector withStatus(ConnectorStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the connector. Connectors with status live or beta are callable. */ - public Connector withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public Connector withStatus(@Nullable ConnectorStatus status) { this.status = status; return this; } - /** - * A description of the object. - */ - public Connector withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = JsonNullable.of(description); - return this; - } /** * A description of the object. */ - public Connector withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * Link to a small square icon for the connector. - */ - public Connector withIconUrl(String iconUrl) { - Utils.checkNotNull(iconUrl, "iconUrl"); - this.iconUrl = Optional.ofNullable(iconUrl); + public Connector withDescription(@Nullable String description) { + this.description = JsonNullable.of(description); return this; } @@ -632,431 +513,210 @@ public Connector withIconUrl(String iconUrl) { /** * Link to a small square icon for the connector. */ - public Connector withIconUrl(Optional iconUrl) { - Utils.checkNotNull(iconUrl, "iconUrl"); + public Connector withIconUrl(@Nullable String iconUrl) { this.iconUrl = iconUrl; return this; } - /** - * Link to the full logo for the connector. - */ - public Connector withLogoUrl(String logoUrl) { - Utils.checkNotNull(logoUrl, "logoUrl"); - this.logoUrl = Optional.ofNullable(logoUrl); - return this; - } - /** * Link to the full logo for the connector. */ - public Connector withLogoUrl(Optional logoUrl) { - Utils.checkNotNull(logoUrl, "logoUrl"); + public Connector withLogoUrl(@Nullable String logoUrl) { this.logoUrl = logoUrl; return this; } - /** - * Link to the connector's website. - */ - public Connector withWebsiteUrl(String websiteUrl) { - Utils.checkNotNull(websiteUrl, "websiteUrl"); - this.websiteUrl = Optional.ofNullable(websiteUrl); - return this; - } - /** * Link to the connector's website. */ - public Connector withWebsiteUrl(Optional websiteUrl) { - Utils.checkNotNull(websiteUrl, "websiteUrl"); + public Connector withWebsiteUrl(@Nullable String websiteUrl) { this.websiteUrl = websiteUrl; return this; } - /** - * Link to the connector's signup page. - */ - public Connector withSignupUrl(String signupUrl) { - Utils.checkNotNull(signupUrl, "signupUrl"); - this.signupUrl = Optional.ofNullable(signupUrl); - return this; - } - /** * Link to the connector's signup page. */ - public Connector withSignupUrl(Optional signupUrl) { - Utils.checkNotNull(signupUrl, "signupUrl"); + public Connector withSignupUrl(@Nullable String signupUrl) { this.signupUrl = signupUrl; return this; } - /** - * Link to the connector's partner program signup page. - */ - public Connector withPartnerSignupUrl(String partnerSignupUrl) { - Utils.checkNotNull(partnerSignupUrl, "partnerSignupUrl"); - this.partnerSignupUrl = Optional.ofNullable(partnerSignupUrl); - return this; - } - /** * Link to the connector's partner program signup page. */ - public Connector withPartnerSignupUrl(Optional partnerSignupUrl) { - Utils.checkNotNull(partnerSignupUrl, "partnerSignupUrl"); + public Connector withPartnerSignupUrl(@Nullable String partnerSignupUrl) { this.partnerSignupUrl = partnerSignupUrl; return this; } - /** - * Set to `true` when the connector offers a free trial. Use `signup_url` to sign up for a free trial - */ - public Connector withFreeTrialAvailable(boolean freeTrialAvailable) { - Utils.checkNotNull(freeTrialAvailable, "freeTrialAvailable"); - this.freeTrialAvailable = Optional.ofNullable(freeTrialAvailable); - return this; - } - /** * Set to `true` when the connector offers a free trial. Use `signup_url` to sign up for a free trial */ - public Connector withFreeTrialAvailable(Optional freeTrialAvailable) { - Utils.checkNotNull(freeTrialAvailable, "freeTrialAvailable"); + public Connector withFreeTrialAvailable(@Nullable Boolean freeTrialAvailable) { this.freeTrialAvailable = freeTrialAvailable; return this; } - /** - * Type of authorization used by the connector - */ - public Connector withAuthType(ConnectorAuthType authType) { - Utils.checkNotNull(authType, "authType"); - this.authType = Optional.ofNullable(authType); - return this; - } - /** * Type of authorization used by the connector */ - public Connector withAuthType(Optional authType) { - Utils.checkNotNull(authType, "authType"); + public Connector withAuthType(@Nullable ConnectorAuthType authType) { this.authType = authType; return this; } - /** - * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API - */ - public Connector withAuthOnly(boolean authOnly) { - Utils.checkNotNull(authOnly, "authOnly"); - this.authOnly = Optional.ofNullable(authOnly); - return this; - } - /** * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API */ - public Connector withAuthOnly(Optional authOnly) { - Utils.checkNotNull(authOnly, "authOnly"); + public Connector withAuthOnly(@Nullable Boolean authOnly) { this.authOnly = authOnly; return this; } - /** - * Set to `true` when connector was implemented from downstream docs only and without API access. This state indicates that integration will require Apideck support, and access to downstream API to validate mapping quality. - */ - public Connector withBlindMapped(boolean blindMapped) { - Utils.checkNotNull(blindMapped, "blindMapped"); - this.blindMapped = Optional.ofNullable(blindMapped); - return this; - } - /** * Set to `true` when connector was implemented from downstream docs only and without API access. This state indicates that integration will require Apideck support, and access to downstream API to validate mapping quality. */ - public Connector withBlindMapped(Optional blindMapped) { - Utils.checkNotNull(blindMapped, "blindMapped"); + public Connector withBlindMapped(@Nullable Boolean blindMapped) { this.blindMapped = blindMapped; return this; } - /** - * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types - */ - public Connector withOauthGrantType(ConnectorOauthGrantType oauthGrantType) { - Utils.checkNotNull(oauthGrantType, "oauthGrantType"); - this.oauthGrantType = Optional.ofNullable(oauthGrantType); - return this; - } - /** * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types */ - public Connector withOauthGrantType(Optional oauthGrantType) { - Utils.checkNotNull(oauthGrantType, "oauthGrantType"); + public Connector withOauthGrantType(@Nullable ConnectorOauthGrantType oauthGrantType) { this.oauthGrantType = oauthGrantType; return this; } - /** - * Location of the OAuth client credentials. For most connectors the OAuth client credentials are stored on integration and managed by the application owner. For others they are stored on connection and managed by the consumer in Vault. - */ - public Connector withOauthCredentialsSource(OauthCredentialsSource oauthCredentialsSource) { - Utils.checkNotNull(oauthCredentialsSource, "oauthCredentialsSource"); - this.oauthCredentialsSource = Optional.ofNullable(oauthCredentialsSource); - return this; - } - /** * Location of the OAuth client credentials. For most connectors the OAuth client credentials are stored on integration and managed by the application owner. For others they are stored on connection and managed by the consumer in Vault. */ - public Connector withOauthCredentialsSource(Optional oauthCredentialsSource) { - Utils.checkNotNull(oauthCredentialsSource, "oauthCredentialsSource"); + public Connector withOauthCredentialsSource(@Nullable OauthCredentialsSource oauthCredentialsSource) { this.oauthCredentialsSource = oauthCredentialsSource; return this; } - /** - * List of OAuth Scopes available for this connector. - */ - public Connector withOauthScopes(List oauthScopes) { - Utils.checkNotNull(oauthScopes, "oauthScopes"); - this.oauthScopes = Optional.ofNullable(oauthScopes); - return this; - } - /** * List of OAuth Scopes available for this connector. */ - public Connector withOauthScopes(Optional> oauthScopes) { - Utils.checkNotNull(oauthScopes, "oauthScopes"); + public Connector withOauthScopes(@Nullable List oauthScopes) { this.oauthScopes = oauthScopes; return this; } - /** - * Set to `true` when connector allows the definition of custom scopes. - */ - public Connector withCustomScopes(boolean customScopes) { - Utils.checkNotNull(customScopes, "customScopes"); - this.customScopes = Optional.ofNullable(customScopes); - return this; - } - /** * Set to `true` when connector allows the definition of custom scopes. */ - public Connector withCustomScopes(Optional customScopes) { - Utils.checkNotNull(customScopes, "customScopes"); + public Connector withCustomScopes(@Nullable Boolean customScopes) { this.customScopes = customScopes; return this; } - /** - * Indicates whether Apideck Sandbox OAuth credentials are available. - */ - public Connector withHasSandboxCredentials(boolean hasSandboxCredentials) { - Utils.checkNotNull(hasSandboxCredentials, "hasSandboxCredentials"); - this.hasSandboxCredentials = Optional.ofNullable(hasSandboxCredentials); - return this; - } - /** * Indicates whether Apideck Sandbox OAuth credentials are available. */ - public Connector withHasSandboxCredentials(Optional hasSandboxCredentials) { - Utils.checkNotNull(hasSandboxCredentials, "hasSandboxCredentials"); + public Connector withHasSandboxCredentials(@Nullable Boolean hasSandboxCredentials) { this.hasSandboxCredentials = hasSandboxCredentials; return this; } - public Connector withSettings(List settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = Optional.ofNullable(settings); - return this; - } - - public Connector withSettings(Optional> settings) { - Utils.checkNotNull(settings, "settings"); + public Connector withSettings(@Nullable List settings) { this.settings = settings; return this; } - /** - * Service provider identifier - */ - public Connector withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Service provider identifier */ - public Connector withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Connector withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * List of Unified APIs that feature this connector. - */ - public Connector withUnifiedApis(List unifiedApis) { - Utils.checkNotNull(unifiedApis, "unifiedApis"); - this.unifiedApis = Optional.ofNullable(unifiedApis); - return this; - } - /** * List of Unified APIs that feature this connector. */ - public Connector withUnifiedApis(Optional> unifiedApis) { - Utils.checkNotNull(unifiedApis, "unifiedApis"); + public Connector withUnifiedApis(@Nullable List unifiedApis) { this.unifiedApis = unifiedApis; return this; } - /** - * List of resources that are supported on the connector. - */ - public Connector withSupportedResources(List supportedResources) { - Utils.checkNotNull(supportedResources, "supportedResources"); - this.supportedResources = Optional.ofNullable(supportedResources); - return this; - } - /** * List of resources that are supported on the connector. */ - public Connector withSupportedResources(Optional> supportedResources) { - Utils.checkNotNull(supportedResources, "supportedResources"); + public Connector withSupportedResources(@Nullable List supportedResources) { this.supportedResources = supportedResources; return this; } - /** - * List of resources that have settings that can be configured. - */ - public Connector withConfigurableResources(List configurableResources) { - Utils.checkNotNull(configurableResources, "configurableResources"); - this.configurableResources = Optional.ofNullable(configurableResources); - return this; - } - /** * List of resources that have settings that can be configured. */ - public Connector withConfigurableResources(Optional> configurableResources) { - Utils.checkNotNull(configurableResources, "configurableResources"); + public Connector withConfigurableResources(@Nullable List configurableResources) { this.configurableResources = configurableResources; return this; } - /** - * List of events that are supported on the connector across all Unified APIs. - */ - public Connector withSupportedEvents(List supportedEvents) { - Utils.checkNotNull(supportedEvents, "supportedEvents"); - this.supportedEvents = Optional.ofNullable(supportedEvents); - return this; - } - /** * List of events that are supported on the connector across all Unified APIs. */ - public Connector withSupportedEvents(Optional> supportedEvents) { - Utils.checkNotNull(supportedEvents, "supportedEvents"); + public Connector withSupportedEvents(@Nullable List supportedEvents) { this.supportedEvents = supportedEvents; return this; } - /** - * How webhooks are supported for the connector. Sometimes the connector natively supports webhooks, other times Apideck virtualizes them based on polling. - */ - public Connector withWebhookSupport(WebhookSupport webhookSupport) { - Utils.checkNotNull(webhookSupport, "webhookSupport"); - this.webhookSupport = Optional.ofNullable(webhookSupport); - return this; - } - /** * How webhooks are supported for the connector. Sometimes the connector natively supports webhooks, other times Apideck virtualizes them based on polling. */ - public Connector withWebhookSupport(Optional webhookSupport) { - Utils.checkNotNull(webhookSupport, "webhookSupport"); + public Connector withWebhookSupport(@Nullable WebhookSupport webhookSupport) { this.webhookSupport = webhookSupport; return this; } - /** - * When a connector has schema_support, a call can be made to retrieve a json schema that describes a downstream resource. - */ - public Connector withSchemaSupport(SchemaSupport schemaSupport) { - Utils.checkNotNull(schemaSupport, "schemaSupport"); - this.schemaSupport = Optional.ofNullable(schemaSupport); - return this; - } - /** * When a connector has schema_support, a call can be made to retrieve a json schema that describes a downstream resource. */ - public Connector withSchemaSupport(Optional schemaSupport) { - Utils.checkNotNull(schemaSupport, "schemaSupport"); + public Connector withSchemaSupport(@Nullable SchemaSupport schemaSupport) { this.schemaSupport = schemaSupport; return this; } - public Connector withDocs(List docs) { - Utils.checkNotNull(docs, "docs"); - this.docs = Optional.ofNullable(docs); - return this; - } - - public Connector withDocs(Optional> docs) { - Utils.checkNotNull(docs, "docs"); + public Connector withDocs(@Nullable List docs) { this.docs = docs; return this; } - public Connector withTlsSupport(TlsSupport tlsSupport) { - Utils.checkNotNull(tlsSupport, "tlsSupport"); - this.tlsSupport = Optional.ofNullable(tlsSupport); - return this; - } - - public Connector withTlsSupport(Optional tlsSupport) { - Utils.checkNotNull(tlsSupport, "tlsSupport"); + public Connector withTlsSupport(@Nullable TlsSupport tlsSupport) { this.tlsSupport = tlsSupport; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1148,582 +808,282 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private Optional status = Optional.empty(); + private ConnectorStatus status; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional iconUrl = Optional.empty(); + private String iconUrl; - private Optional logoUrl = Optional.empty(); + private String logoUrl; - private Optional websiteUrl = Optional.empty(); + private String websiteUrl; - private Optional signupUrl = Optional.empty(); + private String signupUrl; - private Optional partnerSignupUrl = Optional.empty(); + private String partnerSignupUrl; - private Optional freeTrialAvailable = Optional.empty(); + private Boolean freeTrialAvailable; - private Optional authType = Optional.empty(); + private ConnectorAuthType authType; - private Optional authOnly = Optional.empty(); + private Boolean authOnly; - private Optional blindMapped = Optional.empty(); + private Boolean blindMapped; - private Optional oauthGrantType = Optional.empty(); + private ConnectorOauthGrantType oauthGrantType; - private Optional oauthCredentialsSource = Optional.empty(); + private OauthCredentialsSource oauthCredentialsSource; - private Optional> oauthScopes = Optional.empty(); + private List oauthScopes; - private Optional customScopes = Optional.empty(); + private Boolean customScopes; - private Optional hasSandboxCredentials = Optional.empty(); + private Boolean hasSandboxCredentials; - private Optional> settings = Optional.empty(); + private List settings; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional> unifiedApis = Optional.empty(); + private List unifiedApis; - private Optional> supportedResources = Optional.empty(); + private List supportedResources; - private Optional> configurableResources = Optional.empty(); + private List configurableResources; - private Optional> supportedEvents = Optional.empty(); + private List supportedEvents; - private Optional webhookSupport = Optional.empty(); + private WebhookSupport webhookSupport; - private Optional schemaSupport = Optional.empty(); + private SchemaSupport schemaSupport; - private Optional> docs = Optional.empty(); + private List docs; - private Optional tlsSupport = Optional.empty(); + private TlsSupport tlsSupport; private Builder() { // force use of static builder() method } - /** * ID of the connector. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * ID of the connector. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Name of the connector. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the connector. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * Status of the connector. Connectors with status live or beta are callable. */ - public Builder status(ConnectorStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * Status of the connector. Connectors with status live or beta are callable. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ConnectorStatus status) { this.status = status; return this; } - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * Link to a small square icon for the connector. - */ - public Builder iconUrl(String iconUrl) { - Utils.checkNotNull(iconUrl, "iconUrl"); - this.iconUrl = Optional.ofNullable(iconUrl); - return this; - } - /** * Link to a small square icon for the connector. */ - public Builder iconUrl(Optional iconUrl) { - Utils.checkNotNull(iconUrl, "iconUrl"); + public Builder iconUrl(@Nullable String iconUrl) { this.iconUrl = iconUrl; return this; } - /** * Link to the full logo for the connector. */ - public Builder logoUrl(String logoUrl) { - Utils.checkNotNull(logoUrl, "logoUrl"); - this.logoUrl = Optional.ofNullable(logoUrl); - return this; - } - - /** - * Link to the full logo for the connector. - */ - public Builder logoUrl(Optional logoUrl) { - Utils.checkNotNull(logoUrl, "logoUrl"); + public Builder logoUrl(@Nullable String logoUrl) { this.logoUrl = logoUrl; return this; } - - /** - * Link to the connector's website. - */ - public Builder websiteUrl(String websiteUrl) { - Utils.checkNotNull(websiteUrl, "websiteUrl"); - this.websiteUrl = Optional.ofNullable(websiteUrl); - return this; - } - /** * Link to the connector's website. */ - public Builder websiteUrl(Optional websiteUrl) { - Utils.checkNotNull(websiteUrl, "websiteUrl"); + public Builder websiteUrl(@Nullable String websiteUrl) { this.websiteUrl = websiteUrl; return this; } - /** * Link to the connector's signup page. */ - public Builder signupUrl(String signupUrl) { - Utils.checkNotNull(signupUrl, "signupUrl"); - this.signupUrl = Optional.ofNullable(signupUrl); - return this; - } - - /** - * Link to the connector's signup page. - */ - public Builder signupUrl(Optional signupUrl) { - Utils.checkNotNull(signupUrl, "signupUrl"); + public Builder signupUrl(@Nullable String signupUrl) { this.signupUrl = signupUrl; return this; } - - /** - * Link to the connector's partner program signup page. - */ - public Builder partnerSignupUrl(String partnerSignupUrl) { - Utils.checkNotNull(partnerSignupUrl, "partnerSignupUrl"); - this.partnerSignupUrl = Optional.ofNullable(partnerSignupUrl); - return this; - } - /** * Link to the connector's partner program signup page. */ - public Builder partnerSignupUrl(Optional partnerSignupUrl) { - Utils.checkNotNull(partnerSignupUrl, "partnerSignupUrl"); + public Builder partnerSignupUrl(@Nullable String partnerSignupUrl) { this.partnerSignupUrl = partnerSignupUrl; return this; } - - /** - * Set to `true` when the connector offers a free trial. Use `signup_url` to sign up for a free trial - */ - public Builder freeTrialAvailable(boolean freeTrialAvailable) { - Utils.checkNotNull(freeTrialAvailable, "freeTrialAvailable"); - this.freeTrialAvailable = Optional.ofNullable(freeTrialAvailable); - return this; - } - /** * Set to `true` when the connector offers a free trial. Use `signup_url` to sign up for a free trial */ - public Builder freeTrialAvailable(Optional freeTrialAvailable) { - Utils.checkNotNull(freeTrialAvailable, "freeTrialAvailable"); + public Builder freeTrialAvailable(@Nullable Boolean freeTrialAvailable) { this.freeTrialAvailable = freeTrialAvailable; return this; } - /** * Type of authorization used by the connector */ - public Builder authType(ConnectorAuthType authType) { - Utils.checkNotNull(authType, "authType"); - this.authType = Optional.ofNullable(authType); - return this; - } - - /** - * Type of authorization used by the connector - */ - public Builder authType(Optional authType) { - Utils.checkNotNull(authType, "authType"); + public Builder authType(@Nullable ConnectorAuthType authType) { this.authType = authType; return this; } - - /** - * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API - */ - public Builder authOnly(boolean authOnly) { - Utils.checkNotNull(authOnly, "authOnly"); - this.authOnly = Optional.ofNullable(authOnly); - return this; - } - /** * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API */ - public Builder authOnly(Optional authOnly) { - Utils.checkNotNull(authOnly, "authOnly"); + public Builder authOnly(@Nullable Boolean authOnly) { this.authOnly = authOnly; return this; } - - /** - * Set to `true` when connector was implemented from downstream docs only and without API access. This state indicates that integration will require Apideck support, and access to downstream API to validate mapping quality. - */ - public Builder blindMapped(boolean blindMapped) { - Utils.checkNotNull(blindMapped, "blindMapped"); - this.blindMapped = Optional.ofNullable(blindMapped); - return this; - } - /** * Set to `true` when connector was implemented from downstream docs only and without API access. This state indicates that integration will require Apideck support, and access to downstream API to validate mapping quality. */ - public Builder blindMapped(Optional blindMapped) { - Utils.checkNotNull(blindMapped, "blindMapped"); + public Builder blindMapped(@Nullable Boolean blindMapped) { this.blindMapped = blindMapped; return this; } - /** * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types */ - public Builder oauthGrantType(ConnectorOauthGrantType oauthGrantType) { - Utils.checkNotNull(oauthGrantType, "oauthGrantType"); - this.oauthGrantType = Optional.ofNullable(oauthGrantType); - return this; - } - - /** - * OAuth grant type used by the connector. More info: https://oauth.net/2/grant-types - */ - public Builder oauthGrantType(Optional oauthGrantType) { - Utils.checkNotNull(oauthGrantType, "oauthGrantType"); + public Builder oauthGrantType(@Nullable ConnectorOauthGrantType oauthGrantType) { this.oauthGrantType = oauthGrantType; return this; } - /** * Location of the OAuth client credentials. For most connectors the OAuth client credentials are stored on integration and managed by the application owner. For others they are stored on connection and managed by the consumer in Vault. */ - public Builder oauthCredentialsSource(OauthCredentialsSource oauthCredentialsSource) { - Utils.checkNotNull(oauthCredentialsSource, "oauthCredentialsSource"); - this.oauthCredentialsSource = Optional.ofNullable(oauthCredentialsSource); - return this; - } - - /** - * Location of the OAuth client credentials. For most connectors the OAuth client credentials are stored on integration and managed by the application owner. For others they are stored on connection and managed by the consumer in Vault. - */ - public Builder oauthCredentialsSource(Optional oauthCredentialsSource) { - Utils.checkNotNull(oauthCredentialsSource, "oauthCredentialsSource"); + public Builder oauthCredentialsSource(@Nullable OauthCredentialsSource oauthCredentialsSource) { this.oauthCredentialsSource = oauthCredentialsSource; return this; } - - /** - * List of OAuth Scopes available for this connector. - */ - public Builder oauthScopes(List oauthScopes) { - Utils.checkNotNull(oauthScopes, "oauthScopes"); - this.oauthScopes = Optional.ofNullable(oauthScopes); - return this; - } - /** * List of OAuth Scopes available for this connector. */ - public Builder oauthScopes(Optional> oauthScopes) { - Utils.checkNotNull(oauthScopes, "oauthScopes"); + public Builder oauthScopes(@Nullable List oauthScopes) { this.oauthScopes = oauthScopes; return this; } - /** * Set to `true` when connector allows the definition of custom scopes. */ - public Builder customScopes(boolean customScopes) { - Utils.checkNotNull(customScopes, "customScopes"); - this.customScopes = Optional.ofNullable(customScopes); - return this; - } - - /** - * Set to `true` when connector allows the definition of custom scopes. - */ - public Builder customScopes(Optional customScopes) { - Utils.checkNotNull(customScopes, "customScopes"); + public Builder customScopes(@Nullable Boolean customScopes) { this.customScopes = customScopes; return this; } - - /** - * Indicates whether Apideck Sandbox OAuth credentials are available. - */ - public Builder hasSandboxCredentials(boolean hasSandboxCredentials) { - Utils.checkNotNull(hasSandboxCredentials, "hasSandboxCredentials"); - this.hasSandboxCredentials = Optional.ofNullable(hasSandboxCredentials); - return this; - } - /** * Indicates whether Apideck Sandbox OAuth credentials are available. */ - public Builder hasSandboxCredentials(Optional hasSandboxCredentials) { - Utils.checkNotNull(hasSandboxCredentials, "hasSandboxCredentials"); + public Builder hasSandboxCredentials(@Nullable Boolean hasSandboxCredentials) { this.hasSandboxCredentials = hasSandboxCredentials; return this; } - - public Builder settings(List settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = Optional.ofNullable(settings); - return this; - } - - public Builder settings(Optional> settings) { - Utils.checkNotNull(settings, "settings"); + public Builder settings(@Nullable List settings) { this.settings = settings; return this; } - - /** - * Service provider identifier - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Service provider identifier */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * List of Unified APIs that feature this connector. */ - public Builder unifiedApis(List unifiedApis) { - Utils.checkNotNull(unifiedApis, "unifiedApis"); - this.unifiedApis = Optional.ofNullable(unifiedApis); - return this; - } - - /** - * List of Unified APIs that feature this connector. - */ - public Builder unifiedApis(Optional> unifiedApis) { - Utils.checkNotNull(unifiedApis, "unifiedApis"); + public Builder unifiedApis(@Nullable List unifiedApis) { this.unifiedApis = unifiedApis; return this; } - /** * List of resources that are supported on the connector. */ - public Builder supportedResources(List supportedResources) { - Utils.checkNotNull(supportedResources, "supportedResources"); - this.supportedResources = Optional.ofNullable(supportedResources); - return this; - } - - /** - * List of resources that are supported on the connector. - */ - public Builder supportedResources(Optional> supportedResources) { - Utils.checkNotNull(supportedResources, "supportedResources"); + public Builder supportedResources(@Nullable List supportedResources) { this.supportedResources = supportedResources; return this; } - - /** - * List of resources that have settings that can be configured. - */ - public Builder configurableResources(List configurableResources) { - Utils.checkNotNull(configurableResources, "configurableResources"); - this.configurableResources = Optional.ofNullable(configurableResources); - return this; - } - /** * List of resources that have settings that can be configured. */ - public Builder configurableResources(Optional> configurableResources) { - Utils.checkNotNull(configurableResources, "configurableResources"); + public Builder configurableResources(@Nullable List configurableResources) { this.configurableResources = configurableResources; return this; } - /** * List of events that are supported on the connector across all Unified APIs. */ - public Builder supportedEvents(List supportedEvents) { - Utils.checkNotNull(supportedEvents, "supportedEvents"); - this.supportedEvents = Optional.ofNullable(supportedEvents); - return this; - } - - /** - * List of events that are supported on the connector across all Unified APIs. - */ - public Builder supportedEvents(Optional> supportedEvents) { - Utils.checkNotNull(supportedEvents, "supportedEvents"); + public Builder supportedEvents(@Nullable List supportedEvents) { this.supportedEvents = supportedEvents; return this; } - /** * How webhooks are supported for the connector. Sometimes the connector natively supports webhooks, other times Apideck virtualizes them based on polling. */ - public Builder webhookSupport(WebhookSupport webhookSupport) { - Utils.checkNotNull(webhookSupport, "webhookSupport"); - this.webhookSupport = Optional.ofNullable(webhookSupport); - return this; - } - - /** - * How webhooks are supported for the connector. Sometimes the connector natively supports webhooks, other times Apideck virtualizes them based on polling. - */ - public Builder webhookSupport(Optional webhookSupport) { - Utils.checkNotNull(webhookSupport, "webhookSupport"); + public Builder webhookSupport(@Nullable WebhookSupport webhookSupport) { this.webhookSupport = webhookSupport; return this; } - /** * When a connector has schema_support, a call can be made to retrieve a json schema that describes a downstream resource. */ - public Builder schemaSupport(SchemaSupport schemaSupport) { - Utils.checkNotNull(schemaSupport, "schemaSupport"); - this.schemaSupport = Optional.ofNullable(schemaSupport); - return this; - } - - /** - * When a connector has schema_support, a call can be made to retrieve a json schema that describes a downstream resource. - */ - public Builder schemaSupport(Optional schemaSupport) { - Utils.checkNotNull(schemaSupport, "schemaSupport"); + public Builder schemaSupport(@Nullable SchemaSupport schemaSupport) { this.schemaSupport = schemaSupport; return this; } - - public Builder docs(List docs) { - Utils.checkNotNull(docs, "docs"); - this.docs = Optional.ofNullable(docs); - return this; - } - - public Builder docs(Optional> docs) { - Utils.checkNotNull(docs, "docs"); + public Builder docs(@Nullable List docs) { this.docs = docs; return this; } - - public Builder tlsSupport(TlsSupport tlsSupport) { - Utils.checkNotNull(tlsSupport, "tlsSupport"); - this.tlsSupport = Optional.ofNullable(tlsSupport); - return this; - } - - public Builder tlsSupport(Optional tlsSupport) { - Utils.checkNotNull(tlsSupport, "tlsSupport"); + public Builder tlsSupport(@Nullable TlsSupport tlsSupport) { this.tlsSupport = tlsSupport; return this; } public Connector build() { - return new Connector( id, name, status, description, iconUrl, logoUrl, diff --git a/src/main/java/com/apideck/unify/models/components/ConnectorDoc.java b/src/main/java/com/apideck/unify/models/components/ConnectorDoc.java index c183ea56..cddccaeb 100644 --- a/src/main/java/com/apideck/unify/models/components/ConnectorDoc.java +++ b/src/main/java/com/apideck/unify/models/components/ConnectorDoc.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -21,48 +20,43 @@ public class ConnectorDoc { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Name of the doc. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Audience for the doc. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("audience") - private Optional audience; + private Audience audience; /** * Format of the doc. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("format") - private Optional format; + private Format format; /** * Link to fetch the content of the doc. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("url") - private Optional url; + private String url; @JsonCreator public ConnectorDoc( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("audience") Optional audience, - @JsonProperty("format") Optional format, - @JsonProperty("url") Optional url) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(audience, "audience"); - Utils.checkNotNull(format, "format"); - Utils.checkNotNull(url, "url"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("audience") @Nullable Audience audience, + @JsonProperty("format") @Nullable Format format, + @JsonProperty("url") @Nullable String url) { this.id = id; this.name = name; this.audience = audience; @@ -71,50 +65,43 @@ public ConnectorDoc( } public ConnectorDoc() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Name of the doc. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Audience for the doc. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional audience() { - return (Optional) audience; + return Optional.ofNullable(this.audience); } /** * Format of the doc. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional format() { - return (Optional) format; + return Optional.ofNullable(this.format); } /** * Link to fetch the content of the doc. */ - @JsonIgnore public Optional url() { - return url; + return Optional.ofNullable(this.url); } public static Builder builder() { @@ -125,98 +112,48 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public ConnectorDoc withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public ConnectorDoc withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ConnectorDoc withId(@Nullable String id) { this.id = id; return this; } - /** - * Name of the doc. - */ - public ConnectorDoc withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the doc. */ - public ConnectorDoc withName(Optional name) { - Utils.checkNotNull(name, "name"); + public ConnectorDoc withName(@Nullable String name) { this.name = name; return this; } - /** - * Audience for the doc. - */ - public ConnectorDoc withAudience(Audience audience) { - Utils.checkNotNull(audience, "audience"); - this.audience = Optional.ofNullable(audience); - return this; - } - /** * Audience for the doc. */ - public ConnectorDoc withAudience(Optional audience) { - Utils.checkNotNull(audience, "audience"); + public ConnectorDoc withAudience(@Nullable Audience audience) { this.audience = audience; return this; } - /** - * Format of the doc. - */ - public ConnectorDoc withFormat(Format format) { - Utils.checkNotNull(format, "format"); - this.format = Optional.ofNullable(format); - return this; - } - /** * Format of the doc. */ - public ConnectorDoc withFormat(Optional format) { - Utils.checkNotNull(format, "format"); + public ConnectorDoc withFormat(@Nullable Format format) { this.format = format; return this; } - /** - * Link to fetch the content of the doc. - */ - public ConnectorDoc withUrl(String url) { - Utils.checkNotNull(url, "url"); - this.url = Optional.ofNullable(url); - return this; - } - /** * Link to fetch the content of the doc. */ - public ConnectorDoc withUrl(Optional url) { - Utils.checkNotNull(url, "url"); + public ConnectorDoc withUrl(@Nullable String url) { this.url = url; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -254,117 +191,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private Optional audience = Optional.empty(); + private Audience audience; - private Optional format = Optional.empty(); + private Format format; - private Optional url = Optional.empty(); + private String url; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Name of the doc. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * Name of the doc. - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * Audience for the doc. - */ - public Builder audience(Audience audience) { - Utils.checkNotNull(audience, "audience"); - this.audience = Optional.ofNullable(audience); - return this; - } - /** * Audience for the doc. */ - public Builder audience(Optional audience) { - Utils.checkNotNull(audience, "audience"); + public Builder audience(@Nullable Audience audience) { this.audience = audience; return this; } - - /** - * Format of the doc. - */ - public Builder format(Format format) { - Utils.checkNotNull(format, "format"); - this.format = Optional.ofNullable(format); - return this; - } - /** * Format of the doc. */ - public Builder format(Optional format) { - Utils.checkNotNull(format, "format"); + public Builder format(@Nullable Format format) { this.format = format; return this; } - - /** - * Link to fetch the content of the doc. - */ - public Builder url(String url) { - Utils.checkNotNull(url, "url"); - this.url = Optional.ofNullable(url); - return this; - } - /** * Link to fetch the content of the doc. */ - public Builder url(Optional url) { - Utils.checkNotNull(url, "url"); + public Builder url(@Nullable String url) { this.url = url; return this; } public ConnectorDoc build() { - return new ConnectorDoc( id, name, audience, format, url); diff --git a/src/main/java/com/apideck/unify/models/components/ConnectorEvent.java b/src/main/java/com/apideck/unify/models/components/ConnectorEvent.java index 42956682..456671ce 100644 --- a/src/main/java/com/apideck/unify/models/components/ConnectorEvent.java +++ b/src/main/java/com/apideck/unify/models/components/ConnectorEvent.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -26,46 +25,41 @@ public class ConnectorEvent { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("event_type") - private Optional eventType; + private String eventType; /** * Unify event source */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("event_source") - private Optional eventSource; + private EventSource eventSource; /** * Downstream event type */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_event_type") - private Optional downstreamEventType; + private String downstreamEventType; @JsonInclude(Include.NON_ABSENT) @JsonProperty("resources") - private Optional> resources; + private List resources; /** * Unify entity type */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("entity_type") - private Optional entityType; + private String entityType; @JsonCreator public ConnectorEvent( - @JsonProperty("event_type") Optional eventType, - @JsonProperty("event_source") Optional eventSource, - @JsonProperty("downstream_event_type") Optional downstreamEventType, - @JsonProperty("resources") Optional> resources, - @JsonProperty("entity_type") Optional entityType) { - Utils.checkNotNull(eventType, "eventType"); - Utils.checkNotNull(eventSource, "eventSource"); - Utils.checkNotNull(downstreamEventType, "downstreamEventType"); - Utils.checkNotNull(resources, "resources"); - Utils.checkNotNull(entityType, "entityType"); + @JsonProperty("event_type") @Nullable String eventType, + @JsonProperty("event_source") @Nullable EventSource eventSource, + @JsonProperty("downstream_event_type") @Nullable String downstreamEventType, + @JsonProperty("resources") @Nullable List resources, + @JsonProperty("entity_type") @Nullable String entityType) { this.eventType = eventType; this.eventSource = eventSource; this.downstreamEventType = downstreamEventType; @@ -74,47 +68,40 @@ public ConnectorEvent( } public ConnectorEvent() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * Unify event type */ - @JsonIgnore public Optional eventType() { - return eventType; + return Optional.ofNullable(this.eventType); } /** * Unify event source */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional eventSource() { - return (Optional) eventSource; + return Optional.ofNullable(this.eventSource); } /** * Downstream event type */ - @JsonIgnore public Optional downstreamEventType() { - return downstreamEventType; + return Optional.ofNullable(this.downstreamEventType); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> resources() { - return (Optional>) resources; + return Optional.ofNullable(this.resources); } /** * Unify entity type */ - @JsonIgnore public Optional entityType() { - return entityType; + return Optional.ofNullable(this.entityType); } public static Builder builder() { @@ -125,92 +112,45 @@ public static Builder builder() { /** * Unify event type */ - public ConnectorEvent withEventType(String eventType) { - Utils.checkNotNull(eventType, "eventType"); - this.eventType = Optional.ofNullable(eventType); - return this; - } - - - /** - * Unify event type - */ - public ConnectorEvent withEventType(Optional eventType) { - Utils.checkNotNull(eventType, "eventType"); + public ConnectorEvent withEventType(@Nullable String eventType) { this.eventType = eventType; return this; } - /** - * Unify event source - */ - public ConnectorEvent withEventSource(EventSource eventSource) { - Utils.checkNotNull(eventSource, "eventSource"); - this.eventSource = Optional.ofNullable(eventSource); - return this; - } - /** * Unify event source */ - public ConnectorEvent withEventSource(Optional eventSource) { - Utils.checkNotNull(eventSource, "eventSource"); + public ConnectorEvent withEventSource(@Nullable EventSource eventSource) { this.eventSource = eventSource; return this; } - /** - * Downstream event type - */ - public ConnectorEvent withDownstreamEventType(String downstreamEventType) { - Utils.checkNotNull(downstreamEventType, "downstreamEventType"); - this.downstreamEventType = Optional.ofNullable(downstreamEventType); - return this; - } - /** * Downstream event type */ - public ConnectorEvent withDownstreamEventType(Optional downstreamEventType) { - Utils.checkNotNull(downstreamEventType, "downstreamEventType"); + public ConnectorEvent withDownstreamEventType(@Nullable String downstreamEventType) { this.downstreamEventType = downstreamEventType; return this; } - public ConnectorEvent withResources(List resources) { - Utils.checkNotNull(resources, "resources"); - this.resources = Optional.ofNullable(resources); - return this; - } - - public ConnectorEvent withResources(Optional> resources) { - Utils.checkNotNull(resources, "resources"); + public ConnectorEvent withResources(@Nullable List resources) { this.resources = resources; return this; } - /** - * Unify entity type - */ - public ConnectorEvent withEntityType(String entityType) { - Utils.checkNotNull(entityType, "entityType"); - this.entityType = Optional.ofNullable(entityType); - return this; - } - /** * Unify entity type */ - public ConnectorEvent withEntityType(Optional entityType) { - Utils.checkNotNull(entityType, "entityType"); + public ConnectorEvent withEntityType(@Nullable String entityType) { this.entityType = entityType; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -248,111 +188,58 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional eventType = Optional.empty(); + private String eventType; - private Optional eventSource = Optional.empty(); + private EventSource eventSource; - private Optional downstreamEventType = Optional.empty(); + private String downstreamEventType; - private Optional> resources = Optional.empty(); + private List resources; - private Optional entityType = Optional.empty(); + private String entityType; private Builder() { // force use of static builder() method } - - /** - * Unify event type - */ - public Builder eventType(String eventType) { - Utils.checkNotNull(eventType, "eventType"); - this.eventType = Optional.ofNullable(eventType); - return this; - } - /** * Unify event type */ - public Builder eventType(Optional eventType) { - Utils.checkNotNull(eventType, "eventType"); + public Builder eventType(@Nullable String eventType) { this.eventType = eventType; return this; } - - /** - * Unify event source - */ - public Builder eventSource(EventSource eventSource) { - Utils.checkNotNull(eventSource, "eventSource"); - this.eventSource = Optional.ofNullable(eventSource); - return this; - } - /** * Unify event source */ - public Builder eventSource(Optional eventSource) { - Utils.checkNotNull(eventSource, "eventSource"); + public Builder eventSource(@Nullable EventSource eventSource) { this.eventSource = eventSource; return this; } - /** * Downstream event type */ - public Builder downstreamEventType(String downstreamEventType) { - Utils.checkNotNull(downstreamEventType, "downstreamEventType"); - this.downstreamEventType = Optional.ofNullable(downstreamEventType); - return this; - } - - /** - * Downstream event type - */ - public Builder downstreamEventType(Optional downstreamEventType) { - Utils.checkNotNull(downstreamEventType, "downstreamEventType"); + public Builder downstreamEventType(@Nullable String downstreamEventType) { this.downstreamEventType = downstreamEventType; return this; } - - public Builder resources(List resources) { - Utils.checkNotNull(resources, "resources"); - this.resources = Optional.ofNullable(resources); - return this; - } - - public Builder resources(Optional> resources) { - Utils.checkNotNull(resources, "resources"); + public Builder resources(@Nullable List resources) { this.resources = resources; return this; } - /** * Unify entity type */ - public Builder entityType(String entityType) { - Utils.checkNotNull(entityType, "entityType"); - this.entityType = Optional.ofNullable(entityType); - return this; - } - - /** - * Unify entity type - */ - public Builder entityType(Optional entityType) { - Utils.checkNotNull(entityType, "entityType"); + public Builder entityType(@Nullable String entityType) { this.entityType = entityType; return this; } public ConnectorEvent build() { - return new ConnectorEvent( eventType, eventSource, downstreamEventType, resources, entityType); diff --git a/src/main/java/com/apideck/unify/models/components/ConnectorOauthScopes.java b/src/main/java/com/apideck/unify/models/components/ConnectorOauthScopes.java index 2c97817b..1fd81df1 100644 --- a/src/main/java/com/apideck/unify/models/components/ConnectorOauthScopes.java +++ b/src/main/java/com/apideck/unify/models/components/ConnectorOauthScopes.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -24,43 +24,39 @@ public class ConnectorOauthScopes { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Label of the OAuth scope. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("label") - private Optional label; + private String label; @JsonCreator public ConnectorOauthScopes( - @JsonProperty("id") Optional id, - @JsonProperty("label") Optional label) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(label, "label"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("label") @Nullable String label) { this.id = id; this.label = label; } public ConnectorOauthScopes() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * ID of the OAuth scope. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Label of the OAuth scope. */ - @JsonIgnore public Optional label() { - return label; + return Optional.ofNullable(this.label); } public static Builder builder() { @@ -71,41 +67,21 @@ public static Builder builder() { /** * ID of the OAuth scope. */ - public ConnectorOauthScopes withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the OAuth scope. - */ - public ConnectorOauthScopes withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ConnectorOauthScopes withId(@Nullable String id) { this.id = id; return this; } - /** - * Label of the OAuth scope. - */ - public ConnectorOauthScopes withLabel(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - /** * Label of the OAuth scope. */ - public ConnectorOauthScopes withLabel(Optional label) { - Utils.checkNotNull(label, "label"); + public ConnectorOauthScopes withLabel(@Nullable String label) { this.label = label; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -136,54 +112,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional label = Optional.empty(); + private String label; private Builder() { // force use of static builder() method } - /** * ID of the OAuth scope. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * ID of the OAuth scope. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Label of the OAuth scope. - */ - public Builder label(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - /** * Label of the OAuth scope. */ - public Builder label(Optional label) { - Utils.checkNotNull(label, "label"); + public Builder label(@Nullable String label) { this.label = label; return this; } public ConnectorOauthScopes build() { - return new ConnectorOauthScopes( id, label); } diff --git a/src/main/java/com/apideck/unify/models/components/ConnectorResource.java b/src/main/java/com/apideck/unify/models/components/ConnectorResource.java index 2bfc77da..b9b80514 100644 --- a/src/main/java/com/apideck/unify/models/components/ConnectorResource.java +++ b/src/main/java/com/apideck/unify/models/components/ConnectorResource.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -23,127 +22,113 @@ public class ConnectorResource { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Name of the resource (plural) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * ID of the resource in the Connector's API (downstream) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_id") - private Optional downstreamId; + private String downstreamId; /** * Name of the resource in the Connector's API (downstream) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_name") - private Optional downstreamName; + private String downstreamName; /** * Status of the resource. Resources with status live or beta are callable. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private ResourceStatus status; /** * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pagination_supported") - private Optional paginationSupported; + private Boolean paginationSupported; @JsonInclude(Include.NON_ABSENT) @JsonProperty("pagination") - private Optional pagination; + private PaginationCoverage pagination; /** * Indicates if custom fields are supported on this resource. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields_supported") - private Optional customFieldsSupported; + private Boolean customFieldsSupported; /** * List of supported operations on the resource. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_operations") - private Optional> supportedOperations; + private List supportedOperations; /** * List of operations that are not supported on the downstream. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_unsupported_operations") - private Optional> downstreamUnsupportedOperations; + private List downstreamUnsupportedOperations; /** * Supported filters on the list endpoint of the resource. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_filters") - private Optional> supportedFilters; + private List supportedFilters; /** * Supported sorting properties on the list endpoint of the resource. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_sort_by") - private Optional> supportedSortBy; + private List supportedSortBy; /** * Supported fields on the detail endpoint. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_fields") - private Optional> supportedFields; + private List supportedFields; /** * Supported fields on the list endpoint. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_list_fields") - private Optional> supportedListFields; + private List supportedListFields; @JsonCreator public ConnectorResource( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("downstream_id") Optional downstreamId, - @JsonProperty("downstream_name") Optional downstreamName, - @JsonProperty("status") Optional status, - @JsonProperty("pagination_supported") Optional paginationSupported, - @JsonProperty("pagination") Optional pagination, - @JsonProperty("custom_fields_supported") Optional customFieldsSupported, - @JsonProperty("supported_operations") Optional> supportedOperations, - @JsonProperty("downstream_unsupported_operations") Optional> downstreamUnsupportedOperations, - @JsonProperty("supported_filters") Optional> supportedFilters, - @JsonProperty("supported_sort_by") Optional> supportedSortBy, - @JsonProperty("supported_fields") Optional> supportedFields, - @JsonProperty("supported_list_fields") Optional> supportedListFields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(downstreamName, "downstreamName"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(paginationSupported, "paginationSupported"); - Utils.checkNotNull(pagination, "pagination"); - Utils.checkNotNull(customFieldsSupported, "customFieldsSupported"); - Utils.checkNotNull(supportedOperations, "supportedOperations"); - Utils.checkNotNull(downstreamUnsupportedOperations, "downstreamUnsupportedOperations"); - Utils.checkNotNull(supportedFilters, "supportedFilters"); - Utils.checkNotNull(supportedSortBy, "supportedSortBy"); - Utils.checkNotNull(supportedFields, "supportedFields"); - Utils.checkNotNull(supportedListFields, "supportedListFields"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("downstream_id") @Nullable String downstreamId, + @JsonProperty("downstream_name") @Nullable String downstreamName, + @JsonProperty("status") @Nullable ResourceStatus status, + @JsonProperty("pagination_supported") @Nullable Boolean paginationSupported, + @JsonProperty("pagination") @Nullable PaginationCoverage pagination, + @JsonProperty("custom_fields_supported") @Nullable Boolean customFieldsSupported, + @JsonProperty("supported_operations") @Nullable List supportedOperations, + @JsonProperty("downstream_unsupported_operations") @Nullable List downstreamUnsupportedOperations, + @JsonProperty("supported_filters") @Nullable List supportedFilters, + @JsonProperty("supported_sort_by") @Nullable List supportedSortBy, + @JsonProperty("supported_fields") @Nullable List supportedFields, + @JsonProperty("supported_list_fields") @Nullable List supportedListFields) { this.id = id; this.name = name; this.downstreamId = downstreamId; @@ -161,128 +146,106 @@ public ConnectorResource( } public ConnectorResource() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * ID of the resource, typically a lowercased version of name. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Name of the resource (plural) */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * ID of the resource in the Connector's API (downstream) */ - @JsonIgnore public Optional downstreamId() { - return downstreamId; + return Optional.ofNullable(this.downstreamId); } /** * Name of the resource in the Connector's API (downstream) */ - @JsonIgnore public Optional downstreamName() { - return downstreamName; + return Optional.ofNullable(this.downstreamName); } /** * Status of the resource. Resources with status live or beta are callable. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. */ - @JsonIgnore public Optional paginationSupported() { - return paginationSupported; + return Optional.ofNullable(this.paginationSupported); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional pagination() { - return (Optional) pagination; + return Optional.ofNullable(this.pagination); } /** * Indicates if custom fields are supported on this resource. */ - @JsonIgnore public Optional customFieldsSupported() { - return customFieldsSupported; + return Optional.ofNullable(this.customFieldsSupported); } /** * List of supported operations on the resource. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedOperations() { - return (Optional>) supportedOperations; + return Optional.ofNullable(this.supportedOperations); } /** * List of operations that are not supported on the downstream. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> downstreamUnsupportedOperations() { - return (Optional>) downstreamUnsupportedOperations; + return Optional.ofNullable(this.downstreamUnsupportedOperations); } /** * Supported filters on the list endpoint of the resource. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedFilters() { - return (Optional>) supportedFilters; + return Optional.ofNullable(this.supportedFilters); } /** * Supported sorting properties on the list endpoint of the resource. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedSortBy() { - return (Optional>) supportedSortBy; + return Optional.ofNullable(this.supportedSortBy); } /** * Supported fields on the detail endpoint. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedFields() { - return (Optional>) supportedFields; + return Optional.ofNullable(this.supportedFields); } /** * Supported fields on the list endpoint. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedListFields() { - return (Optional>) supportedListFields; + return Optional.ofNullable(this.supportedListFields); } public static Builder builder() { @@ -293,263 +256,126 @@ public static Builder builder() { /** * ID of the resource, typically a lowercased version of name. */ - public ConnectorResource withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the resource, typically a lowercased version of name. - */ - public ConnectorResource withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ConnectorResource withId(@Nullable String id) { this.id = id; return this; } - /** - * Name of the resource (plural) - */ - public ConnectorResource withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the resource (plural) */ - public ConnectorResource withName(Optional name) { - Utils.checkNotNull(name, "name"); + public ConnectorResource withName(@Nullable String name) { this.name = name; return this; } - /** - * ID of the resource in the Connector's API (downstream) - */ - public ConnectorResource withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = Optional.ofNullable(downstreamId); - return this; - } - /** * ID of the resource in the Connector's API (downstream) */ - public ConnectorResource withDownstreamId(Optional downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public ConnectorResource withDownstreamId(@Nullable String downstreamId) { this.downstreamId = downstreamId; return this; } - /** - * Name of the resource in the Connector's API (downstream) - */ - public ConnectorResource withDownstreamName(String downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); - this.downstreamName = Optional.ofNullable(downstreamName); - return this; - } - /** * Name of the resource in the Connector's API (downstream) */ - public ConnectorResource withDownstreamName(Optional downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); + public ConnectorResource withDownstreamName(@Nullable String downstreamName) { this.downstreamName = downstreamName; return this; } - /** - * Status of the resource. Resources with status live or beta are callable. - */ - public ConnectorResource withStatus(ResourceStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the resource. Resources with status live or beta are callable. */ - public ConnectorResource withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public ConnectorResource withStatus(@Nullable ResourceStatus status) { this.status = status; return this; } - /** - * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. - */ - public ConnectorResource withPaginationSupported(boolean paginationSupported) { - Utils.checkNotNull(paginationSupported, "paginationSupported"); - this.paginationSupported = Optional.ofNullable(paginationSupported); - return this; - } - /** * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. */ - public ConnectorResource withPaginationSupported(Optional paginationSupported) { - Utils.checkNotNull(paginationSupported, "paginationSupported"); + public ConnectorResource withPaginationSupported(@Nullable Boolean paginationSupported) { this.paginationSupported = paginationSupported; return this; } - public ConnectorResource withPagination(PaginationCoverage pagination) { - Utils.checkNotNull(pagination, "pagination"); - this.pagination = Optional.ofNullable(pagination); - return this; - } - - public ConnectorResource withPagination(Optional pagination) { - Utils.checkNotNull(pagination, "pagination"); + public ConnectorResource withPagination(@Nullable PaginationCoverage pagination) { this.pagination = pagination; return this; } - /** - * Indicates if custom fields are supported on this resource. - */ - public ConnectorResource withCustomFieldsSupported(boolean customFieldsSupported) { - Utils.checkNotNull(customFieldsSupported, "customFieldsSupported"); - this.customFieldsSupported = Optional.ofNullable(customFieldsSupported); - return this; - } - /** * Indicates if custom fields are supported on this resource. */ - public ConnectorResource withCustomFieldsSupported(Optional customFieldsSupported) { - Utils.checkNotNull(customFieldsSupported, "customFieldsSupported"); + public ConnectorResource withCustomFieldsSupported(@Nullable Boolean customFieldsSupported) { this.customFieldsSupported = customFieldsSupported; return this; } - /** - * List of supported operations on the resource. - */ - public ConnectorResource withSupportedOperations(List supportedOperations) { - Utils.checkNotNull(supportedOperations, "supportedOperations"); - this.supportedOperations = Optional.ofNullable(supportedOperations); - return this; - } - /** * List of supported operations on the resource. */ - public ConnectorResource withSupportedOperations(Optional> supportedOperations) { - Utils.checkNotNull(supportedOperations, "supportedOperations"); + public ConnectorResource withSupportedOperations(@Nullable List supportedOperations) { this.supportedOperations = supportedOperations; return this; } - /** - * List of operations that are not supported on the downstream. - */ - public ConnectorResource withDownstreamUnsupportedOperations(List downstreamUnsupportedOperations) { - Utils.checkNotNull(downstreamUnsupportedOperations, "downstreamUnsupportedOperations"); - this.downstreamUnsupportedOperations = Optional.ofNullable(downstreamUnsupportedOperations); - return this; - } - /** * List of operations that are not supported on the downstream. */ - public ConnectorResource withDownstreamUnsupportedOperations(Optional> downstreamUnsupportedOperations) { - Utils.checkNotNull(downstreamUnsupportedOperations, "downstreamUnsupportedOperations"); + public ConnectorResource withDownstreamUnsupportedOperations(@Nullable List downstreamUnsupportedOperations) { this.downstreamUnsupportedOperations = downstreamUnsupportedOperations; return this; } - /** - * Supported filters on the list endpoint of the resource. - */ - public ConnectorResource withSupportedFilters(List supportedFilters) { - Utils.checkNotNull(supportedFilters, "supportedFilters"); - this.supportedFilters = Optional.ofNullable(supportedFilters); - return this; - } - /** * Supported filters on the list endpoint of the resource. */ - public ConnectorResource withSupportedFilters(Optional> supportedFilters) { - Utils.checkNotNull(supportedFilters, "supportedFilters"); + public ConnectorResource withSupportedFilters(@Nullable List supportedFilters) { this.supportedFilters = supportedFilters; return this; } - /** - * Supported sorting properties on the list endpoint of the resource. - */ - public ConnectorResource withSupportedSortBy(List supportedSortBy) { - Utils.checkNotNull(supportedSortBy, "supportedSortBy"); - this.supportedSortBy = Optional.ofNullable(supportedSortBy); - return this; - } - /** * Supported sorting properties on the list endpoint of the resource. */ - public ConnectorResource withSupportedSortBy(Optional> supportedSortBy) { - Utils.checkNotNull(supportedSortBy, "supportedSortBy"); + public ConnectorResource withSupportedSortBy(@Nullable List supportedSortBy) { this.supportedSortBy = supportedSortBy; return this; } - /** - * Supported fields on the detail endpoint. - */ - public ConnectorResource withSupportedFields(List supportedFields) { - Utils.checkNotNull(supportedFields, "supportedFields"); - this.supportedFields = Optional.ofNullable(supportedFields); - return this; - } - /** * Supported fields on the detail endpoint. */ - public ConnectorResource withSupportedFields(Optional> supportedFields) { - Utils.checkNotNull(supportedFields, "supportedFields"); + public ConnectorResource withSupportedFields(@Nullable List supportedFields) { this.supportedFields = supportedFields; return this; } - /** - * Supported fields on the list endpoint. - */ - public ConnectorResource withSupportedListFields(List supportedListFields) { - Utils.checkNotNull(supportedListFields, "supportedListFields"); - this.supportedListFields = Optional.ofNullable(supportedListFields); - return this; - } - /** * Supported fields on the list endpoint. */ - public ConnectorResource withSupportedListFields(Optional> supportedListFields) { - Utils.checkNotNull(supportedListFields, "supportedListFields"); + public ConnectorResource withSupportedListFields(@Nullable List supportedListFields) { this.supportedListFields = supportedListFields; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -608,300 +434,148 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private Optional downstreamId = Optional.empty(); + private String downstreamId; - private Optional downstreamName = Optional.empty(); + private String downstreamName; - private Optional status = Optional.empty(); + private ResourceStatus status; - private Optional paginationSupported = Optional.empty(); + private Boolean paginationSupported; - private Optional pagination = Optional.empty(); + private PaginationCoverage pagination; - private Optional customFieldsSupported = Optional.empty(); + private Boolean customFieldsSupported; - private Optional> supportedOperations = Optional.empty(); + private List supportedOperations; - private Optional> downstreamUnsupportedOperations = Optional.empty(); + private List downstreamUnsupportedOperations; - private Optional> supportedFilters = Optional.empty(); + private List supportedFilters; - private Optional> supportedSortBy = Optional.empty(); + private List supportedSortBy; - private Optional> supportedFields = Optional.empty(); + private List supportedFields; - private Optional> supportedListFields = Optional.empty(); + private List supportedListFields; private Builder() { // force use of static builder() method } - - /** - * ID of the resource, typically a lowercased version of name. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * ID of the resource, typically a lowercased version of name. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Name of the resource (plural) - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the resource (plural) */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * ID of the resource in the Connector's API (downstream) */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = Optional.ofNullable(downstreamId); - return this; - } - - /** - * ID of the resource in the Connector's API (downstream) - */ - public Builder downstreamId(Optional downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = downstreamId; return this; } - /** * Name of the resource in the Connector's API (downstream) */ - public Builder downstreamName(String downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); - this.downstreamName = Optional.ofNullable(downstreamName); - return this; - } - - /** - * Name of the resource in the Connector's API (downstream) - */ - public Builder downstreamName(Optional downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); + public Builder downstreamName(@Nullable String downstreamName) { this.downstreamName = downstreamName; return this; } - /** * Status of the resource. Resources with status live or beta are callable. */ - public Builder status(ResourceStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * Status of the resource. Resources with status live or beta are callable. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ResourceStatus status) { this.status = status; return this; } - - /** - * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. - */ - public Builder paginationSupported(boolean paginationSupported) { - Utils.checkNotNull(paginationSupported, "paginationSupported"); - this.paginationSupported = Optional.ofNullable(paginationSupported); - return this; - } - /** * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. */ - public Builder paginationSupported(Optional paginationSupported) { - Utils.checkNotNull(paginationSupported, "paginationSupported"); + public Builder paginationSupported(@Nullable Boolean paginationSupported) { this.paginationSupported = paginationSupported; return this; } - - public Builder pagination(PaginationCoverage pagination) { - Utils.checkNotNull(pagination, "pagination"); - this.pagination = Optional.ofNullable(pagination); - return this; - } - - public Builder pagination(Optional pagination) { - Utils.checkNotNull(pagination, "pagination"); + public Builder pagination(@Nullable PaginationCoverage pagination) { this.pagination = pagination; return this; } - /** * Indicates if custom fields are supported on this resource. */ - public Builder customFieldsSupported(boolean customFieldsSupported) { - Utils.checkNotNull(customFieldsSupported, "customFieldsSupported"); - this.customFieldsSupported = Optional.ofNullable(customFieldsSupported); - return this; - } - - /** - * Indicates if custom fields are supported on this resource. - */ - public Builder customFieldsSupported(Optional customFieldsSupported) { - Utils.checkNotNull(customFieldsSupported, "customFieldsSupported"); + public Builder customFieldsSupported(@Nullable Boolean customFieldsSupported) { this.customFieldsSupported = customFieldsSupported; return this; } - /** * List of supported operations on the resource. */ - public Builder supportedOperations(List supportedOperations) { - Utils.checkNotNull(supportedOperations, "supportedOperations"); - this.supportedOperations = Optional.ofNullable(supportedOperations); - return this; - } - - /** - * List of supported operations on the resource. - */ - public Builder supportedOperations(Optional> supportedOperations) { - Utils.checkNotNull(supportedOperations, "supportedOperations"); + public Builder supportedOperations(@Nullable List supportedOperations) { this.supportedOperations = supportedOperations; return this; } - - /** - * List of operations that are not supported on the downstream. - */ - public Builder downstreamUnsupportedOperations(List downstreamUnsupportedOperations) { - Utils.checkNotNull(downstreamUnsupportedOperations, "downstreamUnsupportedOperations"); - this.downstreamUnsupportedOperations = Optional.ofNullable(downstreamUnsupportedOperations); - return this; - } - /** * List of operations that are not supported on the downstream. */ - public Builder downstreamUnsupportedOperations(Optional> downstreamUnsupportedOperations) { - Utils.checkNotNull(downstreamUnsupportedOperations, "downstreamUnsupportedOperations"); + public Builder downstreamUnsupportedOperations(@Nullable List downstreamUnsupportedOperations) { this.downstreamUnsupportedOperations = downstreamUnsupportedOperations; return this; } - - /** - * Supported filters on the list endpoint of the resource. - */ - public Builder supportedFilters(List supportedFilters) { - Utils.checkNotNull(supportedFilters, "supportedFilters"); - this.supportedFilters = Optional.ofNullable(supportedFilters); - return this; - } - /** * Supported filters on the list endpoint of the resource. */ - public Builder supportedFilters(Optional> supportedFilters) { - Utils.checkNotNull(supportedFilters, "supportedFilters"); + public Builder supportedFilters(@Nullable List supportedFilters) { this.supportedFilters = supportedFilters; return this; } - /** * Supported sorting properties on the list endpoint of the resource. */ - public Builder supportedSortBy(List supportedSortBy) { - Utils.checkNotNull(supportedSortBy, "supportedSortBy"); - this.supportedSortBy = Optional.ofNullable(supportedSortBy); - return this; - } - - /** - * Supported sorting properties on the list endpoint of the resource. - */ - public Builder supportedSortBy(Optional> supportedSortBy) { - Utils.checkNotNull(supportedSortBy, "supportedSortBy"); + public Builder supportedSortBy(@Nullable List supportedSortBy) { this.supportedSortBy = supportedSortBy; return this; } - - /** - * Supported fields on the detail endpoint. - */ - public Builder supportedFields(List supportedFields) { - Utils.checkNotNull(supportedFields, "supportedFields"); - this.supportedFields = Optional.ofNullable(supportedFields); - return this; - } - /** * Supported fields on the detail endpoint. */ - public Builder supportedFields(Optional> supportedFields) { - Utils.checkNotNull(supportedFields, "supportedFields"); + public Builder supportedFields(@Nullable List supportedFields) { this.supportedFields = supportedFields; return this; } - /** * Supported fields on the list endpoint. */ - public Builder supportedListFields(List supportedListFields) { - Utils.checkNotNull(supportedListFields, "supportedListFields"); - this.supportedListFields = Optional.ofNullable(supportedListFields); - return this; - } - - /** - * Supported fields on the list endpoint. - */ - public Builder supportedListFields(Optional> supportedListFields) { - Utils.checkNotNull(supportedListFields, "supportedListFields"); + public Builder supportedListFields(@Nullable List supportedListFields) { this.supportedListFields = supportedListFields; return this; } public ConnectorResource build() { - return new ConnectorResource( id, name, downstreamId, downstreamName, status, paginationSupported, diff --git a/src/main/java/com/apideck/unify/models/components/ConnectorSetting.java b/src/main/java/com/apideck/unify/models/components/ConnectorSetting.java index 377d8065..b43915b6 100644 --- a/src/main/java/com/apideck/unify/models/components/ConnectorSetting.java +++ b/src/main/java/com/apideck/unify/models/components/ConnectorSetting.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -19,49 +18,42 @@ public class ConnectorSetting { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonInclude(Include.NON_ABSENT) @JsonProperty("label") - private Optional label; + private String label; @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private ConnectorSettingType type; @JsonCreator public ConnectorSetting( - @JsonProperty("id") Optional id, - @JsonProperty("label") Optional label, - @JsonProperty("type") Optional type) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(label, "label"); - Utils.checkNotNull(type, "type"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("label") @Nullable String label, + @JsonProperty("type") @Nullable ConnectorSettingType type) { this.id = id; this.label = label; this.type = type; } public ConnectorSetting() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } - @JsonIgnore public Optional label() { - return label; + return Optional.ofNullable(this.label); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } public static Builder builder() { @@ -69,45 +61,24 @@ public static Builder builder() { } - public ConnectorSetting withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - public ConnectorSetting withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ConnectorSetting withId(@Nullable String id) { this.id = id; return this; } - public ConnectorSetting withLabel(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - - public ConnectorSetting withLabel(Optional label) { - Utils.checkNotNull(label, "label"); + public ConnectorSetting withLabel(@Nullable String label) { this.label = label; return this; } - public ConnectorSetting withType(ConnectorSettingType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public ConnectorSetting withType(Optional type) { - Utils.checkNotNull(type, "type"); + public ConnectorSetting withType(@Nullable ConnectorSettingType type) { this.type = type; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -140,57 +111,32 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional label = Optional.empty(); + private String label; - private Optional type = Optional.empty(); + private ConnectorSettingType type; private Builder() { // force use of static builder() method } - - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - public Builder label(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - - public Builder label(Optional label) { - Utils.checkNotNull(label, "label"); + public Builder label(@Nullable String label) { this.label = label; return this; } - - public Builder type(ConnectorSettingType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ConnectorSettingType type) { this.type = type; return this; } public ConnectorSetting build() { - return new ConnectorSetting( id, label, type); } diff --git a/src/main/java/com/apideck/unify/models/components/ConnectorsFilter.java b/src/main/java/com/apideck/unify/models/components/ConnectorsFilter.java index e5c81d73..cc695a1b 100644 --- a/src/main/java/com/apideck/unify/models/components/ConnectorsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/ConnectorsFilter.java @@ -6,10 +6,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -18,44 +17,38 @@ public class ConnectorsFilter { * Name of Apideck Unified API */ @SpeakeasyMetadata("queryParam:name=unified_api") - private Optional unifiedApi; + private UnifiedApiId unifiedApi; /** * Status of the connector. Connectors with status live or beta are callable. */ @SpeakeasyMetadata("queryParam:name=status") - private Optional status; + private ConnectorStatus status; @JsonCreator public ConnectorsFilter( - Optional unifiedApi, - Optional status) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(status, "status"); + @Nullable UnifiedApiId unifiedApi, + @Nullable ConnectorStatus status) { this.unifiedApi = unifiedApi; this.status = status; } public ConnectorsFilter() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * Name of Apideck Unified API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unifiedApi() { - return (Optional) unifiedApi; + return Optional.ofNullable(this.unifiedApi); } /** * Status of the connector. Connectors with status live or beta are callable. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } public static Builder builder() { @@ -66,41 +59,21 @@ public static Builder builder() { /** * Name of Apideck Unified API */ - public ConnectorsFilter withUnifiedApi(UnifiedApiId unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = Optional.ofNullable(unifiedApi); - return this; - } - - - /** - * Name of Apideck Unified API - */ - public ConnectorsFilter withUnifiedApi(Optional unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); + public ConnectorsFilter withUnifiedApi(@Nullable UnifiedApiId unifiedApi) { this.unifiedApi = unifiedApi; return this; } - /** - * Status of the connector. Connectors with status live or beta are callable. - */ - public ConnectorsFilter withStatus(ConnectorStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the connector. Connectors with status live or beta are callable. */ - public ConnectorsFilter withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public ConnectorsFilter withStatus(@Nullable ConnectorStatus status) { this.status = status; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -131,54 +104,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional unifiedApi = Optional.empty(); + private UnifiedApiId unifiedApi; - private Optional status = Optional.empty(); + private ConnectorStatus status; private Builder() { // force use of static builder() method } - /** * Name of Apideck Unified API */ - public Builder unifiedApi(UnifiedApiId unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = Optional.ofNullable(unifiedApi); - return this; - } - - /** - * Name of Apideck Unified API - */ - public Builder unifiedApi(Optional unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); + public Builder unifiedApi(@Nullable UnifiedApiId unifiedApi) { this.unifiedApi = unifiedApi; return this; } - - /** - * Status of the connector. Connectors with status live or beta are callable. - */ - public Builder status(ConnectorStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the connector. Connectors with status live or beta are callable. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ConnectorStatus status) { this.status = status; return this; } public ConnectorsFilter build() { - return new ConnectorsFilter( unifiedApi, status); } diff --git a/src/main/java/com/apideck/unify/models/components/Consumer.java b/src/main/java/com/apideck/unify/models/components/Consumer.java index 6c6db56b..64037c9c 100644 --- a/src/main/java/com/apideck/unify/models/components/Consumer.java +++ b/src/main/java/com/apideck/unify/models/components/Consumer.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -29,73 +29,64 @@ public class Consumer { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("application_id") - private Optional applicationId; + private String applicationId; /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("metadata") - private Optional metadata; + private ConsumerMetadata metadata; @JsonInclude(Include.NON_ABSENT) @JsonProperty("connections") - private Optional> connections; + private List connections; @JsonInclude(Include.NON_ABSENT) @JsonProperty("services") - private Optional> services; + private List services; @JsonInclude(Include.NON_ABSENT) @JsonProperty("aggregated_request_count") - private Optional aggregatedRequestCount; + private Double aggregatedRequestCount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("request_counts") - private Optional requestCounts; + private RequestCountAllocation requestCounts; @JsonInclude(Include.NON_ABSENT) @JsonProperty("created") - private Optional created; + private String created; @JsonInclude(Include.NON_ABSENT) @JsonProperty("modified") - private Optional modified; + private String modified; @JsonInclude(Include.NON_ABSENT) @JsonProperty("request_count_updated") - private Optional requestCountUpdated; + private String requestCountUpdated; @JsonCreator public Consumer( - @JsonProperty("consumer_id") String consumerId, - @JsonProperty("application_id") Optional applicationId, - @JsonProperty("metadata") Optional metadata, - @JsonProperty("connections") Optional> connections, - @JsonProperty("services") Optional> services, - @JsonProperty("aggregated_request_count") Optional aggregatedRequestCount, - @JsonProperty("request_counts") Optional requestCounts, - @JsonProperty("created") Optional created, - @JsonProperty("modified") Optional modified, - @JsonProperty("request_count_updated") Optional requestCountUpdated) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(applicationId, "applicationId"); - Utils.checkNotNull(metadata, "metadata"); - Utils.checkNotNull(connections, "connections"); - Utils.checkNotNull(services, "services"); - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); - Utils.checkNotNull(requestCounts, "requestCounts"); - Utils.checkNotNull(created, "created"); - Utils.checkNotNull(modified, "modified"); - Utils.checkNotNull(requestCountUpdated, "requestCountUpdated"); - this.consumerId = consumerId; + @JsonProperty("consumer_id") @Nonnull String consumerId, + @JsonProperty("application_id") @Nullable String applicationId, + @JsonProperty("metadata") @Nullable ConsumerMetadata metadata, + @JsonProperty("connections") @Nullable List connections, + @JsonProperty("services") @Nullable List services, + @JsonProperty("aggregated_request_count") @Nullable Double aggregatedRequestCount, + @JsonProperty("request_counts") @Nullable RequestCountAllocation requestCounts, + @JsonProperty("created") @Nullable String created, + @JsonProperty("modified") @Nullable String modified, + @JsonProperty("request_count_updated") @Nullable String requestCountUpdated) { + this.consumerId = Optional.ofNullable(consumerId) + .orElseThrow(() -> new IllegalArgumentException("consumerId cannot be null")); this.applicationId = applicationId; this.metadata = metadata; this.connections = connections; @@ -108,74 +99,60 @@ public Consumer( } public Consumer( - String consumerId) { - this(consumerId, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + @Nonnull String consumerId) { + this(consumerId, null, null, + null, null, null, + null, null, null, + null); } /** * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. */ - @JsonIgnore public String consumerId() { - return consumerId; + return this.consumerId; } /** * ID of your Apideck Application */ - @JsonIgnore public Optional applicationId() { - return applicationId; + return Optional.ofNullable(this.applicationId); } /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional metadata() { - return (Optional) metadata; + return Optional.ofNullable(this.metadata); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> connections() { - return (Optional>) connections; + return Optional.ofNullable(this.connections); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> services() { - return (Optional>) services; + return Optional.ofNullable(this.services); } - @JsonIgnore public Optional aggregatedRequestCount() { - return aggregatedRequestCount; + return Optional.ofNullable(this.aggregatedRequestCount); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional requestCounts() { - return (Optional) requestCounts; + return Optional.ofNullable(this.requestCounts); } - @JsonIgnore public Optional created() { - return created; + return Optional.ofNullable(this.created); } - @JsonIgnore public Optional modified() { - return modified; + return Optional.ofNullable(this.modified); } - @JsonIgnore public Optional requestCountUpdated() { - return requestCountUpdated; + return Optional.ofNullable(this.requestCountUpdated); } public static Builder builder() { @@ -186,18 +163,8 @@ public static Builder builder() { /** * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. */ - public Consumer withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - /** - * ID of your Apideck Application - */ - public Consumer withApplicationId(String applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); - this.applicationId = Optional.ofNullable(applicationId); + public Consumer withConsumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } @@ -205,122 +172,63 @@ public Consumer withApplicationId(String applicationId) { /** * ID of your Apideck Application */ - public Consumer withApplicationId(Optional applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); + public Consumer withApplicationId(@Nullable String applicationId) { this.applicationId = applicationId; return this; } - /** - * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - */ - public Consumer withMetadata(ConsumerMetadata metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = Optional.ofNullable(metadata); - return this; - } - /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - public Consumer withMetadata(Optional metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Consumer withMetadata(@Nullable ConsumerMetadata metadata) { this.metadata = metadata; return this; } - public Consumer withConnections(List connections) { - Utils.checkNotNull(connections, "connections"); - this.connections = Optional.ofNullable(connections); - return this; - } - - public Consumer withConnections(Optional> connections) { - Utils.checkNotNull(connections, "connections"); + public Consumer withConnections(@Nullable List connections) { this.connections = connections; return this; } - public Consumer withServices(List services) { - Utils.checkNotNull(services, "services"); - this.services = Optional.ofNullable(services); - return this; - } - - public Consumer withServices(Optional> services) { - Utils.checkNotNull(services, "services"); + public Consumer withServices(@Nullable List services) { this.services = services; return this; } - public Consumer withAggregatedRequestCount(double aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); - this.aggregatedRequestCount = Optional.ofNullable(aggregatedRequestCount); - return this; - } - - public Consumer withAggregatedRequestCount(Optional aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); + public Consumer withAggregatedRequestCount(@Nullable Double aggregatedRequestCount) { this.aggregatedRequestCount = aggregatedRequestCount; return this; } - public Consumer withRequestCounts(RequestCountAllocation requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); - this.requestCounts = Optional.ofNullable(requestCounts); - return this; - } - - public Consumer withRequestCounts(Optional requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); + public Consumer withRequestCounts(@Nullable RequestCountAllocation requestCounts) { this.requestCounts = requestCounts; return this; } - public Consumer withCreated(String created) { - Utils.checkNotNull(created, "created"); - this.created = Optional.ofNullable(created); - return this; - } - - public Consumer withCreated(Optional created) { - Utils.checkNotNull(created, "created"); + public Consumer withCreated(@Nullable String created) { this.created = created; return this; } - public Consumer withModified(String modified) { - Utils.checkNotNull(modified, "modified"); - this.modified = Optional.ofNullable(modified); - return this; - } - - public Consumer withModified(Optional modified) { - Utils.checkNotNull(modified, "modified"); + public Consumer withModified(@Nullable String modified) { this.modified = modified; return this; } - public Consumer withRequestCountUpdated(String requestCountUpdated) { - Utils.checkNotNull(requestCountUpdated, "requestCountUpdated"); - this.requestCountUpdated = Optional.ofNullable(requestCountUpdated); - return this; - } - - public Consumer withRequestCountUpdated(Optional requestCountUpdated) { - Utils.checkNotNull(requestCountUpdated, "requestCountUpdated"); + public Consumer withRequestCountUpdated(@Nullable String requestCountUpdated) { this.requestCountUpdated = requestCountUpdated; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -372,169 +280,88 @@ public final static class Builder { private String consumerId; - private Optional applicationId = Optional.empty(); + private String applicationId; - private Optional metadata = Optional.empty(); + private ConsumerMetadata metadata; - private Optional> connections = Optional.empty(); + private List connections; - private Optional> services = Optional.empty(); + private List services; - private Optional aggregatedRequestCount = Optional.empty(); + private Double aggregatedRequestCount; - private Optional requestCounts = Optional.empty(); + private RequestCountAllocation requestCounts; - private Optional created = Optional.empty(); + private String created; - private Optional modified = Optional.empty(); + private String modified; - private Optional requestCountUpdated = Optional.empty(); + private String requestCountUpdated; private Builder() { // force use of static builder() method } - /** * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - - /** - * ID of your Apideck Application - */ - public Builder applicationId(String applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); - this.applicationId = Optional.ofNullable(applicationId); + public Builder consumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } /** * ID of your Apideck Application */ - public Builder applicationId(Optional applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); + public Builder applicationId(@Nullable String applicationId) { this.applicationId = applicationId; return this; } - - /** - * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - */ - public Builder metadata(ConsumerMetadata metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = Optional.ofNullable(metadata); - return this; - } - /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - public Builder metadata(Optional metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Builder metadata(@Nullable ConsumerMetadata metadata) { this.metadata = metadata; return this; } - - public Builder connections(List connections) { - Utils.checkNotNull(connections, "connections"); - this.connections = Optional.ofNullable(connections); - return this; - } - - public Builder connections(Optional> connections) { - Utils.checkNotNull(connections, "connections"); + public Builder connections(@Nullable List connections) { this.connections = connections; return this; } - - public Builder services(List services) { - Utils.checkNotNull(services, "services"); - this.services = Optional.ofNullable(services); - return this; - } - - public Builder services(Optional> services) { - Utils.checkNotNull(services, "services"); + public Builder services(@Nullable List services) { this.services = services; return this; } - - public Builder aggregatedRequestCount(double aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); - this.aggregatedRequestCount = Optional.ofNullable(aggregatedRequestCount); - return this; - } - - public Builder aggregatedRequestCount(Optional aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); + public Builder aggregatedRequestCount(@Nullable Double aggregatedRequestCount) { this.aggregatedRequestCount = aggregatedRequestCount; return this; } - - public Builder requestCounts(RequestCountAllocation requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); - this.requestCounts = Optional.ofNullable(requestCounts); - return this; - } - - public Builder requestCounts(Optional requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); + public Builder requestCounts(@Nullable RequestCountAllocation requestCounts) { this.requestCounts = requestCounts; return this; } - - public Builder created(String created) { - Utils.checkNotNull(created, "created"); - this.created = Optional.ofNullable(created); - return this; - } - - public Builder created(Optional created) { - Utils.checkNotNull(created, "created"); + public Builder created(@Nullable String created) { this.created = created; return this; } - - public Builder modified(String modified) { - Utils.checkNotNull(modified, "modified"); - this.modified = Optional.ofNullable(modified); - return this; - } - - public Builder modified(Optional modified) { - Utils.checkNotNull(modified, "modified"); + public Builder modified(@Nullable String modified) { this.modified = modified; return this; } - - public Builder requestCountUpdated(String requestCountUpdated) { - Utils.checkNotNull(requestCountUpdated, "requestCountUpdated"); - this.requestCountUpdated = Optional.ofNullable(requestCountUpdated); - return this; - } - - public Builder requestCountUpdated(Optional requestCountUpdated) { - Utils.checkNotNull(requestCountUpdated, "requestCountUpdated"); + public Builder requestCountUpdated(@Nullable String requestCountUpdated) { this.requestCountUpdated = requestCountUpdated; return this; } public Consumer build() { - return new Consumer( consumerId, applicationId, metadata, connections, services, aggregatedRequestCount, diff --git a/src/main/java/com/apideck/unify/models/components/ConsumerConnection.java b/src/main/java/com/apideck/unify/models/components/ConsumerConnection.java index 3cb9f879..3f01a461 100644 --- a/src/main/java/com/apideck/unify/models/components/ConsumerConnection.java +++ b/src/main/java/com/apideck/unify/models/components/ConsumerConnection.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,78 +22,78 @@ public class ConsumerConnection { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; @JsonInclude(Include.NON_ABSENT) @JsonProperty("icon") - private Optional icon; + private String icon; @JsonInclude(Include.NON_ABSENT) @JsonProperty("logo") - private Optional logo; + private String logo; @JsonInclude(Include.NON_ABSENT) @JsonProperty("website") - private Optional website; + private String website; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tag_line") - private Optional tagLine; + private String tagLine; @JsonInclude(Include.NON_ABSENT) @JsonProperty("service_id") - private Optional serviceId; + private String serviceId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("unified_api") - private Optional unifiedApi; + private String unifiedApi; @JsonInclude(Include.NON_ABSENT) @JsonProperty("consumer_id") - private Optional consumerId; + private String consumerId; /** * Type of authorization used by the connector */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("auth_type") - private Optional authType; + private AuthType authType; @JsonInclude(Include.NON_ABSENT) @JsonProperty("enabled") - private Optional enabled; + private Boolean enabled; /** * Connection settings. Values will persist to `form_fields` with corresponding id */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("settings") - private JsonNullable> settings; + private JsonNullable> settings; /** * Attach your own consumer specific metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("metadata") - private JsonNullable> metadata; + private JsonNullable> metadata; @JsonInclude(Include.NON_ABSENT) @JsonProperty("created_at") - private Optional createdAt; + private String createdAt; @JsonInclude(Include.NON_ABSENT) @@ -106,42 +105,26 @@ public class ConsumerConnection { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("state") - private Optional state; + private ConnectionState state; @JsonCreator public ConsumerConnection( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("icon") Optional icon, - @JsonProperty("logo") Optional logo, - @JsonProperty("website") Optional website, - @JsonProperty("tag_line") Optional tagLine, - @JsonProperty("service_id") Optional serviceId, - @JsonProperty("unified_api") Optional unifiedApi, - @JsonProperty("consumer_id") Optional consumerId, - @JsonProperty("auth_type") Optional authType, - @JsonProperty("enabled") Optional enabled, - @JsonProperty("settings") JsonNullable> settings, - @JsonProperty("metadata") JsonNullable> metadata, - @JsonProperty("created_at") Optional createdAt, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("state") Optional state) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(icon, "icon"); - Utils.checkNotNull(logo, "logo"); - Utils.checkNotNull(website, "website"); - Utils.checkNotNull(tagLine, "tagLine"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(authType, "authType"); - Utils.checkNotNull(enabled, "enabled"); - Utils.checkNotNull(settings, "settings"); - Utils.checkNotNull(metadata, "metadata"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(state, "state"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("icon") @Nullable String icon, + @JsonProperty("logo") @Nullable String logo, + @JsonProperty("website") @Nullable String website, + @JsonProperty("tag_line") @Nullable String tagLine, + @JsonProperty("service_id") @Nullable String serviceId, + @JsonProperty("unified_api") @Nullable String unifiedApi, + @JsonProperty("consumer_id") @Nullable String consumerId, + @JsonProperty("auth_type") @Nullable AuthType authType, + @JsonProperty("enabled") @Nullable Boolean enabled, + @JsonProperty("settings") @Nullable JsonNullable> settings, + @JsonProperty("metadata") @Nullable JsonNullable> metadata, + @JsonProperty("created_at") @Nullable String createdAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("state") @Nullable ConnectionState state) { this.id = id; this.name = name; this.icon = icon; @@ -153,116 +136,99 @@ public ConsumerConnection( this.consumerId = consumerId; this.authType = authType; this.enabled = enabled; - this.settings = settings; - this.metadata = metadata; + this.settings = Optional.ofNullable(settings) + .orElse(JsonNullable.undefined()); + this.metadata = Optional.ofNullable(metadata) + .orElse(JsonNullable.undefined()); this.createdAt = createdAt; - this.updatedAt = updatedAt; + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); this.state = state; } public ConsumerConnection() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } - @JsonIgnore public Optional icon() { - return icon; + return Optional.ofNullable(this.icon); } - @JsonIgnore public Optional logo() { - return logo; + return Optional.ofNullable(this.logo); } - @JsonIgnore public Optional website() { - return website; + return Optional.ofNullable(this.website); } - @JsonIgnore public Optional tagLine() { - return tagLine; + return Optional.ofNullable(this.tagLine); } - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public Optional unifiedApi() { - return unifiedApi; + return Optional.ofNullable(this.unifiedApi); } - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * Type of authorization used by the connector */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional authType() { - return (Optional) authType; + return Optional.ofNullable(this.authType); } - @JsonIgnore public Optional enabled() { - return enabled; + return Optional.ofNullable(this.enabled); } /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> settings() { - return (JsonNullable>) settings; + return this.settings; } /** * Attach your own consumer specific metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> metadata() { - return (JsonNullable>) metadata; + return this.metadata; } - @JsonIgnore public Optional createdAt() { - return createdAt; + return Optional.ofNullable(this.createdAt); } - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * [Connection state flow](#section/Connection-state) */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional state() { - return (Optional) state; + return Optional.ofNullable(this.state); } public static Builder builder() { @@ -270,222 +236,101 @@ public static Builder builder() { } - public ConsumerConnection withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - public ConsumerConnection withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ConsumerConnection withId(@Nullable String id) { this.id = id; return this; } - public ConsumerConnection withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - public ConsumerConnection withName(Optional name) { - Utils.checkNotNull(name, "name"); + public ConsumerConnection withName(@Nullable String name) { this.name = name; return this; } - public ConsumerConnection withIcon(String icon) { - Utils.checkNotNull(icon, "icon"); - this.icon = Optional.ofNullable(icon); - return this; - } - - public ConsumerConnection withIcon(Optional icon) { - Utils.checkNotNull(icon, "icon"); + public ConsumerConnection withIcon(@Nullable String icon) { this.icon = icon; return this; } - public ConsumerConnection withLogo(String logo) { - Utils.checkNotNull(logo, "logo"); - this.logo = Optional.ofNullable(logo); - return this; - } - - public ConsumerConnection withLogo(Optional logo) { - Utils.checkNotNull(logo, "logo"); + public ConsumerConnection withLogo(@Nullable String logo) { this.logo = logo; return this; } - public ConsumerConnection withWebsite(String website) { - Utils.checkNotNull(website, "website"); - this.website = Optional.ofNullable(website); - return this; - } - - public ConsumerConnection withWebsite(Optional website) { - Utils.checkNotNull(website, "website"); + public ConsumerConnection withWebsite(@Nullable String website) { this.website = website; return this; } - public ConsumerConnection withTagLine(String tagLine) { - Utils.checkNotNull(tagLine, "tagLine"); - this.tagLine = Optional.ofNullable(tagLine); - return this; - } - - public ConsumerConnection withTagLine(Optional tagLine) { - Utils.checkNotNull(tagLine, "tagLine"); + public ConsumerConnection withTagLine(@Nullable String tagLine) { this.tagLine = tagLine; return this; } - public ConsumerConnection withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - public ConsumerConnection withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public ConsumerConnection withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public ConsumerConnection withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = Optional.ofNullable(unifiedApi); - return this; - } - - public ConsumerConnection withUnifiedApi(Optional unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); + public ConsumerConnection withUnifiedApi(@Nullable String unifiedApi) { this.unifiedApi = unifiedApi; return this; } - public ConsumerConnection withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - public ConsumerConnection withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public ConsumerConnection withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * Type of authorization used by the connector - */ - public ConsumerConnection withAuthType(AuthType authType) { - Utils.checkNotNull(authType, "authType"); - this.authType = Optional.ofNullable(authType); - return this; - } - /** * Type of authorization used by the connector */ - public ConsumerConnection withAuthType(Optional authType) { - Utils.checkNotNull(authType, "authType"); + public ConsumerConnection withAuthType(@Nullable AuthType authType) { this.authType = authType; return this; } - public ConsumerConnection withEnabled(boolean enabled) { - Utils.checkNotNull(enabled, "enabled"); - this.enabled = Optional.ofNullable(enabled); - return this; - } - - public ConsumerConnection withEnabled(Optional enabled) { - Utils.checkNotNull(enabled, "enabled"); + public ConsumerConnection withEnabled(@Nullable Boolean enabled) { this.enabled = enabled; return this; } + /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - public ConsumerConnection withSettings(Map settings) { - Utils.checkNotNull(settings, "settings"); + public ConsumerConnection withSettings(@Nullable Map settings) { this.settings = JsonNullable.of(settings); return this; } - /** - * Connection settings. Values will persist to `form_fields` with corresponding id - */ - public ConsumerConnection withSettings(JsonNullable> settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = settings; - return this; - } /** * Attach your own consumer specific metadata */ - public ConsumerConnection withMetadata(Map metadata) { - Utils.checkNotNull(metadata, "metadata"); + public ConsumerConnection withMetadata(@Nullable Map metadata) { this.metadata = JsonNullable.of(metadata); return this; } - /** - * Attach your own consumer specific metadata - */ - public ConsumerConnection withMetadata(JsonNullable> metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = metadata; - return this; - } - - public ConsumerConnection withCreatedAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - public ConsumerConnection withCreatedAt(Optional createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public ConsumerConnection withCreatedAt(@Nullable String createdAt) { this.createdAt = createdAt; return this; } - public ConsumerConnection withUpdatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = JsonNullable.of(updatedAt); - return this; - } - - public ConsumerConnection withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - /** - * [Connection state flow](#section/Connection-state) - */ - public ConsumerConnection withState(ConnectionState state) { - Utils.checkNotNull(state, "state"); - this.state = Optional.ofNullable(state); + public ConsumerConnection withUpdatedAt(@Nullable String updatedAt) { + this.updatedAt = JsonNullable.of(updatedAt); return this; } @@ -493,12 +338,12 @@ public ConsumerConnection withState(ConnectionState state) { /** * [Connection state flow](#section/Connection-state) */ - public ConsumerConnection withState(Optional state) { - Utils.checkNotNull(state, "state"); + public ConsumerConnection withState(@Nullable ConnectionState state) { this.state = state; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -562,276 +407,135 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private Optional icon = Optional.empty(); + private String icon; - private Optional logo = Optional.empty(); + private String logo; - private Optional website = Optional.empty(); + private String website; - private Optional tagLine = Optional.empty(); + private String tagLine; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional unifiedApi = Optional.empty(); + private String unifiedApi; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional authType = Optional.empty(); + private AuthType authType; - private Optional enabled = Optional.empty(); + private Boolean enabled; - private JsonNullable> settings = JsonNullable.undefined(); + private JsonNullable> settings; - private JsonNullable> metadata = JsonNullable.undefined(); + private JsonNullable> metadata; - private Optional createdAt = Optional.empty(); + private String createdAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private Optional state = Optional.empty(); + private ConnectionState state; private Builder() { // force use of static builder() method } - - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - public Builder icon(String icon) { - Utils.checkNotNull(icon, "icon"); - this.icon = Optional.ofNullable(icon); - return this; - } - - public Builder icon(Optional icon) { - Utils.checkNotNull(icon, "icon"); + public Builder icon(@Nullable String icon) { this.icon = icon; return this; } - - public Builder logo(String logo) { - Utils.checkNotNull(logo, "logo"); - this.logo = Optional.ofNullable(logo); - return this; - } - - public Builder logo(Optional logo) { - Utils.checkNotNull(logo, "logo"); + public Builder logo(@Nullable String logo) { this.logo = logo; return this; } - - public Builder website(String website) { - Utils.checkNotNull(website, "website"); - this.website = Optional.ofNullable(website); - return this; - } - - public Builder website(Optional website) { - Utils.checkNotNull(website, "website"); + public Builder website(@Nullable String website) { this.website = website; return this; } - - public Builder tagLine(String tagLine) { - Utils.checkNotNull(tagLine, "tagLine"); - this.tagLine = Optional.ofNullable(tagLine); - return this; - } - - public Builder tagLine(Optional tagLine) { - Utils.checkNotNull(tagLine, "tagLine"); + public Builder tagLine(@Nullable String tagLine) { this.tagLine = tagLine; return this; } - - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = Optional.ofNullable(unifiedApi); - return this; - } - - public Builder unifiedApi(Optional unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); + public Builder unifiedApi(@Nullable String unifiedApi) { this.unifiedApi = unifiedApi; return this; } - - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * Type of authorization used by the connector - */ - public Builder authType(AuthType authType) { - Utils.checkNotNull(authType, "authType"); - this.authType = Optional.ofNullable(authType); - return this; - } - /** * Type of authorization used by the connector */ - public Builder authType(Optional authType) { - Utils.checkNotNull(authType, "authType"); + public Builder authType(@Nullable AuthType authType) { this.authType = authType; return this; } - - public Builder enabled(boolean enabled) { - Utils.checkNotNull(enabled, "enabled"); - this.enabled = Optional.ofNullable(enabled); - return this; - } - - public Builder enabled(Optional enabled) { - Utils.checkNotNull(enabled, "enabled"); + public Builder enabled(@Nullable Boolean enabled) { this.enabled = enabled; return this; } - /** * Connection settings. Values will persist to `form_fields` with corresponding id */ - public Builder settings(Map settings) { - Utils.checkNotNull(settings, "settings"); + public Builder settings(@Nullable Map settings) { this.settings = JsonNullable.of(settings); return this; } - /** - * Connection settings. Values will persist to `form_fields` with corresponding id - */ - public Builder settings(JsonNullable> settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = settings; - return this; - } - - /** * Attach your own consumer specific metadata */ - public Builder metadata(Map metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Builder metadata(@Nullable Map metadata) { this.metadata = JsonNullable.of(metadata); return this; } - /** - * Attach your own consumer specific metadata - */ - public Builder metadata(JsonNullable> metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = metadata; - return this; - } - - - public Builder createdAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - - public Builder createdAt(Optional createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable String createdAt) { this.createdAt = createdAt; return this; } - - public Builder updatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - - /** - * [Connection state flow](#section/Connection-state) - */ - public Builder state(ConnectionState state) { - Utils.checkNotNull(state, "state"); - this.state = Optional.ofNullable(state); - return this; - } - /** * [Connection state flow](#section/Connection-state) */ - public Builder state(Optional state) { - Utils.checkNotNull(state, "state"); + public Builder state(@Nullable ConnectionState state) { this.state = state; return this; } public ConsumerConnection build() { - return new ConsumerConnection( id, name, icon, logo, website, tagLine, diff --git a/src/main/java/com/apideck/unify/models/components/ConsumerInput.java b/src/main/java/com/apideck/unify/models/components/ConsumerInput.java index 54c49680..db10d3d5 100644 --- a/src/main/java/com/apideck/unify/models/components/ConsumerInput.java +++ b/src/main/java/com/apideck/unify/models/components/ConsumerInput.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -27,38 +27,34 @@ public class ConsumerInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("metadata") - private Optional metadata; + private ConsumerMetadata metadata; @JsonCreator public ConsumerInput( - @JsonProperty("consumer_id") String consumerId, - @JsonProperty("metadata") Optional metadata) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(metadata, "metadata"); - this.consumerId = consumerId; + @JsonProperty("consumer_id") @Nonnull String consumerId, + @JsonProperty("metadata") @Nullable ConsumerMetadata metadata) { + this.consumerId = Optional.ofNullable(consumerId) + .orElseThrow(() -> new IllegalArgumentException("consumerId cannot be null")); this.metadata = metadata; } public ConsumerInput( - String consumerId) { - this(consumerId, Optional.empty()); + @Nonnull String consumerId) { + this(consumerId, null); } /** * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. */ - @JsonIgnore public String consumerId() { - return consumerId; + return this.consumerId; } /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional metadata() { - return (Optional) metadata; + return Optional.ofNullable(this.metadata); } public static Builder builder() { @@ -69,18 +65,8 @@ public static Builder builder() { /** * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. */ - public ConsumerInput withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - /** - * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - */ - public ConsumerInput withMetadata(ConsumerMetadata metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = Optional.ofNullable(metadata); + public ConsumerInput withConsumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } @@ -88,12 +74,12 @@ public ConsumerInput withMetadata(ConsumerMetadata metadata) { /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - public ConsumerInput withMetadata(Optional metadata) { - Utils.checkNotNull(metadata, "metadata"); + public ConsumerInput withMetadata(@Nullable ConsumerMetadata metadata) { this.metadata = metadata; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -126,43 +112,29 @@ public final static class Builder { private String consumerId; - private Optional metadata = Optional.empty(); + private ConsumerMetadata metadata; private Builder() { // force use of static builder() method } - /** * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - - /** - * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - */ - public Builder metadata(ConsumerMetadata metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = Optional.ofNullable(metadata); + public Builder consumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - public Builder metadata(Optional metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Builder metadata(@Nullable ConsumerMetadata metadata) { this.metadata = metadata; return this; } public ConsumerInput build() { - return new ConsumerInput( consumerId, metadata); } diff --git a/src/main/java/com/apideck/unify/models/components/ConsumerMetadata.java b/src/main/java/com/apideck/unify/models/components/ConsumerMetadata.java index f6decc5b..5732a7f2 100644 --- a/src/main/java/com/apideck/unify/models/components/ConsumerMetadata.java +++ b/src/main/java/com/apideck/unify/models/components/ConsumerMetadata.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -24,39 +24,35 @@ public class ConsumerMetadata { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("account_name") - private Optional accountName; + private String accountName; /** * The name of the user as shown in the sidebar. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("user_name") - private Optional userName; + private String userName; /** * The email of the user as shown in the sidebar. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("email") - private Optional email; + private String email; /** * The avatar of the user in the sidebar. Must be a valid URL */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("image") - private Optional image; + private String image; @JsonCreator public ConsumerMetadata( - @JsonProperty("account_name") Optional accountName, - @JsonProperty("user_name") Optional userName, - @JsonProperty("email") Optional email, - @JsonProperty("image") Optional image) { - Utils.checkNotNull(accountName, "accountName"); - Utils.checkNotNull(userName, "userName"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(image, "image"); + @JsonProperty("account_name") @Nullable String accountName, + @JsonProperty("user_name") @Nullable String userName, + @JsonProperty("email") @Nullable String email, + @JsonProperty("image") @Nullable String image) { this.accountName = accountName; this.userName = userName; this.email = email; @@ -64,40 +60,36 @@ public ConsumerMetadata( } public ConsumerMetadata() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * The name of the account as shown in the sidebar. */ - @JsonIgnore public Optional accountName() { - return accountName; + return Optional.ofNullable(this.accountName); } /** * The name of the user as shown in the sidebar. */ - @JsonIgnore public Optional userName() { - return userName; + return Optional.ofNullable(this.userName); } /** * The email of the user as shown in the sidebar. */ - @JsonIgnore public Optional email() { - return email; + return Optional.ofNullable(this.email); } /** * The avatar of the user in the sidebar. Must be a valid URL */ - @JsonIgnore public Optional image() { - return image; + return Optional.ofNullable(this.image); } public static Builder builder() { @@ -108,79 +100,39 @@ public static Builder builder() { /** * The name of the account as shown in the sidebar. */ - public ConsumerMetadata withAccountName(String accountName) { - Utils.checkNotNull(accountName, "accountName"); - this.accountName = Optional.ofNullable(accountName); - return this; - } - - - /** - * The name of the account as shown in the sidebar. - */ - public ConsumerMetadata withAccountName(Optional accountName) { - Utils.checkNotNull(accountName, "accountName"); + public ConsumerMetadata withAccountName(@Nullable String accountName) { this.accountName = accountName; return this; } - /** - * The name of the user as shown in the sidebar. - */ - public ConsumerMetadata withUserName(String userName) { - Utils.checkNotNull(userName, "userName"); - this.userName = Optional.ofNullable(userName); - return this; - } - /** * The name of the user as shown in the sidebar. */ - public ConsumerMetadata withUserName(Optional userName) { - Utils.checkNotNull(userName, "userName"); + public ConsumerMetadata withUserName(@Nullable String userName) { this.userName = userName; return this; } - /** - * The email of the user as shown in the sidebar. - */ - public ConsumerMetadata withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - /** * The email of the user as shown in the sidebar. */ - public ConsumerMetadata withEmail(Optional email) { - Utils.checkNotNull(email, "email"); + public ConsumerMetadata withEmail(@Nullable String email) { this.email = email; return this; } - /** - * The avatar of the user in the sidebar. Must be a valid URL - */ - public ConsumerMetadata withImage(String image) { - Utils.checkNotNull(image, "image"); - this.image = Optional.ofNullable(image); - return this; - } - /** * The avatar of the user in the sidebar. Must be a valid URL */ - public ConsumerMetadata withImage(Optional image) { - Utils.checkNotNull(image, "image"); + public ConsumerMetadata withImage(@Nullable String image) { this.image = image; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -216,96 +168,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional accountName = Optional.empty(); + private String accountName; - private Optional userName = Optional.empty(); + private String userName; - private Optional email = Optional.empty(); + private String email; - private Optional image = Optional.empty(); + private String image; private Builder() { // force use of static builder() method } - /** * The name of the account as shown in the sidebar. */ - public Builder accountName(String accountName) { - Utils.checkNotNull(accountName, "accountName"); - this.accountName = Optional.ofNullable(accountName); - return this; - } - - /** - * The name of the account as shown in the sidebar. - */ - public Builder accountName(Optional accountName) { - Utils.checkNotNull(accountName, "accountName"); + public Builder accountName(@Nullable String accountName) { this.accountName = accountName; return this; } - - /** - * The name of the user as shown in the sidebar. - */ - public Builder userName(String userName) { - Utils.checkNotNull(userName, "userName"); - this.userName = Optional.ofNullable(userName); - return this; - } - /** * The name of the user as shown in the sidebar. */ - public Builder userName(Optional userName) { - Utils.checkNotNull(userName, "userName"); + public Builder userName(@Nullable String userName) { this.userName = userName; return this; } - /** * The email of the user as shown in the sidebar. */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - - /** - * The email of the user as shown in the sidebar. - */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } - /** * The avatar of the user in the sidebar. Must be a valid URL */ - public Builder image(String image) { - Utils.checkNotNull(image, "image"); - this.image = Optional.ofNullable(image); - return this; - } - - /** - * The avatar of the user in the sidebar. Must be a valid URL - */ - public Builder image(Optional image) { - Utils.checkNotNull(image, "image"); + public Builder image(@Nullable String image) { this.image = image; return this; } public ConsumerMetadata build() { - return new ConsumerMetadata( accountName, userName, email, image); diff --git a/src/main/java/com/apideck/unify/models/components/ConsumerRequestCountsInDateRangeResponse.java b/src/main/java/com/apideck/unify/models/components/ConsumerRequestCountsInDateRangeResponse.java index a0bd31af..005c2fba 100644 --- a/src/main/java/com/apideck/unify/models/components/ConsumerRequestCountsInDateRangeResponse.java +++ b/src/main/java/com/apideck/unify/models/components/ConsumerRequestCountsInDateRangeResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class ConsumerRequestCountsInDateRangeResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public ConsumerRequestCountsInDateRangeResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") ConsumerRequestCountsInDateRangeResponseData data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull ConsumerRequestCountsInDateRangeResponseData data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public ConsumerRequestCountsInDateRangeResponse( long statusCode, - String status, - ConsumerRequestCountsInDateRangeResponseData data) { + @Nonnull String status, + @Nonnull ConsumerRequestCountsInDateRangeResponseData data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public ConsumerRequestCountsInDateRangeResponseData data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public ConsumerRequestCountsInDateRangeResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public ConsumerRequestCountsInDateRangeResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public ConsumerRequestCountsInDateRangeResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public ConsumerRequestCountsInDateRangeResponse withData(ConsumerRequestCountsInDateRangeResponseData data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public ConsumerRequestCountsInDateRangeResponse withData(@Nonnull ConsumerRequestCountsInDateRangeResponseData data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public ConsumerRequestCountsInDateRangeResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public ConsumerRequestCountsInDateRangeResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public ConsumerRequestCountsInDateRangeResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private ConsumerRequestCountsInDateRangeResponseData data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(ConsumerRequestCountsInDateRangeResponseData data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull ConsumerRequestCountsInDateRangeResponseData data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public ConsumerRequestCountsInDateRangeResponse build() { - return new ConsumerRequestCountsInDateRangeResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/ConsumerRequestCountsInDateRangeResponseData.java b/src/main/java/com/apideck/unify/models/components/ConsumerRequestCountsInDateRangeResponseData.java index 4df2dca9..600aa6e4 100644 --- a/src/main/java/com/apideck/unify/models/components/ConsumerRequestCountsInDateRangeResponseData.java +++ b/src/main/java/com/apideck/unify/models/components/ConsumerRequestCountsInDateRangeResponseData.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,47 +19,41 @@ public class ConsumerRequestCountsInDateRangeResponseData { @JsonInclude(Include.NON_ABSENT) @JsonProperty("application_id") - private Optional applicationId; + private String applicationId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("consumer_id") - private Optional consumerId; + private String consumerId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("start_datetime") - private Optional startDatetime; + private String startDatetime; @JsonInclude(Include.NON_ABSENT) @JsonProperty("end_datetime") - private Optional endDatetime; + private String endDatetime; @JsonInclude(Include.NON_ABSENT) @JsonProperty("aggregated_request_count") - private Optional aggregatedRequestCount; + private Double aggregatedRequestCount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("request_counts") - private Optional requestCounts; + private RequestCountAllocation requestCounts; @JsonCreator public ConsumerRequestCountsInDateRangeResponseData( - @JsonProperty("application_id") Optional applicationId, - @JsonProperty("consumer_id") Optional consumerId, - @JsonProperty("start_datetime") Optional startDatetime, - @JsonProperty("end_datetime") Optional endDatetime, - @JsonProperty("aggregated_request_count") Optional aggregatedRequestCount, - @JsonProperty("request_counts") Optional requestCounts) { - Utils.checkNotNull(applicationId, "applicationId"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(startDatetime, "startDatetime"); - Utils.checkNotNull(endDatetime, "endDatetime"); - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); - Utils.checkNotNull(requestCounts, "requestCounts"); + @JsonProperty("application_id") @Nullable String applicationId, + @JsonProperty("consumer_id") @Nullable String consumerId, + @JsonProperty("start_datetime") @Nullable String startDatetime, + @JsonProperty("end_datetime") @Nullable String endDatetime, + @JsonProperty("aggregated_request_count") @Nullable Double aggregatedRequestCount, + @JsonProperty("request_counts") @Nullable RequestCountAllocation requestCounts) { this.applicationId = applicationId; this.consumerId = consumerId; this.startDatetime = startDatetime; @@ -70,39 +63,32 @@ public ConsumerRequestCountsInDateRangeResponseData( } public ConsumerRequestCountsInDateRangeResponseData() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null); } - @JsonIgnore public Optional applicationId() { - return applicationId; + return Optional.ofNullable(this.applicationId); } - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } - @JsonIgnore public Optional startDatetime() { - return startDatetime; + return Optional.ofNullable(this.startDatetime); } - @JsonIgnore public Optional endDatetime() { - return endDatetime; + return Optional.ofNullable(this.endDatetime); } - @JsonIgnore public Optional aggregatedRequestCount() { - return aggregatedRequestCount; + return Optional.ofNullable(this.aggregatedRequestCount); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional requestCounts() { - return (Optional) requestCounts; + return Optional.ofNullable(this.requestCounts); } public static Builder builder() { @@ -110,84 +96,42 @@ public static Builder builder() { } - public ConsumerRequestCountsInDateRangeResponseData withApplicationId(String applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); - this.applicationId = Optional.ofNullable(applicationId); - return this; - } - - - public ConsumerRequestCountsInDateRangeResponseData withApplicationId(Optional applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); + public ConsumerRequestCountsInDateRangeResponseData withApplicationId(@Nullable String applicationId) { this.applicationId = applicationId; return this; } - public ConsumerRequestCountsInDateRangeResponseData withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - public ConsumerRequestCountsInDateRangeResponseData withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public ConsumerRequestCountsInDateRangeResponseData withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - public ConsumerRequestCountsInDateRangeResponseData withStartDatetime(String startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); - this.startDatetime = Optional.ofNullable(startDatetime); - return this; - } - - public ConsumerRequestCountsInDateRangeResponseData withStartDatetime(Optional startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); + public ConsumerRequestCountsInDateRangeResponseData withStartDatetime(@Nullable String startDatetime) { this.startDatetime = startDatetime; return this; } - public ConsumerRequestCountsInDateRangeResponseData withEndDatetime(String endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); - this.endDatetime = Optional.ofNullable(endDatetime); - return this; - } - - public ConsumerRequestCountsInDateRangeResponseData withEndDatetime(Optional endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); + public ConsumerRequestCountsInDateRangeResponseData withEndDatetime(@Nullable String endDatetime) { this.endDatetime = endDatetime; return this; } - public ConsumerRequestCountsInDateRangeResponseData withAggregatedRequestCount(double aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); - this.aggregatedRequestCount = Optional.ofNullable(aggregatedRequestCount); - return this; - } - - public ConsumerRequestCountsInDateRangeResponseData withAggregatedRequestCount(Optional aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); + public ConsumerRequestCountsInDateRangeResponseData withAggregatedRequestCount(@Nullable Double aggregatedRequestCount) { this.aggregatedRequestCount = aggregatedRequestCount; return this; } - public ConsumerRequestCountsInDateRangeResponseData withRequestCounts(RequestCountAllocation requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); - this.requestCounts = Optional.ofNullable(requestCounts); - return this; - } - - public ConsumerRequestCountsInDateRangeResponseData withRequestCounts(Optional requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); + public ConsumerRequestCountsInDateRangeResponseData withRequestCounts(@Nullable RequestCountAllocation requestCounts) { this.requestCounts = requestCounts; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -227,102 +171,53 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional applicationId = Optional.empty(); + private String applicationId; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional startDatetime = Optional.empty(); + private String startDatetime; - private Optional endDatetime = Optional.empty(); + private String endDatetime; - private Optional aggregatedRequestCount = Optional.empty(); + private Double aggregatedRequestCount; - private Optional requestCounts = Optional.empty(); + private RequestCountAllocation requestCounts; private Builder() { // force use of static builder() method } - - public Builder applicationId(String applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); - this.applicationId = Optional.ofNullable(applicationId); - return this; - } - - public Builder applicationId(Optional applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); + public Builder applicationId(@Nullable String applicationId) { this.applicationId = applicationId; return this; } - - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - public Builder startDatetime(String startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); - this.startDatetime = Optional.ofNullable(startDatetime); - return this; - } - - public Builder startDatetime(Optional startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); + public Builder startDatetime(@Nullable String startDatetime) { this.startDatetime = startDatetime; return this; } - - public Builder endDatetime(String endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); - this.endDatetime = Optional.ofNullable(endDatetime); - return this; - } - - public Builder endDatetime(Optional endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); + public Builder endDatetime(@Nullable String endDatetime) { this.endDatetime = endDatetime; return this; } - - public Builder aggregatedRequestCount(double aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); - this.aggregatedRequestCount = Optional.ofNullable(aggregatedRequestCount); - return this; - } - - public Builder aggregatedRequestCount(Optional aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); + public Builder aggregatedRequestCount(@Nullable Double aggregatedRequestCount) { this.aggregatedRequestCount = aggregatedRequestCount; return this; } - - public Builder requestCounts(RequestCountAllocation requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); - this.requestCounts = Optional.ofNullable(requestCounts); - return this; - } - - public Builder requestCounts(Optional requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); + public Builder requestCounts(@Nullable RequestCountAllocation requestCounts) { this.requestCounts = requestCounts; return this; } public ConsumerRequestCountsInDateRangeResponseData build() { - return new ConsumerRequestCountsInDateRangeResponseData( applicationId, consumerId, startDatetime, endDatetime, aggregatedRequestCount, requestCounts); diff --git a/src/main/java/com/apideck/unify/models/components/Contact.java b/src/main/java/com/apideck/unify/models/components/Contact.java index af40be07..8c575009 100644 --- a/src/main/java/com/apideck/unify/models/components/Contact.java +++ b/src/main/java/com/apideck/unify/models/components/Contact.java @@ -5,17 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -29,7 +28,7 @@ public class Contact { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Full name of the contact. @@ -50,7 +49,7 @@ public class Contact { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The company the contact is associated with. @@ -134,7 +133,7 @@ public class Contact { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("gender") - private JsonNullable gender; + private JsonNullable gender; /** * The birthday of the contact. @@ -204,27 +203,27 @@ public class Contact { @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("social_links") - private Optional> socialLinks; + private List socialLinks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @@ -234,12 +233,12 @@ public class Contact { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private JsonNullable> customFields; + private JsonNullable> customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; /** * The first call date of the contact. @@ -267,7 +266,7 @@ public class Contact { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The last update date of the contact. @@ -288,295 +287,268 @@ public class Contact { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("opportunity_ids") - private Optional> opportunityIds; + private List opportunityIds; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Contact( - @JsonProperty("id") Optional id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("type") JsonNullable type, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("lead_id") JsonNullable leadId, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("prefix") JsonNullable prefix, - @JsonProperty("suffix") JsonNullable suffix, - @JsonProperty("title") JsonNullable title, - @JsonProperty("department") JsonNullable department, - @JsonProperty("language") JsonNullable language, - @JsonProperty("gender") JsonNullable gender, - @JsonProperty("birthday") JsonNullable birthday, - @JsonProperty("image") JsonNullable image, - @JsonProperty("photo_url") JsonNullable photoUrl, - @JsonProperty("lead_source") JsonNullable leadSource, - @JsonProperty("fax") JsonNullable fax, - @JsonProperty("description") JsonNullable description, - @JsonProperty("current_balance") JsonNullable currentBalance, - @JsonProperty("status") JsonNullable status, - @JsonProperty("active") JsonNullable active, - @JsonProperty("websites") Optional> websites, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("social_links") Optional> socialLinks, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("email_domain") JsonNullable emailDomain, - @JsonProperty("custom_fields") JsonNullable> customFields, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("first_call_at") JsonNullable firstCallAt, - @JsonProperty("first_email_at") JsonNullable firstEmailAt, - @JsonProperty("last_activity_at") JsonNullable lastActivityAt, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("opportunity_ids") Optional> opportunityIds, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(leadId, "leadId"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(prefix, "prefix"); - Utils.checkNotNull(suffix, "suffix"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(department, "department"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(gender, "gender"); - Utils.checkNotNull(birthday, "birthday"); - Utils.checkNotNull(image, "image"); - Utils.checkNotNull(photoUrl, "photoUrl"); - Utils.checkNotNull(leadSource, "leadSource"); - Utils.checkNotNull(fax, "fax"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(currentBalance, "currentBalance"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(socialLinks, "socialLinks"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(emailDomain, "emailDomain"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(firstCallAt, "firstCallAt"); - Utils.checkNotNull(firstEmailAt, "firstEmailAt"); - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(opportunityIds, "opportunityIds"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("lead_id") @Nullable JsonNullable leadId, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("prefix") @Nullable JsonNullable prefix, + @JsonProperty("suffix") @Nullable JsonNullable suffix, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("department") @Nullable JsonNullable department, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("gender") @Nullable JsonNullable gender, + @JsonProperty("birthday") @Nullable JsonNullable birthday, + @JsonProperty("image") @Nullable JsonNullable image, + @JsonProperty("photo_url") @Nullable JsonNullable photoUrl, + @JsonProperty("lead_source") @Nullable JsonNullable leadSource, + @JsonProperty("fax") @Nullable JsonNullable fax, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("current_balance") @Nullable JsonNullable currentBalance, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("active") @Nullable JsonNullable active, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("social_links") @Nullable List socialLinks, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("email_domain") @Nullable JsonNullable emailDomain, + @JsonProperty("custom_fields") @Nullable JsonNullable> customFields, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("first_call_at") @Nullable JsonNullable firstCallAt, + @JsonProperty("first_email_at") @Nullable JsonNullable firstEmailAt, + @JsonProperty("last_activity_at") @Nullable JsonNullable lastActivityAt, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("opportunity_ids") @Nullable List opportunityIds, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.name = name; - this.ownerId = ownerId; - this.type = type; - this.companyId = companyId; - this.companyName = companyName; - this.leadId = leadId; - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.prefix = prefix; - this.suffix = suffix; - this.title = title; - this.department = department; - this.language = language; - this.gender = gender; - this.birthday = birthday; - this.image = image; - this.photoUrl = photoUrl; - this.leadSource = leadSource; - this.fax = fax; - this.description = description; - this.currentBalance = currentBalance; - this.status = status; - this.active = active; + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.leadId = Optional.ofNullable(leadId) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.prefix = Optional.ofNullable(prefix) + .orElse(JsonNullable.undefined()); + this.suffix = Optional.ofNullable(suffix) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.department = Optional.ofNullable(department) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.gender = Optional.ofNullable(gender) + .orElse(JsonNullable.undefined()); + this.birthday = Optional.ofNullable(birthday) + .orElse(JsonNullable.undefined()); + this.image = Optional.ofNullable(image) + .orElse(JsonNullable.undefined()); + this.photoUrl = Optional.ofNullable(photoUrl) + .orElse(JsonNullable.undefined()); + this.leadSource = Optional.ofNullable(leadSource) + .orElse(JsonNullable.undefined()); + this.fax = Optional.ofNullable(fax) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.currentBalance = Optional.ofNullable(currentBalance) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.active = Optional.ofNullable(active) + .orElse(JsonNullable.undefined()); this.websites = websites; this.addresses = addresses; this.socialLinks = socialLinks; this.phoneNumbers = phoneNumbers; this.emails = emails; - this.emailDomain = emailDomain; - this.customFields = customFields; - this.tags = tags; - this.firstCallAt = firstCallAt; - this.firstEmailAt = firstEmailAt; - this.lastActivityAt = lastActivityAt; - this.customMappings = customMappings; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.emailDomain = Optional.ofNullable(emailDomain) + .orElse(JsonNullable.undefined()); + this.customFields = Optional.ofNullable(customFields) + .orElse(JsonNullable.undefined()); + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); + this.firstCallAt = Optional.ofNullable(firstCallAt) + .orElse(JsonNullable.undefined()); + this.firstEmailAt = Optional.ofNullable(firstEmailAt) + .orElse(JsonNullable.undefined()); + this.lastActivityAt = Optional.ofNullable(lastActivityAt) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.opportunityIds = opportunityIds; this.passThrough = passThrough; } public Contact() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * Unique identifier for the contact. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Full name of the contact. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The owner of the contact. */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The type of the contact. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The company the contact is associated with. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The name of the company the contact is associated with. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The lead the contact is associated with. */ - @JsonIgnore public JsonNullable leadId() { - return leadId; + return this.leadId; } /** * The first name of the contact. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The middle name of the contact. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The last name of the contact. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * The prefix of the contact. */ - @JsonIgnore public JsonNullable prefix() { - return prefix; + return this.prefix; } /** * The suffix of the contact. */ - @JsonIgnore public JsonNullable suffix() { - return suffix; + return this.suffix; } /** * The job title of the contact. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The department of the contact. */ - @JsonIgnore public JsonNullable department() { - return department; + return this.department; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } /** * The gender of the contact. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable gender() { - return (JsonNullable) gender; + return this.gender; } /** * The birthday of the contact. */ - @JsonIgnore public JsonNullable birthday() { - return birthday; + return this.birthday; } /** @@ -584,179 +556,145 @@ public JsonNullable birthday() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable image() { - return image; + return this.image; } /** * The URL of the photo of a person. */ - @JsonIgnore public JsonNullable photoUrl() { - return photoUrl; + return this.photoUrl; } /** * The lead source of the contact. */ - @JsonIgnore public JsonNullable leadSource() { - return leadSource; + return this.leadSource; } /** * The fax number of the contact. */ - @JsonIgnore public JsonNullable fax() { - return fax; + return this.fax; } /** * The description of the contact. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The current balance of the contact. */ - @JsonIgnore public JsonNullable currentBalance() { - return currentBalance; + return this.currentBalance; } /** * The status of the contact. */ - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * The active status of the contact. */ - @JsonIgnore public JsonNullable active() { - return active; + return this.active; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> socialLinks() { - return (Optional>) socialLinks; + return Optional.ofNullable(this.socialLinks); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @JsonIgnore public JsonNullable emailDomain() { - return emailDomain; + return this.emailDomain; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customFields() { - return (JsonNullable>) customFields; + return this.customFields; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } /** * The first call date of the contact. */ - @JsonIgnore public JsonNullable firstCallAt() { - return firstCallAt; + return this.firstCallAt; } /** * The first email date of the contact. */ - @JsonIgnore public JsonNullable firstEmailAt() { - return firstEmailAt; + return this.firstEmailAt; } /** * The last activity date of the contact. */ - @JsonIgnore public JsonNullable lastActivityAt() { - return lastActivityAt; + return this.lastActivityAt; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The last update date of the contact. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The creation date of the contact. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The opportunity ids of the contact. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> opportunityIds() { - return (Optional>) opportunityIds; + return Optional.ofNullable(this.opportunityIds); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -767,705 +705,350 @@ public static Builder builder() { /** * Unique identifier for the contact. */ - public Contact withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * Unique identifier for the contact. - */ - public Contact withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Contact withId(@Nullable String id) { this.id = id; return this; } + /** * Full name of the contact. */ - public Contact withName(String name) { - Utils.checkNotNull(name, "name"); + public Contact withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the contact. - */ - public Contact withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The owner of the contact. */ - public Contact withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Contact withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the contact. - */ - public Contact withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The type of the contact. */ - public Contact withType(ContactType type) { - Utils.checkNotNull(type, "type"); + public Contact withType(@Nullable ContactType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of the contact. - */ - public Contact withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The company the contact is associated with. */ - public Contact withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Contact withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company the contact is associated with. - */ - public Contact withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The name of the company the contact is associated with. */ - public Contact withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Contact withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company the contact is associated with. - */ - public Contact withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The lead the contact is associated with. */ - public Contact withLeadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Contact withLeadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead the contact is associated with. - */ - public Contact withLeadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } /** * The first name of the contact. */ - public Contact withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Contact withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the contact. - */ - public Contact withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The middle name of the contact. */ - public Contact withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Contact withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * The middle name of the contact. - */ - public Contact withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The last name of the contact. */ - public Contact withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Contact withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the contact. - */ - public Contact withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * The prefix of the contact. */ - public Contact withPrefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public Contact withPrefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * The prefix of the contact. - */ - public Contact withPrefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } /** * The suffix of the contact. */ - public Contact withSuffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Contact withSuffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - /** - * The suffix of the contact. - */ - public Contact withSuffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } /** * The job title of the contact. */ - public Contact withTitle(String title) { - Utils.checkNotNull(title, "title"); + public Contact withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the contact. - */ - public Contact withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The department of the contact. */ - public Contact withDepartment(String department) { - Utils.checkNotNull(department, "department"); + public Contact withDepartment(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department of the contact. - */ - public Contact withDepartment(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public Contact withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public Contact withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Contact withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } /** * The gender of the contact. */ - public Contact withGender(ContactGender gender) { - Utils.checkNotNull(gender, "gender"); + public Contact withGender(@Nullable ContactGender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender of the contact. - */ - public Contact withGender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } /** * The birthday of the contact. */ - public Contact withBirthday(String birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Contact withBirthday(@Nullable String birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The birthday of the contact. - */ - public Contact withBirthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Contact withImage(String image) { - Utils.checkNotNull(image, "image"); + public Contact withImage(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Contact withImage(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } /** * The URL of the photo of a person. */ - public Contact withPhotoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public Contact withPhotoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public Contact withPhotoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } /** * The lead source of the contact. */ - public Contact withLeadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public Contact withLeadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The lead source of the contact. - */ - public Contact withLeadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } /** * The fax number of the contact. */ - public Contact withFax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Contact withFax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the contact. - */ - public Contact withFax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } /** * The description of the contact. */ - public Contact withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Contact withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the contact. - */ - public Contact withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The current balance of the contact. */ - public Contact withCurrentBalance(double currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); + public Contact withCurrentBalance(@Nullable Double currentBalance) { this.currentBalance = JsonNullable.of(currentBalance); return this; } - /** - * The current balance of the contact. - */ - public Contact withCurrentBalance(JsonNullable currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); - this.currentBalance = currentBalance; - return this; - } /** * The status of the contact. */ - public Contact withStatus(String status) { - Utils.checkNotNull(status, "status"); + public Contact withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the contact. - */ - public Contact withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The active status of the contact. */ - public Contact withActive(boolean active) { - Utils.checkNotNull(active, "active"); + public Contact withActive(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * The active status of the contact. - */ - public Contact withActive(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - public Contact withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - - public Contact withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Contact withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public Contact withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Contact withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Contact withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public Contact withSocialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Contact withSocialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Contact withSocialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - public Contact withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Contact withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Contact withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Contact withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Contact withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Contact withEmails(@Nullable List emails) { this.emails = emails; return this; } - public Contact withEmailDomain(String emailDomain) { - Utils.checkNotNull(emailDomain, "emailDomain"); + + public Contact withEmailDomain(@Nullable String emailDomain) { this.emailDomain = JsonNullable.of(emailDomain); return this; } - public Contact withEmailDomain(JsonNullable emailDomain) { - Utils.checkNotNull(emailDomain, "emailDomain"); - this.emailDomain = emailDomain; - return this; - } - public Contact withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Contact withCustomFields(@Nullable List customFields) { this.customFields = JsonNullable.of(customFields); return this; } - public Contact withCustomFields(JsonNullable> customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = customFields; - return this; - } - public Contact withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Contact withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Contact withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } /** * The first call date of the contact. */ - public Contact withFirstCallAt(OffsetDateTime firstCallAt) { - Utils.checkNotNull(firstCallAt, "firstCallAt"); + public Contact withFirstCallAt(@Nullable OffsetDateTime firstCallAt) { this.firstCallAt = JsonNullable.of(firstCallAt); return this; } - /** - * The first call date of the contact. - */ - public Contact withFirstCallAt(JsonNullable firstCallAt) { - Utils.checkNotNull(firstCallAt, "firstCallAt"); - this.firstCallAt = firstCallAt; - return this; - } /** * The first email date of the contact. */ - public Contact withFirstEmailAt(OffsetDateTime firstEmailAt) { - Utils.checkNotNull(firstEmailAt, "firstEmailAt"); + public Contact withFirstEmailAt(@Nullable OffsetDateTime firstEmailAt) { this.firstEmailAt = JsonNullable.of(firstEmailAt); return this; } - /** - * The first email date of the contact. - */ - public Contact withFirstEmailAt(JsonNullable firstEmailAt) { - Utils.checkNotNull(firstEmailAt, "firstEmailAt"); - this.firstEmailAt = firstEmailAt; - return this; - } /** * The last activity date of the contact. */ - public Contact withLastActivityAt(OffsetDateTime lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); + public Contact withLastActivityAt(@Nullable OffsetDateTime lastActivityAt) { this.lastActivityAt = JsonNullable.of(lastActivityAt); return this; } - /** - * The last activity date of the contact. - */ - public Contact withLastActivityAt(JsonNullable lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); - this.lastActivityAt = lastActivityAt; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Contact withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Contact withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Contact withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The last update date of the contact. */ - public Contact withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Contact withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The last update date of the contact. - */ - public Contact withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The creation date of the contact. */ - public Contact withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Contact withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The creation date of the contact. - */ - public Contact withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The opportunity ids of the contact. */ - public Contact withOpportunityIds(List opportunityIds) { - Utils.checkNotNull(opportunityIds, "opportunityIds"); - this.opportunityIds = Optional.ofNullable(opportunityIds); - return this; - } - - - /** - * The opportunity ids of the contact. - */ - public Contact withOpportunityIds(Optional> opportunityIds) { - Utils.checkNotNull(opportunityIds, "opportunityIds"); + public Contact withOpportunityIds(@Nullable List opportunityIds) { this.opportunityIds = opportunityIds; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Contact withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Contact withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Contact withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1587,830 +1170,400 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable leadId = JsonNullable.undefined(); + private JsonNullable leadId; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable prefix = JsonNullable.undefined(); + private JsonNullable prefix; - private JsonNullable suffix = JsonNullable.undefined(); + private JsonNullable suffix; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable department = JsonNullable.undefined(); + private JsonNullable department; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable gender = JsonNullable.undefined(); + private JsonNullable gender; - private JsonNullable birthday = JsonNullable.undefined(); + private JsonNullable birthday; @Deprecated - private JsonNullable image = JsonNullable.undefined(); + private JsonNullable image; - private JsonNullable photoUrl = JsonNullable.undefined(); + private JsonNullable photoUrl; - private JsonNullable leadSource = JsonNullable.undefined(); + private JsonNullable leadSource; - private JsonNullable fax = JsonNullable.undefined(); + private JsonNullable fax; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable currentBalance = JsonNullable.undefined(); + private JsonNullable currentBalance; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable active = JsonNullable.undefined(); + private JsonNullable active; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> socialLinks = Optional.empty(); + private List socialLinks; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private JsonNullable emailDomain = JsonNullable.undefined(); + private JsonNullable emailDomain; - private JsonNullable> customFields = JsonNullable.undefined(); + private JsonNullable> customFields; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private JsonNullable firstCallAt = JsonNullable.undefined(); + private JsonNullable firstCallAt; - private JsonNullable firstEmailAt = JsonNullable.undefined(); + private JsonNullable firstEmailAt; - private JsonNullable lastActivityAt = JsonNullable.undefined(); + private JsonNullable lastActivityAt; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> opportunityIds = Optional.empty(); + private List opportunityIds; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * Unique identifier for the contact. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * Unique identifier for the contact. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Full name of the contact. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the contact. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The owner of the contact. */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the contact. - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The type of the contact. */ - public Builder type(ContactType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ContactType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of the contact. - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The company the contact is associated with. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company the contact is associated with. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The name of the company the contact is associated with. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company the contact is associated with. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The lead the contact is associated with. */ - public Builder leadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Builder leadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead the contact is associated with. - */ - public Builder leadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } - - /** * The first name of the contact. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the contact. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The middle name of the contact. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * The middle name of the contact. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The last name of the contact. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the contact. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * The prefix of the contact. */ - public Builder prefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public Builder prefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * The prefix of the contact. - */ - public Builder prefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } - - /** * The suffix of the contact. */ - public Builder suffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Builder suffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - /** - * The suffix of the contact. - */ - public Builder suffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } - - /** * The job title of the contact. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the contact. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The department of the contact. */ - public Builder department(String department) { - Utils.checkNotNull(department, "department"); + public Builder department(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department of the contact. - */ - public Builder department(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - /** * The gender of the contact. */ - public Builder gender(ContactGender gender) { - Utils.checkNotNull(gender, "gender"); + public Builder gender(@Nullable ContactGender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender of the contact. - */ - public Builder gender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } - - /** * The birthday of the contact. */ - public Builder birthday(String birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Builder birthday(@Nullable String birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The birthday of the contact. - */ - public Builder birthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder image(String image) { - Utils.checkNotNull(image, "image"); + public Builder image(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder image(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } - - /** * The URL of the photo of a person. */ - public Builder photoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public Builder photoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public Builder photoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } - - /** * The lead source of the contact. */ - public Builder leadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public Builder leadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The lead source of the contact. - */ - public Builder leadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } - - /** * The fax number of the contact. */ - public Builder fax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Builder fax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the contact. - */ - public Builder fax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } - - /** * The description of the contact. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the contact. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The current balance of the contact. */ - public Builder currentBalance(double currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); + public Builder currentBalance(@Nullable Double currentBalance) { this.currentBalance = JsonNullable.of(currentBalance); return this; } - /** - * The current balance of the contact. - */ - public Builder currentBalance(JsonNullable currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); - this.currentBalance = currentBalance; - return this; - } - - /** * The status of the contact. */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the contact. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The active status of the contact. */ - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * The active status of the contact. - */ - public Builder active(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder socialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Builder socialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Builder socialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder emailDomain(String emailDomain) { - Utils.checkNotNull(emailDomain, "emailDomain"); + public Builder emailDomain(@Nullable String emailDomain) { this.emailDomain = JsonNullable.of(emailDomain); return this; } - public Builder emailDomain(JsonNullable emailDomain) { - Utils.checkNotNull(emailDomain, "emailDomain"); - this.emailDomain = emailDomain; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = JsonNullable.of(customFields); return this; } - public Builder customFields(JsonNullable> customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = customFields; - return this; - } - - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** * The first call date of the contact. */ - public Builder firstCallAt(OffsetDateTime firstCallAt) { - Utils.checkNotNull(firstCallAt, "firstCallAt"); + public Builder firstCallAt(@Nullable OffsetDateTime firstCallAt) { this.firstCallAt = JsonNullable.of(firstCallAt); return this; } - /** - * The first call date of the contact. - */ - public Builder firstCallAt(JsonNullable firstCallAt) { - Utils.checkNotNull(firstCallAt, "firstCallAt"); - this.firstCallAt = firstCallAt; - return this; - } - - /** * The first email date of the contact. */ - public Builder firstEmailAt(OffsetDateTime firstEmailAt) { - Utils.checkNotNull(firstEmailAt, "firstEmailAt"); + public Builder firstEmailAt(@Nullable OffsetDateTime firstEmailAt) { this.firstEmailAt = JsonNullable.of(firstEmailAt); return this; } - /** - * The first email date of the contact. - */ - public Builder firstEmailAt(JsonNullable firstEmailAt) { - Utils.checkNotNull(firstEmailAt, "firstEmailAt"); - this.firstEmailAt = firstEmailAt; - return this; - } - - /** * The last activity date of the contact. */ - public Builder lastActivityAt(OffsetDateTime lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); + public Builder lastActivityAt(@Nullable OffsetDateTime lastActivityAt) { this.lastActivityAt = JsonNullable.of(lastActivityAt); return this; } - /** - * The last activity date of the contact. - */ - public Builder lastActivityAt(JsonNullable lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); - this.lastActivityAt = lastActivityAt; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The last update date of the contact. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The last update date of the contact. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The creation date of the contact. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The creation date of the contact. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The opportunity ids of the contact. - */ - public Builder opportunityIds(List opportunityIds) { - Utils.checkNotNull(opportunityIds, "opportunityIds"); - this.opportunityIds = Optional.ofNullable(opportunityIds); - return this; - } - /** * The opportunity ids of the contact. */ - public Builder opportunityIds(Optional> opportunityIds) { - Utils.checkNotNull(opportunityIds, "opportunityIds"); + public Builder opportunityIds(@Nullable List opportunityIds) { this.opportunityIds = opportunityIds; return this; } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Contact build() { - return new Contact( id, name, ownerId, type, companyId, companyName, diff --git a/src/main/java/com/apideck/unify/models/components/ContactInput.java b/src/main/java/com/apideck/unify/models/components/ContactInput.java index 81b1988d..26522f0a 100644 --- a/src/main/java/com/apideck/unify/models/components/ContactInput.java +++ b/src/main/java/com/apideck/unify/models/components/ContactInput.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -40,7 +39,7 @@ public class ContactInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The company the contact is associated with. @@ -124,7 +123,7 @@ public class ContactInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("gender") - private JsonNullable gender; + private JsonNullable gender; /** * The birthday of the contact. @@ -194,27 +193,27 @@ public class ContactInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("social_links") - private Optional> socialLinks; + private List socialLinks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @@ -224,276 +223,251 @@ public class ContactInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private JsonNullable> customFields; + private JsonNullable> customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; /** * The opportunity ids of the contact. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("opportunity_ids") - private Optional> opportunityIds; + private List opportunityIds; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public ContactInput( - @JsonProperty("name") JsonNullable name, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("type") JsonNullable type, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("lead_id") JsonNullable leadId, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("prefix") JsonNullable prefix, - @JsonProperty("suffix") JsonNullable suffix, - @JsonProperty("title") JsonNullable title, - @JsonProperty("department") JsonNullable department, - @JsonProperty("language") JsonNullable language, - @JsonProperty("gender") JsonNullable gender, - @JsonProperty("birthday") JsonNullable birthday, - @JsonProperty("image") JsonNullable image, - @JsonProperty("photo_url") JsonNullable photoUrl, - @JsonProperty("lead_source") JsonNullable leadSource, - @JsonProperty("fax") JsonNullable fax, - @JsonProperty("description") JsonNullable description, - @JsonProperty("current_balance") JsonNullable currentBalance, - @JsonProperty("status") JsonNullable status, - @JsonProperty("active") JsonNullable active, - @JsonProperty("websites") Optional> websites, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("social_links") Optional> socialLinks, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("email_domain") JsonNullable emailDomain, - @JsonProperty("custom_fields") JsonNullable> customFields, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("opportunity_ids") Optional> opportunityIds, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(leadId, "leadId"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(prefix, "prefix"); - Utils.checkNotNull(suffix, "suffix"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(department, "department"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(gender, "gender"); - Utils.checkNotNull(birthday, "birthday"); - Utils.checkNotNull(image, "image"); - Utils.checkNotNull(photoUrl, "photoUrl"); - Utils.checkNotNull(leadSource, "leadSource"); - Utils.checkNotNull(fax, "fax"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(currentBalance, "currentBalance"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(socialLinks, "socialLinks"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(emailDomain, "emailDomain"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(opportunityIds, "opportunityIds"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; - this.ownerId = ownerId; - this.type = type; - this.companyId = companyId; - this.companyName = companyName; - this.leadId = leadId; - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.prefix = prefix; - this.suffix = suffix; - this.title = title; - this.department = department; - this.language = language; - this.gender = gender; - this.birthday = birthday; - this.image = image; - this.photoUrl = photoUrl; - this.leadSource = leadSource; - this.fax = fax; - this.description = description; - this.currentBalance = currentBalance; - this.status = status; - this.active = active; + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("lead_id") @Nullable JsonNullable leadId, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("prefix") @Nullable JsonNullable prefix, + @JsonProperty("suffix") @Nullable JsonNullable suffix, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("department") @Nullable JsonNullable department, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("gender") @Nullable JsonNullable gender, + @JsonProperty("birthday") @Nullable JsonNullable birthday, + @JsonProperty("image") @Nullable JsonNullable image, + @JsonProperty("photo_url") @Nullable JsonNullable photoUrl, + @JsonProperty("lead_source") @Nullable JsonNullable leadSource, + @JsonProperty("fax") @Nullable JsonNullable fax, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("current_balance") @Nullable JsonNullable currentBalance, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("active") @Nullable JsonNullable active, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("social_links") @Nullable List socialLinks, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("email_domain") @Nullable JsonNullable emailDomain, + @JsonProperty("custom_fields") @Nullable JsonNullable> customFields, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("opportunity_ids") @Nullable List opportunityIds, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.leadId = Optional.ofNullable(leadId) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.prefix = Optional.ofNullable(prefix) + .orElse(JsonNullable.undefined()); + this.suffix = Optional.ofNullable(suffix) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.department = Optional.ofNullable(department) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.gender = Optional.ofNullable(gender) + .orElse(JsonNullable.undefined()); + this.birthday = Optional.ofNullable(birthday) + .orElse(JsonNullable.undefined()); + this.image = Optional.ofNullable(image) + .orElse(JsonNullable.undefined()); + this.photoUrl = Optional.ofNullable(photoUrl) + .orElse(JsonNullable.undefined()); + this.leadSource = Optional.ofNullable(leadSource) + .orElse(JsonNullable.undefined()); + this.fax = Optional.ofNullable(fax) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.currentBalance = Optional.ofNullable(currentBalance) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.active = Optional.ofNullable(active) + .orElse(JsonNullable.undefined()); this.websites = websites; this.addresses = addresses; this.socialLinks = socialLinks; this.phoneNumbers = phoneNumbers; this.emails = emails; - this.emailDomain = emailDomain; - this.customFields = customFields; - this.tags = tags; + this.emailDomain = Optional.ofNullable(emailDomain) + .orElse(JsonNullable.undefined()); + this.customFields = Optional.ofNullable(customFields) + .orElse(JsonNullable.undefined()); + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); this.opportunityIds = opportunityIds; this.passThrough = passThrough; } public ContactInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Full name of the contact. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The owner of the contact. */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The type of the contact. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The company the contact is associated with. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The name of the company the contact is associated with. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The lead the contact is associated with. */ - @JsonIgnore public JsonNullable leadId() { - return leadId; + return this.leadId; } /** * The first name of the contact. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The middle name of the contact. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The last name of the contact. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * The prefix of the contact. */ - @JsonIgnore public JsonNullable prefix() { - return prefix; + return this.prefix; } /** * The suffix of the contact. */ - @JsonIgnore public JsonNullable suffix() { - return suffix; + return this.suffix; } /** * The job title of the contact. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The department of the contact. */ - @JsonIgnore public JsonNullable department() { - return department; + return this.department; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } /** * The gender of the contact. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable gender() { - return (JsonNullable) gender; + return this.gender; } /** * The birthday of the contact. */ - @JsonIgnore public JsonNullable birthday() { - return birthday; + return this.birthday; } /** @@ -501,130 +475,103 @@ public JsonNullable birthday() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable image() { - return image; + return this.image; } /** * The URL of the photo of a person. */ - @JsonIgnore public JsonNullable photoUrl() { - return photoUrl; + return this.photoUrl; } /** * The lead source of the contact. */ - @JsonIgnore public JsonNullable leadSource() { - return leadSource; + return this.leadSource; } /** * The fax number of the contact. */ - @JsonIgnore public JsonNullable fax() { - return fax; + return this.fax; } /** * The description of the contact. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The current balance of the contact. */ - @JsonIgnore public JsonNullable currentBalance() { - return currentBalance; + return this.currentBalance; } /** * The status of the contact. */ - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * The active status of the contact. */ - @JsonIgnore public JsonNullable active() { - return active; + return this.active; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> socialLinks() { - return (Optional>) socialLinks; + return Optional.ofNullable(this.socialLinks); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @JsonIgnore public JsonNullable emailDomain() { - return emailDomain; + return this.emailDomain; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customFields() { - return (JsonNullable>) customFields; + return this.customFields; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } /** * The opportunity ids of the contact. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> opportunityIds() { - return (Optional>) opportunityIds; + return Optional.ofNullable(this.opportunityIds); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -635,578 +582,287 @@ public static Builder builder() { /** * Full name of the contact. */ - public ContactInput withName(String name) { - Utils.checkNotNull(name, "name"); + public ContactInput withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the contact. - */ - public ContactInput withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The owner of the contact. */ - public ContactInput withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public ContactInput withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the contact. - */ - public ContactInput withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The type of the contact. */ - public ContactInput withType(ContactType type) { - Utils.checkNotNull(type, "type"); + public ContactInput withType(@Nullable ContactType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of the contact. - */ - public ContactInput withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The company the contact is associated with. */ - public ContactInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public ContactInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company the contact is associated with. - */ - public ContactInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The name of the company the contact is associated with. */ - public ContactInput withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public ContactInput withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company the contact is associated with. - */ - public ContactInput withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The lead the contact is associated with. */ - public ContactInput withLeadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public ContactInput withLeadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead the contact is associated with. - */ - public ContactInput withLeadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } /** * The first name of the contact. */ - public ContactInput withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public ContactInput withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the contact. - */ - public ContactInput withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The middle name of the contact. */ - public ContactInput withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public ContactInput withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * The middle name of the contact. - */ - public ContactInput withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The last name of the contact. */ - public ContactInput withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public ContactInput withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the contact. - */ - public ContactInput withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * The prefix of the contact. */ - public ContactInput withPrefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public ContactInput withPrefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * The prefix of the contact. - */ - public ContactInput withPrefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } /** * The suffix of the contact. */ - public ContactInput withSuffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public ContactInput withSuffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - /** - * The suffix of the contact. - */ - public ContactInput withSuffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } /** * The job title of the contact. */ - public ContactInput withTitle(String title) { - Utils.checkNotNull(title, "title"); + public ContactInput withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the contact. - */ - public ContactInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The department of the contact. */ - public ContactInput withDepartment(String department) { - Utils.checkNotNull(department, "department"); + public ContactInput withDepartment(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department of the contact. - */ - public ContactInput withDepartment(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public ContactInput withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public ContactInput withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public ContactInput withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } /** * The gender of the contact. */ - public ContactInput withGender(ContactGender gender) { - Utils.checkNotNull(gender, "gender"); + public ContactInput withGender(@Nullable ContactGender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender of the contact. - */ - public ContactInput withGender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } /** * The birthday of the contact. */ - public ContactInput withBirthday(String birthday) { - Utils.checkNotNull(birthday, "birthday"); + public ContactInput withBirthday(@Nullable String birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The birthday of the contact. - */ - public ContactInput withBirthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public ContactInput withImage(String image) { - Utils.checkNotNull(image, "image"); + public ContactInput withImage(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public ContactInput withImage(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } /** * The URL of the photo of a person. */ - public ContactInput withPhotoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public ContactInput withPhotoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public ContactInput withPhotoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } /** * The lead source of the contact. */ - public ContactInput withLeadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public ContactInput withLeadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The lead source of the contact. - */ - public ContactInput withLeadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } /** * The fax number of the contact. */ - public ContactInput withFax(String fax) { - Utils.checkNotNull(fax, "fax"); + public ContactInput withFax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the contact. - */ - public ContactInput withFax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } /** * The description of the contact. */ - public ContactInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public ContactInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the contact. - */ - public ContactInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The current balance of the contact. */ - public ContactInput withCurrentBalance(double currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); + public ContactInput withCurrentBalance(@Nullable Double currentBalance) { this.currentBalance = JsonNullable.of(currentBalance); return this; } - /** - * The current balance of the contact. - */ - public ContactInput withCurrentBalance(JsonNullable currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); - this.currentBalance = currentBalance; - return this; - } /** * The status of the contact. */ - public ContactInput withStatus(String status) { - Utils.checkNotNull(status, "status"); + public ContactInput withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the contact. - */ - public ContactInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The active status of the contact. */ - public ContactInput withActive(boolean active) { - Utils.checkNotNull(active, "active"); + public ContactInput withActive(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * The active status of the contact. - */ - public ContactInput withActive(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - public ContactInput withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public ContactInput withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public ContactInput withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public ContactInput withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public ContactInput withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public ContactInput withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public ContactInput withSocialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public ContactInput withSocialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public ContactInput withSocialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - public ContactInput withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public ContactInput withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public ContactInput withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public ContactInput withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public ContactInput withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public ContactInput withEmails(@Nullable List emails) { this.emails = emails; return this; } - public ContactInput withEmailDomain(String emailDomain) { - Utils.checkNotNull(emailDomain, "emailDomain"); + + public ContactInput withEmailDomain(@Nullable String emailDomain) { this.emailDomain = JsonNullable.of(emailDomain); return this; } - public ContactInput withEmailDomain(JsonNullable emailDomain) { - Utils.checkNotNull(emailDomain, "emailDomain"); - this.emailDomain = emailDomain; - return this; - } - public ContactInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); + public ContactInput withCustomFields(@Nullable List customFields) { this.customFields = JsonNullable.of(customFields); return this; } - public ContactInput withCustomFields(JsonNullable> customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = customFields; - return this; - } - public ContactInput withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + public ContactInput withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public ContactInput withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** - * The opportunity ids of the contact. - */ - public ContactInput withOpportunityIds(List opportunityIds) { - Utils.checkNotNull(opportunityIds, "opportunityIds"); - this.opportunityIds = Optional.ofNullable(opportunityIds); - return this; - } - /** * The opportunity ids of the contact. */ - public ContactInput withOpportunityIds(Optional> opportunityIds) { - Utils.checkNotNull(opportunityIds, "opportunityIds"); + public ContactInput withOpportunityIds(@Nullable List opportunityIds) { this.opportunityIds = opportunityIds; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public ContactInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public ContactInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public ContactInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1312,683 +968,330 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable leadId = JsonNullable.undefined(); + private JsonNullable leadId; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable prefix = JsonNullable.undefined(); + private JsonNullable prefix; - private JsonNullable suffix = JsonNullable.undefined(); + private JsonNullable suffix; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable department = JsonNullable.undefined(); + private JsonNullable department; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable gender = JsonNullable.undefined(); + private JsonNullable gender; - private JsonNullable birthday = JsonNullable.undefined(); + private JsonNullable birthday; @Deprecated - private JsonNullable image = JsonNullable.undefined(); + private JsonNullable image; - private JsonNullable photoUrl = JsonNullable.undefined(); + private JsonNullable photoUrl; - private JsonNullable leadSource = JsonNullable.undefined(); + private JsonNullable leadSource; - private JsonNullable fax = JsonNullable.undefined(); + private JsonNullable fax; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable currentBalance = JsonNullable.undefined(); + private JsonNullable currentBalance; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable active = JsonNullable.undefined(); + private JsonNullable active; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> socialLinks = Optional.empty(); + private List socialLinks; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private JsonNullable emailDomain = JsonNullable.undefined(); + private JsonNullable emailDomain; - private JsonNullable> customFields = JsonNullable.undefined(); + private JsonNullable> customFields; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private Optional> opportunityIds = Optional.empty(); + private List opportunityIds; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Full name of the contact. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the contact. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The owner of the contact. */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the contact. - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The type of the contact. */ - public Builder type(ContactType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ContactType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of the contact. - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The company the contact is associated with. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company the contact is associated with. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The name of the company the contact is associated with. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company the contact is associated with. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The lead the contact is associated with. */ - public Builder leadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Builder leadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead the contact is associated with. - */ - public Builder leadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } - - /** * The first name of the contact. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the contact. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The middle name of the contact. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * The middle name of the contact. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The last name of the contact. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the contact. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * The prefix of the contact. */ - public Builder prefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public Builder prefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * The prefix of the contact. - */ - public Builder prefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } - - /** * The suffix of the contact. */ - public Builder suffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Builder suffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - /** - * The suffix of the contact. - */ - public Builder suffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } - - /** * The job title of the contact. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the contact. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The department of the contact. */ - public Builder department(String department) { - Utils.checkNotNull(department, "department"); + public Builder department(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department of the contact. - */ - public Builder department(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - /** * The gender of the contact. */ - public Builder gender(ContactGender gender) { - Utils.checkNotNull(gender, "gender"); + public Builder gender(@Nullable ContactGender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender of the contact. - */ - public Builder gender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } - - /** * The birthday of the contact. */ - public Builder birthday(String birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Builder birthday(@Nullable String birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The birthday of the contact. - */ - public Builder birthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder image(String image) { - Utils.checkNotNull(image, "image"); + public Builder image(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder image(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } - - /** * The URL of the photo of a person. */ - public Builder photoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public Builder photoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public Builder photoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } - - /** * The lead source of the contact. */ - public Builder leadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public Builder leadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The lead source of the contact. - */ - public Builder leadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } - - /** * The fax number of the contact. */ - public Builder fax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Builder fax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the contact. - */ - public Builder fax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } - - /** * The description of the contact. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the contact. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The current balance of the contact. */ - public Builder currentBalance(double currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); + public Builder currentBalance(@Nullable Double currentBalance) { this.currentBalance = JsonNullable.of(currentBalance); return this; } - /** - * The current balance of the contact. - */ - public Builder currentBalance(JsonNullable currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); - this.currentBalance = currentBalance; - return this; - } - - /** * The status of the contact. */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the contact. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The active status of the contact. */ - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * The active status of the contact. - */ - public Builder active(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder socialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Builder socialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Builder socialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder emailDomain(String emailDomain) { - Utils.checkNotNull(emailDomain, "emailDomain"); + public Builder emailDomain(@Nullable String emailDomain) { this.emailDomain = JsonNullable.of(emailDomain); return this; } - public Builder emailDomain(JsonNullable emailDomain) { - Utils.checkNotNull(emailDomain, "emailDomain"); - this.emailDomain = emailDomain; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = JsonNullable.of(customFields); return this; } - public Builder customFields(JsonNullable> customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = customFields; - return this; - } - - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** * The opportunity ids of the contact. */ - public Builder opportunityIds(List opportunityIds) { - Utils.checkNotNull(opportunityIds, "opportunityIds"); - this.opportunityIds = Optional.ofNullable(opportunityIds); - return this; - } - - /** - * The opportunity ids of the contact. - */ - public Builder opportunityIds(Optional> opportunityIds) { - Utils.checkNotNull(opportunityIds, "opportunityIds"); + public Builder opportunityIds(@Nullable List opportunityIds) { this.opportunityIds = opportunityIds; return this; } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public ContactInput build() { - return new ContactInput( name, ownerId, type, companyId, companyName, leadId, diff --git a/src/main/java/com/apideck/unify/models/components/ContactsFilter.java b/src/main/java/com/apideck/unify/models/components/ContactsFilter.java index d873780f..713cc669 100644 --- a/src/main/java/com/apideck/unify/models/components/ContactsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/ContactsFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,60 +17,53 @@ public class ContactsFilter { * Name of the contact to filter on */ @SpeakeasyMetadata("queryParam:name=name") - private Optional name; + private String name; /** * First name of the contact to filter on */ @SpeakeasyMetadata("queryParam:name=first_name") - private Optional firstName; + private String firstName; /** * Last name of the contact to filter on */ @SpeakeasyMetadata("queryParam:name=last_name") - private Optional lastName; + private String lastName; /** * Email of the contact to filter on */ @SpeakeasyMetadata("queryParam:name=email") - private Optional email; + private String email; /** * Phone number of the contact to filter on */ @SpeakeasyMetadata("queryParam:name=phone_number") - private Optional phoneNumber; + private String phoneNumber; /** * Unique identifier for the associated company of the contact to filter on */ @SpeakeasyMetadata("queryParam:name=company_id") - private Optional companyId; + private String companyId; /** * Unique identifier for the owner of the contact to filter on */ @SpeakeasyMetadata("queryParam:name=owner_id") - private Optional ownerId; + private String ownerId; @JsonCreator public ContactsFilter( - Optional name, - Optional firstName, - Optional lastName, - Optional email, - Optional phoneNumber, - Optional companyId, - Optional ownerId) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(phoneNumber, "phoneNumber"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(ownerId, "ownerId"); + @Nullable String name, + @Nullable String firstName, + @Nullable String lastName, + @Nullable String email, + @Nullable String phoneNumber, + @Nullable String companyId, + @Nullable String ownerId) { this.name = name; this.firstName = firstName; this.lastName = lastName; @@ -81,65 +74,58 @@ public ContactsFilter( } public ContactsFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } /** * Name of the contact to filter on */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * First name of the contact to filter on */ - @JsonIgnore public Optional firstName() { - return firstName; + return Optional.ofNullable(this.firstName); } /** * Last name of the contact to filter on */ - @JsonIgnore public Optional lastName() { - return lastName; + return Optional.ofNullable(this.lastName); } /** * Email of the contact to filter on */ - @JsonIgnore public Optional email() { - return email; + return Optional.ofNullable(this.email); } /** * Phone number of the contact to filter on */ - @JsonIgnore public Optional phoneNumber() { - return phoneNumber; + return Optional.ofNullable(this.phoneNumber); } /** * Unique identifier for the associated company of the contact to filter on */ - @JsonIgnore public Optional companyId() { - return companyId; + return Optional.ofNullable(this.companyId); } /** * Unique identifier for the owner of the contact to filter on */ - @JsonIgnore public Optional ownerId() { - return ownerId; + return Optional.ofNullable(this.ownerId); } public static Builder builder() { @@ -150,136 +136,66 @@ public static Builder builder() { /** * Name of the contact to filter on */ - public ContactsFilter withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - /** - * Name of the contact to filter on - */ - public ContactsFilter withName(Optional name) { - Utils.checkNotNull(name, "name"); + public ContactsFilter withName(@Nullable String name) { this.name = name; return this; } - /** - * First name of the contact to filter on - */ - public ContactsFilter withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = Optional.ofNullable(firstName); - return this; - } - /** * First name of the contact to filter on */ - public ContactsFilter withFirstName(Optional firstName) { - Utils.checkNotNull(firstName, "firstName"); + public ContactsFilter withFirstName(@Nullable String firstName) { this.firstName = firstName; return this; } - /** - * Last name of the contact to filter on - */ - public ContactsFilter withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = Optional.ofNullable(lastName); - return this; - } - /** * Last name of the contact to filter on */ - public ContactsFilter withLastName(Optional lastName) { - Utils.checkNotNull(lastName, "lastName"); + public ContactsFilter withLastName(@Nullable String lastName) { this.lastName = lastName; return this; } - /** - * Email of the contact to filter on - */ - public ContactsFilter withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - /** * Email of the contact to filter on */ - public ContactsFilter withEmail(Optional email) { - Utils.checkNotNull(email, "email"); + public ContactsFilter withEmail(@Nullable String email) { this.email = email; return this; } - /** - * Phone number of the contact to filter on - */ - public ContactsFilter withPhoneNumber(String phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); - this.phoneNumber = Optional.ofNullable(phoneNumber); - return this; - } - /** * Phone number of the contact to filter on */ - public ContactsFilter withPhoneNumber(Optional phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); + public ContactsFilter withPhoneNumber(@Nullable String phoneNumber) { this.phoneNumber = phoneNumber; return this; } - /** - * Unique identifier for the associated company of the contact to filter on - */ - public ContactsFilter withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - /** * Unique identifier for the associated company of the contact to filter on */ - public ContactsFilter withCompanyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public ContactsFilter withCompanyId(@Nullable String companyId) { this.companyId = companyId; return this; } - /** - * Unique identifier for the owner of the contact to filter on - */ - public ContactsFilter withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = Optional.ofNullable(ownerId); - return this; - } - /** * Unique identifier for the owner of the contact to filter on */ - public ContactsFilter withOwnerId(Optional ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public ContactsFilter withOwnerId(@Nullable String ownerId) { this.ownerId = ownerId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -322,159 +238,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional name = Optional.empty(); + private String name; - private Optional firstName = Optional.empty(); + private String firstName; - private Optional lastName = Optional.empty(); + private String lastName; - private Optional email = Optional.empty(); + private String email; - private Optional phoneNumber = Optional.empty(); + private String phoneNumber; - private Optional companyId = Optional.empty(); + private String companyId; - private Optional ownerId = Optional.empty(); + private String ownerId; private Builder() { // force use of static builder() method } - - /** - * Name of the contact to filter on - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the contact to filter on */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * First name of the contact to filter on - */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = Optional.ofNullable(firstName); - return this; - } - /** * First name of the contact to filter on */ - public Builder firstName(Optional firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = firstName; return this; } - - /** - * Last name of the contact to filter on - */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = Optional.ofNullable(lastName); - return this; - } - /** * Last name of the contact to filter on */ - public Builder lastName(Optional lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = lastName; return this; } - /** * Email of the contact to filter on */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - - /** - * Email of the contact to filter on - */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } - - /** - * Phone number of the contact to filter on - */ - public Builder phoneNumber(String phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); - this.phoneNumber = Optional.ofNullable(phoneNumber); - return this; - } - /** * Phone number of the contact to filter on */ - public Builder phoneNumber(Optional phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); + public Builder phoneNumber(@Nullable String phoneNumber) { this.phoneNumber = phoneNumber; return this; } - /** * Unique identifier for the associated company of the contact to filter on */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - - /** - * Unique identifier for the associated company of the contact to filter on - */ - public Builder companyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = companyId; return this; } - /** * Unique identifier for the owner of the contact to filter on */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = Optional.ofNullable(ownerId); - return this; - } - - /** - * Unique identifier for the owner of the contact to filter on - */ - public Builder ownerId(Optional ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = ownerId; return this; } public ContactsFilter build() { - return new ContactsFilter( name, firstName, lastName, email, phoneNumber, companyId, diff --git a/src/main/java/com/apideck/unify/models/components/ContactsSort.java b/src/main/java/com/apideck/unify/models/components/ContactsSort.java index ef92792a..6524bc21 100644 --- a/src/main/java/com/apideck/unify/models/components/ContactsSort.java +++ b/src/main/java/com/apideck/unify/models/components/ContactsSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class ContactsSort { * The field on which to sort the Contacts */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private ContactsSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public ContactsSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable ContactsSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public ContactsSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Contacts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Contacts */ - public ContactsSort withBy(ContactsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Contacts - */ - public ContactsSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public ContactsSort withBy(@Nullable ContactsSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public ContactsSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public ContactsSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public ContactsSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private ContactsSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Contacts - */ - public Builder by(ContactsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Contacts */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable ContactsSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public ContactsSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new ContactsSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/CopyFolderRequest.java b/src/main/java/com/apideck/unify/models/components/CopyFolderRequest.java index 146e7a2c..6bf93b18 100644 --- a/src/main/java/com/apideck/unify/models/components/CopyFolderRequest.java +++ b/src/main/java/com/apideck/unify/models/components/CopyFolderRequest.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -22,7 +22,7 @@ public class CopyFolderRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. @@ -35,49 +35,43 @@ public class CopyFolderRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CopyFolderRequest( - @JsonProperty("name") Optional name, - @JsonProperty("parent_folder_id") String parentFolderId, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(parentFolderId, "parentFolderId"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("name") @Nullable String name, + @JsonProperty("parent_folder_id") @Nonnull String parentFolderId, + @JsonProperty("pass_through") @Nullable List passThrough) { this.name = name; - this.parentFolderId = parentFolderId; + this.parentFolderId = Optional.ofNullable(parentFolderId) + .orElseThrow(() -> new IllegalArgumentException("parentFolderId cannot be null")); this.passThrough = passThrough; } public CopyFolderRequest( - String parentFolderId) { - this(Optional.empty(), parentFolderId, Optional.empty()); + @Nonnull String parentFolderId) { + this(null, parentFolderId, null); } /** * The name of the folder. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - @JsonIgnore public String parentFolderId() { - return parentFolderId; + return this.parentFolderId; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -88,37 +82,17 @@ public static Builder builder() { /** * The name of the folder. */ - public CopyFolderRequest withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - /** - * The name of the folder. - */ - public CopyFolderRequest withName(Optional name) { - Utils.checkNotNull(name, "name"); + public CopyFolderRequest withName(@Nullable String name) { this.name = name; return this; } - /** - * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - */ - public CopyFolderRequest withParentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = parentFolderId; - return this; - } /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. + * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - public CopyFolderRequest withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public CopyFolderRequest withParentFolderId(@Nonnull String parentFolderId) { + this.parentFolderId = Utils.checkNotNull(parentFolderId, "parentFolderId"); return this; } @@ -126,12 +100,12 @@ public CopyFolderRequest withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CopyFolderRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CopyFolderRequest withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -164,66 +138,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional name = Optional.empty(); + private String name; private String parentFolderId; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The name of the folder. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * The name of the folder. - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - public Builder parentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = parentFolderId; + public Builder parentFolderId(@Nonnull String parentFolderId) { + this.parentFolderId = Utils.checkNotNull(parentFolderId, "parentFolderId"); return this; } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CopyFolderRequest build() { - return new CopyFolderRequest( name, parentFolderId, passThrough); } diff --git a/src/main/java/com/apideck/unify/models/components/CostOfGoodsSold.java b/src/main/java/com/apideck/unify/models/components/CostOfGoodsSold.java index fa2704ae..35ae7937 100644 --- a/src/main/java/com/apideck/unify/models/components/CostOfGoodsSold.java +++ b/src/main/java/com/apideck/unify/models/components/CostOfGoodsSold.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -28,28 +28,28 @@ public class CostOfGoodsSold { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The account code of the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * The name of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") - private Optional title; + private String title; /** * The type of profit and loss */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The aggregated total of all accounts within this category. @@ -64,76 +64,66 @@ public class CostOfGoodsSold { @JsonCreator public CostOfGoodsSold( - @JsonProperty("id") Optional id, - @JsonProperty("code") Optional code, - @JsonProperty("title") Optional title, - @JsonProperty("type") JsonNullable type, - @JsonProperty("total") JsonNullable total, - @JsonProperty("records") Object records) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(records, "records"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("code") @Nullable String code, + @JsonProperty("title") @Nullable String title, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("total") @Nullable JsonNullable total, + @JsonProperty("records") @Nonnull Object records) { this.id = id; this.code = code; this.title = title; - this.type = type; - this.total = total; - this.records = records; + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); + this.records = Optional.ofNullable(records) + .orElseThrow(() -> new IllegalArgumentException("records cannot be null")); } public CostOfGoodsSold( - Object records) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), records); + @Nonnull Object records) { + this(null, null, null, + null, null, records); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The account code of the account */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * The name of the account. */ - @JsonIgnore public Optional title() { - return title; + return Optional.ofNullable(this.title); } /** * The type of profit and loss */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The aggregated total of all accounts within this category. */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } - @JsonIgnore public Object records() { - return records; + return this.records; } public static Builder builder() { @@ -144,102 +134,54 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public CostOfGoodsSold withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public CostOfGoodsSold withId(Optional id) { - Utils.checkNotNull(id, "id"); + public CostOfGoodsSold withId(@Nullable String id) { this.id = id; return this; } - /** - * The account code of the account - */ - public CostOfGoodsSold withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The account code of the account */ - public CostOfGoodsSold withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public CostOfGoodsSold withCode(@Nullable String code) { this.code = code; return this; } - /** - * The name of the account. - */ - public CostOfGoodsSold withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public CostOfGoodsSold withTitle(Optional title) { - Utils.checkNotNull(title, "title"); + public CostOfGoodsSold withTitle(@Nullable String title) { this.title = title; return this; } + /** * The type of profit and loss */ - public CostOfGoodsSold withType(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public CostOfGoodsSold withType(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public CostOfGoodsSold withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The aggregated total of all accounts within this category. */ - public CostOfGoodsSold withTotal(double total) { - Utils.checkNotNull(total, "total"); + public CostOfGoodsSold withTotal(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * The aggregated total of all accounts within this category. - */ - public CostOfGoodsSold withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - public CostOfGoodsSold withRecords(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; + public CostOfGoodsSold withRecords(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -279,15 +221,15 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional code = Optional.empty(); + private String code; - private Optional title = Optional.empty(); + private String title; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; private Object records; @@ -295,110 +237,52 @@ private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The account code of the account */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The account code of the account - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - /** - * The name of the account. - */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = title; return this; } - /** * The type of profit and loss */ - public Builder type(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The aggregated total of all accounts within this category. */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * The aggregated total of all accounts within this category. - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - - - public Builder records(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; + public Builder records(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } public CostOfGoodsSold build() { - return new CostOfGoodsSold( id, code, title, type, total, records); diff --git a/src/main/java/com/apideck/unify/models/components/Coverage.java b/src/main/java/com/apideck/unify/models/components/Coverage.java index ceb86d17..d9788e73 100644 --- a/src/main/java/com/apideck/unify/models/components/Coverage.java +++ b/src/main/java/com/apideck/unify/models/components/Coverage.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -23,82 +22,73 @@ public class Coverage { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_id") - private Optional downstreamId; + private String downstreamId; /** * Name of the resource in the Connector's API (downstream) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_name") - private Optional downstreamName; + private String downstreamName; /** * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pagination_supported") - private Optional paginationSupported; + private Boolean paginationSupported; @JsonInclude(Include.NON_ABSENT) @JsonProperty("pagination") - private Optional pagination; + private PaginationCoverage pagination; /** * List of supported operations on the resource. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_operations") - private Optional> supportedOperations; + private List supportedOperations; /** * Supported filters on the list endpoint of the resource. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_filters") - private Optional> supportedFilters; + private List supportedFilters; /** * Supported sorting properties on the list endpoint of the resource. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_sort_by") - private Optional> supportedSortBy; + private List supportedSortBy; /** * Supported fields on the detail endpoint. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_fields") - private Optional> supportedFields; + private List supportedFields; /** * Supported fields on the list endpoint. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_list_fields") - private Optional> supportedListFields; + private List supportedListFields; @JsonCreator public Coverage( - @JsonProperty("downstream_id") Optional downstreamId, - @JsonProperty("downstream_name") Optional downstreamName, - @JsonProperty("pagination_supported") Optional paginationSupported, - @JsonProperty("pagination") Optional pagination, - @JsonProperty("supported_operations") Optional> supportedOperations, - @JsonProperty("supported_filters") Optional> supportedFilters, - @JsonProperty("supported_sort_by") Optional> supportedSortBy, - @JsonProperty("supported_fields") Optional> supportedFields, - @JsonProperty("supported_list_fields") Optional> supportedListFields) { - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(downstreamName, "downstreamName"); - Utils.checkNotNull(paginationSupported, "paginationSupported"); - Utils.checkNotNull(pagination, "pagination"); - Utils.checkNotNull(supportedOperations, "supportedOperations"); - Utils.checkNotNull(supportedFilters, "supportedFilters"); - Utils.checkNotNull(supportedSortBy, "supportedSortBy"); - Utils.checkNotNull(supportedFields, "supportedFields"); - Utils.checkNotNull(supportedListFields, "supportedListFields"); + @JsonProperty("downstream_id") @Nullable String downstreamId, + @JsonProperty("downstream_name") @Nullable String downstreamName, + @JsonProperty("pagination_supported") @Nullable Boolean paginationSupported, + @JsonProperty("pagination") @Nullable PaginationCoverage pagination, + @JsonProperty("supported_operations") @Nullable List supportedOperations, + @JsonProperty("supported_filters") @Nullable List supportedFilters, + @JsonProperty("supported_sort_by") @Nullable List supportedSortBy, + @JsonProperty("supported_fields") @Nullable List supportedFields, + @JsonProperty("supported_list_fields") @Nullable List supportedListFields) { this.downstreamId = downstreamId; this.downstreamName = downstreamName; this.paginationSupported = paginationSupported; @@ -111,84 +101,69 @@ public Coverage( } public Coverage() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null); } /** * ID of the resource in the Connector's API (downstream) */ - @JsonIgnore public Optional downstreamId() { - return downstreamId; + return Optional.ofNullable(this.downstreamId); } /** * Name of the resource in the Connector's API (downstream) */ - @JsonIgnore public Optional downstreamName() { - return downstreamName; + return Optional.ofNullable(this.downstreamName); } /** * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. */ - @JsonIgnore public Optional paginationSupported() { - return paginationSupported; + return Optional.ofNullable(this.paginationSupported); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional pagination() { - return (Optional) pagination; + return Optional.ofNullable(this.pagination); } /** * List of supported operations on the resource. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedOperations() { - return (Optional>) supportedOperations; + return Optional.ofNullable(this.supportedOperations); } /** * Supported filters on the list endpoint of the resource. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedFilters() { - return (Optional>) supportedFilters; + return Optional.ofNullable(this.supportedFilters); } /** * Supported sorting properties on the list endpoint of the resource. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedSortBy() { - return (Optional>) supportedSortBy; + return Optional.ofNullable(this.supportedSortBy); } /** * Supported fields on the detail endpoint. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedFields() { - return (Optional>) supportedFields; + return Optional.ofNullable(this.supportedFields); } /** * Supported fields on the list endpoint. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedListFields() { - return (Optional>) supportedListFields; + return Optional.ofNullable(this.supportedListFields); } public static Builder builder() { @@ -199,168 +174,81 @@ public static Builder builder() { /** * ID of the resource in the Connector's API (downstream) */ - public Coverage withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = Optional.ofNullable(downstreamId); - return this; - } - - - /** - * ID of the resource in the Connector's API (downstream) - */ - public Coverage withDownstreamId(Optional downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Coverage withDownstreamId(@Nullable String downstreamId) { this.downstreamId = downstreamId; return this; } - /** - * Name of the resource in the Connector's API (downstream) - */ - public Coverage withDownstreamName(String downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); - this.downstreamName = Optional.ofNullable(downstreamName); - return this; - } - /** * Name of the resource in the Connector's API (downstream) */ - public Coverage withDownstreamName(Optional downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); + public Coverage withDownstreamName(@Nullable String downstreamName) { this.downstreamName = downstreamName; return this; } - /** - * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. - */ - public Coverage withPaginationSupported(boolean paginationSupported) { - Utils.checkNotNull(paginationSupported, "paginationSupported"); - this.paginationSupported = Optional.ofNullable(paginationSupported); - return this; - } - /** * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. */ - public Coverage withPaginationSupported(Optional paginationSupported) { - Utils.checkNotNull(paginationSupported, "paginationSupported"); + public Coverage withPaginationSupported(@Nullable Boolean paginationSupported) { this.paginationSupported = paginationSupported; return this; } - public Coverage withPagination(PaginationCoverage pagination) { - Utils.checkNotNull(pagination, "pagination"); - this.pagination = Optional.ofNullable(pagination); - return this; - } - - public Coverage withPagination(Optional pagination) { - Utils.checkNotNull(pagination, "pagination"); + public Coverage withPagination(@Nullable PaginationCoverage pagination) { this.pagination = pagination; return this; } - /** - * List of supported operations on the resource. - */ - public Coverage withSupportedOperations(List supportedOperations) { - Utils.checkNotNull(supportedOperations, "supportedOperations"); - this.supportedOperations = Optional.ofNullable(supportedOperations); - return this; - } - /** * List of supported operations on the resource. */ - public Coverage withSupportedOperations(Optional> supportedOperations) { - Utils.checkNotNull(supportedOperations, "supportedOperations"); + public Coverage withSupportedOperations(@Nullable List supportedOperations) { this.supportedOperations = supportedOperations; return this; } - /** - * Supported filters on the list endpoint of the resource. - */ - public Coverage withSupportedFilters(List supportedFilters) { - Utils.checkNotNull(supportedFilters, "supportedFilters"); - this.supportedFilters = Optional.ofNullable(supportedFilters); - return this; - } - /** * Supported filters on the list endpoint of the resource. */ - public Coverage withSupportedFilters(Optional> supportedFilters) { - Utils.checkNotNull(supportedFilters, "supportedFilters"); + public Coverage withSupportedFilters(@Nullable List supportedFilters) { this.supportedFilters = supportedFilters; return this; } - /** - * Supported sorting properties on the list endpoint of the resource. - */ - public Coverage withSupportedSortBy(List supportedSortBy) { - Utils.checkNotNull(supportedSortBy, "supportedSortBy"); - this.supportedSortBy = Optional.ofNullable(supportedSortBy); - return this; - } - /** * Supported sorting properties on the list endpoint of the resource. */ - public Coverage withSupportedSortBy(Optional> supportedSortBy) { - Utils.checkNotNull(supportedSortBy, "supportedSortBy"); + public Coverage withSupportedSortBy(@Nullable List supportedSortBy) { this.supportedSortBy = supportedSortBy; return this; } - /** - * Supported fields on the detail endpoint. - */ - public Coverage withSupportedFields(List supportedFields) { - Utils.checkNotNull(supportedFields, "supportedFields"); - this.supportedFields = Optional.ofNullable(supportedFields); - return this; - } - /** * Supported fields on the detail endpoint. */ - public Coverage withSupportedFields(Optional> supportedFields) { - Utils.checkNotNull(supportedFields, "supportedFields"); + public Coverage withSupportedFields(@Nullable List supportedFields) { this.supportedFields = supportedFields; return this; } - /** - * Supported fields on the list endpoint. - */ - public Coverage withSupportedListFields(List supportedListFields) { - Utils.checkNotNull(supportedListFields, "supportedListFields"); - this.supportedListFields = Optional.ofNullable(supportedListFields); - return this; - } - /** * Supported fields on the list endpoint. */ - public Coverage withSupportedListFields(Optional> supportedListFields) { - Utils.checkNotNull(supportedListFields, "supportedListFields"); + public Coverage withSupportedListFields(@Nullable List supportedListFields) { this.supportedListFields = supportedListFields; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -407,195 +295,98 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional downstreamId = Optional.empty(); + private String downstreamId; - private Optional downstreamName = Optional.empty(); + private String downstreamName; - private Optional paginationSupported = Optional.empty(); + private Boolean paginationSupported; - private Optional pagination = Optional.empty(); + private PaginationCoverage pagination; - private Optional> supportedOperations = Optional.empty(); + private List supportedOperations; - private Optional> supportedFilters = Optional.empty(); + private List supportedFilters; - private Optional> supportedSortBy = Optional.empty(); + private List supportedSortBy; - private Optional> supportedFields = Optional.empty(); + private List supportedFields; - private Optional> supportedListFields = Optional.empty(); + private List supportedListFields; private Builder() { // force use of static builder() method } - - /** - * ID of the resource in the Connector's API (downstream) - */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = Optional.ofNullable(downstreamId); - return this; - } - /** * ID of the resource in the Connector's API (downstream) */ - public Builder downstreamId(Optional downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = downstreamId; return this; } - /** * Name of the resource in the Connector's API (downstream) */ - public Builder downstreamName(String downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); - this.downstreamName = Optional.ofNullable(downstreamName); - return this; - } - - /** - * Name of the resource in the Connector's API (downstream) - */ - public Builder downstreamName(Optional downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); + public Builder downstreamName(@Nullable String downstreamName) { this.downstreamName = downstreamName; return this; } - /** * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. */ - public Builder paginationSupported(boolean paginationSupported) { - Utils.checkNotNull(paginationSupported, "paginationSupported"); - this.paginationSupported = Optional.ofNullable(paginationSupported); - return this; - } - - /** - * Indicates if pagination (cursor and limit parameters) is supported on the list endpoint of the resource. - */ - public Builder paginationSupported(Optional paginationSupported) { - Utils.checkNotNull(paginationSupported, "paginationSupported"); + public Builder paginationSupported(@Nullable Boolean paginationSupported) { this.paginationSupported = paginationSupported; return this; } - - public Builder pagination(PaginationCoverage pagination) { - Utils.checkNotNull(pagination, "pagination"); - this.pagination = Optional.ofNullable(pagination); - return this; - } - - public Builder pagination(Optional pagination) { - Utils.checkNotNull(pagination, "pagination"); + public Builder pagination(@Nullable PaginationCoverage pagination) { this.pagination = pagination; return this; } - - /** - * List of supported operations on the resource. - */ - public Builder supportedOperations(List supportedOperations) { - Utils.checkNotNull(supportedOperations, "supportedOperations"); - this.supportedOperations = Optional.ofNullable(supportedOperations); - return this; - } - /** * List of supported operations on the resource. */ - public Builder supportedOperations(Optional> supportedOperations) { - Utils.checkNotNull(supportedOperations, "supportedOperations"); + public Builder supportedOperations(@Nullable List supportedOperations) { this.supportedOperations = supportedOperations; return this; } - /** * Supported filters on the list endpoint of the resource. */ - public Builder supportedFilters(List supportedFilters) { - Utils.checkNotNull(supportedFilters, "supportedFilters"); - this.supportedFilters = Optional.ofNullable(supportedFilters); - return this; - } - - /** - * Supported filters on the list endpoint of the resource. - */ - public Builder supportedFilters(Optional> supportedFilters) { - Utils.checkNotNull(supportedFilters, "supportedFilters"); + public Builder supportedFilters(@Nullable List supportedFilters) { this.supportedFilters = supportedFilters; return this; } - - /** - * Supported sorting properties on the list endpoint of the resource. - */ - public Builder supportedSortBy(List supportedSortBy) { - Utils.checkNotNull(supportedSortBy, "supportedSortBy"); - this.supportedSortBy = Optional.ofNullable(supportedSortBy); - return this; - } - /** * Supported sorting properties on the list endpoint of the resource. */ - public Builder supportedSortBy(Optional> supportedSortBy) { - Utils.checkNotNull(supportedSortBy, "supportedSortBy"); + public Builder supportedSortBy(@Nullable List supportedSortBy) { this.supportedSortBy = supportedSortBy; return this; } - - /** - * Supported fields on the detail endpoint. - */ - public Builder supportedFields(List supportedFields) { - Utils.checkNotNull(supportedFields, "supportedFields"); - this.supportedFields = Optional.ofNullable(supportedFields); - return this; - } - /** * Supported fields on the detail endpoint. */ - public Builder supportedFields(Optional> supportedFields) { - Utils.checkNotNull(supportedFields, "supportedFields"); + public Builder supportedFields(@Nullable List supportedFields) { this.supportedFields = supportedFields; return this; } - - /** - * Supported fields on the list endpoint. - */ - public Builder supportedListFields(List supportedListFields) { - Utils.checkNotNull(supportedListFields, "supportedListFields"); - this.supportedListFields = Optional.ofNullable(supportedListFields); - return this; - } - /** * Supported fields on the list endpoint. */ - public Builder supportedListFields(Optional> supportedListFields) { - Utils.checkNotNull(supportedListFields, "supportedListFields"); + public Builder supportedListFields(@Nullable List supportedListFields) { this.supportedListFields = supportedListFields; return this; } public Coverage build() { - return new Coverage( downstreamId, downstreamName, paginationSupported, pagination, supportedOperations, supportedFilters, diff --git a/src/main/java/com/apideck/unify/models/components/CreateAccountingDepartmentResponse.java b/src/main/java/com/apideck/unify/models/components/CreateAccountingDepartmentResponse.java index 0f321862..aa241053 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateAccountingDepartmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateAccountingDepartmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateAccountingDepartmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateAccountingDepartmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateAccountingDepartmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateAccountingDepartmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateAccountingDepartmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateAccountingDepartmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateAccountingDepartmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateAccountingDepartmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateAccountingDepartmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateAccountingDepartmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateAccountingDepartmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateAccountingDepartmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateAccountingDepartmentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateAccountingDepartmentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateAccountingDepartmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateAccountingDepartmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateAccountingDepartmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateAccountingDepartmentResponse build() { - return new CreateAccountingDepartmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateAccountingLocationResponse.java b/src/main/java/com/apideck/unify/models/components/CreateAccountingLocationResponse.java index 952e3475..5334c2c6 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateAccountingLocationResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateAccountingLocationResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateAccountingLocationResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateAccountingLocationResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateAccountingLocationResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateAccountingLocationResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateAccountingLocationResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateAccountingLocationResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateAccountingLocationResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateAccountingLocationResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateAccountingLocationResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateAccountingLocationResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateAccountingLocationResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateAccountingLocationResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateAccountingLocationResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateAccountingLocationResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateAccountingLocationResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateAccountingLocationResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateAccountingLocationResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateAccountingLocationResponse build() { - return new CreateAccountingLocationResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateActivityResponse.java b/src/main/java/com/apideck/unify/models/components/CreateActivityResponse.java index ad083be3..d2fe5ccb 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateActivityResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateActivityResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateActivityResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateActivityResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateActivityResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateActivityResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateActivityResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateActivityResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateActivityResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateActivityResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateActivityResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateActivityResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateActivityResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateActivityResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateActivityResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateActivityResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateActivityResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateActivityResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateActivityResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateActivityResponse build() { - return new CreateActivityResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateApplicantResponse.java b/src/main/java/com/apideck/unify/models/components/CreateApplicantResponse.java index 178325ca..18fd67da 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateApplicantResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateApplicantResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateApplicantResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateApplicantResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateApplicantResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateApplicantResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateApplicantResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateApplicantResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateApplicantResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateApplicantResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateApplicantResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateApplicantResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateApplicantResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateApplicantResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateApplicantResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateApplicantResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateApplicantResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateApplicantResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateApplicantResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateApplicantResponse build() { - return new CreateApplicantResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateApplicationResponse.java b/src/main/java/com/apideck/unify/models/components/CreateApplicationResponse.java index a8399832..7262a8ad 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateApplicationResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateApplicationResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateApplicationResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateApplicationResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateApplicationResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateApplicationResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateApplicationResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateApplicationResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateApplicationResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateApplicationResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateApplicationResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateApplicationResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateApplicationResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateApplicationResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateApplicationResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateApplicationResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateApplicationResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateApplicationResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateApplicationResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateApplicationResponse build() { - return new CreateApplicationResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateAttachmentResponse.java b/src/main/java/com/apideck/unify/models/components/CreateAttachmentResponse.java index 17692029..151bf24d 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateAttachmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateAttachmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateAttachmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateAttachmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateAttachmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateAttachmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateAttachmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateAttachmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateAttachmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateAttachmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateAttachmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateAttachmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateAttachmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateAttachmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateAttachmentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateAttachmentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateAttachmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateAttachmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateAttachmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateAttachmentResponse build() { - return new CreateAttachmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateBankFeedAccountResponse.java b/src/main/java/com/apideck/unify/models/components/CreateBankFeedAccountResponse.java index 041a3ca5..fb693cb6 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateBankFeedAccountResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateBankFeedAccountResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateBankFeedAccountResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateBankFeedAccountResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateBankFeedAccountResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateBankFeedAccountResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateBankFeedAccountResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateBankFeedAccountResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateBankFeedAccountResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateBankFeedAccountResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateBankFeedAccountResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateBankFeedAccountResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateBankFeedAccountResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateBankFeedAccountResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateBankFeedAccountResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateBankFeedAccountResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateBankFeedAccountResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateBankFeedAccountResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateBankFeedAccountResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateBankFeedAccountResponse build() { - return new CreateBankFeedAccountResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateBankFeedStatementResponse.java b/src/main/java/com/apideck/unify/models/components/CreateBankFeedStatementResponse.java index 15fefa5d..9f409fd3 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateBankFeedStatementResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateBankFeedStatementResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateBankFeedStatementResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateBankFeedStatementResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateBankFeedStatementResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateBankFeedStatementResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateBankFeedStatementResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateBankFeedStatementResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateBankFeedStatementResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateBankFeedStatementResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateBankFeedStatementResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateBankFeedStatementResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateBankFeedStatementResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateBankFeedStatementResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateBankFeedStatementResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateBankFeedStatementResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateBankFeedStatementResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateBankFeedStatementResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateBankFeedStatementResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateBankFeedStatementResponse build() { - return new CreateBankFeedStatementResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateBillPaymentResponse.java b/src/main/java/com/apideck/unify/models/components/CreateBillPaymentResponse.java index 66ab3f15..32175ae6 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateBillPaymentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateBillPaymentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateBillPaymentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateBillPaymentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateBillPaymentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateBillPaymentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateBillPaymentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateBillPaymentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateBillPaymentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateBillPaymentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateBillPaymentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateBillPaymentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateBillPaymentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateBillPaymentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateBillPaymentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateBillPaymentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateBillPaymentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateBillPaymentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateBillPaymentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateBillPaymentResponse build() { - return new CreateBillPaymentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateBillResponse.java b/src/main/java/com/apideck/unify/models/components/CreateBillResponse.java index b1789140..c085ecea 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateBillResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateBillResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateBillResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateBillResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateBillResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateBillResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateBillResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateBillResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateBillResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateBillResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateBillResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateBillResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateBillResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateBillResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateBillResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateBillResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateBillResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateBillResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateBillResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateBillResponse build() { - return new CreateBillResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateCallbackState.java b/src/main/java/com/apideck/unify/models/components/CreateCallbackState.java index c0ae3c14..d5603d79 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateCallbackState.java +++ b/src/main/java/com/apideck/unify/models/components/CreateCallbackState.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -20,25 +20,23 @@ public class CreateCallbackState { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("redirect_uri") - private Optional redirectUri; + private String redirectUri; @JsonCreator public CreateCallbackState( - @JsonProperty("redirect_uri") Optional redirectUri) { - Utils.checkNotNull(redirectUri, "redirectUri"); + @JsonProperty("redirect_uri") @Nullable String redirectUri) { this.redirectUri = redirectUri; } public CreateCallbackState() { - this(Optional.empty()); + this(null); } /** * The redirect URI to be used after the connection is created. */ - @JsonIgnore public Optional redirectUri() { - return redirectUri; + return Optional.ofNullable(this.redirectUri); } public static Builder builder() { @@ -49,22 +47,12 @@ public static Builder builder() { /** * The redirect URI to be used after the connection is created. */ - public CreateCallbackState withRedirectUri(String redirectUri) { - Utils.checkNotNull(redirectUri, "redirectUri"); - this.redirectUri = Optional.ofNullable(redirectUri); - return this; - } - - - /** - * The redirect URI to be used after the connection is created. - */ - public CreateCallbackState withRedirectUri(Optional redirectUri) { - Utils.checkNotNull(redirectUri, "redirectUri"); + public CreateCallbackState withRedirectUri(@Nullable String redirectUri) { this.redirectUri = redirectUri; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -93,33 +81,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional redirectUri = Optional.empty(); + private String redirectUri; private Builder() { // force use of static builder() method } - - /** - * The redirect URI to be used after the connection is created. - */ - public Builder redirectUri(String redirectUri) { - Utils.checkNotNull(redirectUri, "redirectUri"); - this.redirectUri = Optional.ofNullable(redirectUri); - return this; - } - /** * The redirect URI to be used after the connection is created. */ - public Builder redirectUri(Optional redirectUri) { - Utils.checkNotNull(redirectUri, "redirectUri"); + public Builder redirectUri(@Nullable String redirectUri) { this.redirectUri = redirectUri; return this; } public CreateCallbackState build() { - return new CreateCallbackState( redirectUri); } diff --git a/src/main/java/com/apideck/unify/models/components/CreateCallbackStateResponse.java b/src/main/java/com/apideck/unify/models/components/CreateCallbackStateResponse.java index 87f4239c..3de5275f 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateCallbackStateResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateCallbackStateResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class CreateCallbackStateResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateCallbackStateResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") CreateCallbackStateResponseData data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull CreateCallbackStateResponseData data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateCallbackStateResponse( long statusCode, - String status, - CreateCallbackStateResponseData data) { + @Nonnull String status, + @Nonnull CreateCallbackStateResponseData data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public CreateCallbackStateResponseData data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateCallbackStateResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateCallbackStateResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateCallbackStateResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public CreateCallbackStateResponse withData(CreateCallbackStateResponseData data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public CreateCallbackStateResponse withData(@Nonnull CreateCallbackStateResponseData data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateCallbackStateResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateCallbackStateResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateCallbackStateResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private CreateCallbackStateResponseData data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(CreateCallbackStateResponseData data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull CreateCallbackStateResponseData data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateCallbackStateResponse build() { - return new CreateCallbackStateResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/CreateCallbackStateResponseData.java b/src/main/java/com/apideck/unify/models/components/CreateCallbackStateResponseData.java index b3c7a651..a16b6f44 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateCallbackStateResponseData.java +++ b/src/main/java/com/apideck/unify/models/components/CreateCallbackStateResponseData.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -20,25 +20,23 @@ public class CreateCallbackStateResponseData { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("state") - private Optional state; + private String state; @JsonCreator public CreateCallbackStateResponseData( - @JsonProperty("state") Optional state) { - Utils.checkNotNull(state, "state"); + @JsonProperty("state") @Nullable String state) { this.state = state; } public CreateCallbackStateResponseData() { - this(Optional.empty()); + this(null); } /** * Callback state */ - @JsonIgnore public Optional state() { - return state; + return Optional.ofNullable(this.state); } public static Builder builder() { @@ -49,22 +47,12 @@ public static Builder builder() { /** * Callback state */ - public CreateCallbackStateResponseData withState(String state) { - Utils.checkNotNull(state, "state"); - this.state = Optional.ofNullable(state); - return this; - } - - - /** - * Callback state - */ - public CreateCallbackStateResponseData withState(Optional state) { - Utils.checkNotNull(state, "state"); + public CreateCallbackStateResponseData withState(@Nullable String state) { this.state = state; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -93,33 +81,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional state = Optional.empty(); + private String state; private Builder() { // force use of static builder() method } - - /** - * Callback state - */ - public Builder state(String state) { - Utils.checkNotNull(state, "state"); - this.state = Optional.ofNullable(state); - return this; - } - /** * Callback state */ - public Builder state(Optional state) { - Utils.checkNotNull(state, "state"); + public Builder state(@Nullable String state) { this.state = state; return this; } public CreateCallbackStateResponseData build() { - return new CreateCallbackStateResponseData( state); } diff --git a/src/main/java/com/apideck/unify/models/components/CreateCommentResponse.java b/src/main/java/com/apideck/unify/models/components/CreateCommentResponse.java index cea7114d..93e74314 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateCommentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateCommentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateCommentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateCommentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateCommentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateCommentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateCommentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateCommentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateCommentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateCommentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateCommentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateCommentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateCommentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateCommentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateCommentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateCommentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateCommentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateCommentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateCommentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateCommentResponse build() { - return new CreateCommentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateCompanyResponse.java b/src/main/java/com/apideck/unify/models/components/CreateCompanyResponse.java index b6a3a53d..6acc8d71 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateCompanyResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateCompanyResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateCompanyResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateCompanyResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateCompanyResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateCompanyResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateCompanyResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateCompanyResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateCompanyResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateCompanyResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateCompanyResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateCompanyResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateCompanyResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateCompanyResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateCompanyResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateCompanyResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateCompanyResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateCompanyResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateCompanyResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateCompanyResponse build() { - return new CreateCompanyResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateConnectionResponse.java b/src/main/java/com/apideck/unify/models/components/CreateConnectionResponse.java index e7ca9f3e..1c0b22af 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateConnectionResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateConnectionResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class CreateConnectionResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateConnectionResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Connection data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Connection data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateConnectionResponse( long statusCode, - String status, - Connection data) { + @Nonnull String status, + @Nonnull Connection data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Connection data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateConnectionResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateConnectionResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateConnectionResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public CreateConnectionResponse withData(Connection data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public CreateConnectionResponse withData(@Nonnull Connection data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateConnectionResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateConnectionResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateConnectionResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Connection data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Connection data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Connection data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateConnectionResponse build() { - return new CreateConnectionResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/CreateConsumerResponse.java b/src/main/java/com/apideck/unify/models/components/CreateConsumerResponse.java index 9727829a..674aae0b 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateConsumerResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateConsumerResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class CreateConsumerResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateConsumerResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Consumer data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Consumer data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateConsumerResponse( long statusCode, - String status, - Consumer data) { + @Nonnull String status, + @Nonnull Consumer data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Consumer data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateConsumerResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateConsumerResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateConsumerResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public CreateConsumerResponse withData(Consumer data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public CreateConsumerResponse withData(@Nonnull Consumer data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateConsumerResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateConsumerResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateConsumerResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Consumer data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Consumer data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Consumer data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateConsumerResponse build() { - return new CreateConsumerResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/CreateContactResponse.java b/src/main/java/com/apideck/unify/models/components/CreateContactResponse.java index fd73ad8d..737bac05 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateContactResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateContactResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateContactResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateContactResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateContactResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateContactResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateContactResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateContactResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateContactResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateContactResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateContactResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateContactResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateContactResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateContactResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateContactResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateContactResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateContactResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateContactResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateContactResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateContactResponse build() { - return new CreateContactResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateCreditNoteResponse.java b/src/main/java/com/apideck/unify/models/components/CreateCreditNoteResponse.java index 3fb531a2..7dfb8a69 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateCreditNoteResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateCreditNoteResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateCreditNoteResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateCreditNoteResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateCreditNoteResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateCreditNoteResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateCreditNoteResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateCreditNoteResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateCreditNoteResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateCreditNoteResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateCreditNoteResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateCreditNoteResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateCreditNoteResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateCreditNoteResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateCreditNoteResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateCreditNoteResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateCreditNoteResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateCreditNoteResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateCreditNoteResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateCreditNoteResponse build() { - return new CreateCreditNoteResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateCustomObjectResponse.java b/src/main/java/com/apideck/unify/models/components/CreateCustomObjectResponse.java index 2ab7fede..a05f895f 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateCustomObjectResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateCustomObjectResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateCustomObjectResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateCustomObjectResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateCustomObjectResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateCustomObjectResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateCustomObjectResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateCustomObjectResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateCustomObjectResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateCustomObjectResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateCustomObjectResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateCustomObjectResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateCustomObjectResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateCustomObjectResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateCustomObjectResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateCustomObjectResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateCustomObjectResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateCustomObjectResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateCustomObjectResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateCustomObjectResponse build() { - return new CreateCustomObjectResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateCustomObjectSchemaResponse.java b/src/main/java/com/apideck/unify/models/components/CreateCustomObjectSchemaResponse.java index 3ecabefc..b756e885 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateCustomObjectSchemaResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateCustomObjectSchemaResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class CreateCustomObjectSchemaResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateCustomObjectSchemaResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") CustomObjectSchema data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull CustomObjectSchema data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateCustomObjectSchemaResponse( long statusCode, - String status, - String service, - String resource, - String operation, - CustomObjectSchema data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull CustomObjectSchema data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public CustomObjectSchema data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateCustomObjectSchemaResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateCustomObjectSchemaResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateCustomObjectSchemaResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateCustomObjectSchemaResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateCustomObjectSchemaResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateCustomObjectSchemaResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateCustomObjectSchemaResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateCustomObjectSchemaResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateCustomObjectSchemaResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public CreateCustomObjectSchemaResponse withData(CustomObjectSchema data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public CreateCustomObjectSchemaResponse withData(@Nonnull CustomObjectSchema data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateCustomObjectSchemaResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateCustomObjectSchemaResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateCustomObjectSchemaResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private CustomObjectSchema data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(CustomObjectSchema data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull CustomObjectSchema data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateCustomObjectSchemaResponse build() { - return new CreateCustomObjectSchemaResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateCustomerResponse.java b/src/main/java/com/apideck/unify/models/components/CreateCustomerResponse.java index 39298f41..7fc2bddf 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateCustomerResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateCustomerResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateCustomerResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateCustomerResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateCustomerResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateCustomerResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateCustomerResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateCustomerResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateCustomerResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateCustomerResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateCustomerResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateCustomerResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateCustomerResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateCustomerResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateCustomerResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateCustomerResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateCustomerResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateCustomerResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateCustomerResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateCustomerResponse build() { - return new CreateCustomerResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateDepartmentResponse.java b/src/main/java/com/apideck/unify/models/components/CreateDepartmentResponse.java index 184e7b77..424b4b96 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateDepartmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateDepartmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateDepartmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateDepartmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateDepartmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateDepartmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateDepartmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateDepartmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateDepartmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateDepartmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateDepartmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateDepartmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateDepartmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateDepartmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateDepartmentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateDepartmentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateDepartmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateDepartmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateDepartmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateDepartmentResponse build() { - return new CreateDepartmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateDriveGroupResponse.java b/src/main/java/com/apideck/unify/models/components/CreateDriveGroupResponse.java index 878e7e3e..9e1e9530 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateDriveGroupResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateDriveGroupResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateDriveGroupResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateDriveGroupResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateDriveGroupResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateDriveGroupResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateDriveGroupResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateDriveGroupResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateDriveGroupResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateDriveGroupResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateDriveGroupResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateDriveGroupResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateDriveGroupResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateDriveGroupResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateDriveGroupResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateDriveGroupResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateDriveGroupResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateDriveGroupResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateDriveGroupResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateDriveGroupResponse build() { - return new CreateDriveGroupResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateDriveResponse.java b/src/main/java/com/apideck/unify/models/components/CreateDriveResponse.java index 1fe0a469..82713057 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateDriveResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateDriveResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateDriveResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateDriveResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateDriveResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateDriveResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateDriveResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateDriveResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateDriveResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateDriveResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateDriveResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateDriveResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateDriveResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateDriveResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateDriveResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateDriveResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateDriveResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateDriveResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateDriveResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateDriveResponse build() { - return new CreateDriveResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateEmployeeResponse.java b/src/main/java/com/apideck/unify/models/components/CreateEmployeeResponse.java index 97958cca..6e34d452 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateEmployeeResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateEmployeeResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateEmployeeResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateEmployeeResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateEmployeeResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateEmployeeResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateEmployeeResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateEmployeeResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateEmployeeResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateEmployeeResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateEmployeeResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateEmployeeResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateEmployeeResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateEmployeeResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateEmployeeResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateEmployeeResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateEmployeeResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateEmployeeResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateEmployeeResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateEmployeeResponse build() { - return new CreateEmployeeResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateExpenseResponse.java b/src/main/java/com/apideck/unify/models/components/CreateExpenseResponse.java index eebaca66..e5ca083a 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateExpenseResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateExpenseResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateExpenseResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateExpenseResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateExpenseResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateExpenseResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateExpenseResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateExpenseResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateExpenseResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateExpenseResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateExpenseResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateExpenseResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateExpenseResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateExpenseResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateExpenseResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateExpenseResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateExpenseResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateExpenseResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateExpenseResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateExpenseResponse build() { - return new CreateExpenseResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateFolderRequest.java b/src/main/java/com/apideck/unify/models/components/CreateFolderRequest.java index 7b590703..d65423a5 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateFolderRequest.java +++ b/src/main/java/com/apideck/unify/models/components/CreateFolderRequest.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -28,7 +28,7 @@ public class CreateFolderRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("description") - private Optional description; + private String description; /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. @@ -41,80 +41,71 @@ public class CreateFolderRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("drive_id") - private Optional driveId; + private String driveId; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CreateFolderRequest( - @JsonProperty("name") String name, - @JsonProperty("description") Optional description, - @JsonProperty("parent_folder_id") String parentFolderId, - @JsonProperty("drive_id") Optional driveId, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(parentFolderId, "parentFolderId"); - Utils.checkNotNull(driveId, "driveId"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; + @JsonProperty("name") @Nonnull String name, + @JsonProperty("description") @Nullable String description, + @JsonProperty("parent_folder_id") @Nonnull String parentFolderId, + @JsonProperty("drive_id") @Nullable String driveId, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); this.description = description; - this.parentFolderId = parentFolderId; + this.parentFolderId = Optional.ofNullable(parentFolderId) + .orElseThrow(() -> new IllegalArgumentException("parentFolderId cannot be null")); this.driveId = driveId; this.passThrough = passThrough; } public CreateFolderRequest( - String name, - String parentFolderId) { - this(name, Optional.empty(), parentFolderId, - Optional.empty(), Optional.empty()); + @Nonnull String name, + @Nonnull String parentFolderId) { + this(name, null, parentFolderId, + null, null); } /** * The name of the folder. */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * Optional description of the folder. */ - @JsonIgnore public Optional description() { - return description; + return Optional.ofNullable(this.description); } /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - @JsonIgnore public String parentFolderId() { - return parentFolderId; + return this.parentFolderId; } /** * ID of the drive to create the folder in. */ - @JsonIgnore public Optional driveId() { - return driveId; + return Optional.ofNullable(this.driveId); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -125,18 +116,8 @@ public static Builder builder() { /** * The name of the folder. */ - public CreateFolderRequest withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** - * Optional description of the folder. - */ - public CreateFolderRequest withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = Optional.ofNullable(description); + public CreateFolderRequest withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } @@ -144,27 +125,17 @@ public CreateFolderRequest withDescription(String description) { /** * Optional description of the folder. */ - public CreateFolderRequest withDescription(Optional description) { - Utils.checkNotNull(description, "description"); + public CreateFolderRequest withDescription(@Nullable String description) { this.description = description; return this; } - /** - * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - */ - public CreateFolderRequest withParentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = parentFolderId; - return this; - } /** - * ID of the drive to create the folder in. + * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - public CreateFolderRequest withDriveId(String driveId) { - Utils.checkNotNull(driveId, "driveId"); - this.driveId = Optional.ofNullable(driveId); + public CreateFolderRequest withParentFolderId(@Nonnull String parentFolderId) { + this.parentFolderId = Utils.checkNotNull(parentFolderId, "parentFolderId"); return this; } @@ -172,31 +143,21 @@ public CreateFolderRequest withDriveId(String driveId) { /** * ID of the drive to create the folder in. */ - public CreateFolderRequest withDriveId(Optional driveId) { - Utils.checkNotNull(driveId, "driveId"); + public CreateFolderRequest withDriveId(@Nullable String driveId) { this.driveId = driveId; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CreateFolderRequest withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CreateFolderRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CreateFolderRequest withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -236,97 +197,59 @@ public final static class Builder { private String name; - private Optional description = Optional.empty(); + private String description; private String parentFolderId; - private Optional driveId = Optional.empty(); + private String driveId; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The name of the folder. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - - /** - * Optional description of the folder. - */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); - this.description = Optional.ofNullable(description); + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } /** * Optional description of the folder. */ - public Builder description(Optional description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = description; return this; } - /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - public Builder parentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = parentFolderId; - return this; - } - - - /** - * ID of the drive to create the folder in. - */ - public Builder driveId(String driveId) { - Utils.checkNotNull(driveId, "driveId"); - this.driveId = Optional.ofNullable(driveId); + public Builder parentFolderId(@Nonnull String parentFolderId) { + this.parentFolderId = Utils.checkNotNull(parentFolderId, "parentFolderId"); return this; } /** * ID of the drive to create the folder in. */ - public Builder driveId(Optional driveId) { - Utils.checkNotNull(driveId, "driveId"); + public Builder driveId(@Nullable String driveId) { this.driveId = driveId; return this; } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CreateFolderRequest build() { - return new CreateFolderRequest( name, description, parentFolderId, driveId, passThrough); diff --git a/src/main/java/com/apideck/unify/models/components/CreateFolderResponse.java b/src/main/java/com/apideck/unify/models/components/CreateFolderResponse.java index ebacd381..b39a2b06 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateFolderResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateFolderResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateFolderResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateFolderResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateFolderResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateFolderResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateFolderResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateFolderResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateFolderResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateFolderResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateFolderResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateFolderResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateFolderResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateFolderResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateFolderResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateFolderResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateFolderResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateFolderResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateFolderResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateFolderResponse build() { - return new CreateFolderResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateHrisCompanyResponse.java b/src/main/java/com/apideck/unify/models/components/CreateHrisCompanyResponse.java index d5fc6d7d..fb8d7be3 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateHrisCompanyResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateHrisCompanyResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateHrisCompanyResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateHrisCompanyResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateHrisCompanyResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateHrisCompanyResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateHrisCompanyResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateHrisCompanyResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateHrisCompanyResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateHrisCompanyResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateHrisCompanyResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateHrisCompanyResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateHrisCompanyResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateHrisCompanyResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateHrisCompanyResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateHrisCompanyResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateHrisCompanyResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateHrisCompanyResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateHrisCompanyResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateHrisCompanyResponse build() { - return new CreateHrisCompanyResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateInvoiceItemResponse.java b/src/main/java/com/apideck/unify/models/components/CreateInvoiceItemResponse.java index d7690a49..37c2906e 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateInvoiceItemResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateInvoiceItemResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateInvoiceItemResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateInvoiceItemResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateInvoiceItemResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateInvoiceItemResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateInvoiceItemResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateInvoiceItemResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateInvoiceItemResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateInvoiceItemResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateInvoiceItemResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateInvoiceItemResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateInvoiceItemResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateInvoiceItemResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateInvoiceItemResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateInvoiceItemResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateInvoiceItemResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateInvoiceItemResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateInvoiceItemResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateInvoiceItemResponse build() { - return new CreateInvoiceItemResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateInvoiceResponse.java b/src/main/java/com/apideck/unify/models/components/CreateInvoiceResponse.java index dac242b7..e23c7060 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateInvoiceResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateInvoiceResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class CreateInvoiceResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateInvoiceResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") InvoiceResponse data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull InvoiceResponse data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateInvoiceResponse( long statusCode, - String status, - String service, - String resource, - String operation, - InvoiceResponse data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull InvoiceResponse data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public InvoiceResponse data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateInvoiceResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateInvoiceResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateInvoiceResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateInvoiceResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateInvoiceResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateInvoiceResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateInvoiceResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateInvoiceResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateInvoiceResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public CreateInvoiceResponse withData(InvoiceResponse data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public CreateInvoiceResponse withData(@Nonnull InvoiceResponse data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateInvoiceResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateInvoiceResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateInvoiceResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private InvoiceResponse data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(InvoiceResponse data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull InvoiceResponse data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateInvoiceResponse build() { - return new CreateInvoiceResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateJournalEntryResponse.java b/src/main/java/com/apideck/unify/models/components/CreateJournalEntryResponse.java index 0fd85863..50361fa5 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateJournalEntryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateJournalEntryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateJournalEntryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateJournalEntryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateJournalEntryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateJournalEntryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateJournalEntryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateJournalEntryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateJournalEntryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateJournalEntryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateJournalEntryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateJournalEntryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateJournalEntryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateJournalEntryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateJournalEntryResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateJournalEntryResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateJournalEntryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateJournalEntryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateJournalEntryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateJournalEntryResponse build() { - return new CreateJournalEntryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateLeadResponse.java b/src/main/java/com/apideck/unify/models/components/CreateLeadResponse.java index 8b64bf36..8201a4de 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateLeadResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateLeadResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateLeadResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateLeadResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateLeadResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateLeadResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateLeadResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateLeadResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateLeadResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateLeadResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateLeadResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateLeadResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateLeadResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateLeadResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateLeadResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateLeadResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateLeadResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateLeadResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateLeadResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateLeadResponse build() { - return new CreateLeadResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateLedgerAccountResponse.java b/src/main/java/com/apideck/unify/models/components/CreateLedgerAccountResponse.java index ab7d4393..1fcaf4fb 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateLedgerAccountResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateLedgerAccountResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateLedgerAccountResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateLedgerAccountResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateLedgerAccountResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateLedgerAccountResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateLedgerAccountResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateLedgerAccountResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateLedgerAccountResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateLedgerAccountResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateLedgerAccountResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateLedgerAccountResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateLedgerAccountResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateLedgerAccountResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateLedgerAccountResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateLedgerAccountResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateLedgerAccountResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateLedgerAccountResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateLedgerAccountResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateLedgerAccountResponse build() { - return new CreateLedgerAccountResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateMessageResponse.java b/src/main/java/com/apideck/unify/models/components/CreateMessageResponse.java index c2fcdc4d..0ccdbbe6 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateMessageResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateMessageResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateMessageResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateMessageResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateMessageResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateMessageResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateMessageResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateMessageResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateMessageResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateMessageResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateMessageResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateMessageResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateMessageResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateMessageResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateMessageResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateMessageResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateMessageResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateMessageResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateMessageResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateMessageResponse build() { - return new CreateMessageResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateNoteResponse.java b/src/main/java/com/apideck/unify/models/components/CreateNoteResponse.java index 140facad..4724ef88 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateNoteResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateNoteResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateNoteResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateNoteResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateNoteResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateNoteResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateNoteResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateNoteResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateNoteResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateNoteResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateNoteResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateNoteResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateNoteResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateNoteResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateNoteResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateNoteResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateNoteResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateNoteResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateNoteResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateNoteResponse build() { - return new CreateNoteResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateOpportunityResponse.java b/src/main/java/com/apideck/unify/models/components/CreateOpportunityResponse.java index 607af536..b5401ecf 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateOpportunityResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateOpportunityResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateOpportunityResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateOpportunityResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateOpportunityResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateOpportunityResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateOpportunityResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateOpportunityResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateOpportunityResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateOpportunityResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateOpportunityResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateOpportunityResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateOpportunityResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateOpportunityResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateOpportunityResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateOpportunityResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateOpportunityResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateOpportunityResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateOpportunityResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateOpportunityResponse build() { - return new CreateOpportunityResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreatePaymentResponse.java b/src/main/java/com/apideck/unify/models/components/CreatePaymentResponse.java index f8f03771..8aee895d 100644 --- a/src/main/java/com/apideck/unify/models/components/CreatePaymentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreatePaymentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreatePaymentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreatePaymentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreatePaymentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreatePaymentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreatePaymentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreatePaymentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreatePaymentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreatePaymentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreatePaymentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreatePaymentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreatePaymentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreatePaymentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreatePaymentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreatePaymentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreatePaymentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreatePaymentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreatePaymentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreatePaymentResponse build() { - return new CreatePaymentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreatePipelineResponse.java b/src/main/java/com/apideck/unify/models/components/CreatePipelineResponse.java index 3d9bbf53..d4d5f55d 100644 --- a/src/main/java/com/apideck/unify/models/components/CreatePipelineResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreatePipelineResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreatePipelineResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreatePipelineResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreatePipelineResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreatePipelineResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreatePipelineResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreatePipelineResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreatePipelineResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreatePipelineResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreatePipelineResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreatePipelineResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreatePipelineResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreatePipelineResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreatePipelineResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreatePipelineResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreatePipelineResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreatePipelineResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreatePipelineResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreatePipelineResponse build() { - return new CreatePipelineResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreatePurchaseOrderResponse.java b/src/main/java/com/apideck/unify/models/components/CreatePurchaseOrderResponse.java index 1a285e42..6f180f76 100644 --- a/src/main/java/com/apideck/unify/models/components/CreatePurchaseOrderResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreatePurchaseOrderResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreatePurchaseOrderResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreatePurchaseOrderResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreatePurchaseOrderResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreatePurchaseOrderResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreatePurchaseOrderResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreatePurchaseOrderResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreatePurchaseOrderResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreatePurchaseOrderResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreatePurchaseOrderResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreatePurchaseOrderResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreatePurchaseOrderResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreatePurchaseOrderResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreatePurchaseOrderResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreatePurchaseOrderResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreatePurchaseOrderResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreatePurchaseOrderResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreatePurchaseOrderResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreatePurchaseOrderResponse build() { - return new CreatePurchaseOrderResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateSessionResponse.java b/src/main/java/com/apideck/unify/models/components/CreateSessionResponse.java index a3433d1d..44afe386 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateSessionResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateSessionResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class CreateSessionResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateSessionResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") CreateSessionResponseData data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull CreateSessionResponseData data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateSessionResponse( long statusCode, - String status, - CreateSessionResponseData data) { + @Nonnull String status, + @Nonnull CreateSessionResponseData data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public CreateSessionResponseData data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateSessionResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateSessionResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateSessionResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public CreateSessionResponse withData(CreateSessionResponseData data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public CreateSessionResponse withData(@Nonnull CreateSessionResponseData data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateSessionResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateSessionResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateSessionResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private CreateSessionResponseData data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(CreateSessionResponseData data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull CreateSessionResponseData data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateSessionResponse build() { - return new CreateSessionResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/CreateSessionResponseData.java b/src/main/java/com/apideck/unify/models/components/CreateSessionResponseData.java index c6cc7031..2475a9cf 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateSessionResponseData.java +++ b/src/main/java/com/apideck/unify/models/components/CreateSessionResponseData.java @@ -5,10 +5,11 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; import java.lang.Override; import java.lang.String; +import java.util.Optional; public class CreateSessionResponseData { @@ -22,22 +23,20 @@ public class CreateSessionResponseData { @JsonCreator public CreateSessionResponseData( - @JsonProperty("session_uri") String sessionUri, - @JsonProperty("session_token") String sessionToken) { - Utils.checkNotNull(sessionUri, "sessionUri"); - Utils.checkNotNull(sessionToken, "sessionToken"); - this.sessionUri = sessionUri; - this.sessionToken = sessionToken; + @JsonProperty("session_uri") @Nonnull String sessionUri, + @JsonProperty("session_token") @Nonnull String sessionToken) { + this.sessionUri = Optional.ofNullable(sessionUri) + .orElseThrow(() -> new IllegalArgumentException("sessionUri cannot be null")); + this.sessionToken = Optional.ofNullable(sessionToken) + .orElseThrow(() -> new IllegalArgumentException("sessionToken cannot be null")); } - @JsonIgnore public String sessionUri() { - return sessionUri; + return this.sessionUri; } - @JsonIgnore public String sessionToken() { - return sessionToken; + return this.sessionToken; } public static Builder builder() { @@ -45,18 +44,18 @@ public static Builder builder() { } - public CreateSessionResponseData withSessionUri(String sessionUri) { - Utils.checkNotNull(sessionUri, "sessionUri"); - this.sessionUri = sessionUri; + public CreateSessionResponseData withSessionUri(@Nonnull String sessionUri) { + this.sessionUri = Utils.checkNotNull(sessionUri, "sessionUri"); return this; } - public CreateSessionResponseData withSessionToken(String sessionToken) { - Utils.checkNotNull(sessionToken, "sessionToken"); - this.sessionToken = sessionToken; + + public CreateSessionResponseData withSessionToken(@Nonnull String sessionToken) { + this.sessionToken = Utils.checkNotNull(sessionToken, "sessionToken"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -95,22 +94,17 @@ private Builder() { // force use of static builder() method } - - public Builder sessionUri(String sessionUri) { - Utils.checkNotNull(sessionUri, "sessionUri"); - this.sessionUri = sessionUri; + public Builder sessionUri(@Nonnull String sessionUri) { + this.sessionUri = Utils.checkNotNull(sessionUri, "sessionUri"); return this; } - - public Builder sessionToken(String sessionToken) { - Utils.checkNotNull(sessionToken, "sessionToken"); - this.sessionToken = sessionToken; + public Builder sessionToken(@Nonnull String sessionToken) { + this.sessionToken = Utils.checkNotNull(sessionToken, "sessionToken"); return this; } public CreateSessionResponseData build() { - return new CreateSessionResponseData( sessionUri, sessionToken); } diff --git a/src/main/java/com/apideck/unify/models/components/CreateSharedLinkResponse.java b/src/main/java/com/apideck/unify/models/components/CreateSharedLinkResponse.java index e2f22065..61b131a0 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateSharedLinkResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateSharedLinkResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateSharedLinkResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateSharedLinkResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateSharedLinkResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateSharedLinkResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateSharedLinkResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateSharedLinkResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateSharedLinkResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateSharedLinkResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateSharedLinkResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateSharedLinkResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateSharedLinkResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateSharedLinkResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateSharedLinkResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateSharedLinkResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateSharedLinkResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateSharedLinkResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateSharedLinkResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateSharedLinkResponse build() { - return new CreateSharedLinkResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateSubsidiaryResponse.java b/src/main/java/com/apideck/unify/models/components/CreateSubsidiaryResponse.java index 25fc32a6..4db9b1fa 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateSubsidiaryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateSubsidiaryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateSubsidiaryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateSubsidiaryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateSubsidiaryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateSubsidiaryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateSubsidiaryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateSubsidiaryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateSubsidiaryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateSubsidiaryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateSubsidiaryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateSubsidiaryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateSubsidiaryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateSubsidiaryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateSubsidiaryResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateSubsidiaryResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateSubsidiaryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateSubsidiaryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateSubsidiaryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateSubsidiaryResponse build() { - return new CreateSubsidiaryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateSupplierResponse.java b/src/main/java/com/apideck/unify/models/components/CreateSupplierResponse.java index 05c231aa..34dcd577 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateSupplierResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateSupplierResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateSupplierResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateSupplierResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateSupplierResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateSupplierResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateSupplierResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateSupplierResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateSupplierResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateSupplierResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateSupplierResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateSupplierResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateSupplierResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateSupplierResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateSupplierResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateSupplierResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateSupplierResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateSupplierResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateSupplierResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateSupplierResponse build() { - return new CreateSupplierResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateTaxRateResponse.java b/src/main/java/com/apideck/unify/models/components/CreateTaxRateResponse.java index cc57a08b..87a8376d 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateTaxRateResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateTaxRateResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateTaxRateResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateTaxRateResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateTaxRateResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateTaxRateResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateTaxRateResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateTaxRateResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateTaxRateResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateTaxRateResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateTaxRateResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateTaxRateResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateTaxRateResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateTaxRateResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateTaxRateResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateTaxRateResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateTaxRateResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateTaxRateResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateTaxRateResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateTaxRateResponse build() { - return new CreateTaxRateResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateTicketResponse.java b/src/main/java/com/apideck/unify/models/components/CreateTicketResponse.java index bd51e300..4f5d7e04 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateTicketResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateTicketResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateTicketResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateTicketResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateTicketResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateTicketResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateTicketResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateTicketResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateTicketResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateTicketResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateTicketResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateTicketResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateTicketResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateTicketResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateTicketResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateTicketResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateTicketResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateTicketResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateTicketResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateTicketResponse build() { - return new CreateTicketResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateTimeOffRequestResponse.java b/src/main/java/com/apideck/unify/models/components/CreateTimeOffRequestResponse.java index 2c949fdb..dc214d07 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateTimeOffRequestResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateTimeOffRequestResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateTimeOffRequestResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateTimeOffRequestResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateTimeOffRequestResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateTimeOffRequestResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateTimeOffRequestResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateTimeOffRequestResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateTimeOffRequestResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateTimeOffRequestResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateTimeOffRequestResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateTimeOffRequestResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateTimeOffRequestResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateTimeOffRequestResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateTimeOffRequestResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateTimeOffRequestResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateTimeOffRequestResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateTimeOffRequestResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateTimeOffRequestResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateTimeOffRequestResponse build() { - return new CreateTimeOffRequestResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateTrackingCategoryResponse.java b/src/main/java/com/apideck/unify/models/components/CreateTrackingCategoryResponse.java index 78d296c3..a5756202 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateTrackingCategoryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateTrackingCategoryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateTrackingCategoryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateTrackingCategoryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateTrackingCategoryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateTrackingCategoryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateTrackingCategoryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateTrackingCategoryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateTrackingCategoryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateTrackingCategoryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateTrackingCategoryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateTrackingCategoryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateTrackingCategoryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateTrackingCategoryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateTrackingCategoryResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateTrackingCategoryResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateTrackingCategoryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateTrackingCategoryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateTrackingCategoryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateTrackingCategoryResponse build() { - return new CreateTrackingCategoryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateUploadSessionRequest.java b/src/main/java/com/apideck/unify/models/components/CreateUploadSessionRequest.java index 363ac5cc..898d5394 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateUploadSessionRequest.java +++ b/src/main/java/com/apideck/unify/models/components/CreateUploadSessionRequest.java @@ -5,16 +5,17 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; +import org.openapitools.jackson.nullable.JsonNullable; public class CreateUploadSessionRequest { @@ -35,87 +36,78 @@ public class CreateUploadSessionRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("drive_id") - private Optional driveId; + private String driveId; /** * The size of the file in bytes */ @JsonInclude(Include.ALWAYS) @JsonProperty("size") - private Optional size; + private JsonNullable size; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CreateUploadSessionRequest( - @JsonProperty("name") String name, - @JsonProperty("parent_folder_id") String parentFolderId, - @JsonProperty("drive_id") Optional driveId, - @JsonProperty("size") Optional size, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(parentFolderId, "parentFolderId"); - Utils.checkNotNull(driveId, "driveId"); - Utils.checkNotNull(size, "size"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; - this.parentFolderId = parentFolderId; + @JsonProperty("name") @Nonnull String name, + @JsonProperty("parent_folder_id") @Nonnull String parentFolderId, + @JsonProperty("drive_id") @Nullable String driveId, + @JsonProperty("size") @Nullable Long size, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.parentFolderId = Optional.ofNullable(parentFolderId) + .orElseThrow(() -> new IllegalArgumentException("parentFolderId cannot be null")); this.driveId = driveId; - this.size = size; + this.size = JsonNullable.of(size); this.passThrough = passThrough; } public CreateUploadSessionRequest( - String name, - String parentFolderId) { - this(name, parentFolderId, Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String name, + @Nonnull String parentFolderId) { + this(name, parentFolderId, null, + null, null); } /** * The name of the file. */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - @JsonIgnore public String parentFolderId() { - return parentFolderId; + return this.parentFolderId; } /** * ID of the drive to upload to. */ - @JsonIgnore public Optional driveId() { - return driveId; + return Optional.ofNullable(this.driveId); } /** * The size of the file in bytes */ - @JsonIgnore - public Optional size() { - return size; + public JsonNullable size() { + return this.size; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -126,27 +118,17 @@ public static Builder builder() { /** * The name of the file. */ - public CreateUploadSessionRequest withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public CreateUploadSessionRequest withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** - * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - */ - public CreateUploadSessionRequest withParentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = parentFolderId; - return this; - } /** - * ID of the drive to upload to. + * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - public CreateUploadSessionRequest withDriveId(String driveId) { - Utils.checkNotNull(driveId, "driveId"); - this.driveId = Optional.ofNullable(driveId); + public CreateUploadSessionRequest withParentFolderId(@Nonnull String parentFolderId) { + this.parentFolderId = Utils.checkNotNull(parentFolderId, "parentFolderId"); return this; } @@ -154,37 +136,17 @@ public CreateUploadSessionRequest withDriveId(String driveId) { /** * ID of the drive to upload to. */ - public CreateUploadSessionRequest withDriveId(Optional driveId) { - Utils.checkNotNull(driveId, "driveId"); + public CreateUploadSessionRequest withDriveId(@Nullable String driveId) { this.driveId = driveId; return this; } - /** - * The size of the file in bytes - */ - public CreateUploadSessionRequest withSize(long size) { - Utils.checkNotNull(size, "size"); - this.size = Optional.ofNullable(size); - return this; - } - /** * The size of the file in bytes */ - public CreateUploadSessionRequest withSize(Optional size) { - Utils.checkNotNull(size, "size"); - this.size = size; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CreateUploadSessionRequest withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public CreateUploadSessionRequest withSize(@Nullable Long size) { + this.size = JsonNullable.of(size); return this; } @@ -192,12 +154,12 @@ public CreateUploadSessionRequest withPassThrough(List passThro /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CreateUploadSessionRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CreateUploadSessionRequest withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -239,95 +201,57 @@ public final static class Builder { private String parentFolderId; - private Optional driveId = Optional.empty(); + private String driveId; - private Optional size = Optional.empty(); + private Long size; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The name of the file. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - public Builder parentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = parentFolderId; + public Builder parentFolderId(@Nonnull String parentFolderId) { + this.parentFolderId = Utils.checkNotNull(parentFolderId, "parentFolderId"); return this; } - /** * ID of the drive to upload to. */ - public Builder driveId(String driveId) { - Utils.checkNotNull(driveId, "driveId"); - this.driveId = Optional.ofNullable(driveId); - return this; - } - - /** - * ID of the drive to upload to. - */ - public Builder driveId(Optional driveId) { - Utils.checkNotNull(driveId, "driveId"); + public Builder driveId(@Nullable String driveId) { this.driveId = driveId; return this; } - - /** - * The size of the file in bytes - */ - public Builder size(long size) { - Utils.checkNotNull(size, "size"); - this.size = Optional.ofNullable(size); - return this; - } - /** * The size of the file in bytes */ - public Builder size(Optional size) { - Utils.checkNotNull(size, "size"); + public Builder size(@Nullable Long size) { this.size = size; return this; } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CreateUploadSessionRequest build() { - return new CreateUploadSessionRequest( name, parentFolderId, driveId, size, passThrough); diff --git a/src/main/java/com/apideck/unify/models/components/CreateUploadSessionResponse.java b/src/main/java/com/apideck/unify/models/components/CreateUploadSessionResponse.java index 91c1156d..6911124f 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateUploadSessionResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateUploadSessionResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateUploadSessionResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateUploadSessionResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateUploadSessionResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateUploadSessionResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateUploadSessionResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateUploadSessionResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateUploadSessionResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateUploadSessionResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateUploadSessionResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateUploadSessionResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateUploadSessionResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateUploadSessionResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateUploadSessionResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateUploadSessionResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateUploadSessionResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateUploadSessionResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateUploadSessionResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateUploadSessionResponse build() { - return new CreateUploadSessionResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateUserResponse.java b/src/main/java/com/apideck/unify/models/components/CreateUserResponse.java index 08f16188..8de8c62b 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateUserResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateUserResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class CreateUserResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateUserResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateUserResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateUserResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateUserResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateUserResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public CreateUserResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public CreateUserResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public CreateUserResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public CreateUserResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public CreateUserResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public CreateUserResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public CreateUserResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public CreateUserResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateUserResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateUserResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateUserResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateUserResponse build() { - return new CreateUserResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/CreateWebhookRequest.java b/src/main/java/com/apideck/unify/models/components/CreateWebhookRequest.java index 4bce45fe..4f4dcc04 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateWebhookRequest.java +++ b/src/main/java/com/apideck/unify/models/components/CreateWebhookRequest.java @@ -5,13 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.List; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -49,70 +51,65 @@ public class CreateWebhookRequest { @JsonCreator public CreateWebhookRequest( - @JsonProperty("description") JsonNullable description, - @JsonProperty("unified_api") UnifiedApiId unifiedApi, - @JsonProperty("status") Status status, - @JsonProperty("delivery_url") String deliveryUrl, - @JsonProperty("events") List events) { - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); - Utils.checkNotNull(events, "events"); - this.description = description; - this.unifiedApi = unifiedApi; - this.status = status; - this.deliveryUrl = deliveryUrl; - this.events = events; + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("unified_api") @Nonnull UnifiedApiId unifiedApi, + @JsonProperty("status") @Nonnull Status status, + @JsonProperty("delivery_url") @Nonnull String deliveryUrl, + @JsonProperty("events") @Nonnull List events) { + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.deliveryUrl = Optional.ofNullable(deliveryUrl) + .orElseThrow(() -> new IllegalArgumentException("deliveryUrl cannot be null")); + this.events = Optional.ofNullable(events) + .orElseThrow(() -> new IllegalArgumentException("events cannot be null")); } public CreateWebhookRequest( - UnifiedApiId unifiedApi, - Status status, - String deliveryUrl, - List events) { - this(JsonNullable.undefined(), unifiedApi, status, + @Nonnull UnifiedApiId unifiedApi, + @Nonnull Status status, + @Nonnull String deliveryUrl, + @Nonnull List events) { + this(null, unifiedApi, status, deliveryUrl, events); } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Name of Apideck Unified API */ - @JsonIgnore public UnifiedApiId unifiedApi() { - return unifiedApi; + return this.unifiedApi; } /** * The status of the webhook. */ - @JsonIgnore public Status status() { - return status; + return this.status; } /** * The delivery url of the webhook endpoint. */ - @JsonIgnore public String deliveryUrl() { - return deliveryUrl; + return this.deliveryUrl; } /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ - @JsonIgnore public List events() { - return events; + return this.events; } public static Builder builder() { @@ -123,57 +120,48 @@ public static Builder builder() { /** * A description of the object. */ - public CreateWebhookRequest withDescription(String description) { - Utils.checkNotNull(description, "description"); + public CreateWebhookRequest withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public CreateWebhookRequest withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * Name of Apideck Unified API */ - public CreateWebhookRequest withUnifiedApi(UnifiedApiId unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public CreateWebhookRequest withUnifiedApi(@Nonnull UnifiedApiId unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + /** * The status of the webhook. */ - public CreateWebhookRequest withStatus(Status status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateWebhookRequest withStatus(@Nonnull Status status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * The delivery url of the webhook endpoint. */ - public CreateWebhookRequest withDeliveryUrl(String deliveryUrl) { - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); - this.deliveryUrl = deliveryUrl; + public CreateWebhookRequest withDeliveryUrl(@Nonnull String deliveryUrl) { + this.deliveryUrl = Utils.checkNotNull(deliveryUrl, "deliveryUrl"); return this; } + /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ - public CreateWebhookRequest withEvents(List events) { - Utils.checkNotNull(events, "events"); - this.events = events; + public CreateWebhookRequest withEvents(@Nonnull List events) { + this.events = Utils.checkNotNull(events, "events"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -211,7 +199,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; private UnifiedApiId unifiedApi; @@ -225,67 +213,47 @@ private Builder() { // force use of static builder() method } - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * Name of Apideck Unified API */ - public Builder unifiedApi(UnifiedApiId unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull UnifiedApiId unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** * The status of the webhook. */ - public Builder status(Status status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull Status status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * The delivery url of the webhook endpoint. */ - public Builder deliveryUrl(String deliveryUrl) { - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); - this.deliveryUrl = deliveryUrl; + public Builder deliveryUrl(@Nonnull String deliveryUrl) { + this.deliveryUrl = Utils.checkNotNull(deliveryUrl, "deliveryUrl"); return this; } - /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ - public Builder events(List events) { - Utils.checkNotNull(events, "events"); - this.events = events; + public Builder events(@Nonnull List events) { + this.events = Utils.checkNotNull(events, "events"); return this; } public CreateWebhookRequest build() { - return new CreateWebhookRequest( description, unifiedApi, status, deliveryUrl, events); diff --git a/src/main/java/com/apideck/unify/models/components/CreateWebhookResponse.java b/src/main/java/com/apideck/unify/models/components/CreateWebhookResponse.java index c2b07bcc..aec6ec5c 100644 --- a/src/main/java/com/apideck/unify/models/components/CreateWebhookResponse.java +++ b/src/main/java/com/apideck/unify/models/components/CreateWebhookResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class CreateWebhookResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public CreateWebhookResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Webhook data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Webhook data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public CreateWebhookResponse( long statusCode, - String status, - Webhook data) { + @Nonnull String status, + @Nonnull Webhook data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Webhook data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public CreateWebhookResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public CreateWebhookResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public CreateWebhookResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public CreateWebhookResponse withData(Webhook data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public CreateWebhookResponse withData(@Nonnull Webhook data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public CreateWebhookResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public CreateWebhookResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public CreateWebhookResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Webhook data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Webhook data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Webhook data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public CreateWebhookResponse build() { - return new CreateWebhookResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/Credentials.java b/src/main/java/com/apideck/unify/models/components/Credentials.java index 98c53d16..629f85a0 100644 --- a/src/main/java/com/apideck/unify/models/components/Credentials.java +++ b/src/main/java/com/apideck/unify/models/components/Credentials.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; @@ -30,7 +30,7 @@ public class Credentials { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("access_token") - private Optional accessToken; + private String accessToken; /** * The datetime at which the token was issued. If omitted the token will be queued for refresh. @@ -48,55 +48,50 @@ public class Credentials { @JsonCreator public Credentials( - @JsonProperty("refresh_token") JsonNullable refreshToken, - @JsonProperty("access_token") Optional accessToken, - @JsonProperty("issued_at") JsonNullable issuedAt, - @JsonProperty("expires_in") JsonNullable expiresIn) { - Utils.checkNotNull(refreshToken, "refreshToken"); - Utils.checkNotNull(accessToken, "accessToken"); - Utils.checkNotNull(issuedAt, "issuedAt"); - Utils.checkNotNull(expiresIn, "expiresIn"); - this.refreshToken = refreshToken; + @JsonProperty("refresh_token") @Nullable JsonNullable refreshToken, + @JsonProperty("access_token") @Nullable String accessToken, + @JsonProperty("issued_at") @Nullable JsonNullable issuedAt, + @JsonProperty("expires_in") @Nullable JsonNullable expiresIn) { + this.refreshToken = Optional.ofNullable(refreshToken) + .orElse(JsonNullable.undefined()); this.accessToken = accessToken; - this.issuedAt = issuedAt; - this.expiresIn = expiresIn; + this.issuedAt = Optional.ofNullable(issuedAt) + .orElse(JsonNullable.undefined()); + this.expiresIn = Optional.ofNullable(expiresIn) + .orElse(JsonNullable.undefined()); } public Credentials() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null); } /** * The refresh token can be used to obtain a new access token. */ - @JsonIgnore public JsonNullable refreshToken() { - return refreshToken; + return this.refreshToken; } /** * Access token */ - @JsonIgnore public Optional accessToken() { - return accessToken; + return Optional.ofNullable(this.accessToken); } /** * The datetime at which the token was issued. If omitted the token will be queued for refresh. */ - @JsonIgnore public JsonNullable issuedAt() { - return issuedAt; + return this.issuedAt; } /** * The number of seconds until the token expires. If omitted the token will be queued for refresh. */ - @JsonIgnore public JsonNullable expiresIn() { - return expiresIn; + return this.expiresIn; } public static Builder builder() { @@ -107,75 +102,38 @@ public static Builder builder() { /** * The refresh token can be used to obtain a new access token. */ - public Credentials withRefreshToken(String refreshToken) { - Utils.checkNotNull(refreshToken, "refreshToken"); + public Credentials withRefreshToken(@Nullable String refreshToken) { this.refreshToken = JsonNullable.of(refreshToken); return this; } - /** - * The refresh token can be used to obtain a new access token. - */ - public Credentials withRefreshToken(JsonNullable refreshToken) { - Utils.checkNotNull(refreshToken, "refreshToken"); - this.refreshToken = refreshToken; - return this; - } /** * Access token */ - public Credentials withAccessToken(String accessToken) { - Utils.checkNotNull(accessToken, "accessToken"); - this.accessToken = Optional.ofNullable(accessToken); - return this; - } - - - /** - * Access token - */ - public Credentials withAccessToken(Optional accessToken) { - Utils.checkNotNull(accessToken, "accessToken"); + public Credentials withAccessToken(@Nullable String accessToken) { this.accessToken = accessToken; return this; } + /** * The datetime at which the token was issued. If omitted the token will be queued for refresh. */ - public Credentials withIssuedAt(OffsetDateTime issuedAt) { - Utils.checkNotNull(issuedAt, "issuedAt"); + public Credentials withIssuedAt(@Nullable OffsetDateTime issuedAt) { this.issuedAt = JsonNullable.of(issuedAt); return this; } - /** - * The datetime at which the token was issued. If omitted the token will be queued for refresh. - */ - public Credentials withIssuedAt(JsonNullable issuedAt) { - Utils.checkNotNull(issuedAt, "issuedAt"); - this.issuedAt = issuedAt; - return this; - } /** * The number of seconds until the token expires. If omitted the token will be queued for refresh. */ - public Credentials withExpiresIn(long expiresIn) { - Utils.checkNotNull(expiresIn, "expiresIn"); + public Credentials withExpiresIn(@Nullable Long expiresIn) { this.expiresIn = JsonNullable.of(expiresIn); return this; } - /** - * The number of seconds until the token expires. If omitted the token will be queued for refresh. - */ - public Credentials withExpiresIn(JsonNullable expiresIn) { - Utils.checkNotNull(expiresIn, "expiresIn"); - this.expiresIn = expiresIn; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -212,96 +170,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable refreshToken = JsonNullable.undefined(); + private JsonNullable refreshToken; - private Optional accessToken = Optional.empty(); + private String accessToken; - private JsonNullable issuedAt = JsonNullable.undefined(); + private JsonNullable issuedAt; - private JsonNullable expiresIn = JsonNullable.undefined(); + private JsonNullable expiresIn; private Builder() { // force use of static builder() method } - /** * The refresh token can be used to obtain a new access token. */ - public Builder refreshToken(String refreshToken) { - Utils.checkNotNull(refreshToken, "refreshToken"); + public Builder refreshToken(@Nullable String refreshToken) { this.refreshToken = JsonNullable.of(refreshToken); return this; } - /** - * The refresh token can be used to obtain a new access token. - */ - public Builder refreshToken(JsonNullable refreshToken) { - Utils.checkNotNull(refreshToken, "refreshToken"); - this.refreshToken = refreshToken; - return this; - } - - /** * Access token */ - public Builder accessToken(String accessToken) { - Utils.checkNotNull(accessToken, "accessToken"); - this.accessToken = Optional.ofNullable(accessToken); - return this; - } - - /** - * Access token - */ - public Builder accessToken(Optional accessToken) { - Utils.checkNotNull(accessToken, "accessToken"); + public Builder accessToken(@Nullable String accessToken) { this.accessToken = accessToken; return this; } - /** * The datetime at which the token was issued. If omitted the token will be queued for refresh. */ - public Builder issuedAt(OffsetDateTime issuedAt) { - Utils.checkNotNull(issuedAt, "issuedAt"); + public Builder issuedAt(@Nullable OffsetDateTime issuedAt) { this.issuedAt = JsonNullable.of(issuedAt); return this; } - /** - * The datetime at which the token was issued. If omitted the token will be queued for refresh. - */ - public Builder issuedAt(JsonNullable issuedAt) { - Utils.checkNotNull(issuedAt, "issuedAt"); - this.issuedAt = issuedAt; - return this; - } - - /** * The number of seconds until the token expires. If omitted the token will be queued for refresh. */ - public Builder expiresIn(long expiresIn) { - Utils.checkNotNull(expiresIn, "expiresIn"); + public Builder expiresIn(@Nullable Long expiresIn) { this.expiresIn = JsonNullable.of(expiresIn); return this; } - /** - * The number of seconds until the token expires. If omitted the token will be queued for refresh. - */ - public Builder expiresIn(JsonNullable expiresIn) { - Utils.checkNotNull(expiresIn, "expiresIn"); - this.expiresIn = expiresIn; - return this; - } - public Credentials build() { - return new Credentials( refreshToken, accessToken, issuedAt, expiresIn); diff --git a/src/main/java/com/apideck/unify/models/components/CreditNote.java b/src/main/java/com/apideck/unify/models/components/CreditNote.java index 143f3740..e788722e 100644 --- a/src/main/java/com/apideck/unify/models/components/CreditNote.java +++ b/src/main/java/com/apideck/unify/models/components/CreditNote.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -41,7 +41,7 @@ public class CreditNote { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer") - private JsonNullable customer; + private JsonNullable customer; /** * The company or subsidiary id the transaction belongs to @@ -55,7 +55,7 @@ public class CreditNote { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -117,7 +117,7 @@ public class CreditNote { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private CreditNoteStatus status; /** * Optional reference message ie: Debit remittance detail. @@ -131,7 +131,7 @@ public class CreditNote { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("date_issued") - private Optional dateIssued; + private OffsetDateTime dateIssued; /** * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD @@ -145,22 +145,22 @@ public class CreditNote { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private CreditNoteType type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("account") - private JsonNullable account; + private JsonNullable account; @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; @JsonInclude(Include.NON_ABSENT) @JsonProperty("allocations") - private Optional> allocations; + private List allocations; /** * Optional note to be associated with the credit note. @@ -179,31 +179,31 @@ public class CreditNote { @JsonInclude(Include.NON_ABSENT) @JsonProperty("billing_address") - private Optional billingAddress; + private Address billingAddress; @JsonInclude(Include.NON_ABSENT) @JsonProperty("shipping_address") - private Optional shippingAddress; + private Address shippingAddress; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -245,396 +245,339 @@ public class CreditNote { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CreditNote( - @JsonProperty("id") String id, - @JsonProperty("number") JsonNullable number, - @JsonProperty("customer") JsonNullable customer, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("sub_total") JsonNullable subTotal, + @JsonProperty("id") @Nonnull String id, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("customer") @Nullable JsonNullable customer, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, @JsonProperty("total_amount") double totalAmount, - @JsonProperty("total_tax") JsonNullable totalTax, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("balance") JsonNullable balance, - @JsonProperty("remaining_credit") JsonNullable remainingCredit, - @JsonProperty("status") Optional status, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("date_issued") Optional dateIssued, - @JsonProperty("date_paid") JsonNullable datePaid, - @JsonProperty("type") Optional type, - @JsonProperty("account") JsonNullable account, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("allocations") Optional> allocations, - @JsonProperty("note") JsonNullable note, - @JsonProperty("terms") JsonNullable terms, - @JsonProperty("billing_address") Optional billingAddress, - @JsonProperty("shipping_address") Optional shippingAddress, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(customer, "customer"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(totalTax, "totalTax"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(balance, "balance"); - Utils.checkNotNull(remainingCredit, "remainingCredit"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(dateIssued, "dateIssued"); - Utils.checkNotNull(datePaid, "datePaid"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(account, "account"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(allocations, "allocations"); - Utils.checkNotNull(note, "note"); - Utils.checkNotNull(terms, "terms"); - Utils.checkNotNull(billingAddress, "billingAddress"); - Utils.checkNotNull(shippingAddress, "shippingAddress"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); - this.id = id; - this.number = number; - this.customer = customer; - this.companyId = companyId; - this.currency = currency; - this.currencyRate = currencyRate; - this.taxInclusive = taxInclusive; - this.subTotal = subTotal; + @JsonProperty("total_tax") @Nullable JsonNullable totalTax, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("balance") @Nullable JsonNullable balance, + @JsonProperty("remaining_credit") @Nullable JsonNullable remainingCredit, + @JsonProperty("status") @Nullable CreditNoteStatus status, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("date_issued") @Nullable OffsetDateTime dateIssued, + @JsonProperty("date_paid") @Nullable JsonNullable datePaid, + @JsonProperty("type") @Nullable CreditNoteType type, + @JsonProperty("account") @Nullable JsonNullable account, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("allocations") @Nullable List allocations, + @JsonProperty("note") @Nullable JsonNullable note, + @JsonProperty("terms") @Nullable JsonNullable terms, + @JsonProperty("billing_address") @Nullable Address billingAddress, + @JsonProperty("shipping_address") @Nullable Address shippingAddress, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.customer = Optional.ofNullable(customer) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); this.totalAmount = totalAmount; - this.totalTax = totalTax; - this.taxCode = taxCode; - this.balance = balance; - this.remainingCredit = remainingCredit; + this.totalTax = Optional.ofNullable(totalTax) + .orElse(JsonNullable.undefined()); + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.balance = Optional.ofNullable(balance) + .orElse(JsonNullable.undefined()); + this.remainingCredit = Optional.ofNullable(remainingCredit) + .orElse(JsonNullable.undefined()); this.status = status; - this.reference = reference; + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); this.dateIssued = dateIssued; - this.datePaid = datePaid; + this.datePaid = Optional.ofNullable(datePaid) + .orElse(JsonNullable.undefined()); this.type = type; - this.account = account; + this.account = Optional.ofNullable(account) + .orElse(JsonNullable.undefined()); this.lineItems = lineItems; this.allocations = allocations; - this.note = note; - this.terms = terms; + this.note = Optional.ofNullable(note) + .orElse(JsonNullable.undefined()); + this.terms = Optional.ofNullable(terms) + .orElse(JsonNullable.undefined()); this.billingAddress = billingAddress; this.shippingAddress = shippingAddress; - this.trackingCategories = trackingCategories; - this.customMappings = customMappings; + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public CreditNote( - String id, + @Nonnull String id, double totalAmount) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), totalAmount, - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(id, null, null, + null, null, null, + null, null, totalAmount, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Unique identifier representing the entity */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Credit note number. */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * The customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable customer() { - return (JsonNullable) customer; + return this.customer; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Amount of transaction */ - @JsonIgnore public double totalAmount() { - return totalAmount; + return this.totalAmount; } /** * Total tax amount applied to this invoice. */ - @JsonIgnore public JsonNullable totalTax() { - return totalTax; + return this.totalTax; } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } /** * The balance reflecting any payments made against the transaction. */ - @JsonIgnore public JsonNullable balance() { - return balance; + return this.balance; } /** * Indicates the total credit amount still available to apply towards the payment. */ - @JsonIgnore public JsonNullable remainingCredit() { - return remainingCredit; + return this.remainingCredit; } /** * Status of credit notes */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Optional reference message ie: Debit remittance detail. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } /** * Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore public Optional dateIssued() { - return dateIssued; + return Optional.ofNullable(this.dateIssued); } /** * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore public JsonNullable datePaid() { - return datePaid; + return this.datePaid; } /** * Type of payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable account() { - return (JsonNullable) account; + return this.account; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> allocations() { - return (Optional>) allocations; + return Optional.ofNullable(this.allocations); } /** * Optional note to be associated with the credit note. */ - @JsonIgnore public JsonNullable note() { - return note; + return this.note; } /** * Optional terms to be associated with the credit note. */ - @JsonIgnore public JsonNullable terms() { - return terms; + return this.terms; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
billingAddress() { - return (Optional
) billingAddress; + return Optional.ofNullable(this.billingAddress); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
shippingAddress() { - return (Optional
) shippingAddress; + return Optional.ofNullable(this.shippingAddress); } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -645,262 +588,134 @@ public static Builder builder() { /** * Unique identifier representing the entity */ - public CreditNote withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public CreditNote withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * Credit note number. */ - public CreditNote withNumber(String number) { - Utils.checkNotNull(number, "number"); + public CreditNote withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Credit note number. - */ - public CreditNote withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * The customer this entity is linked to. */ - public CreditNote withCustomer(LinkedCustomer customer) { - Utils.checkNotNull(customer, "customer"); + public CreditNote withCustomer(@Nullable LinkedCustomer customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public CreditNote withCustomer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public CreditNote withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public CreditNote withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public CreditNote withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public CreditNote withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public CreditNote withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public CreditNote withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public CreditNote withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public CreditNote withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public CreditNote withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * Amounts are including tax */ - public CreditNote withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public CreditNote withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public CreditNote withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } /** * Sub-total amount, normally before tax. */ - public CreditNote withSubTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public CreditNote withSubTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public CreditNote withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Amount of transaction */ public CreditNote withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); this.totalAmount = totalAmount; return this; } + /** * Total tax amount applied to this invoice. */ - public CreditNote withTotalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public CreditNote withTotalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public CreditNote withTotalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public CreditNote withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public CreditNote withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public CreditNote withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } /** * The balance reflecting any payments made against the transaction. */ - public CreditNote withBalance(double balance) { - Utils.checkNotNull(balance, "balance"); + public CreditNote withBalance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * The balance reflecting any payments made against the transaction. - */ - public CreditNote withBalance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } /** * Indicates the total credit amount still available to apply towards the payment. */ - public CreditNote withRemainingCredit(double remainingCredit) { - Utils.checkNotNull(remainingCredit, "remainingCredit"); + public CreditNote withRemainingCredit(@Nullable Double remainingCredit) { this.remainingCredit = JsonNullable.of(remainingCredit); return this; } - /** - * Indicates the total credit amount still available to apply towards the payment. - */ - public CreditNote withRemainingCredit(JsonNullable remainingCredit) { - Utils.checkNotNull(remainingCredit, "remainingCredit"); - this.remainingCredit = remainingCredit; - return this; - } - - /** - * Status of credit notes - */ - public CreditNote withStatus(CreditNoteStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of credit notes */ - public CreditNote withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public CreditNote withStatus(@Nullable CreditNoteStatus status) { this.status = status; return this; } - /** - * Optional reference message ie: Debit remittance detail. - */ - public CreditNote withReference(String reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = JsonNullable.of(reference); - return this; - } /** * Optional reference message ie: Debit remittance detail. */ - public CreditNote withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** - * Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD - */ - public CreditNote withDateIssued(OffsetDateTime dateIssued) { - Utils.checkNotNull(dateIssued, "dateIssued"); - this.dateIssued = Optional.ofNullable(dateIssued); + public CreditNote withReference(@Nullable String reference) { + this.reference = JsonNullable.of(reference); return this; } @@ -908,36 +723,17 @@ public CreditNote withDateIssued(OffsetDateTime dateIssued) { /** * Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD */ - public CreditNote withDateIssued(Optional dateIssued) { - Utils.checkNotNull(dateIssued, "dateIssued"); + public CreditNote withDateIssued(@Nullable OffsetDateTime dateIssued) { this.dateIssued = dateIssued; return this; } - /** - * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD - */ - public CreditNote withDatePaid(OffsetDateTime datePaid) { - Utils.checkNotNull(datePaid, "datePaid"); - this.datePaid = JsonNullable.of(datePaid); - return this; - } /** * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD */ - public CreditNote withDatePaid(JsonNullable datePaid) { - Utils.checkNotNull(datePaid, "datePaid"); - this.datePaid = datePaid; - return this; - } - - /** - * Type of payment - */ - public CreditNote withType(CreditNoteType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); + public CreditNote withDatePaid(@Nullable OffsetDateTime datePaid) { + this.datePaid = JsonNullable.of(datePaid); return this; } @@ -945,270 +741,138 @@ public CreditNote withType(CreditNoteType type) { /** * Type of payment */ - public CreditNote withType(Optional type) { - Utils.checkNotNull(type, "type"); + public CreditNote withType(@Nullable CreditNoteType type) { this.type = type; return this; } - public CreditNote withAccount(LinkedLedgerAccount account) { - Utils.checkNotNull(account, "account"); - this.account = JsonNullable.of(account); - return this; - } - - public CreditNote withAccount(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - public CreditNote withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); + public CreditNote withAccount(@Nullable LinkedLedgerAccount account) { + this.account = JsonNullable.of(account); return this; } - public CreditNote withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public CreditNote withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - public CreditNote withAllocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public CreditNote withAllocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public CreditNote withAllocations(@Nullable List allocations) { this.allocations = allocations; return this; } + /** * Optional note to be associated with the credit note. */ - public CreditNote withNote(String note) { - Utils.checkNotNull(note, "note"); + public CreditNote withNote(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Optional note to be associated with the credit note. - */ - public CreditNote withNote(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } /** * Optional terms to be associated with the credit note. */ - public CreditNote withTerms(String terms) { - Utils.checkNotNull(terms, "terms"); + public CreditNote withTerms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Optional terms to be associated with the credit note. - */ - public CreditNote withTerms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } - - public CreditNote withBillingAddress(Address billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); - this.billingAddress = Optional.ofNullable(billingAddress); - return this; - } - - public CreditNote withBillingAddress(Optional billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); + public CreditNote withBillingAddress(@Nullable Address billingAddress) { this.billingAddress = billingAddress; return this; } - public CreditNote withShippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public CreditNote withShippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public CreditNote withShippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } + /** * A list of linked tracking categories. */ - public CreditNote withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public CreditNote withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public CreditNote withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public CreditNote withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public CreditNote withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public CreditNote withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - public CreditNote withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - - public CreditNote withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public CreditNote withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public CreditNote withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public CreditNote withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public CreditNote withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public CreditNote withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public CreditNote withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public CreditNote withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public CreditNote withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public CreditNote withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public CreditNote withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public CreditNote withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public CreditNote withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public CreditNote withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public CreditNote withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public CreditNote withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public CreditNote withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CreditNote withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CreditNote withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CreditNote withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1316,670 +980,331 @@ public final static class Builder { private String id; - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private JsonNullable customer = JsonNullable.undefined(); + private JsonNullable customer; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private Double totalAmount; + private double totalAmount; - private JsonNullable totalTax = JsonNullable.undefined(); + private JsonNullable totalTax; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable balance = JsonNullable.undefined(); + private JsonNullable balance; - private JsonNullable remainingCredit = JsonNullable.undefined(); + private JsonNullable remainingCredit; - private Optional status = Optional.empty(); + private CreditNoteStatus status; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private Optional dateIssued = Optional.empty(); + private OffsetDateTime dateIssued; - private JsonNullable datePaid = JsonNullable.undefined(); + private JsonNullable datePaid; - private Optional type = Optional.empty(); + private CreditNoteType type; - private JsonNullable account = JsonNullable.undefined(); + private JsonNullable account; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private Optional> allocations = Optional.empty(); + private List allocations; - private JsonNullable note = JsonNullable.undefined(); + private JsonNullable note; - private JsonNullable terms = JsonNullable.undefined(); + private JsonNullable terms; - private Optional billingAddress = Optional.empty(); + private Address billingAddress; - private Optional shippingAddress = Optional.empty(); + private Address shippingAddress; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Unique identifier representing the entity */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * Credit note number. */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Credit note number. - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * The customer this entity is linked to. */ - public Builder customer(LinkedCustomer customer) { - Utils.checkNotNull(customer, "customer"); + public Builder customer(@Nullable LinkedCustomer customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public Builder customer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Amount of transaction */ public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); this.totalAmount = totalAmount; return this; } - /** * Total tax amount applied to this invoice. */ - public Builder totalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Builder totalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public Builder totalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } - - /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - /** * The balance reflecting any payments made against the transaction. */ - public Builder balance(double balance) { - Utils.checkNotNull(balance, "balance"); + public Builder balance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * The balance reflecting any payments made against the transaction. - */ - public Builder balance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } - - /** * Indicates the total credit amount still available to apply towards the payment. */ - public Builder remainingCredit(double remainingCredit) { - Utils.checkNotNull(remainingCredit, "remainingCredit"); + public Builder remainingCredit(@Nullable Double remainingCredit) { this.remainingCredit = JsonNullable.of(remainingCredit); return this; } - /** - * Indicates the total credit amount still available to apply towards the payment. - */ - public Builder remainingCredit(JsonNullable remainingCredit) { - Utils.checkNotNull(remainingCredit, "remainingCredit"); - this.remainingCredit = remainingCredit; - return this; - } - - - /** - * Status of credit notes - */ - public Builder status(CreditNoteStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of credit notes */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable CreditNoteStatus status) { this.status = status; return this; } - /** * Optional reference message ie: Debit remittance detail. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference message ie: Debit remittance detail. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - - /** - * Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Builder dateIssued(OffsetDateTime dateIssued) { - Utils.checkNotNull(dateIssued, "dateIssued"); - this.dateIssued = Optional.ofNullable(dateIssued); - return this; - } - /** * Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder dateIssued(Optional dateIssued) { - Utils.checkNotNull(dateIssued, "dateIssued"); + public Builder dateIssued(@Nullable OffsetDateTime dateIssued) { this.dateIssued = dateIssued; return this; } - /** * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder datePaid(OffsetDateTime datePaid) { - Utils.checkNotNull(datePaid, "datePaid"); + public Builder datePaid(@Nullable OffsetDateTime datePaid) { this.datePaid = JsonNullable.of(datePaid); return this; } - /** - * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Builder datePaid(JsonNullable datePaid) { - Utils.checkNotNull(datePaid, "datePaid"); - this.datePaid = datePaid; - return this; - } - - /** * Type of payment */ - public Builder type(CreditNoteType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - /** - * Type of payment - */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable CreditNoteType type) { this.type = type; return this; } - - public Builder account(LinkedLedgerAccount account) { - Utils.checkNotNull(account, "account"); + public Builder account(@Nullable LinkedLedgerAccount account) { this.account = JsonNullable.of(account); return this; } - public Builder account(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - - - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - - public Builder allocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public Builder allocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public Builder allocations(@Nullable List allocations) { this.allocations = allocations; return this; } - /** * Optional note to be associated with the credit note. */ - public Builder note(String note) { - Utils.checkNotNull(note, "note"); + public Builder note(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Optional note to be associated with the credit note. - */ - public Builder note(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } - - /** * Optional terms to be associated with the credit note. */ - public Builder terms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Builder terms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Optional terms to be associated with the credit note. - */ - public Builder terms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } - - - public Builder billingAddress(Address billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); - this.billingAddress = Optional.ofNullable(billingAddress); - return this; - } - - public Builder billingAddress(Optional billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); + public Builder billingAddress(@Nullable Address billingAddress) { this.billingAddress = billingAddress; return this; } - - public Builder shippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public Builder shippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public Builder shippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CreditNote build() { - return new CreditNote( id, number, customer, companyId, currency, currencyRate, diff --git a/src/main/java/com/apideck/unify/models/components/CreditNoteInput.java b/src/main/java/com/apideck/unify/models/components/CreditNoteInput.java index b6cd9fcf..783caec1 100644 --- a/src/main/java/com/apideck/unify/models/components/CreditNoteInput.java +++ b/src/main/java/com/apideck/unify/models/components/CreditNoteInput.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -33,7 +32,7 @@ public class CreditNoteInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer") - private JsonNullable customer; + private JsonNullable customer; /** * The company or subsidiary id the transaction belongs to @@ -47,7 +46,7 @@ public class CreditNoteInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -109,7 +108,7 @@ public class CreditNoteInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private CreditNoteStatus status; /** * Optional reference message ie: Debit remittance detail. @@ -123,7 +122,7 @@ public class CreditNoteInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("date_issued") - private Optional dateIssued; + private OffsetDateTime dateIssued; /** * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD @@ -137,22 +136,22 @@ public class CreditNoteInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private CreditNoteType type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("account") - private JsonNullable account; + private JsonNullable account; @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; @JsonInclude(Include.NON_ABSENT) @JsonProperty("allocations") - private Optional> allocations; + private List allocations; /** * Optional note to be associated with the credit note. @@ -171,24 +170,24 @@ public class CreditNoteInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("billing_address") - private Optional billingAddress; + private Address billingAddress; @JsonInclude(Include.NON_ABSENT) @JsonProperty("shipping_address") - private Optional shippingAddress; + private Address shippingAddress; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -202,326 +201,276 @@ public class CreditNoteInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CreditNoteInput( - @JsonProperty("number") JsonNullable number, - @JsonProperty("customer") JsonNullable customer, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("sub_total") JsonNullable subTotal, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("customer") @Nullable JsonNullable customer, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, @JsonProperty("total_amount") double totalAmount, - @JsonProperty("total_tax") JsonNullable totalTax, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("balance") JsonNullable balance, - @JsonProperty("remaining_credit") JsonNullable remainingCredit, - @JsonProperty("status") Optional status, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("date_issued") Optional dateIssued, - @JsonProperty("date_paid") JsonNullable datePaid, - @JsonProperty("type") Optional type, - @JsonProperty("account") JsonNullable account, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("allocations") Optional> allocations, - @JsonProperty("note") JsonNullable note, - @JsonProperty("terms") JsonNullable terms, - @JsonProperty("billing_address") Optional billingAddress, - @JsonProperty("shipping_address") Optional shippingAddress, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(customer, "customer"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(totalTax, "totalTax"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(balance, "balance"); - Utils.checkNotNull(remainingCredit, "remainingCredit"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(dateIssued, "dateIssued"); - Utils.checkNotNull(datePaid, "datePaid"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(account, "account"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(allocations, "allocations"); - Utils.checkNotNull(note, "note"); - Utils.checkNotNull(terms, "terms"); - Utils.checkNotNull(billingAddress, "billingAddress"); - Utils.checkNotNull(shippingAddress, "shippingAddress"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - this.number = number; - this.customer = customer; - this.companyId = companyId; - this.currency = currency; - this.currencyRate = currencyRate; - this.taxInclusive = taxInclusive; - this.subTotal = subTotal; + @JsonProperty("total_tax") @Nullable JsonNullable totalTax, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("balance") @Nullable JsonNullable balance, + @JsonProperty("remaining_credit") @Nullable JsonNullable remainingCredit, + @JsonProperty("status") @Nullable CreditNoteStatus status, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("date_issued") @Nullable OffsetDateTime dateIssued, + @JsonProperty("date_paid") @Nullable JsonNullable datePaid, + @JsonProperty("type") @Nullable CreditNoteType type, + @JsonProperty("account") @Nullable JsonNullable account, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("allocations") @Nullable List allocations, + @JsonProperty("note") @Nullable JsonNullable note, + @JsonProperty("terms") @Nullable JsonNullable terms, + @JsonProperty("billing_address") @Nullable Address billingAddress, + @JsonProperty("shipping_address") @Nullable Address shippingAddress, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.customer = Optional.ofNullable(customer) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); this.totalAmount = totalAmount; - this.totalTax = totalTax; - this.taxCode = taxCode; - this.balance = balance; - this.remainingCredit = remainingCredit; + this.totalTax = Optional.ofNullable(totalTax) + .orElse(JsonNullable.undefined()); + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.balance = Optional.ofNullable(balance) + .orElse(JsonNullable.undefined()); + this.remainingCredit = Optional.ofNullable(remainingCredit) + .orElse(JsonNullable.undefined()); this.status = status; - this.reference = reference; + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); this.dateIssued = dateIssued; - this.datePaid = datePaid; + this.datePaid = Optional.ofNullable(datePaid) + .orElse(JsonNullable.undefined()); this.type = type; - this.account = account; + this.account = Optional.ofNullable(account) + .orElse(JsonNullable.undefined()); this.lineItems = lineItems; this.allocations = allocations; - this.note = note; - this.terms = terms; + this.note = Optional.ofNullable(note) + .orElse(JsonNullable.undefined()); + this.terms = Optional.ofNullable(terms) + .orElse(JsonNullable.undefined()); this.billingAddress = billingAddress; this.shippingAddress = shippingAddress; - this.trackingCategories = trackingCategories; + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public CreditNoteInput( double totalAmount) { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), totalAmount, JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, totalAmount, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Credit note number. */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * The customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable customer() { - return (JsonNullable) customer; + return this.customer; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Amount of transaction */ - @JsonIgnore public double totalAmount() { - return totalAmount; + return this.totalAmount; } /** * Total tax amount applied to this invoice. */ - @JsonIgnore public JsonNullable totalTax() { - return totalTax; + return this.totalTax; } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } /** * The balance reflecting any payments made against the transaction. */ - @JsonIgnore public JsonNullable balance() { - return balance; + return this.balance; } /** * Indicates the total credit amount still available to apply towards the payment. */ - @JsonIgnore public JsonNullable remainingCredit() { - return remainingCredit; + return this.remainingCredit; } /** * Status of credit notes */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Optional reference message ie: Debit remittance detail. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } /** * Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore public Optional dateIssued() { - return dateIssued; + return Optional.ofNullable(this.dateIssued); } /** * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore public JsonNullable datePaid() { - return datePaid; + return this.datePaid; } /** * Type of payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable account() { - return (JsonNullable) account; + return this.account; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> allocations() { - return (Optional>) allocations; + return Optional.ofNullable(this.allocations); } /** * Optional note to be associated with the credit note. */ - @JsonIgnore public JsonNullable note() { - return note; + return this.note; } /** * Optional terms to be associated with the credit note. */ - @JsonIgnore public JsonNullable terms() { - return terms; + return this.terms; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
billingAddress() { - return (Optional
) billingAddress; + return Optional.ofNullable(this.billingAddress); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
shippingAddress() { - return (Optional
) shippingAddress; + return Optional.ofNullable(this.shippingAddress); } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -532,253 +481,125 @@ public static Builder builder() { /** * Credit note number. */ - public CreditNoteInput withNumber(String number) { - Utils.checkNotNull(number, "number"); + public CreditNoteInput withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Credit note number. - */ - public CreditNoteInput withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * The customer this entity is linked to. */ - public CreditNoteInput withCustomer(LinkedCustomerInput customer) { - Utils.checkNotNull(customer, "customer"); + public CreditNoteInput withCustomer(@Nullable LinkedCustomerInput customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public CreditNoteInput withCustomer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public CreditNoteInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public CreditNoteInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public CreditNoteInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public CreditNoteInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public CreditNoteInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public CreditNoteInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public CreditNoteInput withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public CreditNoteInput withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public CreditNoteInput withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * Amounts are including tax */ - public CreditNoteInput withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public CreditNoteInput withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public CreditNoteInput withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } /** * Sub-total amount, normally before tax. */ - public CreditNoteInput withSubTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public CreditNoteInput withSubTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public CreditNoteInput withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Amount of transaction */ public CreditNoteInput withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); this.totalAmount = totalAmount; return this; } + /** * Total tax amount applied to this invoice. */ - public CreditNoteInput withTotalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public CreditNoteInput withTotalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public CreditNoteInput withTotalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public CreditNoteInput withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public CreditNoteInput withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public CreditNoteInput withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } /** * The balance reflecting any payments made against the transaction. */ - public CreditNoteInput withBalance(double balance) { - Utils.checkNotNull(balance, "balance"); + public CreditNoteInput withBalance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * The balance reflecting any payments made against the transaction. - */ - public CreditNoteInput withBalance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } /** * Indicates the total credit amount still available to apply towards the payment. */ - public CreditNoteInput withRemainingCredit(double remainingCredit) { - Utils.checkNotNull(remainingCredit, "remainingCredit"); + public CreditNoteInput withRemainingCredit(@Nullable Double remainingCredit) { this.remainingCredit = JsonNullable.of(remainingCredit); return this; } - /** - * Indicates the total credit amount still available to apply towards the payment. - */ - public CreditNoteInput withRemainingCredit(JsonNullable remainingCredit) { - Utils.checkNotNull(remainingCredit, "remainingCredit"); - this.remainingCredit = remainingCredit; - return this; - } /** * Status of credit notes */ - public CreditNoteInput withStatus(CreditNoteStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - - /** - * Status of credit notes - */ - public CreditNoteInput withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public CreditNoteInput withStatus(@Nullable CreditNoteStatus status) { this.status = status; return this; } - /** - * Optional reference message ie: Debit remittance detail. - */ - public CreditNoteInput withReference(String reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = JsonNullable.of(reference); - return this; - } /** * Optional reference message ie: Debit remittance detail. */ - public CreditNoteInput withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** - * Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD - */ - public CreditNoteInput withDateIssued(OffsetDateTime dateIssued) { - Utils.checkNotNull(dateIssued, "dateIssued"); - this.dateIssued = Optional.ofNullable(dateIssued); + public CreditNoteInput withReference(@Nullable String reference) { + this.reference = JsonNullable.of(reference); return this; } @@ -786,36 +607,17 @@ public CreditNoteInput withDateIssued(OffsetDateTime dateIssued) { /** * Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD */ - public CreditNoteInput withDateIssued(Optional dateIssued) { - Utils.checkNotNull(dateIssued, "dateIssued"); + public CreditNoteInput withDateIssued(@Nullable OffsetDateTime dateIssued) { this.dateIssued = dateIssued; return this; } - /** - * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD - */ - public CreditNoteInput withDatePaid(OffsetDateTime datePaid) { - Utils.checkNotNull(datePaid, "datePaid"); - this.datePaid = JsonNullable.of(datePaid); - return this; - } /** * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD */ - public CreditNoteInput withDatePaid(JsonNullable datePaid) { - Utils.checkNotNull(datePaid, "datePaid"); - this.datePaid = datePaid; - return this; - } - - /** - * Type of payment - */ - public CreditNoteInput withType(CreditNoteType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); + public CreditNoteInput withDatePaid(@Nullable OffsetDateTime datePaid) { + this.datePaid = JsonNullable.of(datePaid); return this; } @@ -823,167 +625,80 @@ public CreditNoteInput withType(CreditNoteType type) { /** * Type of payment */ - public CreditNoteInput withType(Optional type) { - Utils.checkNotNull(type, "type"); + public CreditNoteInput withType(@Nullable CreditNoteType type) { this.type = type; return this; } - public CreditNoteInput withAccount(LinkedLedgerAccountInput account) { - Utils.checkNotNull(account, "account"); - this.account = JsonNullable.of(account); - return this; - } - - public CreditNoteInput withAccount(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - public CreditNoteInput withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); + public CreditNoteInput withAccount(@Nullable LinkedLedgerAccountInput account) { + this.account = JsonNullable.of(account); return this; } - public CreditNoteInput withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public CreditNoteInput withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - public CreditNoteInput withAllocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public CreditNoteInput withAllocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public CreditNoteInput withAllocations(@Nullable List allocations) { this.allocations = allocations; return this; } + /** * Optional note to be associated with the credit note. */ - public CreditNoteInput withNote(String note) { - Utils.checkNotNull(note, "note"); + public CreditNoteInput withNote(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Optional note to be associated with the credit note. - */ - public CreditNoteInput withNote(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } /** * Optional terms to be associated with the credit note. */ - public CreditNoteInput withTerms(String terms) { - Utils.checkNotNull(terms, "terms"); + public CreditNoteInput withTerms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Optional terms to be associated with the credit note. - */ - public CreditNoteInput withTerms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } - - public CreditNoteInput withBillingAddress(Address billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); - this.billingAddress = Optional.ofNullable(billingAddress); - return this; - } - - public CreditNoteInput withBillingAddress(Optional billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); + public CreditNoteInput withBillingAddress(@Nullable Address billingAddress) { this.billingAddress = billingAddress; return this; } - public CreditNoteInput withShippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public CreditNoteInput withShippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public CreditNoteInput withShippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } - /** - * A list of linked tracking categories. - */ - public CreditNoteInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = JsonNullable.of(trackingCategories); - return this; - } /** * A list of linked tracking categories. */ - public CreditNoteInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - public CreditNoteInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); + public CreditNoteInput withTrackingCategories(@Nullable List trackingCategories) { + this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - public CreditNoteInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public CreditNoteInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public CreditNoteInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public CreditNoteInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CreditNoteInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public CreditNoteInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -991,12 +706,12 @@ public CreditNoteInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CreditNoteInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CreditNoteInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1088,555 +803,273 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private JsonNullable customer = JsonNullable.undefined(); + private JsonNullable customer; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private Double totalAmount; + private double totalAmount; - private JsonNullable totalTax = JsonNullable.undefined(); + private JsonNullable totalTax; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable balance = JsonNullable.undefined(); + private JsonNullable balance; - private JsonNullable remainingCredit = JsonNullable.undefined(); + private JsonNullable remainingCredit; - private Optional status = Optional.empty(); + private CreditNoteStatus status; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private Optional dateIssued = Optional.empty(); + private OffsetDateTime dateIssued; - private JsonNullable datePaid = JsonNullable.undefined(); + private JsonNullable datePaid; - private Optional type = Optional.empty(); + private CreditNoteType type; - private JsonNullable account = JsonNullable.undefined(); + private JsonNullable account; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private Optional> allocations = Optional.empty(); + private List allocations; - private JsonNullable note = JsonNullable.undefined(); + private JsonNullable note; - private JsonNullable terms = JsonNullable.undefined(); + private JsonNullable terms; - private Optional billingAddress = Optional.empty(); + private Address billingAddress; - private Optional shippingAddress = Optional.empty(); + private Address shippingAddress; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Credit note number. */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Credit note number. - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * The customer this entity is linked to. */ - public Builder customer(LinkedCustomerInput customer) { - Utils.checkNotNull(customer, "customer"); + public Builder customer(@Nullable LinkedCustomerInput customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public Builder customer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Amount of transaction */ public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); this.totalAmount = totalAmount; return this; } - /** * Total tax amount applied to this invoice. */ - public Builder totalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Builder totalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public Builder totalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } - - /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - /** * The balance reflecting any payments made against the transaction. */ - public Builder balance(double balance) { - Utils.checkNotNull(balance, "balance"); + public Builder balance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * The balance reflecting any payments made against the transaction. - */ - public Builder balance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } - - /** * Indicates the total credit amount still available to apply towards the payment. */ - public Builder remainingCredit(double remainingCredit) { - Utils.checkNotNull(remainingCredit, "remainingCredit"); + public Builder remainingCredit(@Nullable Double remainingCredit) { this.remainingCredit = JsonNullable.of(remainingCredit); return this; } - /** - * Indicates the total credit amount still available to apply towards the payment. - */ - public Builder remainingCredit(JsonNullable remainingCredit) { - Utils.checkNotNull(remainingCredit, "remainingCredit"); - this.remainingCredit = remainingCredit; - return this; - } - - - /** - * Status of credit notes - */ - public Builder status(CreditNoteStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of credit notes */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable CreditNoteStatus status) { this.status = status; return this; } - /** * Optional reference message ie: Debit remittance detail. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference message ie: Debit remittance detail. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** * Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder dateIssued(OffsetDateTime dateIssued) { - Utils.checkNotNull(dateIssued, "dateIssued"); - this.dateIssued = Optional.ofNullable(dateIssued); - return this; - } - - /** - * Date credit note issued - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Builder dateIssued(Optional dateIssued) { - Utils.checkNotNull(dateIssued, "dateIssued"); + public Builder dateIssued(@Nullable OffsetDateTime dateIssued) { this.dateIssued = dateIssued; return this; } - /** * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder datePaid(OffsetDateTime datePaid) { - Utils.checkNotNull(datePaid, "datePaid"); + public Builder datePaid(@Nullable OffsetDateTime datePaid) { this.datePaid = JsonNullable.of(datePaid); return this; } - /** - * Date credit note paid - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Builder datePaid(JsonNullable datePaid) { - Utils.checkNotNull(datePaid, "datePaid"); - this.datePaid = datePaid; - return this; - } - - - /** - * Type of payment - */ - public Builder type(CreditNoteType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of payment */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable CreditNoteType type) { this.type = type; return this; } - - public Builder account(LinkedLedgerAccountInput account) { - Utils.checkNotNull(account, "account"); + public Builder account(@Nullable LinkedLedgerAccountInput account) { this.account = JsonNullable.of(account); return this; } - public Builder account(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - - - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - - public Builder allocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public Builder allocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public Builder allocations(@Nullable List allocations) { this.allocations = allocations; return this; } - /** * Optional note to be associated with the credit note. */ - public Builder note(String note) { - Utils.checkNotNull(note, "note"); + public Builder note(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Optional note to be associated with the credit note. - */ - public Builder note(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } - - /** * Optional terms to be associated with the credit note. */ - public Builder terms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Builder terms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Optional terms to be associated with the credit note. - */ - public Builder terms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } - - - public Builder billingAddress(Address billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); - this.billingAddress = Optional.ofNullable(billingAddress); - return this; - } - - public Builder billingAddress(Optional billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); + public Builder billingAddress(@Nullable Address billingAddress) { this.billingAddress = billingAddress; return this; } - - public Builder shippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public Builder shippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public Builder shippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CreditNoteInput build() { - return new CreditNoteInput( number, customer, companyId, currency, currencyRate, taxInclusive, diff --git a/src/main/java/com/apideck/unify/models/components/CreditNotesFilter.java b/src/main/java/com/apideck/unify/models/components/CreditNotesFilter.java index c2eb4a2b..e6b9d29b 100644 --- a/src/main/java/com/apideck/unify/models/components/CreditNotesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/CreditNotesFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; @@ -16,22 +16,20 @@ public class CreditNotesFilter { @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private OffsetDateTime updatedSince; @JsonCreator public CreditNotesFilter( - Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + @Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; } public CreditNotesFilter() { - this(Optional.empty()); + this(null); } - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } public static Builder builder() { @@ -39,19 +37,12 @@ public static Builder builder() { } - public CreditNotesFilter withUpdatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - - public CreditNotesFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public CreditNotesFilter withUpdatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -80,27 +71,18 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional updatedSince = Optional.empty(); + private OffsetDateTime updatedSince; private Builder() { // force use of static builder() method } - - public Builder updatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } public CreditNotesFilter build() { - return new CreditNotesFilter( updatedSince); } diff --git a/src/main/java/com/apideck/unify/models/components/CreditNotesSort.java b/src/main/java/com/apideck/unify/models/components/CreditNotesSort.java index 64b3fc66..1bf0b042 100644 --- a/src/main/java/com/apideck/unify/models/components/CreditNotesSort.java +++ b/src/main/java/com/apideck/unify/models/components/CreditNotesSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class CreditNotesSort { * The field on which to sort the Customers */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private CreditNotesSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public CreditNotesSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable CreditNotesSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public CreditNotesSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Customers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Customers */ - public CreditNotesSort withBy(CreditNotesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Customers - */ - public CreditNotesSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public CreditNotesSort withBy(@Nullable CreditNotesSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public CreditNotesSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public CreditNotesSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public CreditNotesSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private CreditNotesSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Customers - */ - public Builder by(CreditNotesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Customers */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable CreditNotesSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public CreditNotesSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new CreditNotesSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/Cursors.java b/src/main/java/com/apideck/unify/models/components/Cursors.java index f2941df3..3e4a4d62 100644 --- a/src/main/java/com/apideck/unify/models/components/Cursors.java +++ b/src/main/java/com/apideck/unify/models/components/Cursors.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -42,43 +43,40 @@ public class Cursors { @JsonCreator public Cursors( - @JsonProperty("previous") JsonNullable previous, - @JsonProperty("current") JsonNullable current, - @JsonProperty("next") JsonNullable next) { - Utils.checkNotNull(previous, "previous"); - Utils.checkNotNull(current, "current"); - Utils.checkNotNull(next, "next"); - this.previous = previous; - this.current = current; - this.next = next; + @JsonProperty("previous") @Nullable JsonNullable previous, + @JsonProperty("current") @Nullable JsonNullable current, + @JsonProperty("next") @Nullable JsonNullable next) { + this.previous = Optional.ofNullable(previous) + .orElse(JsonNullable.undefined()); + this.current = Optional.ofNullable(current) + .orElse(JsonNullable.undefined()); + this.next = Optional.ofNullable(next) + .orElse(JsonNullable.undefined()); } public Cursors() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * Cursor to navigate to the previous page of results through the API */ - @JsonIgnore public JsonNullable previous() { - return previous; + return this.previous; } /** * Cursor to navigate to the current page of results through the API */ - @JsonIgnore public JsonNullable current() { - return current; + return this.current; } /** * Cursor to navigate to the next page of results through the API */ - @JsonIgnore public JsonNullable next() { - return next; + return this.next; } public static Builder builder() { @@ -89,56 +87,29 @@ public static Builder builder() { /** * Cursor to navigate to the previous page of results through the API */ - public Cursors withPrevious(String previous) { - Utils.checkNotNull(previous, "previous"); + public Cursors withPrevious(@Nullable String previous) { this.previous = JsonNullable.of(previous); return this; } - /** - * Cursor to navigate to the previous page of results through the API - */ - public Cursors withPrevious(JsonNullable previous) { - Utils.checkNotNull(previous, "previous"); - this.previous = previous; - return this; - } /** * Cursor to navigate to the current page of results through the API */ - public Cursors withCurrent(String current) { - Utils.checkNotNull(current, "current"); + public Cursors withCurrent(@Nullable String current) { this.current = JsonNullable.of(current); return this; } - /** - * Cursor to navigate to the current page of results through the API - */ - public Cursors withCurrent(JsonNullable current) { - Utils.checkNotNull(current, "current"); - this.current = current; - return this; - } /** * Cursor to navigate to the next page of results through the API */ - public Cursors withNext(String next) { - Utils.checkNotNull(next, "next"); + public Cursors withNext(@Nullable String next) { this.next = JsonNullable.of(next); return this; } - /** - * Cursor to navigate to the next page of results through the API - */ - public Cursors withNext(JsonNullable next) { - Utils.checkNotNull(next, "next"); - this.next = next; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -172,75 +143,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable previous = JsonNullable.undefined(); + private JsonNullable previous; - private JsonNullable current = JsonNullable.undefined(); + private JsonNullable current; - private JsonNullable next = JsonNullable.undefined(); + private JsonNullable next; private Builder() { // force use of static builder() method } - /** * Cursor to navigate to the previous page of results through the API */ - public Builder previous(String previous) { - Utils.checkNotNull(previous, "previous"); + public Builder previous(@Nullable String previous) { this.previous = JsonNullable.of(previous); return this; } - /** - * Cursor to navigate to the previous page of results through the API - */ - public Builder previous(JsonNullable previous) { - Utils.checkNotNull(previous, "previous"); - this.previous = previous; - return this; - } - - /** * Cursor to navigate to the current page of results through the API */ - public Builder current(String current) { - Utils.checkNotNull(current, "current"); + public Builder current(@Nullable String current) { this.current = JsonNullable.of(current); return this; } - /** - * Cursor to navigate to the current page of results through the API - */ - public Builder current(JsonNullable current) { - Utils.checkNotNull(current, "current"); - this.current = current; - return this; - } - - /** * Cursor to navigate to the next page of results through the API */ - public Builder next(String next) { - Utils.checkNotNull(next, "next"); + public Builder next(@Nullable String next) { this.next = JsonNullable.of(next); return this; } - /** - * Cursor to navigate to the next page of results through the API - */ - public Builder next(JsonNullable next) { - Utils.checkNotNull(next, "next"); - this.next = next; - return this; - } - public Cursors build() { - return new Cursors( previous, current, next); } diff --git a/src/main/java/com/apideck/unify/models/components/CustomField.java b/src/main/java/com/apideck/unify/models/components/CustomField.java index fe834ddd..ef344958 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomField.java +++ b/src/main/java/com/apideck/unify/models/components/CustomField.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -22,7 +21,7 @@ public class CustomField { */ @JsonInclude(Include.ALWAYS) @JsonProperty("id") - private Optional id; + private JsonNullable id; /** * Name of the custom field. @@ -41,57 +40,51 @@ public class CustomField { @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private JsonNullable value; + private JsonNullable value; @JsonCreator public CustomField( - @JsonProperty("id") Optional id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("value") JsonNullable value) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(value, "value"); - this.id = id; - this.name = name; - this.description = description; - this.value = value; + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("value") @Nullable JsonNullable value) { + this.id = JsonNullable.of(id); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.value = Optional.ofNullable(value) + .orElse(JsonNullable.undefined()); } public CustomField() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null); } /** * Unique identifier for the custom field. */ - @JsonIgnore - public Optional id() { - return id; + public JsonNullable id() { + return this.id; } /** * Name of the custom field. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * More information about the custom field */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable value() { - return (JsonNullable) value; + return this.value; } public static Builder builder() { @@ -102,69 +95,35 @@ public static Builder builder() { /** * Unique identifier for the custom field. */ - public CustomField withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); + public CustomField withId(@Nullable String id) { + this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the custom field. - */ - public CustomField withId(Optional id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - /** * Name of the custom field. */ - public CustomField withName(String name) { - Utils.checkNotNull(name, "name"); + public CustomField withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Name of the custom field. - */ - public CustomField withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * More information about the custom field */ - public CustomField withDescription(String description) { - Utils.checkNotNull(description, "description"); + public CustomField withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * More information about the custom field - */ - public CustomField withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - public CustomField withValue(Value value) { - Utils.checkNotNull(value, "value"); + public CustomField withValue(@Nullable Value value) { this.value = JsonNullable.of(value); return this; } - public CustomField withValue(JsonNullable value) { - Utils.checkNotNull(value, "value"); - this.value = value; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -201,90 +160,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable value = JsonNullable.undefined(); + private JsonNullable value; private Builder() { // force use of static builder() method } - - /** - * Unique identifier for the custom field. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * Unique identifier for the custom field. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Name of the custom field. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Name of the custom field. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * More information about the custom field */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * More information about the custom field - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - public Builder value(Value value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable Value value) { this.value = JsonNullable.of(value); return this; } - public Builder value(JsonNullable value) { - Utils.checkNotNull(value, "value"); - this.value = value; - return this; - } - public CustomField build() { - return new CustomField( id, name, description, value); diff --git a/src/main/java/com/apideck/unify/models/components/CustomFieldFinder.java b/src/main/java/com/apideck/unify/models/components/CustomFieldFinder.java index 2e9af8e2..5fa550f8 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomFieldFinder.java +++ b/src/main/java/com/apideck/unify/models/components/CustomFieldFinder.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,7 +22,7 @@ public class CustomFieldFinder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Custom Field name to use as a label if provided @@ -44,78 +43,69 @@ public class CustomFieldFinder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private Object value; /** * JSONPath finder for retrieving this value when mapping a response payload from downstream */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("finder") - private Optional finder; + private String finder; @JsonCreator public CustomFieldFinder( - @JsonProperty("id") Optional id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("value") Optional value, - @JsonProperty("finder") Optional finder) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(value, "value"); - Utils.checkNotNull(finder, "finder"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("value") @Nullable Object value, + @JsonProperty("finder") @Nullable String finder) { this.id = id; - this.name = name; - this.description = description; + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.value = value; this.finder = finder; } public CustomFieldFinder() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * Custom Field ID */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Custom Field name to use as a label if provided */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * More information about the custom field */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Custom Field value */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional value() { - return (Optional) value; + return Optional.ofNullable(this.value); } /** * JSONPath finder for retrieving this value when mapping a response payload from downstream */ - @JsonIgnore public Optional finder() { - return finder; + return Optional.ofNullable(this.finder); } public static Builder builder() { @@ -126,96 +116,48 @@ public static Builder builder() { /** * Custom Field ID */ - public CustomFieldFinder withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * Custom Field ID - */ - public CustomFieldFinder withId(Optional id) { - Utils.checkNotNull(id, "id"); + public CustomFieldFinder withId(@Nullable String id) { this.id = id; return this; } + /** * Custom Field name to use as a label if provided */ - public CustomFieldFinder withName(String name) { - Utils.checkNotNull(name, "name"); + public CustomFieldFinder withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Custom Field name to use as a label if provided - */ - public CustomFieldFinder withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * More information about the custom field */ - public CustomFieldFinder withDescription(String description) { - Utils.checkNotNull(description, "description"); + public CustomFieldFinder withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * More information about the custom field - */ - public CustomFieldFinder withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * Custom Field value - */ - public CustomFieldFinder withValue(Object value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * Custom Field value */ - public CustomFieldFinder withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public CustomFieldFinder withValue(@Nullable Object value) { this.value = value; return this; } - /** - * JSONPath finder for retrieving this value when mapping a response payload from downstream - */ - public CustomFieldFinder withFinder(String finder) { - Utils.checkNotNull(finder, "finder"); - this.finder = Optional.ofNullable(finder); - return this; - } - /** * JSONPath finder for retrieving this value when mapping a response payload from downstream */ - public CustomFieldFinder withFinder(Optional finder) { - Utils.checkNotNull(finder, "finder"); + public CustomFieldFinder withFinder(@Nullable String finder) { this.finder = finder; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -253,117 +195,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional value = Optional.empty(); + private Object value; - private Optional finder = Optional.empty(); + private String finder; private Builder() { // force use of static builder() method } - - /** - * Custom Field ID - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * Custom Field ID */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Custom Field name to use as a label if provided */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Custom Field name to use as a label if provided - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * More information about the custom field */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * More information about the custom field - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * Custom Field value - */ - public Builder value(Object value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * Custom Field value */ - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable Object value) { this.value = value; return this; } - - /** - * JSONPath finder for retrieving this value when mapping a response payload from downstream - */ - public Builder finder(String finder) { - Utils.checkNotNull(finder, "finder"); - this.finder = Optional.ofNullable(finder); - return this; - } - /** * JSONPath finder for retrieving this value when mapping a response payload from downstream */ - public Builder finder(Optional finder) { - Utils.checkNotNull(finder, "finder"); + public Builder finder(@Nullable String finder) { this.finder = finder; return this; } public CustomFieldFinder build() { - return new CustomFieldFinder( id, name, description, value, finder); diff --git a/src/main/java/com/apideck/unify/models/components/CustomMapping.java b/src/main/java/com/apideck/unify/models/components/CustomMapping.java index 771f880d..1402e842 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomMapping.java +++ b/src/main/java/com/apideck/unify/models/components/CustomMapping.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -22,14 +22,14 @@ public class CustomMapping { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Target Field name to use as a label */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("label") - private Optional label; + private String label; /** * Target Field description @@ -43,28 +43,28 @@ public class CustomMapping { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private String value; /** * Target Field Key */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("key") - private Optional key; + private String key; /** * Target Field Mapping is required */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("required") - private Optional required; + private Boolean required; /** * This mapping represents a finder for a custom field */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_field") - private Optional customField; + private Boolean customField; /** * Consumer ID @@ -82,111 +82,96 @@ public class CustomMapping { @JsonCreator public CustomMapping( - @JsonProperty("id") Optional id, - @JsonProperty("label") Optional label, - @JsonProperty("description") JsonNullable description, - @JsonProperty("value") Optional value, - @JsonProperty("key") Optional key, - @JsonProperty("required") Optional required, - @JsonProperty("custom_field") Optional customField, - @JsonProperty("consumer_id") JsonNullable consumerId, - @JsonProperty("example") JsonNullable example) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(label, "label"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(value, "value"); - Utils.checkNotNull(key, "key"); - Utils.checkNotNull(required, "required"); - Utils.checkNotNull(customField, "customField"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(example, "example"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("label") @Nullable String label, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("value") @Nullable String value, + @JsonProperty("key") @Nullable String key, + @JsonProperty("required") @Nullable Boolean required, + @JsonProperty("custom_field") @Nullable Boolean customField, + @JsonProperty("consumer_id") @Nullable JsonNullable consumerId, + @JsonProperty("example") @Nullable JsonNullable example) { this.id = id; this.label = label; - this.description = description; + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.value = value; this.key = key; this.required = required; this.customField = customField; - this.consumerId = consumerId; - this.example = example; + this.consumerId = Optional.ofNullable(consumerId) + .orElse(JsonNullable.undefined()); + this.example = Optional.ofNullable(example) + .orElse(JsonNullable.undefined()); } public CustomMapping() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * Target Field ID */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Target Field name to use as a label */ - @JsonIgnore public Optional label() { - return label; + return Optional.ofNullable(this.label); } /** * Target Field description */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Target Field Mapping value */ - @JsonIgnore public Optional value() { - return value; + return Optional.ofNullable(this.value); } /** * Target Field Key */ - @JsonIgnore public Optional key() { - return key; + return Optional.ofNullable(this.key); } /** * Target Field Mapping is required */ - @JsonIgnore public Optional required() { - return required; + return Optional.ofNullable(this.required); } /** * This mapping represents a finder for a custom field */ - @JsonIgnore public Optional customField() { - return customField; + return Optional.ofNullable(this.customField); } /** * Consumer ID */ - @JsonIgnore public JsonNullable consumerId() { - return consumerId; + return this.consumerId; } /** * Target Field Mapping example value from downstream */ - @JsonIgnore public JsonNullable example() { - return example; + return this.example; } public static Builder builder() { @@ -197,65 +182,26 @@ public static Builder builder() { /** * Target Field ID */ - public CustomMapping withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * Target Field ID - */ - public CustomMapping withId(Optional id) { - Utils.checkNotNull(id, "id"); + public CustomMapping withId(@Nullable String id) { this.id = id; return this; } - /** - * Target Field name to use as a label - */ - public CustomMapping withLabel(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - /** * Target Field name to use as a label */ - public CustomMapping withLabel(Optional label) { - Utils.checkNotNull(label, "label"); + public CustomMapping withLabel(@Nullable String label) { this.label = label; return this; } - /** - * Target Field description - */ - public CustomMapping withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = JsonNullable.of(description); - return this; - } /** * Target Field description */ - public CustomMapping withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * Target Field Mapping value - */ - public CustomMapping withValue(String value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); + public CustomMapping withDescription(@Nullable String description) { + this.description = JsonNullable.of(description); return this; } @@ -263,104 +209,56 @@ public CustomMapping withValue(String value) { /** * Target Field Mapping value */ - public CustomMapping withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public CustomMapping withValue(@Nullable String value) { this.value = value; return this; } - /** - * Target Field Key - */ - public CustomMapping withKey(String key) { - Utils.checkNotNull(key, "key"); - this.key = Optional.ofNullable(key); - return this; - } - /** * Target Field Key */ - public CustomMapping withKey(Optional key) { - Utils.checkNotNull(key, "key"); + public CustomMapping withKey(@Nullable String key) { this.key = key; return this; } - /** - * Target Field Mapping is required - */ - public CustomMapping withRequired(boolean required) { - Utils.checkNotNull(required, "required"); - this.required = Optional.ofNullable(required); - return this; - } - /** * Target Field Mapping is required */ - public CustomMapping withRequired(Optional required) { - Utils.checkNotNull(required, "required"); + public CustomMapping withRequired(@Nullable Boolean required) { this.required = required; return this; } - /** - * This mapping represents a finder for a custom field - */ - public CustomMapping withCustomField(boolean customField) { - Utils.checkNotNull(customField, "customField"); - this.customField = Optional.ofNullable(customField); - return this; - } - /** * This mapping represents a finder for a custom field */ - public CustomMapping withCustomField(Optional customField) { - Utils.checkNotNull(customField, "customField"); + public CustomMapping withCustomField(@Nullable Boolean customField) { this.customField = customField; return this; } + /** * Consumer ID */ - public CustomMapping withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CustomMapping withConsumerId(@Nullable String consumerId) { this.consumerId = JsonNullable.of(consumerId); return this; } - /** - * Consumer ID - */ - public CustomMapping withConsumerId(JsonNullable consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } /** * Target Field Mapping example value from downstream */ - public CustomMapping withExample(String example) { - Utils.checkNotNull(example, "example"); + public CustomMapping withExample(@Nullable String example) { this.example = JsonNullable.of(example); return this; } - /** - * Target Field Mapping example value from downstream - */ - public CustomMapping withExample(JsonNullable example) { - Utils.checkNotNull(example, "example"); - this.example = example; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -408,201 +306,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional label = Optional.empty(); + private String label; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional value = Optional.empty(); + private String value; - private Optional key = Optional.empty(); + private String key; - private Optional required = Optional.empty(); + private Boolean required; - private Optional customField = Optional.empty(); + private Boolean customField; - private JsonNullable consumerId = JsonNullable.undefined(); + private JsonNullable consumerId; - private JsonNullable example = JsonNullable.undefined(); + private JsonNullable example; private Builder() { // force use of static builder() method } - /** * Target Field ID */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * Target Field ID - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Target Field name to use as a label */ - public Builder label(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - - /** - * Target Field name to use as a label - */ - public Builder label(Optional label) { - Utils.checkNotNull(label, "label"); + public Builder label(@Nullable String label) { this.label = label; return this; } - /** * Target Field description */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Target Field description - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * Target Field Mapping value - */ - public Builder value(String value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * Target Field Mapping value */ - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable String value) { this.value = value; return this; } - - /** - * Target Field Key - */ - public Builder key(String key) { - Utils.checkNotNull(key, "key"); - this.key = Optional.ofNullable(key); - return this; - } - /** * Target Field Key */ - public Builder key(Optional key) { - Utils.checkNotNull(key, "key"); + public Builder key(@Nullable String key) { this.key = key; return this; } - - /** - * Target Field Mapping is required - */ - public Builder required(boolean required) { - Utils.checkNotNull(required, "required"); - this.required = Optional.ofNullable(required); - return this; - } - /** * Target Field Mapping is required */ - public Builder required(Optional required) { - Utils.checkNotNull(required, "required"); + public Builder required(@Nullable Boolean required) { this.required = required; return this; } - /** * This mapping represents a finder for a custom field */ - public Builder customField(boolean customField) { - Utils.checkNotNull(customField, "customField"); - this.customField = Optional.ofNullable(customField); - return this; - } - - /** - * This mapping represents a finder for a custom field - */ - public Builder customField(Optional customField) { - Utils.checkNotNull(customField, "customField"); + public Builder customField(@Nullable Boolean customField) { this.customField = customField; return this; } - /** * Consumer ID */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = JsonNullable.of(consumerId); return this; } - /** - * Consumer ID - */ - public Builder consumerId(JsonNullable consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - /** * Target Field Mapping example value from downstream */ - public Builder example(String example) { - Utils.checkNotNull(example, "example"); + public Builder example(@Nullable String example) { this.example = JsonNullable.of(example); return this; } - /** - * Target Field Mapping example value from downstream - */ - public Builder example(JsonNullable example) { - Utils.checkNotNull(example, "example"); - this.example = example; - return this; - } - public CustomMapping build() { - return new CustomMapping( id, label, description, value, key, required, diff --git a/src/main/java/com/apideck/unify/models/components/CustomMappingInput.java b/src/main/java/com/apideck/unify/models/components/CustomMappingInput.java index 08df16cb..1bce026e 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomMappingInput.java +++ b/src/main/java/com/apideck/unify/models/components/CustomMappingInput.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -20,25 +20,23 @@ public class CustomMappingInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private String value; @JsonCreator public CustomMappingInput( - @JsonProperty("value") Optional value) { - Utils.checkNotNull(value, "value"); + @JsonProperty("value") @Nullable String value) { this.value = value; } public CustomMappingInput() { - this(Optional.empty()); + this(null); } /** * Target Field Mapping value */ - @JsonIgnore public Optional value() { - return value; + return Optional.ofNullable(this.value); } public static Builder builder() { @@ -49,22 +47,12 @@ public static Builder builder() { /** * Target Field Mapping value */ - public CustomMappingInput withValue(String value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - - - /** - * Target Field Mapping value - */ - public CustomMappingInput withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public CustomMappingInput withValue(@Nullable String value) { this.value = value; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -93,33 +81,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional value = Optional.empty(); + private String value; private Builder() { // force use of static builder() method } - - /** - * Target Field Mapping value - */ - public Builder value(String value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - /** * Target Field Mapping value */ - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable String value) { this.value = value; return this; } public CustomMappingInput build() { - return new CustomMappingInput( value); } diff --git a/src/main/java/com/apideck/unify/models/components/CustomObject.java b/src/main/java/com/apideck/unify/models/components/CustomObject.java index e2e73e19..26e36000 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomObject.java +++ b/src/main/java/com/apideck/unify/models/components/CustomObject.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,14 +22,14 @@ public class CustomObject { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The unique identifier of the owner of the custom object */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("owner_id") - private Optional ownerId; + private String ownerId; /** * The name of the custom object @@ -42,21 +41,21 @@ public class CustomObject { @JsonInclude(Include.NON_ABSENT) @JsonProperty("fields") - private Optional> fields; + private List fields; /** * The unique identifier of the user who last updated the custom object */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("updated_by") - private Optional updatedBy; + private String updatedBy; /** * The unique identifier of the user who created the custom object */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("created_by") - private Optional createdBy; + private String createdBy; /** * The timestamp when the custom object was last updated @@ -77,114 +76,97 @@ public class CustomObject { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CustomObject( - @JsonProperty("id") Optional id, - @JsonProperty("owner_id") Optional ownerId, - @JsonProperty("name") JsonNullable name, - @JsonProperty("fields") Optional> fields, - @JsonProperty("updated_by") Optional updatedBy, - @JsonProperty("created_by") Optional createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("owner_id") @Nullable String ownerId, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("fields") @Nullable List fields, + @JsonProperty("updated_by") @Nullable String updatedBy, + @JsonProperty("created_by") @Nullable String createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; this.ownerId = ownerId; - this.name = name; + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); this.fields = fields; this.updatedBy = updatedBy; this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public CustomObject() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null); } /** * The unique identifier of the custom object */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The unique identifier of the owner of the custom object */ - @JsonIgnore public Optional ownerId() { - return ownerId; + return Optional.ofNullable(this.ownerId); } /** * The name of the custom object */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> fields() { - return (Optional>) fields; + return Optional.ofNullable(this.fields); } /** * The unique identifier of the user who last updated the custom object */ - @JsonIgnore public Optional updatedBy() { - return updatedBy; + return Optional.ofNullable(this.updatedBy); } /** * The unique identifier of the user who created the custom object */ - @JsonIgnore public Optional createdBy() { - return createdBy; + return Optional.ofNullable(this.createdBy); } /** * The timestamp when the custom object was last updated */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The timestamp when the custom object was created */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -195,165 +177,81 @@ public static Builder builder() { /** * The unique identifier of the custom object */ - public CustomObject withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier of the custom object - */ - public CustomObject withId(Optional id) { - Utils.checkNotNull(id, "id"); + public CustomObject withId(@Nullable String id) { this.id = id; return this; } - /** - * The unique identifier of the owner of the custom object - */ - public CustomObject withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = Optional.ofNullable(ownerId); - return this; - } - /** * The unique identifier of the owner of the custom object */ - public CustomObject withOwnerId(Optional ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public CustomObject withOwnerId(@Nullable String ownerId) { this.ownerId = ownerId; return this; } - /** - * The name of the custom object - */ - public CustomObject withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = JsonNullable.of(name); - return this; - } /** * The name of the custom object */ - public CustomObject withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - public CustomObject withFields(List fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = Optional.ofNullable(fields); + public CustomObject withName(@Nullable String name) { + this.name = JsonNullable.of(name); return this; } - public CustomObject withFields(Optional> fields) { - Utils.checkNotNull(fields, "fields"); + public CustomObject withFields(@Nullable List fields) { this.fields = fields; return this; } - /** - * The unique identifier of the user who last updated the custom object - */ - public CustomObject withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = Optional.ofNullable(updatedBy); - return this; - } - /** * The unique identifier of the user who last updated the custom object */ - public CustomObject withUpdatedBy(Optional updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public CustomObject withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = updatedBy; return this; } - /** - * The unique identifier of the user who created the custom object - */ - public CustomObject withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = Optional.ofNullable(createdBy); - return this; - } - /** * The unique identifier of the user who created the custom object */ - public CustomObject withCreatedBy(Optional createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public CustomObject withCreatedBy(@Nullable String createdBy) { this.createdBy = createdBy; return this; } + /** * The timestamp when the custom object was last updated */ - public CustomObject withUpdatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public CustomObject withUpdatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The timestamp when the custom object was last updated - */ - public CustomObject withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The timestamp when the custom object was created */ - public CustomObject withCreatedAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public CustomObject withCreatedAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The timestamp when the custom object was created - */ - public CustomObject withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CustomObject withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CustomObject withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CustomObject withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -400,195 +298,98 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional ownerId = Optional.empty(); + private String ownerId; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private Optional> fields = Optional.empty(); + private List fields; - private Optional updatedBy = Optional.empty(); + private String updatedBy; - private Optional createdBy = Optional.empty(); + private String createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The unique identifier of the custom object */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * The unique identifier of the custom object - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The unique identifier of the owner of the custom object */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = Optional.ofNullable(ownerId); - return this; - } - - /** - * The unique identifier of the owner of the custom object - */ - public Builder ownerId(Optional ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = ownerId; return this; } - /** * The name of the custom object */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the custom object - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - - public Builder fields(List fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = Optional.ofNullable(fields); - return this; - } - - public Builder fields(Optional> fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable List fields) { this.fields = fields; return this; } - - /** - * The unique identifier of the user who last updated the custom object - */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = Optional.ofNullable(updatedBy); - return this; - } - /** * The unique identifier of the user who last updated the custom object */ - public Builder updatedBy(Optional updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = updatedBy; return this; } - /** * The unique identifier of the user who created the custom object */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = Optional.ofNullable(createdBy); - return this; - } - - /** - * The unique identifier of the user who created the custom object - */ - public Builder createdBy(Optional createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = createdBy; return this; } - /** * The timestamp when the custom object was last updated */ - public Builder updatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The timestamp when the custom object was last updated - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The timestamp when the custom object was created */ - public Builder createdAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The timestamp when the custom object was created - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CustomObject build() { - return new CustomObject( id, ownerId, name, fields, updatedBy, createdBy, diff --git a/src/main/java/com/apideck/unify/models/components/CustomObjectFields.java b/src/main/java/com/apideck/unify/models/components/CustomObjectFields.java index c3dda83f..d1ec1ba4 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomObjectFields.java +++ b/src/main/java/com/apideck/unify/models/components/CustomObjectFields.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,35 +18,31 @@ public class CustomObjectFields { @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private String value; @JsonCreator public CustomObjectFields( - @JsonProperty("name") Optional name, - @JsonProperty("value") Optional value) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(value, "value"); + @JsonProperty("name") @Nullable String name, + @JsonProperty("value") @Nullable String value) { this.name = name; this.value = value; } public CustomObjectFields() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } - @JsonIgnore public Optional value() { - return value; + return Optional.ofNullable(this.value); } public static Builder builder() { @@ -54,32 +50,18 @@ public static Builder builder() { } - public CustomObjectFields withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - public CustomObjectFields withName(Optional name) { - Utils.checkNotNull(name, "name"); + public CustomObjectFields withName(@Nullable String name) { this.name = name; return this; } - public CustomObjectFields withValue(String value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - - public CustomObjectFields withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public CustomObjectFields withValue(@Nullable String value) { this.value = value; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,42 +92,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional name = Optional.empty(); + private String name; - private Optional value = Optional.empty(); + private String value; private Builder() { // force use of static builder() method } - - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - public Builder value(String value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable String value) { this.value = value; return this; } public CustomObjectFields build() { - return new CustomObjectFields( name, value); } diff --git a/src/main/java/com/apideck/unify/models/components/CustomObjectInput.java b/src/main/java/com/apideck/unify/models/components/CustomObjectInput.java index e8f0f961..6573f02b 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomObjectInput.java +++ b/src/main/java/com/apideck/unify/models/components/CustomObjectInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -28,53 +27,46 @@ public class CustomObjectInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("fields") - private Optional> fields; + private List fields; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CustomObjectInput( - @JsonProperty("name") JsonNullable name, - @JsonProperty("fields") Optional> fields, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("fields") @Nullable List fields, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); this.fields = fields; this.passThrough = passThrough; } public CustomObjectInput() { - this(JsonNullable.undefined(), Optional.empty(), Optional.empty()); + this(null, null, null); } /** * The name of the custom object */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> fields() { - return (Optional>) fields; + return Optional.ofNullable(this.fields); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -85,53 +77,27 @@ public static Builder builder() { /** * The name of the custom object */ - public CustomObjectInput withName(String name) { - Utils.checkNotNull(name, "name"); + public CustomObjectInput withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the custom object - */ - public CustomObjectInput withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - public CustomObjectInput withFields(List fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = Optional.ofNullable(fields); - return this; - } - - public CustomObjectInput withFields(Optional> fields) { - Utils.checkNotNull(fields, "fields"); + public CustomObjectInput withFields(@Nullable List fields) { this.fields = fields; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CustomObjectInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CustomObjectInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CustomObjectInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -164,69 +130,38 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private Optional> fields = Optional.empty(); + private List fields; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The name of the custom object */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the custom object - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - - public Builder fields(List fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = Optional.ofNullable(fields); - return this; - } - - public Builder fields(Optional> fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable List fields) { this.fields = fields; return this; } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CustomObjectInput build() { - return new CustomObjectInput( name, fields, passThrough); } diff --git a/src/main/java/com/apideck/unify/models/components/CustomObjectSchema.java b/src/main/java/com/apideck/unify/models/components/CustomObjectSchema.java index baaa58ac..2e5a8542 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomObjectSchema.java +++ b/src/main/java/com/apideck/unify/models/components/CustomObjectSchema.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,7 +23,7 @@ public class CustomObjectSchema { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the custom object schema @@ -45,7 +44,7 @@ public class CustomObjectSchema { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("fields") - private Optional> fields; + private List fields; /** * Whether the custom object schema is visible in the UI @@ -94,140 +93,124 @@ public class CustomObjectSchema { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CustomObjectSchema( - @JsonProperty("id") Optional id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("fields") Optional> fields, - @JsonProperty("visible") JsonNullable visible, - @JsonProperty("active") JsonNullable active, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(visible, "visible"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("fields") @Nullable List fields, + @JsonProperty("visible") @Nullable JsonNullable visible, + @JsonProperty("active") @Nullable JsonNullable active, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.name = name; - this.description = description; + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.fields = fields; - this.visible = visible; - this.active = active; - this.createdBy = createdBy; - this.updatedBy = updatedBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.visible = Optional.ofNullable(visible) + .orElse(JsonNullable.undefined()); + this.active = Optional.ofNullable(active) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public CustomObjectSchema() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null); } /** * The unique identifier of the custom object schema */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the custom object schema */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The description of the custom object schema */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The fields defined in the schema */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> fields() { - return (Optional>) fields; + return Optional.ofNullable(this.fields); } /** * Whether the custom object schema is visible in the UI */ - @JsonIgnore public JsonNullable visible() { - return visible; + return this.visible; } /** * Whether the custom object schema is active */ - @JsonIgnore public JsonNullable active() { - return active; + return this.active; } /** * The ID of the user who created the custom object schema */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The ID of the user who last updated the custom object schema */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The timestamp when the custom object schema was last updated */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The timestamp when the custom object schema was created */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -238,204 +221,102 @@ public static Builder builder() { /** * The unique identifier of the custom object schema */ - public CustomObjectSchema withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier of the custom object schema - */ - public CustomObjectSchema withId(Optional id) { - Utils.checkNotNull(id, "id"); + public CustomObjectSchema withId(@Nullable String id) { this.id = id; return this; } + /** * The name of the custom object schema */ - public CustomObjectSchema withName(String name) { - Utils.checkNotNull(name, "name"); + public CustomObjectSchema withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the custom object schema - */ - public CustomObjectSchema withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The description of the custom object schema */ - public CustomObjectSchema withDescription(String description) { - Utils.checkNotNull(description, "description"); + public CustomObjectSchema withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the custom object schema - */ - public CustomObjectSchema withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * The fields defined in the schema - */ - public CustomObjectSchema withFields(List fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = Optional.ofNullable(fields); - return this; - } - /** * The fields defined in the schema */ - public CustomObjectSchema withFields(Optional> fields) { - Utils.checkNotNull(fields, "fields"); + public CustomObjectSchema withFields(@Nullable List fields) { this.fields = fields; return this; } + /** * Whether the custom object schema is visible in the UI */ - public CustomObjectSchema withVisible(boolean visible) { - Utils.checkNotNull(visible, "visible"); + public CustomObjectSchema withVisible(@Nullable Boolean visible) { this.visible = JsonNullable.of(visible); return this; } - /** - * Whether the custom object schema is visible in the UI - */ - public CustomObjectSchema withVisible(JsonNullable visible) { - Utils.checkNotNull(visible, "visible"); - this.visible = visible; - return this; - } /** * Whether the custom object schema is active */ - public CustomObjectSchema withActive(boolean active) { - Utils.checkNotNull(active, "active"); + public CustomObjectSchema withActive(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the custom object schema is active - */ - public CustomObjectSchema withActive(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } /** * The ID of the user who created the custom object schema */ - public CustomObjectSchema withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public CustomObjectSchema withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The ID of the user who created the custom object schema - */ - public CustomObjectSchema withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The ID of the user who last updated the custom object schema */ - public CustomObjectSchema withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public CustomObjectSchema withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The ID of the user who last updated the custom object schema - */ - public CustomObjectSchema withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The timestamp when the custom object schema was last updated */ - public CustomObjectSchema withUpdatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public CustomObjectSchema withUpdatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The timestamp when the custom object schema was last updated - */ - public CustomObjectSchema withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The timestamp when the custom object schema was created */ - public CustomObjectSchema withCreatedAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public CustomObjectSchema withCreatedAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The timestamp when the custom object schema was created - */ - public CustomObjectSchema withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CustomObjectSchema withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CustomObjectSchema withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CustomObjectSchema withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -487,243 +368,121 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional> fields = Optional.empty(); + private List fields; - private JsonNullable visible = JsonNullable.undefined(); + private JsonNullable visible; - private JsonNullable active = JsonNullable.undefined(); + private JsonNullable active; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * The unique identifier of the custom object schema - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The unique identifier of the custom object schema */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the custom object schema */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the custom object schema - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The description of the custom object schema */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the custom object schema - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * The fields defined in the schema - */ - public Builder fields(List fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = Optional.ofNullable(fields); - return this; - } - /** * The fields defined in the schema */ - public Builder fields(Optional> fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable List fields) { this.fields = fields; return this; } - /** * Whether the custom object schema is visible in the UI */ - public Builder visible(boolean visible) { - Utils.checkNotNull(visible, "visible"); + public Builder visible(@Nullable Boolean visible) { this.visible = JsonNullable.of(visible); return this; } - /** - * Whether the custom object schema is visible in the UI - */ - public Builder visible(JsonNullable visible) { - Utils.checkNotNull(visible, "visible"); - this.visible = visible; - return this; - } - - /** * Whether the custom object schema is active */ - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the custom object schema is active - */ - public Builder active(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - /** * The ID of the user who created the custom object schema */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The ID of the user who created the custom object schema - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The ID of the user who last updated the custom object schema */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The ID of the user who last updated the custom object schema - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The timestamp when the custom object schema was last updated */ - public Builder updatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The timestamp when the custom object schema was last updated - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The timestamp when the custom object schema was created */ - public Builder createdAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The timestamp when the custom object schema was created - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CustomObjectSchema build() { - return new CustomObjectSchema( id, name, description, fields, visible, active, diff --git a/src/main/java/com/apideck/unify/models/components/CustomObjectSchemaInput.java b/src/main/java/com/apideck/unify/models/components/CustomObjectSchemaInput.java index 95c01ccc..6a145611 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomObjectSchemaInput.java +++ b/src/main/java/com/apideck/unify/models/components/CustomObjectSchemaInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -38,7 +37,7 @@ public class CustomObjectSchemaInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("fields") - private Optional> fields; + private List fields; /** * Whether the custom object schema is visible in the UI @@ -59,83 +58,73 @@ public class CustomObjectSchemaInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CustomObjectSchemaInput( - @JsonProperty("name") JsonNullable name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("fields") Optional> fields, - @JsonProperty("visible") JsonNullable visible, - @JsonProperty("active") JsonNullable active, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(visible, "visible"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; - this.description = description; + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("fields") @Nullable List fields, + @JsonProperty("visible") @Nullable JsonNullable visible, + @JsonProperty("active") @Nullable JsonNullable active, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.fields = fields; - this.visible = visible; - this.active = active; + this.visible = Optional.ofNullable(visible) + .orElse(JsonNullable.undefined()); + this.active = Optional.ofNullable(active) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public CustomObjectSchemaInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * The name of the custom object schema */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The description of the custom object schema */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The fields defined in the schema */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> fields() { - return (Optional>) fields; + return Optional.ofNullable(this.fields); } /** * Whether the custom object schema is visible in the UI */ - @JsonIgnore public JsonNullable visible() { - return visible; + return this.visible; } /** * Whether the custom object schema is active */ - @JsonIgnore public JsonNullable active() { - return active; + return this.active; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -146,113 +135,57 @@ public static Builder builder() { /** * The name of the custom object schema */ - public CustomObjectSchemaInput withName(String name) { - Utils.checkNotNull(name, "name"); + public CustomObjectSchemaInput withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the custom object schema - */ - public CustomObjectSchemaInput withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The description of the custom object schema */ - public CustomObjectSchemaInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public CustomObjectSchemaInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the custom object schema - */ - public CustomObjectSchemaInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * The fields defined in the schema - */ - public CustomObjectSchemaInput withFields(List fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = Optional.ofNullable(fields); - return this; - } - /** * The fields defined in the schema */ - public CustomObjectSchemaInput withFields(Optional> fields) { - Utils.checkNotNull(fields, "fields"); + public CustomObjectSchemaInput withFields(@Nullable List fields) { this.fields = fields; return this; } + /** * Whether the custom object schema is visible in the UI */ - public CustomObjectSchemaInput withVisible(boolean visible) { - Utils.checkNotNull(visible, "visible"); + public CustomObjectSchemaInput withVisible(@Nullable Boolean visible) { this.visible = JsonNullable.of(visible); return this; } - /** - * Whether the custom object schema is visible in the UI - */ - public CustomObjectSchemaInput withVisible(JsonNullable visible) { - Utils.checkNotNull(visible, "visible"); - this.visible = visible; - return this; - } /** * Whether the custom object schema is active */ - public CustomObjectSchemaInput withActive(boolean active) { - Utils.checkNotNull(active, "active"); + public CustomObjectSchemaInput withActive(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the custom object schema is active - */ - public CustomObjectSchemaInput withActive(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CustomObjectSchemaInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CustomObjectSchemaInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CustomObjectSchemaInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -292,138 +225,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional> fields = Optional.empty(); + private List fields; - private JsonNullable visible = JsonNullable.undefined(); + private JsonNullable visible; - private JsonNullable active = JsonNullable.undefined(); + private JsonNullable active; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The name of the custom object schema */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the custom object schema - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The description of the custom object schema */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the custom object schema - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * The fields defined in the schema - */ - public Builder fields(List fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = Optional.ofNullable(fields); - return this; - } - /** * The fields defined in the schema */ - public Builder fields(Optional> fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable List fields) { this.fields = fields; return this; } - /** * Whether the custom object schema is visible in the UI */ - public Builder visible(boolean visible) { - Utils.checkNotNull(visible, "visible"); + public Builder visible(@Nullable Boolean visible) { this.visible = JsonNullable.of(visible); return this; } - /** - * Whether the custom object schema is visible in the UI - */ - public Builder visible(JsonNullable visible) { - Utils.checkNotNull(visible, "visible"); - this.visible = visible; - return this; - } - - /** * Whether the custom object schema is active */ - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the custom object schema is active - */ - public Builder active(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CustomObjectSchemaInput build() { - return new CustomObjectSchemaInput( name, description, fields, visible, active, passThrough); diff --git a/src/main/java/com/apideck/unify/models/components/CustomObjectSchemaOptions.java b/src/main/java/com/apideck/unify/models/components/CustomObjectSchemaOptions.java index ba41e38f..38a1eef1 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomObjectSchemaOptions.java +++ b/src/main/java/com/apideck/unify/models/components/CustomObjectSchemaOptions.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,35 +18,31 @@ public class CustomObjectSchemaOptions { @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private String value; @JsonInclude(Include.NON_ABSENT) @JsonProperty("label") - private Optional label; + private String label; @JsonCreator public CustomObjectSchemaOptions( - @JsonProperty("value") Optional value, - @JsonProperty("label") Optional label) { - Utils.checkNotNull(value, "value"); - Utils.checkNotNull(label, "label"); + @JsonProperty("value") @Nullable String value, + @JsonProperty("label") @Nullable String label) { this.value = value; this.label = label; } public CustomObjectSchemaOptions() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @JsonIgnore public Optional value() { - return value; + return Optional.ofNullable(this.value); } - @JsonIgnore public Optional label() { - return label; + return Optional.ofNullable(this.label); } public static Builder builder() { @@ -54,32 +50,18 @@ public static Builder builder() { } - public CustomObjectSchemaOptions withValue(String value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - - - public CustomObjectSchemaOptions withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public CustomObjectSchemaOptions withValue(@Nullable String value) { this.value = value; return this; } - public CustomObjectSchemaOptions withLabel(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - - public CustomObjectSchemaOptions withLabel(Optional label) { - Utils.checkNotNull(label, "label"); + public CustomObjectSchemaOptions withLabel(@Nullable String label) { this.label = label; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,42 +92,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional value = Optional.empty(); + private String value; - private Optional label = Optional.empty(); + private String label; private Builder() { // force use of static builder() method } - - public Builder value(String value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable String value) { this.value = value; return this; } - - public Builder label(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - - public Builder label(Optional label) { - Utils.checkNotNull(label, "label"); + public Builder label(@Nullable String label) { this.label = label; return this; } public CustomObjectSchemaOptions build() { - return new CustomObjectSchemaOptions( value, label); } diff --git a/src/main/java/com/apideck/unify/models/components/Customer.java b/src/main/java/com/apideck/unify/models/components/Customer.java index 9702cc34..1aeea43e 100644 --- a/src/main/java/com/apideck/unify/models/components/Customer.java +++ b/src/main/java/com/apideck/unify/models/components/Customer.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -113,27 +113,27 @@ public class Customer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_accounts") - private Optional> bankAccounts; + private List bankAccounts; /** * Some notes about this customer @@ -145,7 +145,7 @@ public class Customer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRate taxRate; @JsonInclude(Include.NON_ABSENT) @@ -157,26 +157,26 @@ public class Customer { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; @JsonInclude(Include.NON_ABSENT) @JsonProperty("account") - private JsonNullable account; + private JsonNullable account; /** * The parent customer this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("parent") - private JsonNullable parent; + private JsonNullable parent; /** * Customer status */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check @@ -195,14 +195,14 @@ public class Customer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -244,394 +244,338 @@ public class Customer { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Customer( - @JsonProperty("id") String id, - @JsonProperty("downstream_id") JsonNullable downstreamId, - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("title") JsonNullable title, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("suffix") JsonNullable suffix, - @JsonProperty("individual") JsonNullable individual, - @JsonProperty("project") JsonNullable project, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("websites") Optional> websites, - @JsonProperty("bank_accounts") Optional> bankAccounts, - @JsonProperty("notes") JsonNullable notes, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("tax_number") JsonNullable taxNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("account") JsonNullable account, - @JsonProperty("parent") JsonNullable parent, - @JsonProperty("status") JsonNullable status, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("channel") JsonNullable channel, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(suffix, "suffix"); - Utils.checkNotNull(individual, "individual"); - Utils.checkNotNull(project, "project"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(bankAccounts, "bankAccounts"); - Utils.checkNotNull(notes, "notes"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(taxNumber, "taxNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(account, "account"); - Utils.checkNotNull(parent, "parent"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(channel, "channel"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - this.id = id; - this.downstreamId = downstreamId; - this.displayId = displayId; - this.displayName = displayName; - this.companyName = companyName; - this.companyId = companyId; - this.title = title; - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.suffix = suffix; - this.individual = individual; - this.project = project; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId, + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("suffix") @Nullable JsonNullable suffix, + @JsonProperty("individual") @Nullable JsonNullable individual, + @JsonProperty("project") @Nullable JsonNullable project, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("bank_accounts") @Nullable List bankAccounts, + @JsonProperty("notes") @Nullable JsonNullable notes, + @JsonProperty("tax_rate") @Nullable LinkedTaxRate taxRate, + @JsonProperty("tax_number") @Nullable JsonNullable taxNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("account") @Nullable JsonNullable account, + @JsonProperty("parent") @Nullable JsonNullable parent, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("channel") @Nullable JsonNullable channel, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.suffix = Optional.ofNullable(suffix) + .orElse(JsonNullable.undefined()); + this.individual = Optional.ofNullable(individual) + .orElse(JsonNullable.undefined()); + this.project = Optional.ofNullable(project) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.phoneNumbers = phoneNumbers; this.emails = emails; this.websites = websites; this.bankAccounts = bankAccounts; - this.notes = notes; + this.notes = Optional.ofNullable(notes) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; - this.taxNumber = taxNumber; - this.currency = currency; - this.account = account; - this.parent = parent; - this.status = status; - this.paymentMethod = paymentMethod; - this.channel = channel; + this.taxNumber = Optional.ofNullable(taxNumber) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.account = Optional.ofNullable(account) + .orElse(JsonNullable.undefined()); + this.parent = Optional.ofNullable(parent) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.channel = Optional.ofNullable(channel) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; - this.rowVersion = rowVersion; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Customer( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } /** * Display ID */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * Display name */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * Middle name of the person. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } - @JsonIgnore public JsonNullable suffix() { - return suffix; + return this.suffix; } /** * Is this an individual or business customer */ - @JsonIgnore public JsonNullable individual() { - return individual; + return this.individual; } /** * If true, indicates this is a Project. */ - @JsonIgnore public JsonNullable project() { - return project; + return this.project; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> bankAccounts() { - return (Optional>) bankAccounts; + return Optional.ofNullable(this.bankAccounts); } /** * Some notes about this customer */ - @JsonIgnore public JsonNullable notes() { - return notes; + return this.notes; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } - @JsonIgnore public JsonNullable taxNumber() { - return taxNumber; + return this.taxNumber; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable account() { - return (JsonNullable) account; + return this.account; } /** * The parent customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable parent() { - return (JsonNullable) parent; + return this.parent; } /** * Customer status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * The channel through which the transaction is processed. */ - @JsonIgnore public JsonNullable channel() { - return channel; + return this.channel; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -642,572 +586,288 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Customer withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Customer withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The third-party API ID of original entity */ - public Customer withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Customer withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Customer withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } /** * Display ID */ - public Customer withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Customer withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Display ID - */ - public Customer withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } /** * Display name */ - public Customer withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Customer withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * Display name - */ - public Customer withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } /** * The name of the company. */ - public Customer withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Customer withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Customer withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public Customer withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Customer withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Customer withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The job title of the person. */ - public Customer withTitle(String title) { - Utils.checkNotNull(title, "title"); + public Customer withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Customer withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The first name of the person. */ - public Customer withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Customer withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Customer withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * Middle name of the person. */ - public Customer withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Customer withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Customer withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The last name of the person. */ - public Customer withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Customer withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Customer withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - public Customer withSuffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Customer withSuffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - public Customer withSuffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } /** * Is this an individual or business customer */ - public Customer withIndividual(boolean individual) { - Utils.checkNotNull(individual, "individual"); + public Customer withIndividual(@Nullable Boolean individual) { this.individual = JsonNullable.of(individual); return this; } - /** - * Is this an individual or business customer - */ - public Customer withIndividual(JsonNullable individual) { - Utils.checkNotNull(individual, "individual"); - this.individual = individual; - return this; - } /** * If true, indicates this is a Project. */ - public Customer withProject(boolean project) { - Utils.checkNotNull(project, "project"); + public Customer withProject(@Nullable Boolean project) { this.project = JsonNullable.of(project); return this; } - /** - * If true, indicates this is a Project. - */ - public Customer withProject(JsonNullable project) { - Utils.checkNotNull(project, "project"); - this.project = project; - return this; - } - public Customer withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - - public Customer withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Customer withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public Customer withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Customer withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Customer withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Customer withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Customer withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Customer withEmails(@Nullable List emails) { this.emails = emails; return this; } - public Customer withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Customer withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Customer withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public Customer withBankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Customer withBankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Customer withBankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - /** - * Some notes about this customer - */ - public Customer withNotes(String notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = JsonNullable.of(notes); - return this; - } /** * Some notes about this customer */ - public Customer withNotes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - public Customer withTaxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); + public Customer withNotes(@Nullable String notes) { + this.notes = JsonNullable.of(notes); return this; } - public Customer withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Customer withTaxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - public Customer withTaxNumber(String taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); + + public Customer withTaxNumber(@Nullable String taxNumber) { this.taxNumber = JsonNullable.of(taxNumber); return this; } - public Customer withTaxNumber(JsonNullable taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); - this.taxNumber = taxNumber; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Customer withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Customer withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Customer withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - public Customer withAccount(LinkedLedgerAccount account) { - Utils.checkNotNull(account, "account"); + public Customer withAccount(@Nullable LinkedLedgerAccount account) { this.account = JsonNullable.of(account); return this; } - public Customer withAccount(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } /** * The parent customer this entity is linked to. */ - public Customer withParent(LinkedParentCustomer parent) { - Utils.checkNotNull(parent, "parent"); + public Customer withParent(@Nullable LinkedParentCustomer parent) { this.parent = JsonNullable.of(parent); return this; } - /** - * The parent customer this entity is linked to. - */ - public Customer withParent(JsonNullable parent) { - Utils.checkNotNull(parent, "parent"); - this.parent = parent; - return this; - } /** * Customer status */ - public Customer withStatus(CustomerStatusStatus status) { - Utils.checkNotNull(status, "status"); + public Customer withStatus(@Nullable CustomerStatusStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Customer status - */ - public Customer withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Customer withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Customer withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Customer withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * The channel through which the transaction is processed. */ - public Customer withChannel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Customer withChannel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Customer withChannel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - public Customer withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Customer withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Customer withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public Customer withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Customer withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Customer withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public Customer withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Customer withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Customer withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Customer withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Customer withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Customer withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Customer withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Customer withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Customer withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Customer withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Customer withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Customer withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Customer withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Customer withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Customer withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Customer withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Customer withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Customer withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1317,676 +977,329 @@ public final static class Builder { private String id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable suffix = JsonNullable.undefined(); + private JsonNullable suffix; - private JsonNullable individual = JsonNullable.undefined(); + private JsonNullable individual; - private JsonNullable project = JsonNullable.undefined(); + private JsonNullable project; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> bankAccounts = Optional.empty(); + private List bankAccounts; - private JsonNullable notes = JsonNullable.undefined(); + private JsonNullable notes; - private Optional taxRate = Optional.empty(); + private LinkedTaxRate taxRate; - private JsonNullable taxNumber = JsonNullable.undefined(); + private JsonNullable taxNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable account = JsonNullable.undefined(); + private JsonNullable account; - private JsonNullable parent = JsonNullable.undefined(); + private JsonNullable parent; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable channel = JsonNullable.undefined(); + private JsonNullable channel; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } - - /** * Display ID */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Display ID - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * Display name */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * Display name - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * Middle name of the person. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - - public Builder suffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Builder suffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - public Builder suffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } - - /** * Is this an individual or business customer */ - public Builder individual(boolean individual) { - Utils.checkNotNull(individual, "individual"); + public Builder individual(@Nullable Boolean individual) { this.individual = JsonNullable.of(individual); return this; } - /** - * Is this an individual or business customer - */ - public Builder individual(JsonNullable individual) { - Utils.checkNotNull(individual, "individual"); - this.individual = individual; - return this; - } - - /** * If true, indicates this is a Project. */ - public Builder project(boolean project) { - Utils.checkNotNull(project, "project"); + public Builder project(@Nullable Boolean project) { this.project = JsonNullable.of(project); return this; } - /** - * If true, indicates this is a Project. - */ - public Builder project(JsonNullable project) { - Utils.checkNotNull(project, "project"); - this.project = project; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder bankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Builder bankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Builder bankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - /** * Some notes about this customer */ - public Builder notes(String notes) { - Utils.checkNotNull(notes, "notes"); + public Builder notes(@Nullable String notes) { this.notes = JsonNullable.of(notes); return this; } - /** - * Some notes about this customer - */ - public Builder notes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - - public Builder taxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - - public Builder taxNumber(String taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); + public Builder taxNumber(@Nullable String taxNumber) { this.taxNumber = JsonNullable.of(taxNumber); return this; } - public Builder taxNumber(JsonNullable taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); - this.taxNumber = taxNumber; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - public Builder account(LinkedLedgerAccount account) { - Utils.checkNotNull(account, "account"); + public Builder account(@Nullable LinkedLedgerAccount account) { this.account = JsonNullable.of(account); return this; } - public Builder account(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - - /** * The parent customer this entity is linked to. */ - public Builder parent(LinkedParentCustomer parent) { - Utils.checkNotNull(parent, "parent"); + public Builder parent(@Nullable LinkedParentCustomer parent) { this.parent = JsonNullable.of(parent); return this; } - /** - * The parent customer this entity is linked to. - */ - public Builder parent(JsonNullable parent) { - Utils.checkNotNull(parent, "parent"); - this.parent = parent; - return this; - } - - /** * Customer status */ - public Builder status(CustomerStatusStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable CustomerStatusStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Customer status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * The channel through which the transaction is processed. */ - public Builder channel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Builder channel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Builder channel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Customer build() { - return new Customer( id, downstreamId, displayId, displayName, companyName, companyId, diff --git a/src/main/java/com/apideck/unify/models/components/CustomerInput.java b/src/main/java/com/apideck/unify/models/components/CustomerInput.java index 26c941d9..ae023b1e 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomerInput.java +++ b/src/main/java/com/apideck/unify/models/components/CustomerInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -97,27 +96,27 @@ public class CustomerInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_accounts") - private Optional> bankAccounts; + private List bankAccounts; /** * Some notes about this customer @@ -129,7 +128,7 @@ public class CustomerInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRateInput taxRate; @JsonInclude(Include.NON_ABSENT) @@ -141,26 +140,26 @@ public class CustomerInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; @JsonInclude(Include.NON_ABSENT) @JsonProperty("account") - private JsonNullable account; + private JsonNullable account; /** * The parent customer this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("parent") - private JsonNullable parent; + private JsonNullable parent; /** * Customer status */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check @@ -179,7 +178,7 @@ public class CustomerInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -193,313 +192,265 @@ public class CustomerInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public CustomerInput( - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("title") JsonNullable title, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("suffix") JsonNullable suffix, - @JsonProperty("individual") JsonNullable individual, - @JsonProperty("project") JsonNullable project, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("websites") Optional> websites, - @JsonProperty("bank_accounts") Optional> bankAccounts, - @JsonProperty("notes") JsonNullable notes, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("tax_number") JsonNullable taxNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("account") JsonNullable account, - @JsonProperty("parent") JsonNullable parent, - @JsonProperty("status") JsonNullable status, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("channel") JsonNullable channel, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(suffix, "suffix"); - Utils.checkNotNull(individual, "individual"); - Utils.checkNotNull(project, "project"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(bankAccounts, "bankAccounts"); - Utils.checkNotNull(notes, "notes"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(taxNumber, "taxNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(account, "account"); - Utils.checkNotNull(parent, "parent"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(channel, "channel"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - this.displayId = displayId; - this.displayName = displayName; - this.companyName = companyName; - this.companyId = companyId; - this.title = title; - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.suffix = suffix; - this.individual = individual; - this.project = project; + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("suffix") @Nullable JsonNullable suffix, + @JsonProperty("individual") @Nullable JsonNullable individual, + @JsonProperty("project") @Nullable JsonNullable project, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("bank_accounts") @Nullable List bankAccounts, + @JsonProperty("notes") @Nullable JsonNullable notes, + @JsonProperty("tax_rate") @Nullable LinkedTaxRateInput taxRate, + @JsonProperty("tax_number") @Nullable JsonNullable taxNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("account") @Nullable JsonNullable account, + @JsonProperty("parent") @Nullable JsonNullable parent, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("channel") @Nullable JsonNullable channel, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.suffix = Optional.ofNullable(suffix) + .orElse(JsonNullable.undefined()); + this.individual = Optional.ofNullable(individual) + .orElse(JsonNullable.undefined()); + this.project = Optional.ofNullable(project) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.phoneNumbers = phoneNumbers; this.emails = emails; this.websites = websites; this.bankAccounts = bankAccounts; - this.notes = notes; + this.notes = Optional.ofNullable(notes) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; - this.taxNumber = taxNumber; - this.currency = currency; - this.account = account; - this.parent = parent; - this.status = status; - this.paymentMethod = paymentMethod; - this.channel = channel; + this.taxNumber = Optional.ofNullable(taxNumber) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.account = Optional.ofNullable(account) + .orElse(JsonNullable.undefined()); + this.parent = Optional.ofNullable(parent) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.channel = Optional.ofNullable(channel) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public CustomerInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Display ID */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * Display name */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * Middle name of the person. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } - @JsonIgnore public JsonNullable suffix() { - return suffix; + return this.suffix; } /** * Is this an individual or business customer */ - @JsonIgnore public JsonNullable individual() { - return individual; + return this.individual; } /** * If true, indicates this is a Project. */ - @JsonIgnore public JsonNullable project() { - return project; + return this.project; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> bankAccounts() { - return (Optional>) bankAccounts; + return Optional.ofNullable(this.bankAccounts); } /** * Some notes about this customer */ - @JsonIgnore public JsonNullable notes() { - return notes; + return this.notes; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } - @JsonIgnore public JsonNullable taxNumber() { - return taxNumber; + return this.taxNumber; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable account() { - return (JsonNullable) account; + return this.account; } /** * The parent customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable parent() { - return (JsonNullable) parent; + return this.parent; } /** * Customer status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * The channel through which the transaction is processed. */ - @JsonIgnore public JsonNullable channel() { - return channel; + return this.channel; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -510,442 +461,212 @@ public static Builder builder() { /** * Display ID */ - public CustomerInput withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public CustomerInput withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Display ID - */ - public CustomerInput withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } /** * Display name */ - public CustomerInput withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public CustomerInput withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * Display name - */ - public CustomerInput withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } /** * The name of the company. */ - public CustomerInput withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public CustomerInput withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public CustomerInput withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public CustomerInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public CustomerInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public CustomerInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The job title of the person. */ - public CustomerInput withTitle(String title) { - Utils.checkNotNull(title, "title"); + public CustomerInput withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public CustomerInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The first name of the person. */ - public CustomerInput withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public CustomerInput withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public CustomerInput withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * Middle name of the person. */ - public CustomerInput withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public CustomerInput withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public CustomerInput withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The last name of the person. */ - public CustomerInput withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public CustomerInput withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public CustomerInput withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - public CustomerInput withSuffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public CustomerInput withSuffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - public CustomerInput withSuffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } /** * Is this an individual or business customer */ - public CustomerInput withIndividual(boolean individual) { - Utils.checkNotNull(individual, "individual"); + public CustomerInput withIndividual(@Nullable Boolean individual) { this.individual = JsonNullable.of(individual); return this; } - /** - * Is this an individual or business customer - */ - public CustomerInput withIndividual(JsonNullable individual) { - Utils.checkNotNull(individual, "individual"); - this.individual = individual; - return this; - } /** * If true, indicates this is a Project. */ - public CustomerInput withProject(boolean project) { - Utils.checkNotNull(project, "project"); + public CustomerInput withProject(@Nullable Boolean project) { this.project = JsonNullable.of(project); return this; } - /** - * If true, indicates this is a Project. - */ - public CustomerInput withProject(JsonNullable project) { - Utils.checkNotNull(project, "project"); - this.project = project; - return this; - } - - public CustomerInput withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public CustomerInput withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public CustomerInput withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public CustomerInput withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public CustomerInput withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public CustomerInput withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public CustomerInput withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public CustomerInput withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public CustomerInput withEmails(@Nullable List emails) { this.emails = emails; return this; } - public CustomerInput withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public CustomerInput withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public CustomerInput withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public CustomerInput withBankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public CustomerInput withBankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public CustomerInput withBankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - /** - * Some notes about this customer - */ - public CustomerInput withNotes(String notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = JsonNullable.of(notes); - return this; - } /** * Some notes about this customer */ - public CustomerInput withNotes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - public CustomerInput withTaxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); + public CustomerInput withNotes(@Nullable String notes) { + this.notes = JsonNullable.of(notes); return this; } - public CustomerInput withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public CustomerInput withTaxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - public CustomerInput withTaxNumber(String taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); + + public CustomerInput withTaxNumber(@Nullable String taxNumber) { this.taxNumber = JsonNullable.of(taxNumber); return this; } - public CustomerInput withTaxNumber(JsonNullable taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); - this.taxNumber = taxNumber; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public CustomerInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public CustomerInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public CustomerInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - public CustomerInput withAccount(LinkedLedgerAccountInput account) { - Utils.checkNotNull(account, "account"); + public CustomerInput withAccount(@Nullable LinkedLedgerAccountInput account) { this.account = JsonNullable.of(account); return this; } - public CustomerInput withAccount(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } /** * The parent customer this entity is linked to. */ - public CustomerInput withParent(LinkedParentCustomer parent) { - Utils.checkNotNull(parent, "parent"); + public CustomerInput withParent(@Nullable LinkedParentCustomer parent) { this.parent = JsonNullable.of(parent); return this; } - /** - * The parent customer this entity is linked to. - */ - public CustomerInput withParent(JsonNullable parent) { - Utils.checkNotNull(parent, "parent"); - this.parent = parent; - return this; - } /** * Customer status */ - public CustomerInput withStatus(CustomerStatusStatus status) { - Utils.checkNotNull(status, "status"); + public CustomerInput withStatus(@Nullable CustomerStatusStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Customer status - */ - public CustomerInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public CustomerInput withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public CustomerInput withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public CustomerInput withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * The channel through which the transaction is processed. */ - public CustomerInput withChannel(String channel) { - Utils.checkNotNull(channel, "channel"); + public CustomerInput withChannel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public CustomerInput withChannel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - public CustomerInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public CustomerInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public CustomerInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public CustomerInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public CustomerInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public CustomerInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public CustomerInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -953,12 +674,12 @@ public CustomerInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public CustomerInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CustomerInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1050,540 +771,261 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable suffix = JsonNullable.undefined(); + private JsonNullable suffix; - private JsonNullable individual = JsonNullable.undefined(); + private JsonNullable individual; - private JsonNullable project = JsonNullable.undefined(); + private JsonNullable project; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> bankAccounts = Optional.empty(); + private List bankAccounts; - private JsonNullable notes = JsonNullable.undefined(); + private JsonNullable notes; - private Optional taxRate = Optional.empty(); + private LinkedTaxRateInput taxRate; - private JsonNullable taxNumber = JsonNullable.undefined(); + private JsonNullable taxNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable account = JsonNullable.undefined(); + private JsonNullable account; - private JsonNullable parent = JsonNullable.undefined(); + private JsonNullable parent; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable channel = JsonNullable.undefined(); + private JsonNullable channel; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Display ID */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Display ID - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * Display name */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * Display name - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * Middle name of the person. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - - public Builder suffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Builder suffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - public Builder suffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } - - /** * Is this an individual or business customer */ - public Builder individual(boolean individual) { - Utils.checkNotNull(individual, "individual"); + public Builder individual(@Nullable Boolean individual) { this.individual = JsonNullable.of(individual); return this; } - /** - * Is this an individual or business customer - */ - public Builder individual(JsonNullable individual) { - Utils.checkNotNull(individual, "individual"); - this.individual = individual; - return this; - } - - /** * If true, indicates this is a Project. */ - public Builder project(boolean project) { - Utils.checkNotNull(project, "project"); + public Builder project(@Nullable Boolean project) { this.project = JsonNullable.of(project); return this; } - /** - * If true, indicates this is a Project. - */ - public Builder project(JsonNullable project) { - Utils.checkNotNull(project, "project"); - this.project = project; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder bankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Builder bankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Builder bankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - /** * Some notes about this customer */ - public Builder notes(String notes) { - Utils.checkNotNull(notes, "notes"); + public Builder notes(@Nullable String notes) { this.notes = JsonNullable.of(notes); return this; } - /** - * Some notes about this customer - */ - public Builder notes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - - public Builder taxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - - public Builder taxNumber(String taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); + public Builder taxNumber(@Nullable String taxNumber) { this.taxNumber = JsonNullable.of(taxNumber); return this; } - public Builder taxNumber(JsonNullable taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); - this.taxNumber = taxNumber; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - public Builder account(LinkedLedgerAccountInput account) { - Utils.checkNotNull(account, "account"); + public Builder account(@Nullable LinkedLedgerAccountInput account) { this.account = JsonNullable.of(account); return this; } - public Builder account(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - - /** * The parent customer this entity is linked to. */ - public Builder parent(LinkedParentCustomer parent) { - Utils.checkNotNull(parent, "parent"); + public Builder parent(@Nullable LinkedParentCustomer parent) { this.parent = JsonNullable.of(parent); return this; } - /** - * The parent customer this entity is linked to. - */ - public Builder parent(JsonNullable parent) { - Utils.checkNotNull(parent, "parent"); - this.parent = parent; - return this; - } - - /** * Customer status */ - public Builder status(CustomerStatusStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable CustomerStatusStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Customer status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * The channel through which the transaction is processed. */ - public Builder channel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Builder channel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Builder channel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public CustomerInput build() { - return new CustomerInput( displayId, displayName, companyName, companyId, title, firstName, diff --git a/src/main/java/com/apideck/unify/models/components/CustomersFilter.java b/src/main/java/com/apideck/unify/models/components/CustomersFilter.java index a46b91da..55408d67 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomersFilter.java +++ b/src/main/java/com/apideck/unify/models/components/CustomersFilter.java @@ -6,10 +6,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -20,142 +19,126 @@ public class CustomersFilter { * Company Name of customer to search for */ @SpeakeasyMetadata("queryParam:name=company_name") - private Optional companyName; + private String companyName; /** * Display Name of customer to search for */ @SpeakeasyMetadata("queryParam:name=display_name") - private Optional displayName; + private String displayName; /** * First name of customer to search for */ @SpeakeasyMetadata("queryParam:name=first_name") - private Optional firstName; + private String firstName; /** * Last name of customer to search for */ @SpeakeasyMetadata("queryParam:name=last_name") - private Optional lastName; + private String lastName; /** * Email of customer to search for */ @SpeakeasyMetadata("queryParam:name=email") - private Optional email; + private String email; /** * Status of customer to filter on */ @SpeakeasyMetadata("queryParam:name=status") - private JsonNullable status; + private JsonNullable status; @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private OffsetDateTime updatedSince; /** * Supplier ID of customer to search for */ @SpeakeasyMetadata("queryParam:name=supplier_id") - private Optional supplierId; + private String supplierId; @JsonCreator public CustomersFilter( - Optional companyName, - Optional displayName, - Optional firstName, - Optional lastName, - Optional email, - JsonNullable status, - Optional updatedSince, - Optional supplierId) { - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(updatedSince, "updatedSince"); - Utils.checkNotNull(supplierId, "supplierId"); + @Nullable String companyName, + @Nullable String displayName, + @Nullable String firstName, + @Nullable String lastName, + @Nullable String email, + @Nullable JsonNullable status, + @Nullable OffsetDateTime updatedSince, + @Nullable String supplierId) { this.companyName = companyName; this.displayName = displayName; this.firstName = firstName; this.lastName = lastName; this.email = email; - this.status = status; + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); this.updatedSince = updatedSince; this.supplierId = supplierId; } public CustomersFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null); } /** * Company Name of customer to search for */ - @JsonIgnore public Optional companyName() { - return companyName; + return Optional.ofNullable(this.companyName); } /** * Display Name of customer to search for */ - @JsonIgnore public Optional displayName() { - return displayName; + return Optional.ofNullable(this.displayName); } /** * First name of customer to search for */ - @JsonIgnore public Optional firstName() { - return firstName; + return Optional.ofNullable(this.firstName); } /** * Last name of customer to search for */ - @JsonIgnore public Optional lastName() { - return lastName; + return Optional.ofNullable(this.lastName); } /** * Email of customer to search for */ - @JsonIgnore public Optional email() { - return email; + return Optional.ofNullable(this.email); } /** * Status of customer to filter on */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } /** * Supplier ID of customer to search for */ - @JsonIgnore public Optional supplierId() { - return supplierId; + return Optional.ofNullable(this.supplierId); } public static Builder builder() { @@ -166,148 +149,72 @@ public static Builder builder() { /** * Company Name of customer to search for */ - public CustomersFilter withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = Optional.ofNullable(companyName); - return this; - } - - - /** - * Company Name of customer to search for - */ - public CustomersFilter withCompanyName(Optional companyName) { - Utils.checkNotNull(companyName, "companyName"); + public CustomersFilter withCompanyName(@Nullable String companyName) { this.companyName = companyName; return this; } - /** - * Display Name of customer to search for - */ - public CustomersFilter withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = Optional.ofNullable(displayName); - return this; - } - /** * Display Name of customer to search for */ - public CustomersFilter withDisplayName(Optional displayName) { - Utils.checkNotNull(displayName, "displayName"); + public CustomersFilter withDisplayName(@Nullable String displayName) { this.displayName = displayName; return this; } - /** - * First name of customer to search for - */ - public CustomersFilter withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = Optional.ofNullable(firstName); - return this; - } - /** * First name of customer to search for */ - public CustomersFilter withFirstName(Optional firstName) { - Utils.checkNotNull(firstName, "firstName"); + public CustomersFilter withFirstName(@Nullable String firstName) { this.firstName = firstName; return this; } - /** - * Last name of customer to search for - */ - public CustomersFilter withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = Optional.ofNullable(lastName); - return this; - } - /** * Last name of customer to search for */ - public CustomersFilter withLastName(Optional lastName) { - Utils.checkNotNull(lastName, "lastName"); + public CustomersFilter withLastName(@Nullable String lastName) { this.lastName = lastName; return this; } - /** - * Email of customer to search for - */ - public CustomersFilter withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - /** * Email of customer to search for */ - public CustomersFilter withEmail(Optional email) { - Utils.checkNotNull(email, "email"); + public CustomersFilter withEmail(@Nullable String email) { this.email = email; return this; } - /** - * Status of customer to filter on - */ - public CustomersFilter withStatus(CustomersFilterStatus status) { - Utils.checkNotNull(status, "status"); - this.status = JsonNullable.of(status); - return this; - } /** * Status of customer to filter on */ - public CustomersFilter withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - public CustomersFilter withUpdatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); + public CustomersFilter withStatus(@Nullable CustomersFilterStatus status) { + this.status = JsonNullable.of(status); return this; } - public CustomersFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public CustomersFilter withUpdatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - /** - * Supplier ID of customer to search for - */ - public CustomersFilter withSupplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - /** * Supplier ID of customer to search for */ - public CustomersFilter withSupplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public CustomersFilter withSupplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -352,174 +259,88 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional companyName = Optional.empty(); + private String companyName; - private Optional displayName = Optional.empty(); + private String displayName; - private Optional firstName = Optional.empty(); + private String firstName; - private Optional lastName = Optional.empty(); + private String lastName; - private Optional email = Optional.empty(); + private String email; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private Optional updatedSince = Optional.empty(); + private OffsetDateTime updatedSince; - private Optional supplierId = Optional.empty(); + private String supplierId; private Builder() { // force use of static builder() method } - - /** - * Company Name of customer to search for - */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = Optional.ofNullable(companyName); - return this; - } - /** * Company Name of customer to search for */ - public Builder companyName(Optional companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = companyName; return this; } - /** * Display Name of customer to search for */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = Optional.ofNullable(displayName); - return this; - } - - /** - * Display Name of customer to search for - */ - public Builder displayName(Optional displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = displayName; return this; } - - /** - * First name of customer to search for - */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = Optional.ofNullable(firstName); - return this; - } - /** * First name of customer to search for */ - public Builder firstName(Optional firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = firstName; return this; } - /** * Last name of customer to search for */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = Optional.ofNullable(lastName); - return this; - } - - /** - * Last name of customer to search for - */ - public Builder lastName(Optional lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = lastName; return this; } - /** * Email of customer to search for */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - - /** - * Email of customer to search for - */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } - /** * Status of customer to filter on */ - public Builder status(CustomersFilterStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable CustomersFilterStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Status of customer to filter on - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - - public Builder updatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - - /** - * Supplier ID of customer to search for - */ - public Builder supplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - /** * Supplier ID of customer to search for */ - public Builder supplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public Builder supplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } public CustomersFilter build() { - return new CustomersFilter( companyName, displayName, firstName, lastName, email, status, diff --git a/src/main/java/com/apideck/unify/models/components/CustomersSort.java b/src/main/java/com/apideck/unify/models/components/CustomersSort.java index 74e15315..e583225e 100644 --- a/src/main/java/com/apideck/unify/models/components/CustomersSort.java +++ b/src/main/java/com/apideck/unify/models/components/CustomersSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class CustomersSort { * The field on which to sort the Customers */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private CustomersSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public CustomersSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable CustomersSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public CustomersSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Customers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Customers */ - public CustomersSort withBy(CustomersSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Customers - */ - public CustomersSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public CustomersSort withBy(@Nullable CustomersSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public CustomersSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public CustomersSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public CustomersSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private CustomersSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Customers - */ - public Builder by(CustomersSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Customers */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable CustomersSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public CustomersSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new CustomersSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/Data.java b/src/main/java/com/apideck/unify/models/components/Data.java index e8edbc42..14ba2bfa 100644 --- a/src/main/java/com/apideck/unify/models/components/Data.java +++ b/src/main/java/com/apideck/unify/models/components/Data.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -21,70 +20,61 @@ public class Data { @JsonInclude(Include.NON_ABSENT) @JsonProperty("consumer_id") - private Optional consumerId; + private String consumerId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("application_id") - private Optional applicationId; + private String applicationId; /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("metadata") - private Optional metadata; + private ConsumerMetadata metadata; @JsonInclude(Include.NON_ABSENT) @JsonProperty("aggregated_request_count") - private Optional aggregatedRequestCount; + private Double aggregatedRequestCount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("request_counts") - private Optional requestCounts; + private RequestCountAllocation requestCounts; @JsonInclude(Include.NON_ABSENT) @JsonProperty("created") - private Optional created; + private String created; @JsonInclude(Include.NON_ABSENT) @JsonProperty("modified") - private Optional modified; + private String modified; @JsonInclude(Include.NON_ABSENT) @JsonProperty("request_count_updated") - private Optional requestCountUpdated; + private String requestCountUpdated; @JsonInclude(Include.NON_ABSENT) @JsonProperty("services") - private Optional> services; + private List services; @JsonCreator public Data( - @JsonProperty("consumer_id") Optional consumerId, - @JsonProperty("application_id") Optional applicationId, - @JsonProperty("metadata") Optional metadata, - @JsonProperty("aggregated_request_count") Optional aggregatedRequestCount, - @JsonProperty("request_counts") Optional requestCounts, - @JsonProperty("created") Optional created, - @JsonProperty("modified") Optional modified, - @JsonProperty("request_count_updated") Optional requestCountUpdated, - @JsonProperty("services") Optional> services) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(applicationId, "applicationId"); - Utils.checkNotNull(metadata, "metadata"); - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); - Utils.checkNotNull(requestCounts, "requestCounts"); - Utils.checkNotNull(created, "created"); - Utils.checkNotNull(modified, "modified"); - Utils.checkNotNull(requestCountUpdated, "requestCountUpdated"); - Utils.checkNotNull(services, "services"); + @JsonProperty("consumer_id") @Nullable String consumerId, + @JsonProperty("application_id") @Nullable String applicationId, + @JsonProperty("metadata") @Nullable ConsumerMetadata metadata, + @JsonProperty("aggregated_request_count") @Nullable Double aggregatedRequestCount, + @JsonProperty("request_counts") @Nullable RequestCountAllocation requestCounts, + @JsonProperty("created") @Nullable String created, + @JsonProperty("modified") @Nullable String modified, + @JsonProperty("request_count_updated") @Nullable String requestCountUpdated, + @JsonProperty("services") @Nullable List services) { this.consumerId = consumerId; this.applicationId = applicationId; this.metadata = metadata; @@ -97,60 +87,48 @@ public Data( } public Data() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null); } - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } - @JsonIgnore public Optional applicationId() { - return applicationId; + return Optional.ofNullable(this.applicationId); } /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional metadata() { - return (Optional) metadata; + return Optional.ofNullable(this.metadata); } - @JsonIgnore public Optional aggregatedRequestCount() { - return aggregatedRequestCount; + return Optional.ofNullable(this.aggregatedRequestCount); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional requestCounts() { - return (Optional) requestCounts; + return Optional.ofNullable(this.requestCounts); } - @JsonIgnore public Optional created() { - return created; + return Optional.ofNullable(this.created); } - @JsonIgnore public Optional modified() { - return modified; + return Optional.ofNullable(this.modified); } - @JsonIgnore public Optional requestCountUpdated() { - return requestCountUpdated; + return Optional.ofNullable(this.requestCountUpdated); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> services() { - return (Optional>) services; + return Optional.ofNullable(this.services); } public static Builder builder() { @@ -158,129 +136,63 @@ public static Builder builder() { } - public Data withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - public Data withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Data withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - public Data withApplicationId(String applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); - this.applicationId = Optional.ofNullable(applicationId); - return this; - } - - public Data withApplicationId(Optional applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); + public Data withApplicationId(@Nullable String applicationId) { this.applicationId = applicationId; return this; } - /** - * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - */ - public Data withMetadata(ConsumerMetadata metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = Optional.ofNullable(metadata); - return this; - } - /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - public Data withMetadata(Optional metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Data withMetadata(@Nullable ConsumerMetadata metadata) { this.metadata = metadata; return this; } - public Data withAggregatedRequestCount(double aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); - this.aggregatedRequestCount = Optional.ofNullable(aggregatedRequestCount); - return this; - } - - public Data withAggregatedRequestCount(Optional aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); + public Data withAggregatedRequestCount(@Nullable Double aggregatedRequestCount) { this.aggregatedRequestCount = aggregatedRequestCount; return this; } - public Data withRequestCounts(RequestCountAllocation requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); - this.requestCounts = Optional.ofNullable(requestCounts); - return this; - } - - public Data withRequestCounts(Optional requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); + public Data withRequestCounts(@Nullable RequestCountAllocation requestCounts) { this.requestCounts = requestCounts; return this; } - public Data withCreated(String created) { - Utils.checkNotNull(created, "created"); - this.created = Optional.ofNullable(created); - return this; - } - - public Data withCreated(Optional created) { - Utils.checkNotNull(created, "created"); + public Data withCreated(@Nullable String created) { this.created = created; return this; } - public Data withModified(String modified) { - Utils.checkNotNull(modified, "modified"); - this.modified = Optional.ofNullable(modified); - return this; - } - - public Data withModified(Optional modified) { - Utils.checkNotNull(modified, "modified"); + public Data withModified(@Nullable String modified) { this.modified = modified; return this; } - public Data withRequestCountUpdated(String requestCountUpdated) { - Utils.checkNotNull(requestCountUpdated, "requestCountUpdated"); - this.requestCountUpdated = Optional.ofNullable(requestCountUpdated); - return this; - } - - public Data withRequestCountUpdated(Optional requestCountUpdated) { - Utils.checkNotNull(requestCountUpdated, "requestCountUpdated"); + public Data withRequestCountUpdated(@Nullable String requestCountUpdated) { this.requestCountUpdated = requestCountUpdated; return this; } - public Data withServices(List services) { - Utils.checkNotNull(services, "services"); - this.services = Optional.ofNullable(services); - return this; - } - - public Data withServices(Optional> services) { - Utils.checkNotNull(services, "services"); + public Data withServices(@Nullable List services) { this.services = services; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -327,153 +239,77 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional applicationId = Optional.empty(); + private String applicationId; - private Optional metadata = Optional.empty(); + private ConsumerMetadata metadata; - private Optional aggregatedRequestCount = Optional.empty(); + private Double aggregatedRequestCount; - private Optional requestCounts = Optional.empty(); + private RequestCountAllocation requestCounts; - private Optional created = Optional.empty(); + private String created; - private Optional modified = Optional.empty(); + private String modified; - private Optional requestCountUpdated = Optional.empty(); + private String requestCountUpdated; - private Optional> services = Optional.empty(); + private List services; private Builder() { // force use of static builder() method } - - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - public Builder applicationId(String applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); - this.applicationId = Optional.ofNullable(applicationId); - return this; - } - - public Builder applicationId(Optional applicationId) { - Utils.checkNotNull(applicationId, "applicationId"); + public Builder applicationId(@Nullable String applicationId) { this.applicationId = applicationId; return this; } - - /** - * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - */ - public Builder metadata(ConsumerMetadata metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = Optional.ofNullable(metadata); - return this; - } - /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - public Builder metadata(Optional metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Builder metadata(@Nullable ConsumerMetadata metadata) { this.metadata = metadata; return this; } - - public Builder aggregatedRequestCount(double aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); - this.aggregatedRequestCount = Optional.ofNullable(aggregatedRequestCount); - return this; - } - - public Builder aggregatedRequestCount(Optional aggregatedRequestCount) { - Utils.checkNotNull(aggregatedRequestCount, "aggregatedRequestCount"); + public Builder aggregatedRequestCount(@Nullable Double aggregatedRequestCount) { this.aggregatedRequestCount = aggregatedRequestCount; return this; } - - public Builder requestCounts(RequestCountAllocation requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); - this.requestCounts = Optional.ofNullable(requestCounts); - return this; - } - - public Builder requestCounts(Optional requestCounts) { - Utils.checkNotNull(requestCounts, "requestCounts"); + public Builder requestCounts(@Nullable RequestCountAllocation requestCounts) { this.requestCounts = requestCounts; return this; } - - public Builder created(String created) { - Utils.checkNotNull(created, "created"); - this.created = Optional.ofNullable(created); - return this; - } - - public Builder created(Optional created) { - Utils.checkNotNull(created, "created"); + public Builder created(@Nullable String created) { this.created = created; return this; } - - public Builder modified(String modified) { - Utils.checkNotNull(modified, "modified"); - this.modified = Optional.ofNullable(modified); - return this; - } - - public Builder modified(Optional modified) { - Utils.checkNotNull(modified, "modified"); + public Builder modified(@Nullable String modified) { this.modified = modified; return this; } - - public Builder requestCountUpdated(String requestCountUpdated) { - Utils.checkNotNull(requestCountUpdated, "requestCountUpdated"); - this.requestCountUpdated = Optional.ofNullable(requestCountUpdated); - return this; - } - - public Builder requestCountUpdated(Optional requestCountUpdated) { - Utils.checkNotNull(requestCountUpdated, "requestCountUpdated"); + public Builder requestCountUpdated(@Nullable String requestCountUpdated) { this.requestCountUpdated = requestCountUpdated; return this; } - - public Builder services(List services) { - Utils.checkNotNull(services, "services"); - this.services = Optional.ofNullable(services); - return this; - } - - public Builder services(Optional> services) { - Utils.checkNotNull(services, "services"); + public Builder services(@Nullable List services) { this.services = services; return this; } public Data build() { - return new Data( consumerId, applicationId, metadata, aggregatedRequestCount, requestCounts, created, diff --git a/src/main/java/com/apideck/unify/models/components/Deduction.java b/src/main/java/com/apideck/unify/models/components/Deduction.java index 62569a54..38028d13 100644 --- a/src/main/java/com/apideck/unify/models/components/Deduction.java +++ b/src/main/java/com/apideck/unify/models/components/Deduction.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -32,32 +33,30 @@ public class Deduction { @JsonCreator public Deduction( - @JsonProperty("name") JsonNullable name, - @JsonProperty("amount") JsonNullable amount) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(amount, "amount"); - this.name = name; - this.amount = amount; + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("amount") @Nullable JsonNullable amount) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.amount = Optional.ofNullable(amount) + .orElse(JsonNullable.undefined()); } public Deduction() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } /** * The name of the deduction. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The amount deducted. */ - @JsonIgnore public JsonNullable amount() { - return amount; + return this.amount; } public static Builder builder() { @@ -68,38 +67,20 @@ public static Builder builder() { /** * The name of the deduction. */ - public Deduction withName(String name) { - Utils.checkNotNull(name, "name"); + public Deduction withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the deduction. - */ - public Deduction withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The amount deducted. */ - public Deduction withAmount(double amount) { - Utils.checkNotNull(amount, "amount"); + public Deduction withAmount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * The amount deducted. - */ - public Deduction withAmount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -131,54 +112,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable amount = JsonNullable.undefined(); + private JsonNullable amount; private Builder() { // force use of static builder() method } - /** * The name of the deduction. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the deduction. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The amount deducted. */ - public Builder amount(double amount) { - Utils.checkNotNull(amount, "amount"); + public Builder amount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * The amount deducted. - */ - public Builder amount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - public Deduction build() { - return new Deduction( name, amount); } diff --git a/src/main/java/com/apideck/unify/models/components/Defaults.java b/src/main/java/com/apideck/unify/models/components/Defaults.java index 5f7d1aac..bc21e769 100644 --- a/src/main/java/com/apideck/unify/models/components/Defaults.java +++ b/src/main/java/com/apideck/unify/models/components/Defaults.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -20,33 +19,29 @@ public class Defaults { @JsonInclude(Include.NON_ABSENT) @JsonProperty("target") - private Optional target; + private Target target; @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonInclude(Include.NON_ABSENT) @JsonProperty("options") - private Optional> options; + private List options; @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private ConnectionValue value; @JsonCreator public Defaults( - @JsonProperty("target") Optional target, - @JsonProperty("id") Optional id, - @JsonProperty("options") Optional> options, - @JsonProperty("value") Optional value) { - Utils.checkNotNull(target, "target"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(options, "options"); - Utils.checkNotNull(value, "value"); + @JsonProperty("target") @Nullable Target target, + @JsonProperty("id") @Nullable String id, + @JsonProperty("options") @Nullable List options, + @JsonProperty("value") @Nullable ConnectionValue value) { this.target = target; this.id = id; this.options = options; @@ -54,31 +49,24 @@ public Defaults( } public Defaults() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional target() { - return (Optional) target; + return Optional.ofNullable(this.target); } - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> options() { - return (Optional>) options; + return Optional.ofNullable(this.options); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional value() { - return (Optional) value; + return Optional.ofNullable(this.value); } public static Builder builder() { @@ -86,58 +74,30 @@ public static Builder builder() { } - public Defaults withTarget(Target target) { - Utils.checkNotNull(target, "target"); - this.target = Optional.ofNullable(target); - return this; - } - - - public Defaults withTarget(Optional target) { - Utils.checkNotNull(target, "target"); + public Defaults withTarget(@Nullable Target target) { this.target = target; return this; } - public Defaults withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Defaults withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Defaults withId(@Nullable String id) { this.id = id; return this; } - public Defaults withOptions(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - - public Defaults withOptions(Optional> options) { - Utils.checkNotNull(options, "options"); + public Defaults withOptions(@Nullable List options) { this.options = options; return this; } - public Defaults withValue(ConnectionValue value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - - public Defaults withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public Defaults withValue(@Nullable ConnectionValue value) { this.value = value; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,72 +133,39 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional target = Optional.empty(); + private Target target; - private Optional id = Optional.empty(); + private String id; - private Optional> options = Optional.empty(); + private List options; - private Optional value = Optional.empty(); + private ConnectionValue value; private Builder() { // force use of static builder() method } - - public Builder target(Target target) { - Utils.checkNotNull(target, "target"); - this.target = Optional.ofNullable(target); - return this; - } - - public Builder target(Optional target) { - Utils.checkNotNull(target, "target"); + public Builder target(@Nullable Target target) { this.target = target; return this; } - - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - public Builder options(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - - public Builder options(Optional> options) { - Utils.checkNotNull(options, "options"); + public Builder options(@Nullable List options) { this.options = options; return this; } - - public Builder value(ConnectionValue value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); - return this; - } - - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable ConnectionValue value) { this.value = value; return this; } public Defaults build() { - return new Defaults( target, id, options, value); diff --git a/src/main/java/com/apideck/unify/models/components/DeleteAccountingDepartmentResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteAccountingDepartmentResponse.java index 093de48e..b1b8d321 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteAccountingDepartmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteAccountingDepartmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteAccountingDepartmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteAccountingDepartmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteAccountingDepartmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteAccountingDepartmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteAccountingDepartmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteAccountingDepartmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteAccountingDepartmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteAccountingDepartmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteAccountingDepartmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteAccountingDepartmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteAccountingDepartmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteAccountingDepartmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteAccountingDepartmentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteAccountingDepartmentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteAccountingDepartmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteAccountingDepartmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteAccountingDepartmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteAccountingDepartmentResponse build() { - return new DeleteAccountingDepartmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteAccountingLocationResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteAccountingLocationResponse.java index 8f030ebb..1ccdee51 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteAccountingLocationResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteAccountingLocationResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteAccountingLocationResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteAccountingLocationResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteAccountingLocationResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteAccountingLocationResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteAccountingLocationResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteAccountingLocationResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteAccountingLocationResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteAccountingLocationResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteAccountingLocationResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteAccountingLocationResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteAccountingLocationResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteAccountingLocationResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteAccountingLocationResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteAccountingLocationResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteAccountingLocationResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteAccountingLocationResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteAccountingLocationResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteAccountingLocationResponse build() { - return new DeleteAccountingLocationResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteActivityResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteActivityResponse.java index 29afe4ff..a15e82d2 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteActivityResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteActivityResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteActivityResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteActivityResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteActivityResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteActivityResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteActivityResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteActivityResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteActivityResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteActivityResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteActivityResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteActivityResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteActivityResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteActivityResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteActivityResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteActivityResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteActivityResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteActivityResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteActivityResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteActivityResponse build() { - return new DeleteActivityResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteApplicantResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteApplicantResponse.java index 9d6206fd..7345874c 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteApplicantResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteApplicantResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteApplicantResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteApplicantResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteApplicantResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteApplicantResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteApplicantResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteApplicantResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteApplicantResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteApplicantResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteApplicantResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteApplicantResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteApplicantResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteApplicantResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteApplicantResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteApplicantResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteApplicantResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteApplicantResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteApplicantResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteApplicantResponse build() { - return new DeleteApplicantResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteApplicationResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteApplicationResponse.java index eeffda22..1bf079bc 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteApplicationResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteApplicationResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteApplicationResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteApplicationResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteApplicationResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteApplicationResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteApplicationResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteApplicationResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteApplicationResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteApplicationResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteApplicationResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteApplicationResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteApplicationResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteApplicationResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteApplicationResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteApplicationResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteApplicationResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteApplicationResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteApplicationResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteApplicationResponse build() { - return new DeleteApplicationResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteAttachmentResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteAttachmentResponse.java index 8fd753d2..81bf29d4 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteAttachmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteAttachmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteAttachmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteAttachmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteAttachmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteAttachmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteAttachmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteAttachmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteAttachmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteAttachmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteAttachmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteAttachmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteAttachmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteAttachmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteAttachmentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteAttachmentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteAttachmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteAttachmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteAttachmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteAttachmentResponse build() { - return new DeleteAttachmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteBankFeedAccountResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteBankFeedAccountResponse.java index 6e0aa144..9c3a5700 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteBankFeedAccountResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteBankFeedAccountResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteBankFeedAccountResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteBankFeedAccountResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteBankFeedAccountResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteBankFeedAccountResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteBankFeedAccountResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteBankFeedAccountResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteBankFeedAccountResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteBankFeedAccountResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteBankFeedAccountResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteBankFeedAccountResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteBankFeedAccountResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteBankFeedAccountResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteBankFeedAccountResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteBankFeedAccountResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteBankFeedAccountResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteBankFeedAccountResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteBankFeedAccountResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteBankFeedAccountResponse build() { - return new DeleteBankFeedAccountResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteBankFeedStatementResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteBankFeedStatementResponse.java index 44b165aa..5fd8c09c 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteBankFeedStatementResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteBankFeedStatementResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteBankFeedStatementResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteBankFeedStatementResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteBankFeedStatementResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteBankFeedStatementResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteBankFeedStatementResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteBankFeedStatementResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteBankFeedStatementResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteBankFeedStatementResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteBankFeedStatementResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteBankFeedStatementResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteBankFeedStatementResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteBankFeedStatementResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteBankFeedStatementResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteBankFeedStatementResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteBankFeedStatementResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteBankFeedStatementResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteBankFeedStatementResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteBankFeedStatementResponse build() { - return new DeleteBankFeedStatementResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteBillPaymentResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteBillPaymentResponse.java index 0e7b1847..fc80e13a 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteBillPaymentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteBillPaymentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteBillPaymentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteBillPaymentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteBillPaymentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteBillPaymentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteBillPaymentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteBillPaymentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteBillPaymentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteBillPaymentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteBillPaymentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteBillPaymentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteBillPaymentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteBillPaymentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteBillPaymentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteBillPaymentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteBillPaymentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteBillPaymentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteBillPaymentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteBillPaymentResponse build() { - return new DeleteBillPaymentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteBillResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteBillResponse.java index f5842854..5b7e45b3 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteBillResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteBillResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteBillResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteBillResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteBillResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteBillResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteBillResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteBillResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteBillResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteBillResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteBillResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteBillResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteBillResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteBillResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteBillResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteBillResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteBillResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteBillResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteBillResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteBillResponse build() { - return new DeleteBillResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteCommentResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteCommentResponse.java index 2b8708bc..24447034 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteCommentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteCommentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteCommentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteCommentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteCommentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteCommentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteCommentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteCommentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteCommentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteCommentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteCommentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteCommentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteCommentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteCommentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteCommentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteCommentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteCommentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteCommentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteCommentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteCommentResponse build() { - return new DeleteCommentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteCompanyResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteCompanyResponse.java index 1204f311..d504019f 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteCompanyResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteCompanyResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteCompanyResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteCompanyResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteCompanyResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteCompanyResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteCompanyResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteCompanyResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteCompanyResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteCompanyResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteCompanyResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteCompanyResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteCompanyResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteCompanyResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteCompanyResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteCompanyResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteCompanyResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteCompanyResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteCompanyResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteCompanyResponse build() { - return new DeleteCompanyResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteConsumerResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteConsumerResponse.java index 440bcd1a..390f5fdd 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteConsumerResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteConsumerResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class DeleteConsumerResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteConsumerResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") DeleteConsumerResponseData data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull DeleteConsumerResponseData data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteConsumerResponse( long statusCode, - String status, - DeleteConsumerResponseData data) { + @Nonnull String status, + @Nonnull DeleteConsumerResponseData data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public DeleteConsumerResponseData data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteConsumerResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteConsumerResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteConsumerResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public DeleteConsumerResponse withData(DeleteConsumerResponseData data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public DeleteConsumerResponse withData(@Nonnull DeleteConsumerResponseData data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteConsumerResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteConsumerResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteConsumerResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private DeleteConsumerResponseData data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(DeleteConsumerResponseData data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull DeleteConsumerResponseData data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteConsumerResponse build() { - return new DeleteConsumerResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/DeleteConsumerResponseData.java b/src/main/java/com/apideck/unify/models/components/DeleteConsumerResponseData.java index 3ada2fbb..d86fc945 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteConsumerResponseData.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteConsumerResponseData.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -20,25 +20,23 @@ public class DeleteConsumerResponseData { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("consumer_id") - private Optional consumerId; + private String consumerId; @JsonCreator public DeleteConsumerResponseData( - @JsonProperty("consumer_id") Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + @JsonProperty("consumer_id") @Nullable String consumerId) { this.consumerId = consumerId; } public DeleteConsumerResponseData() { - this(Optional.empty()); + this(null); } /** * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } public static Builder builder() { @@ -49,22 +47,12 @@ public static Builder builder() { /** * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. */ - public DeleteConsumerResponseData withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. - */ - public DeleteConsumerResponseData withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public DeleteConsumerResponseData withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -93,33 +81,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; private Builder() { // force use of static builder() method } - - /** - * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID. */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } public DeleteConsumerResponseData build() { - return new DeleteConsumerResponseData( consumerId); } diff --git a/src/main/java/com/apideck/unify/models/components/DeleteContactResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteContactResponse.java index 68665230..a8888b2f 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteContactResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteContactResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteContactResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteContactResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteContactResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteContactResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteContactResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteContactResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteContactResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteContactResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteContactResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteContactResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteContactResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteContactResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteContactResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteContactResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteContactResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteContactResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteContactResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteContactResponse build() { - return new DeleteContactResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteCreditNoteResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteCreditNoteResponse.java index 59c6839b..afd0f558 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteCreditNoteResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteCreditNoteResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteCreditNoteResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteCreditNoteResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteCreditNoteResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteCreditNoteResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteCreditNoteResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteCreditNoteResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteCreditNoteResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteCreditNoteResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteCreditNoteResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteCreditNoteResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteCreditNoteResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteCreditNoteResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteCreditNoteResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteCreditNoteResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteCreditNoteResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteCreditNoteResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteCreditNoteResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteCreditNoteResponse build() { - return new DeleteCreditNoteResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteCustomObjectResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteCustomObjectResponse.java index b7894760..4d3062db 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteCustomObjectResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteCustomObjectResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteCustomObjectResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteCustomObjectResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteCustomObjectResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteCustomObjectResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteCustomObjectResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteCustomObjectResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteCustomObjectResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteCustomObjectResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteCustomObjectResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteCustomObjectResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteCustomObjectResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteCustomObjectResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteCustomObjectResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteCustomObjectResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteCustomObjectResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteCustomObjectResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteCustomObjectResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteCustomObjectResponse build() { - return new DeleteCustomObjectResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteCustomObjectSchemaResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteCustomObjectSchemaResponse.java index 42fdd5b7..54adfdee 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteCustomObjectSchemaResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteCustomObjectSchemaResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteCustomObjectSchemaResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteCustomObjectSchemaResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteCustomObjectSchemaResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteCustomObjectSchemaResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteCustomObjectSchemaResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteCustomObjectSchemaResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteCustomObjectSchemaResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteCustomObjectSchemaResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteCustomObjectSchemaResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteCustomObjectSchemaResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteCustomObjectSchemaResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteCustomObjectSchemaResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteCustomObjectSchemaResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteCustomObjectSchemaResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteCustomObjectSchemaResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteCustomObjectSchemaResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteCustomObjectSchemaResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteCustomObjectSchemaResponse build() { - return new DeleteCustomObjectSchemaResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteCustomerResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteCustomerResponse.java index 5709a8da..10173632 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteCustomerResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteCustomerResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteCustomerResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteCustomerResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteCustomerResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteCustomerResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteCustomerResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteCustomerResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteCustomerResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteCustomerResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteCustomerResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteCustomerResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteCustomerResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteCustomerResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteCustomerResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteCustomerResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteCustomerResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteCustomerResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteCustomerResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteCustomerResponse build() { - return new DeleteCustomerResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteDepartmentResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteDepartmentResponse.java index 1d82257c..671dda37 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteDepartmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteDepartmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteDepartmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteDepartmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteDepartmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteDepartmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteDepartmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteDepartmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteDepartmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteDepartmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteDepartmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteDepartmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteDepartmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteDepartmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteDepartmentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteDepartmentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteDepartmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteDepartmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteDepartmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteDepartmentResponse build() { - return new DeleteDepartmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteDriveGroupResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteDriveGroupResponse.java index 8f695259..5fbd8595 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteDriveGroupResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteDriveGroupResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteDriveGroupResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteDriveGroupResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteDriveGroupResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteDriveGroupResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteDriveGroupResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteDriveGroupResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteDriveGroupResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteDriveGroupResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteDriveGroupResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteDriveGroupResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteDriveGroupResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteDriveGroupResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteDriveGroupResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteDriveGroupResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteDriveGroupResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteDriveGroupResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteDriveGroupResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteDriveGroupResponse build() { - return new DeleteDriveGroupResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteDriveResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteDriveResponse.java index 3e67fe72..0dd32005 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteDriveResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteDriveResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteDriveResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteDriveResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteDriveResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteDriveResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteDriveResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteDriveResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteDriveResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteDriveResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteDriveResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteDriveResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteDriveResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteDriveResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteDriveResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteDriveResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteDriveResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteDriveResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteDriveResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteDriveResponse build() { - return new DeleteDriveResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteEmployeeResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteEmployeeResponse.java index c489e354..e32afa9c 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteEmployeeResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteEmployeeResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteEmployeeResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteEmployeeResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteEmployeeResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteEmployeeResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteEmployeeResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteEmployeeResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteEmployeeResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteEmployeeResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteEmployeeResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteEmployeeResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteEmployeeResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteEmployeeResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteEmployeeResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteEmployeeResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteEmployeeResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteEmployeeResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteEmployeeResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteEmployeeResponse build() { - return new DeleteEmployeeResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteExpenseResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteExpenseResponse.java index 19126bbb..23a158c9 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteExpenseResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteExpenseResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteExpenseResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteExpenseResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteExpenseResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteExpenseResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteExpenseResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteExpenseResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteExpenseResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteExpenseResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteExpenseResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteExpenseResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteExpenseResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteExpenseResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteExpenseResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteExpenseResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteExpenseResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteExpenseResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteExpenseResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteExpenseResponse build() { - return new DeleteExpenseResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteFileResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteFileResponse.java index bfc8fa72..00fa3a05 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteFileResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteFileResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteFileResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteFileResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteFileResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteFileResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteFileResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteFileResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteFileResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteFileResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteFileResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteFileResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteFileResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteFileResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteFileResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteFileResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteFileResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteFileResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteFileResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteFileResponse build() { - return new DeleteFileResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteFolderResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteFolderResponse.java index e7768f53..42b7562f 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteFolderResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteFolderResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteFolderResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteFolderResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteFolderResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteFolderResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteFolderResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteFolderResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteFolderResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteFolderResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteFolderResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteFolderResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteFolderResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteFolderResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteFolderResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteFolderResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteFolderResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteFolderResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteFolderResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteFolderResponse build() { - return new DeleteFolderResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteHrisCompanyResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteHrisCompanyResponse.java index 477c8dce..a7f12733 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteHrisCompanyResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteHrisCompanyResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteHrisCompanyResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteHrisCompanyResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteHrisCompanyResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteHrisCompanyResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteHrisCompanyResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteHrisCompanyResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteHrisCompanyResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteHrisCompanyResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteHrisCompanyResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteHrisCompanyResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteHrisCompanyResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteHrisCompanyResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteHrisCompanyResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteHrisCompanyResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteHrisCompanyResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteHrisCompanyResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteHrisCompanyResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteHrisCompanyResponse build() { - return new DeleteHrisCompanyResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteInvoiceResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteInvoiceResponse.java index 32781db9..7323a80c 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteInvoiceResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteInvoiceResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class DeleteInvoiceResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteInvoiceResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") InvoiceResponse data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull InvoiceResponse data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteInvoiceResponse( long statusCode, - String status, - String service, - String resource, - String operation, - InvoiceResponse data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull InvoiceResponse data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public InvoiceResponse data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteInvoiceResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteInvoiceResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteInvoiceResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteInvoiceResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteInvoiceResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteInvoiceResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteInvoiceResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteInvoiceResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteInvoiceResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public DeleteInvoiceResponse withData(InvoiceResponse data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public DeleteInvoiceResponse withData(@Nonnull InvoiceResponse data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteInvoiceResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteInvoiceResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteInvoiceResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private InvoiceResponse data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(InvoiceResponse data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull InvoiceResponse data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteInvoiceResponse build() { - return new DeleteInvoiceResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteJournalEntryResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteJournalEntryResponse.java index 1eb135b9..299167dc 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteJournalEntryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteJournalEntryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteJournalEntryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteJournalEntryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteJournalEntryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteJournalEntryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteJournalEntryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteJournalEntryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteJournalEntryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteJournalEntryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteJournalEntryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteJournalEntryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteJournalEntryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteJournalEntryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteJournalEntryResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteJournalEntryResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteJournalEntryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteJournalEntryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteJournalEntryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteJournalEntryResponse build() { - return new DeleteJournalEntryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteLeadResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteLeadResponse.java index 08a6bc70..a6a52d02 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteLeadResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteLeadResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteLeadResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteLeadResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteLeadResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteLeadResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteLeadResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteLeadResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteLeadResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteLeadResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteLeadResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteLeadResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteLeadResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteLeadResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteLeadResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteLeadResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteLeadResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteLeadResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteLeadResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteLeadResponse build() { - return new DeleteLeadResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteLedgerAccountResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteLedgerAccountResponse.java index 1326835e..5f8e0aaa 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteLedgerAccountResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteLedgerAccountResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteLedgerAccountResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteLedgerAccountResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteLedgerAccountResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteLedgerAccountResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteLedgerAccountResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteLedgerAccountResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteLedgerAccountResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteLedgerAccountResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteLedgerAccountResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteLedgerAccountResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteLedgerAccountResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteLedgerAccountResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteLedgerAccountResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteLedgerAccountResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteLedgerAccountResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteLedgerAccountResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteLedgerAccountResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteLedgerAccountResponse build() { - return new DeleteLedgerAccountResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteMessageResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteMessageResponse.java index 5c439306..44b8fac9 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteMessageResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteMessageResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteMessageResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteMessageResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteMessageResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteMessageResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteMessageResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteMessageResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteMessageResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteMessageResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteMessageResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteMessageResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteMessageResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteMessageResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteMessageResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteMessageResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteMessageResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteMessageResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteMessageResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteMessageResponse build() { - return new DeleteMessageResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteNoteResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteNoteResponse.java index 7933b636..92fd0f03 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteNoteResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteNoteResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteNoteResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteNoteResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteNoteResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteNoteResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteNoteResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteNoteResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteNoteResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteNoteResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteNoteResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteNoteResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteNoteResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteNoteResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteNoteResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteNoteResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteNoteResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteNoteResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteNoteResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteNoteResponse build() { - return new DeleteNoteResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteOpportunityResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteOpportunityResponse.java index 45e563fe..adda4fc0 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteOpportunityResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteOpportunityResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteOpportunityResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteOpportunityResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteOpportunityResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteOpportunityResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteOpportunityResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteOpportunityResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteOpportunityResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteOpportunityResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteOpportunityResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteOpportunityResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteOpportunityResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteOpportunityResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteOpportunityResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteOpportunityResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteOpportunityResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteOpportunityResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteOpportunityResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteOpportunityResponse build() { - return new DeleteOpportunityResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeletePaymentResponse.java b/src/main/java/com/apideck/unify/models/components/DeletePaymentResponse.java index f5740c2a..16c02714 100644 --- a/src/main/java/com/apideck/unify/models/components/DeletePaymentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeletePaymentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeletePaymentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeletePaymentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeletePaymentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeletePaymentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeletePaymentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeletePaymentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeletePaymentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeletePaymentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeletePaymentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeletePaymentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeletePaymentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeletePaymentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeletePaymentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeletePaymentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeletePaymentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeletePaymentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeletePaymentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeletePaymentResponse build() { - return new DeletePaymentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeletePipelineResponse.java b/src/main/java/com/apideck/unify/models/components/DeletePipelineResponse.java index 8ca85953..fbd91e2c 100644 --- a/src/main/java/com/apideck/unify/models/components/DeletePipelineResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeletePipelineResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeletePipelineResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeletePipelineResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeletePipelineResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeletePipelineResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeletePipelineResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeletePipelineResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeletePipelineResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeletePipelineResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeletePipelineResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeletePipelineResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeletePipelineResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeletePipelineResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeletePipelineResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeletePipelineResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeletePipelineResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeletePipelineResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeletePipelineResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeletePipelineResponse build() { - return new DeletePipelineResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeletePurchaseOrderResponse.java b/src/main/java/com/apideck/unify/models/components/DeletePurchaseOrderResponse.java index 78761bd6..dbf554cc 100644 --- a/src/main/java/com/apideck/unify/models/components/DeletePurchaseOrderResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeletePurchaseOrderResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeletePurchaseOrderResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeletePurchaseOrderResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeletePurchaseOrderResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeletePurchaseOrderResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeletePurchaseOrderResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeletePurchaseOrderResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeletePurchaseOrderResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeletePurchaseOrderResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeletePurchaseOrderResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeletePurchaseOrderResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeletePurchaseOrderResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeletePurchaseOrderResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeletePurchaseOrderResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeletePurchaseOrderResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeletePurchaseOrderResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeletePurchaseOrderResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeletePurchaseOrderResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeletePurchaseOrderResponse build() { - return new DeletePurchaseOrderResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteSharedLinkResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteSharedLinkResponse.java index dfc23f85..152e9175 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteSharedLinkResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteSharedLinkResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteSharedLinkResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteSharedLinkResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteSharedLinkResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteSharedLinkResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteSharedLinkResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteSharedLinkResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteSharedLinkResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteSharedLinkResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteSharedLinkResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteSharedLinkResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteSharedLinkResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteSharedLinkResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteSharedLinkResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteSharedLinkResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteSharedLinkResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteSharedLinkResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteSharedLinkResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteSharedLinkResponse build() { - return new DeleteSharedLinkResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteSubsidiaryResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteSubsidiaryResponse.java index bfd6c78d..d7072fb9 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteSubsidiaryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteSubsidiaryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteSubsidiaryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteSubsidiaryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteSubsidiaryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteSubsidiaryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteSubsidiaryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteSubsidiaryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteSubsidiaryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteSubsidiaryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteSubsidiaryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteSubsidiaryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteSubsidiaryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteSubsidiaryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteSubsidiaryResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteSubsidiaryResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteSubsidiaryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteSubsidiaryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteSubsidiaryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteSubsidiaryResponse build() { - return new DeleteSubsidiaryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteSupplierResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteSupplierResponse.java index 0f32f1dd..99eb3a76 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteSupplierResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteSupplierResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteSupplierResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteSupplierResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteSupplierResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteSupplierResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteSupplierResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteSupplierResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteSupplierResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteSupplierResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteSupplierResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteSupplierResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteSupplierResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteSupplierResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteSupplierResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteSupplierResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteSupplierResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteSupplierResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteSupplierResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteSupplierResponse build() { - return new DeleteSupplierResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteTaxRateResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteTaxRateResponse.java index 30bc9f53..de58aaba 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteTaxRateResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteTaxRateResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteTaxRateResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteTaxRateResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteTaxRateResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteTaxRateResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteTaxRateResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteTaxRateResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteTaxRateResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteTaxRateResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteTaxRateResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteTaxRateResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteTaxRateResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteTaxRateResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteTaxRateResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteTaxRateResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteTaxRateResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteTaxRateResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteTaxRateResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteTaxRateResponse build() { - return new DeleteTaxRateResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteTicketResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteTicketResponse.java index 48c78f64..09680238 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteTicketResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteTicketResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteTicketResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteTicketResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteTicketResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteTicketResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteTicketResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteTicketResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteTicketResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteTicketResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteTicketResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteTicketResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteTicketResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteTicketResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteTicketResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteTicketResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteTicketResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteTicketResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteTicketResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteTicketResponse build() { - return new DeleteTicketResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteTimeOffRequestResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteTimeOffRequestResponse.java index 68e35a3c..4ecbb5c3 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteTimeOffRequestResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteTimeOffRequestResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteTimeOffRequestResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteTimeOffRequestResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteTimeOffRequestResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteTimeOffRequestResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteTimeOffRequestResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteTimeOffRequestResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteTimeOffRequestResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteTimeOffRequestResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteTimeOffRequestResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteTimeOffRequestResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteTimeOffRequestResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteTimeOffRequestResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteTimeOffRequestResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteTimeOffRequestResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteTimeOffRequestResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteTimeOffRequestResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteTimeOffRequestResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteTimeOffRequestResponse build() { - return new DeleteTimeOffRequestResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteTrackingCategoryResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteTrackingCategoryResponse.java index 58d3d094..3b0ea0fa 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteTrackingCategoryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteTrackingCategoryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteTrackingCategoryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteTrackingCategoryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteTrackingCategoryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteTrackingCategoryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteTrackingCategoryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteTrackingCategoryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteTrackingCategoryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteTrackingCategoryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteTrackingCategoryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteTrackingCategoryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteTrackingCategoryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteTrackingCategoryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteTrackingCategoryResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteTrackingCategoryResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteTrackingCategoryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteTrackingCategoryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteTrackingCategoryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteTrackingCategoryResponse build() { - return new DeleteTrackingCategoryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteUploadSessionResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteUploadSessionResponse.java index 21de6dcd..cad3540c 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteUploadSessionResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteUploadSessionResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteUploadSessionResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteUploadSessionResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteUploadSessionResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteUploadSessionResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteUploadSessionResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteUploadSessionResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteUploadSessionResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteUploadSessionResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteUploadSessionResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteUploadSessionResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteUploadSessionResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteUploadSessionResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteUploadSessionResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteUploadSessionResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteUploadSessionResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteUploadSessionResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteUploadSessionResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteUploadSessionResponse build() { - return new DeleteUploadSessionResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteUserResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteUserResponse.java index 631b832e..0ace3ee3 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteUserResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteUserResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class DeleteUserResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteUserResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteUserResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteUserResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteUserResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteUserResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public DeleteUserResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public DeleteUserResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public DeleteUserResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public DeleteUserResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public DeleteUserResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public DeleteUserResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public DeleteUserResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public DeleteUserResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteUserResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteUserResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteUserResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteUserResponse build() { - return new DeleteUserResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/DeleteWebhookResponse.java b/src/main/java/com/apideck/unify/models/components/DeleteWebhookResponse.java index 696f370c..42fffeda 100644 --- a/src/main/java/com/apideck/unify/models/components/DeleteWebhookResponse.java +++ b/src/main/java/com/apideck/unify/models/components/DeleteWebhookResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class DeleteWebhookResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public DeleteWebhookResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Webhook data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Webhook data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public DeleteWebhookResponse( long statusCode, - String status, - Webhook data) { + @Nonnull String status, + @Nonnull Webhook data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Webhook data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public DeleteWebhookResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public DeleteWebhookResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public DeleteWebhookResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public DeleteWebhookResponse withData(Webhook data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public DeleteWebhookResponse withData(@Nonnull Webhook data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public DeleteWebhookResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public DeleteWebhookResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public DeleteWebhookResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Webhook data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Webhook data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Webhook data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public DeleteWebhookResponse build() { - return new DeleteWebhookResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/Department.java b/src/main/java/com/apideck/unify/models/components/Department.java index 766476c8..acfa770a 100644 --- a/src/main/java/com/apideck/unify/models/components/Department.java +++ b/src/main/java/com/apideck/unify/models/components/Department.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -26,7 +25,7 @@ public class Department { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Parent ID @@ -57,7 +56,7 @@ public class Department { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -92,134 +91,119 @@ public class Department { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Department( - @JsonProperty("id") Optional id, - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("name") JsonNullable name, - @JsonProperty("code") JsonNullable code, - @JsonProperty("description") JsonNullable description, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.parentId = parentId; - this.name = name; - this.code = code; - this.description = description; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Department() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Parent ID */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * Department name */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -230,191 +214,96 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Department withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Department withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Department withId(@Nullable String id) { this.id = id; return this; } + /** * Parent ID */ - public Department withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Department withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * Parent ID - */ - public Department withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * Department name */ - public Department withName(String name) { - Utils.checkNotNull(name, "name"); + public Department withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Department name - */ - public Department withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public Department withCode(String code) { - Utils.checkNotNull(code, "code"); + public Department withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - public Department withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - public Department withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Department withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - public Department withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Department withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Department withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Department withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public Department withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Department withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Department withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Department withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Department withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Department withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Department withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Department withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Department withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Department withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Department withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Department withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Department withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Department withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Department withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -466,231 +355,115 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Parent ID */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * Parent ID - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * Department name */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Department name - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Department build() { - return new Department( id, parentId, name, code, description, customMappings, diff --git a/src/main/java/com/apideck/unify/models/components/DepartmentInput.java b/src/main/java/com/apideck/unify/models/components/DepartmentInput.java index 6f925b26..2b656b1c 100644 --- a/src/main/java/com/apideck/unify/models/components/DepartmentInput.java +++ b/src/main/java/com/apideck/unify/models/components/DepartmentInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -40,54 +39,48 @@ public class DepartmentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public DepartmentInput( - @JsonProperty("name") JsonNullable name, - @JsonProperty("code") JsonNullable code, - @JsonProperty("description") JsonNullable description, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; - this.code = code; - this.description = description; + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public DepartmentInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null); } /** * Department name */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -98,64 +91,33 @@ public static Builder builder() { /** * Department name */ - public DepartmentInput withName(String name) { - Utils.checkNotNull(name, "name"); + public DepartmentInput withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Department name - */ - public DepartmentInput withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public DepartmentInput withCode(String code) { - Utils.checkNotNull(code, "code"); + public DepartmentInput withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - public DepartmentInput withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - public DepartmentInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public DepartmentInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - public DepartmentInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public DepartmentInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public DepartmentInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public DepartmentInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -191,84 +153,45 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Department name */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Department name - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public DepartmentInput build() { - return new DepartmentInput( name, code, description, passThrough); diff --git a/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedSupplier.java b/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedSupplier.java index 95bc3b0e..ce01d2ef 100644 --- a/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedSupplier.java +++ b/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedSupplier.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Deprecated; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +29,7 @@ public class DeprecatedLinkedSupplier { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The display ID of the supplier. @@ -56,68 +55,60 @@ public class DeprecatedLinkedSupplier { @JsonInclude(Include.NON_ABSENT) @JsonProperty("address") - private Optional address; + private Address address; @JsonCreator public DeprecatedLinkedSupplier( - @JsonProperty("id") Optional id, - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("address") Optional address) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(address, "address"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("address") @Nullable Address address) { this.id = id; - this.displayId = displayId; - this.displayName = displayName; - this.companyName = companyName; + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); this.address = address; } public DeprecatedLinkedSupplier() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The display ID of the supplier. */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * The display name of the supplier. */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * The company name of the supplier. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
address() { - return (Optional
) address; + return Optional.ofNullable(this.address); } public static Builder builder() { @@ -128,89 +119,45 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public DeprecatedLinkedSupplier withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public DeprecatedLinkedSupplier withId(Optional id) { - Utils.checkNotNull(id, "id"); + public DeprecatedLinkedSupplier withId(@Nullable String id) { this.id = id; return this; } + /** * The display ID of the supplier. */ - public DeprecatedLinkedSupplier withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public DeprecatedLinkedSupplier withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * The display ID of the supplier. - */ - public DeprecatedLinkedSupplier withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } /** * The display name of the supplier. */ - public DeprecatedLinkedSupplier withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public DeprecatedLinkedSupplier withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the supplier. - */ - public DeprecatedLinkedSupplier withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } /** * The company name of the supplier. */ - public DeprecatedLinkedSupplier withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public DeprecatedLinkedSupplier withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The company name of the supplier. - */ - public DeprecatedLinkedSupplier withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - public DeprecatedLinkedSupplier withAddress(Address address) { - Utils.checkNotNull(address, "address"); - this.address = Optional.ofNullable(address); - return this; - } - - - public DeprecatedLinkedSupplier withAddress(Optional address) { - Utils.checkNotNull(address, "address"); + public DeprecatedLinkedSupplier withAddress(@Nullable Address address) { this.address = address; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -248,111 +195,58 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private Optional address = Optional.empty(); + private Address address; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The display ID of the supplier. */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * The display ID of the supplier. - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * The display name of the supplier. */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the supplier. - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * The company name of the supplier. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The company name of the supplier. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - - public Builder address(Address address) { - Utils.checkNotNull(address, "address"); - this.address = Optional.ofNullable(address); - return this; - } - - public Builder address(Optional address) { - Utils.checkNotNull(address, "address"); + public Builder address(@Nullable Address address) { this.address = address; return this; } public DeprecatedLinkedSupplier build() { - return new DeprecatedLinkedSupplier( id, displayId, displayName, companyName, address); diff --git a/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedSupplierInput.java b/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedSupplierInput.java index b2c3a1be..556831b9 100644 --- a/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedSupplierInput.java +++ b/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedSupplierInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Deprecated; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -35,34 +34,30 @@ public class DeprecatedLinkedSupplierInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("address") - private Optional address; + private Address address; @JsonCreator public DeprecatedLinkedSupplierInput( - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("address") Optional address) { - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(address, "address"); - this.displayName = displayName; + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("address") @Nullable Address address) { + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); this.address = address; } public DeprecatedLinkedSupplierInput() { - this(JsonNullable.undefined(), Optional.empty()); + this(null, null); } /** * The display name of the supplier. */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
address() { - return (Optional
) address; + return Optional.ofNullable(this.address); } public static Builder builder() { @@ -73,34 +68,18 @@ public static Builder builder() { /** * The display name of the supplier. */ - public DeprecatedLinkedSupplierInput withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public DeprecatedLinkedSupplierInput withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the supplier. - */ - public DeprecatedLinkedSupplierInput withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - public DeprecatedLinkedSupplierInput withAddress(Address address) { - Utils.checkNotNull(address, "address"); - this.address = Optional.ofNullable(address); - return this; - } - - - public DeprecatedLinkedSupplierInput withAddress(Optional address) { - Utils.checkNotNull(address, "address"); + public DeprecatedLinkedSupplierInput withAddress(@Nullable Address address) { this.address = address; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -131,48 +110,28 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private Optional address = Optional.empty(); + private Address address; private Builder() { // force use of static builder() method } - /** * The display name of the supplier. */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the supplier. - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - - public Builder address(Address address) { - Utils.checkNotNull(address, "address"); - this.address = Optional.ofNullable(address); - return this; - } - - public Builder address(Optional address) { - Utils.checkNotNull(address, "address"); + public Builder address(@Nullable Address address) { this.address = address; return this; } public DeprecatedLinkedSupplierInput build() { - return new DeprecatedLinkedSupplierInput( displayName, address); } diff --git a/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedTrackingCategory.java b/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedTrackingCategory.java index 03946563..5ab687f1 100644 --- a/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedTrackingCategory.java +++ b/src/main/java/com/apideck/unify/models/components/DeprecatedLinkedTrackingCategory.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Deprecated; import java.lang.Override; import java.lang.String; @@ -27,7 +27,7 @@ public class DeprecatedLinkedTrackingCategory { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the tracking category. @@ -38,32 +38,29 @@ public class DeprecatedLinkedTrackingCategory { @JsonCreator public DeprecatedLinkedTrackingCategory( - @JsonProperty("id") Optional id, - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable JsonNullable name) { this.id = id; - this.name = name; + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public DeprecatedLinkedTrackingCategory() { - this(Optional.empty(), JsonNullable.undefined()); + this(null, null); } /** * The unique identifier for the tracking category. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the tracking category. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -74,39 +71,20 @@ public static Builder builder() { /** * The unique identifier for the tracking category. */ - public DeprecatedLinkedTrackingCategory withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier for the tracking category. - */ - public DeprecatedLinkedTrackingCategory withId(Optional id) { - Utils.checkNotNull(id, "id"); + public DeprecatedLinkedTrackingCategory withId(@Nullable String id) { this.id = id; return this; } + /** * The name of the tracking category. */ - public DeprecatedLinkedTrackingCategory withName(String name) { - Utils.checkNotNull(name, "name"); + public DeprecatedLinkedTrackingCategory withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the tracking category. - */ - public DeprecatedLinkedTrackingCategory withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -138,54 +116,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - - /** - * The unique identifier for the tracking category. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The unique identifier for the tracking category. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the tracking category. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the tracking category. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public DeprecatedLinkedTrackingCategory build() { - return new DeprecatedLinkedTrackingCategory( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/Drive.java b/src/main/java/com/apideck/unify/models/components/Drive.java index 120e8b9f..b4305d42 100644 --- a/src/main/java/com/apideck/unify/models/components/Drive.java +++ b/src/main/java/com/apideck/unify/models/components/Drive.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -45,7 +45,7 @@ public class Drive { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -80,119 +80,107 @@ public class Drive { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Drive( - @JsonProperty("id") String id, - @JsonProperty("name") String name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); - this.id = id; - this.name = name; - this.description = description; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("name") @Nonnull String name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Drive( - String id, - String name) { - this(id, name, JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + @Nonnull String id, + @Nonnull String name) { + this(id, name, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The name of the drive */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -203,148 +191,84 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Drive withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Drive withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The name of the drive */ - public Drive withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Drive withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } + /** * A description of the object. */ - public Drive withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Drive withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Drive withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Drive withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Drive withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Drive withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public Drive withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Drive withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Drive withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Drive withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Drive withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Drive withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Drive withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Drive withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Drive withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Drive withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Drive withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Drive withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Drive withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Drive withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Drive withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -395,179 +319,97 @@ public final static class Builder { private String name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The name of the drive */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Drive build() { - return new Drive( id, name, description, customMappings, updatedBy, createdBy, diff --git a/src/main/java/com/apideck/unify/models/components/DriveGroup.java b/src/main/java/com/apideck/unify/models/components/DriveGroup.java index f8f87921..843cb4d5 100644 --- a/src/main/java/com/apideck/unify/models/components/DriveGroup.java +++ b/src/main/java/com/apideck/unify/models/components/DriveGroup.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -52,7 +52,7 @@ public class DriveGroup { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -87,131 +87,118 @@ public class DriveGroup { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public DriveGroup( - @JsonProperty("id") String id, - @JsonProperty("name") String name, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("description") JsonNullable description, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); - this.id = id; - this.name = name; - this.displayName = displayName; - this.description = description; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("name") @Nonnull String name, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public DriveGroup( - String id, - String name) { - this(id, name, JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + @Nonnull String id, + @Nonnull String name) { + this(id, name, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The name of the drive group */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * The display name of the drive group */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -222,166 +209,93 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public DriveGroup withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public DriveGroup withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The name of the drive group */ - public DriveGroup withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public DriveGroup withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } + /** * The display name of the drive group */ - public DriveGroup withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public DriveGroup withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the drive group - */ - public DriveGroup withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } /** * A description of the object. */ - public DriveGroup withDescription(String description) { - Utils.checkNotNull(description, "description"); + public DriveGroup withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public DriveGroup withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public DriveGroup withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public DriveGroup withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public DriveGroup withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public DriveGroup withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public DriveGroup withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public DriveGroup withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public DriveGroup withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public DriveGroup withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public DriveGroup withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public DriveGroup withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public DriveGroup withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public DriveGroup withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public DriveGroup withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public DriveGroup withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public DriveGroup withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public DriveGroup withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public DriveGroup withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public DriveGroup withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -435,200 +349,107 @@ public final static class Builder { private String name; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The name of the drive group */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** * The display name of the drive group */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the drive group - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public DriveGroup build() { - return new DriveGroup( id, name, displayName, description, customMappings, updatedBy, diff --git a/src/main/java/com/apideck/unify/models/components/DriveGroupInput.java b/src/main/java/com/apideck/unify/models/components/DriveGroupInput.java index 79090063..42489055 100644 --- a/src/main/java/com/apideck/unify/models/components/DriveGroupInput.java +++ b/src/main/java/com/apideck/unify/models/components/DriveGroupInput.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -43,61 +43,55 @@ public class DriveGroupInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public DriveGroupInput( - @JsonProperty("name") String name, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("description") JsonNullable description, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; - this.displayName = displayName; - this.description = description; + @JsonProperty("name") @Nonnull String name, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public DriveGroupInput( - String name) { - this(name, JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + @Nonnull String name) { + this(name, null, null, + null); } /** * The name of the drive group */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * The display name of the drive group */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -108,67 +102,39 @@ public static Builder builder() { /** * The name of the drive group */ - public DriveGroupInput withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public DriveGroupInput withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } + /** * The display name of the drive group */ - public DriveGroupInput withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public DriveGroupInput withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the drive group - */ - public DriveGroupInput withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } /** * A description of the object. */ - public DriveGroupInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public DriveGroupInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public DriveGroupInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public DriveGroupInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public DriveGroupInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public DriveGroupInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -206,85 +172,49 @@ public final static class Builder { private String name; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The name of the drive group */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** * The display name of the drive group */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the drive group - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public DriveGroupInput build() { - return new DriveGroupInput( name, displayName, description, passThrough); diff --git a/src/main/java/com/apideck/unify/models/components/DriveGroupsFilter.java b/src/main/java/com/apideck/unify/models/components/DriveGroupsFilter.java index 54a5e4eb..93da15e4 100644 --- a/src/main/java/com/apideck/unify/models/components/DriveGroupsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/DriveGroupsFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,25 +17,23 @@ public class DriveGroupsFilter { * ID of the drive group to filter on */ @SpeakeasyMetadata("queryParam:name=parent_group_id") - private Optional parentGroupId; + private String parentGroupId; @JsonCreator public DriveGroupsFilter( - Optional parentGroupId) { - Utils.checkNotNull(parentGroupId, "parentGroupId"); + @Nullable String parentGroupId) { this.parentGroupId = parentGroupId; } public DriveGroupsFilter() { - this(Optional.empty()); + this(null); } /** * ID of the drive group to filter on */ - @JsonIgnore public Optional parentGroupId() { - return parentGroupId; + return Optional.ofNullable(this.parentGroupId); } public static Builder builder() { @@ -46,22 +44,12 @@ public static Builder builder() { /** * ID of the drive group to filter on */ - public DriveGroupsFilter withParentGroupId(String parentGroupId) { - Utils.checkNotNull(parentGroupId, "parentGroupId"); - this.parentGroupId = Optional.ofNullable(parentGroupId); - return this; - } - - - /** - * ID of the drive group to filter on - */ - public DriveGroupsFilter withParentGroupId(Optional parentGroupId) { - Utils.checkNotNull(parentGroupId, "parentGroupId"); + public DriveGroupsFilter withParentGroupId(@Nullable String parentGroupId) { this.parentGroupId = parentGroupId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,33 +78,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional parentGroupId = Optional.empty(); + private String parentGroupId; private Builder() { // force use of static builder() method } - - /** - * ID of the drive group to filter on - */ - public Builder parentGroupId(String parentGroupId) { - Utils.checkNotNull(parentGroupId, "parentGroupId"); - this.parentGroupId = Optional.ofNullable(parentGroupId); - return this; - } - /** * ID of the drive group to filter on */ - public Builder parentGroupId(Optional parentGroupId) { - Utils.checkNotNull(parentGroupId, "parentGroupId"); + public Builder parentGroupId(@Nullable String parentGroupId) { this.parentGroupId = parentGroupId; return this; } public DriveGroupsFilter build() { - return new DriveGroupsFilter( parentGroupId); } diff --git a/src/main/java/com/apideck/unify/models/components/DriveInput.java b/src/main/java/com/apideck/unify/models/components/DriveInput.java index 6d30beae..70b78121 100644 --- a/src/main/java/com/apideck/unify/models/components/DriveInput.java +++ b/src/main/java/com/apideck/unify/models/components/DriveInput.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -36,49 +36,44 @@ public class DriveInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public DriveInput( - @JsonProperty("name") String name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; - this.description = description; + @JsonProperty("name") @Nonnull String name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public DriveInput( - String name) { - this(name, JsonNullable.undefined(), Optional.empty()); + @Nonnull String name) { + this(name, null, null); } /** * The name of the drive */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -89,36 +84,17 @@ public static Builder builder() { /** * The name of the drive */ - public DriveInput withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public DriveInput withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** - * A description of the object. - */ - public DriveInput withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = JsonNullable.of(description); - return this; - } /** * A description of the object. */ - public DriveInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public DriveInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public DriveInput withDescription(@Nullable String description) { + this.description = JsonNullable.of(description); return this; } @@ -126,12 +102,12 @@ public DriveInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public DriveInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public DriveInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -166,64 +142,39 @@ public final static class Builder { private String name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The name of the drive */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public DriveInput build() { - return new DriveInput( name, description, passThrough); } diff --git a/src/main/java/com/apideck/unify/models/components/DrivesFilter.java b/src/main/java/com/apideck/unify/models/components/DrivesFilter.java index 62f7ae19..2e1478e8 100644 --- a/src/main/java/com/apideck/unify/models/components/DrivesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/DrivesFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,25 +17,23 @@ public class DrivesFilter { * ID of the drive group to filter on */ @SpeakeasyMetadata("queryParam:name=group_id") - private Optional groupId; + private String groupId; @JsonCreator public DrivesFilter( - Optional groupId) { - Utils.checkNotNull(groupId, "groupId"); + @Nullable String groupId) { this.groupId = groupId; } public DrivesFilter() { - this(Optional.empty()); + this(null); } /** * ID of the drive group to filter on */ - @JsonIgnore public Optional groupId() { - return groupId; + return Optional.ofNullable(this.groupId); } public static Builder builder() { @@ -46,22 +44,12 @@ public static Builder builder() { /** * ID of the drive group to filter on */ - public DrivesFilter withGroupId(String groupId) { - Utils.checkNotNull(groupId, "groupId"); - this.groupId = Optional.ofNullable(groupId); - return this; - } - - - /** - * ID of the drive group to filter on - */ - public DrivesFilter withGroupId(Optional groupId) { - Utils.checkNotNull(groupId, "groupId"); + public DrivesFilter withGroupId(@Nullable String groupId) { this.groupId = groupId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,33 +78,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional groupId = Optional.empty(); + private String groupId; private Builder() { // force use of static builder() method } - - /** - * ID of the drive group to filter on - */ - public Builder groupId(String groupId) { - Utils.checkNotNull(groupId, "groupId"); - this.groupId = Optional.ofNullable(groupId); - return this; - } - /** * ID of the drive group to filter on */ - public Builder groupId(Optional groupId) { - Utils.checkNotNull(groupId, "groupId"); + public Builder groupId(@Nullable String groupId) { this.groupId = groupId; return this; } public DrivesFilter build() { - return new DrivesFilter( groupId); } diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceAddress.java b/src/main/java/com/apideck/unify/models/components/EcommerceAddress.java index 3e2b3476..f4a5bc88 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceAddress.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceAddress.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -70,89 +71,82 @@ public class EcommerceAddress { @JsonCreator public EcommerceAddress( - @JsonProperty("line1") JsonNullable line1, - @JsonProperty("line2") JsonNullable line2, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("city") JsonNullable city, - @JsonProperty("state") JsonNullable state, - @JsonProperty("postal_code") JsonNullable postalCode, - @JsonProperty("country") JsonNullable country) { - Utils.checkNotNull(line1, "line1"); - Utils.checkNotNull(line2, "line2"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(city, "city"); - Utils.checkNotNull(state, "state"); - Utils.checkNotNull(postalCode, "postalCode"); - Utils.checkNotNull(country, "country"); - this.line1 = line1; - this.line2 = line2; - this.companyName = companyName; - this.city = city; - this.state = state; - this.postalCode = postalCode; - this.country = country; + @JsonProperty("line1") @Nullable JsonNullable line1, + @JsonProperty("line2") @Nullable JsonNullable line2, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("city") @Nullable JsonNullable city, + @JsonProperty("state") @Nullable JsonNullable state, + @JsonProperty("postal_code") @Nullable JsonNullable postalCode, + @JsonProperty("country") @Nullable JsonNullable country) { + this.line1 = Optional.ofNullable(line1) + .orElse(JsonNullable.undefined()); + this.line2 = Optional.ofNullable(line2) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.city = Optional.ofNullable(city) + .orElse(JsonNullable.undefined()); + this.state = Optional.ofNullable(state) + .orElse(JsonNullable.undefined()); + this.postalCode = Optional.ofNullable(postalCode) + .orElse(JsonNullable.undefined()); + this.country = Optional.ofNullable(country) + .orElse(JsonNullable.undefined()); } public EcommerceAddress() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null); } /** * Address line 1 of the billing address. */ - @JsonIgnore public JsonNullable line1() { - return line1; + return this.line1; } /** * Address line 2 of the billing address. */ - @JsonIgnore public JsonNullable line2() { - return line2; + return this.line2; } /** * Company name of the customer */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * City of the billing address. */ - @JsonIgnore public JsonNullable city() { - return city; + return this.city; } /** * State/province of the billing address. */ - @JsonIgnore public JsonNullable state() { - return state; + return this.state; } /** * Postal/ZIP code of the billing address. */ - @JsonIgnore public JsonNullable postalCode() { - return postalCode; + return this.postalCode; } /** * Country of the billing address. */ - @JsonIgnore public JsonNullable country() { - return country; + return this.country; } public static Builder builder() { @@ -163,128 +157,65 @@ public static Builder builder() { /** * Address line 1 of the billing address. */ - public EcommerceAddress withLine1(String line1) { - Utils.checkNotNull(line1, "line1"); + public EcommerceAddress withLine1(@Nullable String line1) { this.line1 = JsonNullable.of(line1); return this; } - /** - * Address line 1 of the billing address. - */ - public EcommerceAddress withLine1(JsonNullable line1) { - Utils.checkNotNull(line1, "line1"); - this.line1 = line1; - return this; - } /** * Address line 2 of the billing address. */ - public EcommerceAddress withLine2(String line2) { - Utils.checkNotNull(line2, "line2"); + public EcommerceAddress withLine2(@Nullable String line2) { this.line2 = JsonNullable.of(line2); return this; } - /** - * Address line 2 of the billing address. - */ - public EcommerceAddress withLine2(JsonNullable line2) { - Utils.checkNotNull(line2, "line2"); - this.line2 = line2; - return this; - } /** * Company name of the customer */ - public EcommerceAddress withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public EcommerceAddress withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * Company name of the customer - */ - public EcommerceAddress withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * City of the billing address. */ - public EcommerceAddress withCity(String city) { - Utils.checkNotNull(city, "city"); + public EcommerceAddress withCity(@Nullable String city) { this.city = JsonNullable.of(city); return this; } - /** - * City of the billing address. - */ - public EcommerceAddress withCity(JsonNullable city) { - Utils.checkNotNull(city, "city"); - this.city = city; - return this; - } /** * State/province of the billing address. */ - public EcommerceAddress withState(String state) { - Utils.checkNotNull(state, "state"); + public EcommerceAddress withState(@Nullable String state) { this.state = JsonNullable.of(state); return this; } - /** - * State/province of the billing address. - */ - public EcommerceAddress withState(JsonNullable state) { - Utils.checkNotNull(state, "state"); - this.state = state; - return this; - } /** * Postal/ZIP code of the billing address. */ - public EcommerceAddress withPostalCode(String postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); + public EcommerceAddress withPostalCode(@Nullable String postalCode) { this.postalCode = JsonNullable.of(postalCode); return this; } - /** - * Postal/ZIP code of the billing address. - */ - public EcommerceAddress withPostalCode(JsonNullable postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); - this.postalCode = postalCode; - return this; - } /** * Country of the billing address. */ - public EcommerceAddress withCountry(String country) { - Utils.checkNotNull(country, "country"); + public EcommerceAddress withCountry(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * Country of the billing address. - */ - public EcommerceAddress withCountry(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -328,159 +259,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable line1 = JsonNullable.undefined(); + private JsonNullable line1; - private JsonNullable line2 = JsonNullable.undefined(); + private JsonNullable line2; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable city = JsonNullable.undefined(); + private JsonNullable city; - private JsonNullable state = JsonNullable.undefined(); + private JsonNullable state; - private JsonNullable postalCode = JsonNullable.undefined(); + private JsonNullable postalCode; - private JsonNullable country = JsonNullable.undefined(); + private JsonNullable country; private Builder() { // force use of static builder() method } - /** * Address line 1 of the billing address. */ - public Builder line1(String line1) { - Utils.checkNotNull(line1, "line1"); + public Builder line1(@Nullable String line1) { this.line1 = JsonNullable.of(line1); return this; } - /** - * Address line 1 of the billing address. - */ - public Builder line1(JsonNullable line1) { - Utils.checkNotNull(line1, "line1"); - this.line1 = line1; - return this; - } - - /** * Address line 2 of the billing address. */ - public Builder line2(String line2) { - Utils.checkNotNull(line2, "line2"); + public Builder line2(@Nullable String line2) { this.line2 = JsonNullable.of(line2); return this; } - /** - * Address line 2 of the billing address. - */ - public Builder line2(JsonNullable line2) { - Utils.checkNotNull(line2, "line2"); - this.line2 = line2; - return this; - } - - /** * Company name of the customer */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * Company name of the customer - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * City of the billing address. */ - public Builder city(String city) { - Utils.checkNotNull(city, "city"); + public Builder city(@Nullable String city) { this.city = JsonNullable.of(city); return this; } - /** - * City of the billing address. - */ - public Builder city(JsonNullable city) { - Utils.checkNotNull(city, "city"); - this.city = city; - return this; - } - - /** * State/province of the billing address. */ - public Builder state(String state) { - Utils.checkNotNull(state, "state"); + public Builder state(@Nullable String state) { this.state = JsonNullable.of(state); return this; } - /** - * State/province of the billing address. - */ - public Builder state(JsonNullable state) { - Utils.checkNotNull(state, "state"); - this.state = state; - return this; - } - - /** * Postal/ZIP code of the billing address. */ - public Builder postalCode(String postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); + public Builder postalCode(@Nullable String postalCode) { this.postalCode = JsonNullable.of(postalCode); return this; } - /** - * Postal/ZIP code of the billing address. - */ - public Builder postalCode(JsonNullable postalCode) { - Utils.checkNotNull(postalCode, "postalCode"); - this.postalCode = postalCode; - return this; - } - - /** * Country of the billing address. */ - public Builder country(String country) { - Utils.checkNotNull(country, "country"); + public Builder country(@Nullable String country) { this.country = JsonNullable.of(country); return this; } - /** - * Country of the billing address. - */ - public Builder country(JsonNullable country) { - Utils.checkNotNull(country, "country"); - this.country = country; - return this; - } - public EcommerceAddress build() { - return new EcommerceAddress( line1, line2, companyName, city, state, postalCode, diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceCustomer.java b/src/main/java/com/apideck/unify/models/components/EcommerceCustomer.java index 332b7bad..c0511168 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceCustomer.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceCustomer.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -60,47 +60,47 @@ public class EcommerceCustomer { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * An array of email addresses for the customer. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private JsonNullable> emails; + private JsonNullable> emails; /** * An array of phone numbers for the customer. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private JsonNullable> phoneNumbers; + private JsonNullable> phoneNumbers; /** * An array of addresses for the customer. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("orders") - private Optional> orders; + private List orders; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The date and time when the object was created. @@ -118,173 +118,150 @@ public class EcommerceCustomer { @JsonCreator public EcommerceCustomer( - @JsonProperty("id") String id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("status") JsonNullable status, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("emails") JsonNullable> emails, - @JsonProperty("phone_numbers") JsonNullable> phoneNumbers, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("orders") Optional> orders, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("updated_at") JsonNullable updatedAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(orders, "orders"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); - this.id = id; - this.name = name; - this.firstName = firstName; - this.lastName = lastName; - this.companyName = companyName; - this.status = status; - this.currency = currency; - this.emails = emails; - this.phoneNumbers = phoneNumbers; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("emails") @Nullable JsonNullable> emails, + @JsonProperty("phone_numbers") @Nullable JsonNullable> phoneNumbers, + @JsonProperty("addresses") @Nullable List addresses, + @JsonProperty("orders") @Nullable List orders, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.emails = Optional.ofNullable(emails) + .orElse(JsonNullable.undefined()); + this.phoneNumbers = Optional.ofNullable(phoneNumbers) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.orders = orders; - this.customMappings = customMappings; - this.createdAt = createdAt; - this.updatedAt = updatedAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); } public EcommerceCustomer( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Full name of the customer */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * First name of the customer */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * Last name of the customer */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Company name of the customer */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The current status of the customer */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * An array of email addresses for the customer. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> emails() { - return (JsonNullable>) emails; + return this.emails; } /** * An array of phone numbers for the customer. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> phoneNumbers() { - return (JsonNullable>) phoneNumbers; + return this.phoneNumbers; } /** * An array of addresses for the customer. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> orders() { - return (Optional>) orders; + return Optional.ofNullable(this.orders); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } public static Builder builder() { @@ -295,241 +272,125 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EcommerceCustomer withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public EcommerceCustomer withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * Full name of the customer */ - public EcommerceCustomer withName(String name) { - Utils.checkNotNull(name, "name"); + public EcommerceCustomer withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the customer - */ - public EcommerceCustomer withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * First name of the customer */ - public EcommerceCustomer withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public EcommerceCustomer withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * First name of the customer - */ - public EcommerceCustomer withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * Last name of the customer */ - public EcommerceCustomer withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public EcommerceCustomer withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * Last name of the customer - */ - public EcommerceCustomer withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Company name of the customer */ - public EcommerceCustomer withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public EcommerceCustomer withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * Company name of the customer - */ - public EcommerceCustomer withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The current status of the customer */ - public EcommerceCustomer withStatus(CustomerStatus status) { - Utils.checkNotNull(status, "status"); + public EcommerceCustomer withStatus(@Nullable CustomerStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the customer - */ - public EcommerceCustomer withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public EcommerceCustomer withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public EcommerceCustomer withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public EcommerceCustomer withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * An array of email addresses for the customer. */ - public EcommerceCustomer withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); + public EcommerceCustomer withEmails(@Nullable List emails) { this.emails = JsonNullable.of(emails); return this; } - /** - * An array of email addresses for the customer. - */ - public EcommerceCustomer withEmails(JsonNullable> emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = emails; - return this; - } /** * An array of phone numbers for the customer. */ - public EcommerceCustomer withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public EcommerceCustomer withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = JsonNullable.of(phoneNumbers); return this; } - /** - * An array of phone numbers for the customer. - */ - public EcommerceCustomer withPhoneNumbers(JsonNullable> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = phoneNumbers; - return this; - } - - /** - * An array of addresses for the customer. - */ - public EcommerceCustomer withAddresses(List addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - /** * An array of addresses for the customer. */ - public EcommerceCustomer withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public EcommerceCustomer withAddresses(@Nullable List addresses) { this.addresses = addresses; return this; } - public EcommerceCustomer withOrders(List orders) { - Utils.checkNotNull(orders, "orders"); - this.orders = Optional.ofNullable(orders); - return this; - } - - public EcommerceCustomer withOrders(Optional> orders) { - Utils.checkNotNull(orders, "orders"); + public EcommerceCustomer withOrders(@Nullable List orders) { this.orders = orders; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public EcommerceCustomer withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public EcommerceCustomer withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public EcommerceCustomer withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The date and time when the object was created. */ - public EcommerceCustomer withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public EcommerceCustomer withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public EcommerceCustomer withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The date and time when the object was last updated. */ - public EcommerceCustomer withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public EcommerceCustomer withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public EcommerceCustomer withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -591,289 +452,146 @@ public final static class Builder { private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable> emails = JsonNullable.undefined(); + private JsonNullable> emails; - private JsonNullable> phoneNumbers = JsonNullable.undefined(); + private JsonNullable> phoneNumbers; - private Optional> addresses = Optional.empty(); + private List addresses; - private Optional> orders = Optional.empty(); + private List orders; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * Full name of the customer */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the customer - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * First name of the customer */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * First name of the customer - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * Last name of the customer */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * Last name of the customer - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Company name of the customer */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * Company name of the customer - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The current status of the customer */ - public Builder status(CustomerStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable CustomerStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the customer - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * An array of email addresses for the customer. */ - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = JsonNullable.of(emails); return this; } - /** - * An array of email addresses for the customer. - */ - public Builder emails(JsonNullable> emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = emails; - return this; - } - - /** * An array of phone numbers for the customer. */ - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = JsonNullable.of(phoneNumbers); return this; } - /** - * An array of phone numbers for the customer. - */ - public Builder phoneNumbers(JsonNullable> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = phoneNumbers; - return this; - } - - - /** - * An array of addresses for the customer. - */ - public Builder addresses(List addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - /** * An array of addresses for the customer. */ - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List addresses) { this.addresses = addresses; return this; } - - public Builder orders(List orders) { - Utils.checkNotNull(orders, "orders"); - this.orders = Optional.ofNullable(orders); - return this; - } - - public Builder orders(Optional> orders) { - Utils.checkNotNull(orders, "orders"); + public Builder orders(@Nullable List orders) { this.orders = orders; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - public EcommerceCustomer build() { - return new EcommerceCustomer( id, name, firstName, lastName, companyName, status, diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceCustomersFilter.java b/src/main/java/com/apideck/unify/models/components/EcommerceCustomersFilter.java index 8a5ab0fa..2e3da6dc 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceCustomersFilter.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceCustomersFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,42 +17,38 @@ public class EcommerceCustomersFilter { * Customer email address to filter on */ @SpeakeasyMetadata("queryParam:name=email") - private Optional email; + private String email; /** * Customer phone number to filter on */ @SpeakeasyMetadata("queryParam:name=phone_number") - private Optional phoneNumber; + private String phoneNumber; @JsonCreator public EcommerceCustomersFilter( - Optional email, - Optional phoneNumber) { - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(phoneNumber, "phoneNumber"); + @Nullable String email, + @Nullable String phoneNumber) { this.email = email; this.phoneNumber = phoneNumber; } public EcommerceCustomersFilter() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * Customer email address to filter on */ - @JsonIgnore public Optional email() { - return email; + return Optional.ofNullable(this.email); } /** * Customer phone number to filter on */ - @JsonIgnore public Optional phoneNumber() { - return phoneNumber; + return Optional.ofNullable(this.phoneNumber); } public static Builder builder() { @@ -63,41 +59,21 @@ public static Builder builder() { /** * Customer email address to filter on */ - public EcommerceCustomersFilter withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - - - /** - * Customer email address to filter on - */ - public EcommerceCustomersFilter withEmail(Optional email) { - Utils.checkNotNull(email, "email"); + public EcommerceCustomersFilter withEmail(@Nullable String email) { this.email = email; return this; } - /** - * Customer phone number to filter on - */ - public EcommerceCustomersFilter withPhoneNumber(String phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); - this.phoneNumber = Optional.ofNullable(phoneNumber); - return this; - } - /** * Customer phone number to filter on */ - public EcommerceCustomersFilter withPhoneNumber(Optional phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); + public EcommerceCustomersFilter withPhoneNumber(@Nullable String phoneNumber) { this.phoneNumber = phoneNumber; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -128,54 +104,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional email = Optional.empty(); + private String email; - private Optional phoneNumber = Optional.empty(); + private String phoneNumber; private Builder() { // force use of static builder() method } - /** * Customer email address to filter on */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - - /** - * Customer email address to filter on - */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } - - /** - * Customer phone number to filter on - */ - public Builder phoneNumber(String phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); - this.phoneNumber = Optional.ofNullable(phoneNumber); - return this; - } - /** * Customer phone number to filter on */ - public Builder phoneNumber(Optional phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); + public Builder phoneNumber(@Nullable String phoneNumber) { this.phoneNumber = phoneNumber; return this; } public EcommerceCustomersFilter build() { - return new EcommerceCustomersFilter( email, phoneNumber); } diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceDiscount.java b/src/main/java/com/apideck/unify/models/components/EcommerceDiscount.java index 152f27b6..9514903f 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceDiscount.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceDiscount.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -42,43 +43,40 @@ public class EcommerceDiscount { @JsonCreator public EcommerceDiscount( - @JsonProperty("code") JsonNullable code, - @JsonProperty("amount") JsonNullable amount, - @JsonProperty("percentage") JsonNullable percentage) { - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(amount, "amount"); - Utils.checkNotNull(percentage, "percentage"); - this.code = code; - this.amount = amount; - this.percentage = percentage; + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("amount") @Nullable JsonNullable amount, + @JsonProperty("percentage") @Nullable JsonNullable percentage) { + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.amount = Optional.ofNullable(amount) + .orElse(JsonNullable.undefined()); + this.percentage = Optional.ofNullable(percentage) + .orElse(JsonNullable.undefined()); } public EcommerceDiscount() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * The code used to apply the discount. */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * The fixed amount of the discount. */ - @JsonIgnore public JsonNullable amount() { - return amount; + return this.amount; } /** * The percentage of the discount. */ - @JsonIgnore public JsonNullable percentage() { - return percentage; + return this.percentage; } public static Builder builder() { @@ -89,56 +87,29 @@ public static Builder builder() { /** * The code used to apply the discount. */ - public EcommerceDiscount withCode(String code) { - Utils.checkNotNull(code, "code"); + public EcommerceDiscount withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code used to apply the discount. - */ - public EcommerceDiscount withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * The fixed amount of the discount. */ - public EcommerceDiscount withAmount(String amount) { - Utils.checkNotNull(amount, "amount"); + public EcommerceDiscount withAmount(@Nullable String amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * The fixed amount of the discount. - */ - public EcommerceDiscount withAmount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } /** * The percentage of the discount. */ - public EcommerceDiscount withPercentage(String percentage) { - Utils.checkNotNull(percentage, "percentage"); + public EcommerceDiscount withPercentage(@Nullable String percentage) { this.percentage = JsonNullable.of(percentage); return this; } - /** - * The percentage of the discount. - */ - public EcommerceDiscount withPercentage(JsonNullable percentage) { - Utils.checkNotNull(percentage, "percentage"); - this.percentage = percentage; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -172,75 +143,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable amount = JsonNullable.undefined(); + private JsonNullable amount; - private JsonNullable percentage = JsonNullable.undefined(); + private JsonNullable percentage; private Builder() { // force use of static builder() method } - /** * The code used to apply the discount. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code used to apply the discount. - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * The fixed amount of the discount. */ - public Builder amount(String amount) { - Utils.checkNotNull(amount, "amount"); + public Builder amount(@Nullable String amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * The fixed amount of the discount. - */ - public Builder amount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** * The percentage of the discount. */ - public Builder percentage(String percentage) { - Utils.checkNotNull(percentage, "percentage"); + public Builder percentage(@Nullable String percentage) { this.percentage = JsonNullable.of(percentage); return this; } - /** - * The percentage of the discount. - */ - public Builder percentage(JsonNullable percentage) { - Utils.checkNotNull(percentage, "percentage"); - this.percentage = percentage; - return this; - } - public EcommerceDiscount build() { - return new EcommerceDiscount( code, amount, percentage); } diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceOrder.java b/src/main/java/com/apideck/unify/models/components/EcommerceOrder.java index 151aee4f..aea4af09 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceOrder.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceOrder.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -39,12 +39,12 @@ public class EcommerceOrder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; @JsonInclude(Include.NON_ABSENT) @JsonProperty("discounts") - private Optional> discounts; + private List discounts; /** * Sub-total amount, normally before tax. @@ -100,21 +100,21 @@ public class EcommerceOrder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Current payment status of the order. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_status") - private JsonNullable paymentStatus; + private JsonNullable paymentStatus; /** * Current fulfillment status of the order. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("fulfillment_status") - private JsonNullable fulfillmentStatus; + private JsonNullable fulfillmentStatus; /** * Payment method used for this order. @@ -128,31 +128,31 @@ public class EcommerceOrder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer") - private Optional customer; + private LinkedEcommerceCustomer customer; /** * An object representing a shipping or billing address. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("billing_address") - private Optional billingAddress; + private EcommerceAddress billingAddress; /** * An object representing a shipping or billing address. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("shipping_address") - private Optional shippingAddress; + private EcommerceAddress shippingAddress; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking") - private Optional> tracking; + private List tracking; @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; /** * Note for the order. @@ -164,14 +164,14 @@ public class EcommerceOrder { @JsonInclude(Include.NON_ABSENT) @JsonProperty("refunds") - private Optional> refunds; + private List refunds; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The date and time when the object was created. @@ -189,294 +189,250 @@ public class EcommerceOrder { @JsonCreator public EcommerceOrder( - @JsonProperty("id") String id, - @JsonProperty("order_number") JsonNullable orderNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("discounts") Optional> discounts, - @JsonProperty("sub_total") JsonNullable subTotal, - @JsonProperty("shipping_cost") JsonNullable shippingCost, - @JsonProperty("coupon_discount") JsonNullable couponDiscount, - @JsonProperty("total_discount") JsonNullable totalDiscount, - @JsonProperty("total_tax") JsonNullable totalTax, - @JsonProperty("total_amount") JsonNullable totalAmount, - @JsonProperty("refunded_amount") JsonNullable refundedAmount, - @JsonProperty("status") JsonNullable status, - @JsonProperty("payment_status") JsonNullable paymentStatus, - @JsonProperty("fulfillment_status") JsonNullable fulfillmentStatus, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("customer") Optional customer, - @JsonProperty("billing_address") Optional billingAddress, - @JsonProperty("shipping_address") Optional shippingAddress, - @JsonProperty("tracking") Optional> tracking, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("note") JsonNullable note, - @JsonProperty("refunds") Optional> refunds, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("updated_at") JsonNullable updatedAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(orderNumber, "orderNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(discounts, "discounts"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(shippingCost, "shippingCost"); - Utils.checkNotNull(couponDiscount, "couponDiscount"); - Utils.checkNotNull(totalDiscount, "totalDiscount"); - Utils.checkNotNull(totalTax, "totalTax"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(refundedAmount, "refundedAmount"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(paymentStatus, "paymentStatus"); - Utils.checkNotNull(fulfillmentStatus, "fulfillmentStatus"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(customer, "customer"); - Utils.checkNotNull(billingAddress, "billingAddress"); - Utils.checkNotNull(shippingAddress, "shippingAddress"); - Utils.checkNotNull(tracking, "tracking"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(note, "note"); - Utils.checkNotNull(refunds, "refunds"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); - this.id = id; - this.orderNumber = orderNumber; - this.currency = currency; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("order_number") @Nullable JsonNullable orderNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("discounts") @Nullable List discounts, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, + @JsonProperty("shipping_cost") @Nullable JsonNullable shippingCost, + @JsonProperty("coupon_discount") @Nullable JsonNullable couponDiscount, + @JsonProperty("total_discount") @Nullable JsonNullable totalDiscount, + @JsonProperty("total_tax") @Nullable JsonNullable totalTax, + @JsonProperty("total_amount") @Nullable JsonNullable totalAmount, + @JsonProperty("refunded_amount") @Nullable JsonNullable refundedAmount, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("payment_status") @Nullable JsonNullable paymentStatus, + @JsonProperty("fulfillment_status") @Nullable JsonNullable fulfillmentStatus, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("customer") @Nullable LinkedEcommerceCustomer customer, + @JsonProperty("billing_address") @Nullable EcommerceAddress billingAddress, + @JsonProperty("shipping_address") @Nullable EcommerceAddress shippingAddress, + @JsonProperty("tracking") @Nullable List tracking, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("note") @Nullable JsonNullable note, + @JsonProperty("refunds") @Nullable List refunds, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.orderNumber = Optional.ofNullable(orderNumber) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); this.discounts = discounts; - this.subTotal = subTotal; - this.shippingCost = shippingCost; - this.couponDiscount = couponDiscount; - this.totalDiscount = totalDiscount; - this.totalTax = totalTax; - this.totalAmount = totalAmount; - this.refundedAmount = refundedAmount; - this.status = status; - this.paymentStatus = paymentStatus; - this.fulfillmentStatus = fulfillmentStatus; - this.paymentMethod = paymentMethod; + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); + this.shippingCost = Optional.ofNullable(shippingCost) + .orElse(JsonNullable.undefined()); + this.couponDiscount = Optional.ofNullable(couponDiscount) + .orElse(JsonNullable.undefined()); + this.totalDiscount = Optional.ofNullable(totalDiscount) + .orElse(JsonNullable.undefined()); + this.totalTax = Optional.ofNullable(totalTax) + .orElse(JsonNullable.undefined()); + this.totalAmount = Optional.ofNullable(totalAmount) + .orElse(JsonNullable.undefined()); + this.refundedAmount = Optional.ofNullable(refundedAmount) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.paymentStatus = Optional.ofNullable(paymentStatus) + .orElse(JsonNullable.undefined()); + this.fulfillmentStatus = Optional.ofNullable(fulfillmentStatus) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); this.customer = customer; this.billingAddress = billingAddress; this.shippingAddress = shippingAddress; this.tracking = tracking; this.lineItems = lineItems; - this.note = note; + this.note = Optional.ofNullable(note) + .orElse(JsonNullable.undefined()); this.refunds = refunds; - this.customMappings = customMappings; - this.createdAt = createdAt; - this.updatedAt = updatedAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); } public EcommerceOrder( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Order number, if any. */ - @JsonIgnore public JsonNullable orderNumber() { - return orderNumber; + return this.orderNumber; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> discounts() { - return (Optional>) discounts; + return Optional.ofNullable(this.discounts); } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Shipping cost, if any. */ - @JsonIgnore public JsonNullable shippingCost() { - return shippingCost; + return this.shippingCost; } /** * Coupon discount, if any. */ - @JsonIgnore public JsonNullable couponDiscount() { - return couponDiscount; + return this.couponDiscount; } /** * Total discount, if any. */ - @JsonIgnore public JsonNullable totalDiscount() { - return totalDiscount; + return this.totalDiscount; } /** * Total tax, if any. */ - @JsonIgnore public JsonNullable totalTax() { - return totalTax; + return this.totalTax; } /** * Total amount due. */ - @JsonIgnore public JsonNullable totalAmount() { - return totalAmount; + return this.totalAmount; } /** * Refunded amount, if any. */ - @JsonIgnore public JsonNullable refundedAmount() { - return refundedAmount; + return this.refundedAmount; } /** * Current status of the order. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Current payment status of the order. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable paymentStatus() { - return (JsonNullable) paymentStatus; + return this.paymentStatus; } /** * Current fulfillment status of the order. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable fulfillmentStatus() { - return (JsonNullable) fulfillmentStatus; + return this.fulfillmentStatus; } /** * Payment method used for this order. */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * The customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional customer() { - return (Optional) customer; + return Optional.ofNullable(this.customer); } /** * An object representing a shipping or billing address. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional billingAddress() { - return (Optional) billingAddress; + return Optional.ofNullable(this.billingAddress); } /** * An object representing a shipping or billing address. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional shippingAddress() { - return (Optional) shippingAddress; + return Optional.ofNullable(this.shippingAddress); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> tracking() { - return (Optional>) tracking; + return Optional.ofNullable(this.tracking); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } /** * Note for the order. */ - @JsonIgnore public JsonNullable note() { - return note; + return this.note; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> refunds() { - return (Optional>) refunds; + return Optional.ofNullable(this.refunds); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } public static Builder builder() { @@ -487,426 +443,215 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EcommerceOrder withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public EcommerceOrder withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * Order number, if any. */ - public EcommerceOrder withOrderNumber(String orderNumber) { - Utils.checkNotNull(orderNumber, "orderNumber"); + public EcommerceOrder withOrderNumber(@Nullable String orderNumber) { this.orderNumber = JsonNullable.of(orderNumber); return this; } - /** - * Order number, if any. - */ - public EcommerceOrder withOrderNumber(JsonNullable orderNumber) { - Utils.checkNotNull(orderNumber, "orderNumber"); - this.orderNumber = orderNumber; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public EcommerceOrder withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public EcommerceOrder withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public EcommerceOrder withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - public EcommerceOrder withDiscounts(List discounts) { - Utils.checkNotNull(discounts, "discounts"); - this.discounts = Optional.ofNullable(discounts); - return this; - } - - public EcommerceOrder withDiscounts(Optional> discounts) { - Utils.checkNotNull(discounts, "discounts"); + public EcommerceOrder withDiscounts(@Nullable List discounts) { this.discounts = discounts; return this; } + /** * Sub-total amount, normally before tax. */ - public EcommerceOrder withSubTotal(String subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public EcommerceOrder withSubTotal(@Nullable String subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public EcommerceOrder withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Shipping cost, if any. */ - public EcommerceOrder withShippingCost(String shippingCost) { - Utils.checkNotNull(shippingCost, "shippingCost"); + public EcommerceOrder withShippingCost(@Nullable String shippingCost) { this.shippingCost = JsonNullable.of(shippingCost); return this; } - /** - * Shipping cost, if any. - */ - public EcommerceOrder withShippingCost(JsonNullable shippingCost) { - Utils.checkNotNull(shippingCost, "shippingCost"); - this.shippingCost = shippingCost; - return this; - } /** * Coupon discount, if any. */ - public EcommerceOrder withCouponDiscount(String couponDiscount) { - Utils.checkNotNull(couponDiscount, "couponDiscount"); + public EcommerceOrder withCouponDiscount(@Nullable String couponDiscount) { this.couponDiscount = JsonNullable.of(couponDiscount); return this; } - /** - * Coupon discount, if any. - */ - public EcommerceOrder withCouponDiscount(JsonNullable couponDiscount) { - Utils.checkNotNull(couponDiscount, "couponDiscount"); - this.couponDiscount = couponDiscount; - return this; - } /** * Total discount, if any. */ - public EcommerceOrder withTotalDiscount(String totalDiscount) { - Utils.checkNotNull(totalDiscount, "totalDiscount"); + public EcommerceOrder withTotalDiscount(@Nullable String totalDiscount) { this.totalDiscount = JsonNullable.of(totalDiscount); return this; } - /** - * Total discount, if any. - */ - public EcommerceOrder withTotalDiscount(JsonNullable totalDiscount) { - Utils.checkNotNull(totalDiscount, "totalDiscount"); - this.totalDiscount = totalDiscount; - return this; - } /** * Total tax, if any. */ - public EcommerceOrder withTotalTax(String totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public EcommerceOrder withTotalTax(@Nullable String totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax, if any. - */ - public EcommerceOrder withTotalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } /** * Total amount due. */ - public EcommerceOrder withTotalAmount(String totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public EcommerceOrder withTotalAmount(@Nullable String totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Total amount due. - */ - public EcommerceOrder withTotalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } /** * Refunded amount, if any. */ - public EcommerceOrder withRefundedAmount(String refundedAmount) { - Utils.checkNotNull(refundedAmount, "refundedAmount"); + public EcommerceOrder withRefundedAmount(@Nullable String refundedAmount) { this.refundedAmount = JsonNullable.of(refundedAmount); return this; } - /** - * Refunded amount, if any. - */ - public EcommerceOrder withRefundedAmount(JsonNullable refundedAmount) { - Utils.checkNotNull(refundedAmount, "refundedAmount"); - this.refundedAmount = refundedAmount; - return this; - } /** * Current status of the order. */ - public EcommerceOrder withStatus(EcommerceOrderStatus status) { - Utils.checkNotNull(status, "status"); + public EcommerceOrder withStatus(@Nullable EcommerceOrderStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Current status of the order. - */ - public EcommerceOrder withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Current payment status of the order. */ - public EcommerceOrder withPaymentStatus(EcommerceOrderPaymentStatus paymentStatus) { - Utils.checkNotNull(paymentStatus, "paymentStatus"); + public EcommerceOrder withPaymentStatus(@Nullable EcommerceOrderPaymentStatus paymentStatus) { this.paymentStatus = JsonNullable.of(paymentStatus); return this; } - /** - * Current payment status of the order. - */ - public EcommerceOrder withPaymentStatus(JsonNullable paymentStatus) { - Utils.checkNotNull(paymentStatus, "paymentStatus"); - this.paymentStatus = paymentStatus; - return this; - } /** * Current fulfillment status of the order. */ - public EcommerceOrder withFulfillmentStatus(FulfillmentStatus fulfillmentStatus) { - Utils.checkNotNull(fulfillmentStatus, "fulfillmentStatus"); + public EcommerceOrder withFulfillmentStatus(@Nullable FulfillmentStatus fulfillmentStatus) { this.fulfillmentStatus = JsonNullable.of(fulfillmentStatus); return this; } - /** - * Current fulfillment status of the order. - */ - public EcommerceOrder withFulfillmentStatus(JsonNullable fulfillmentStatus) { - Utils.checkNotNull(fulfillmentStatus, "fulfillmentStatus"); - this.fulfillmentStatus = fulfillmentStatus; - return this; - } /** * Payment method used for this order. */ - public EcommerceOrder withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public EcommerceOrder withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for this order. - */ - public EcommerceOrder withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** - * The customer this entity is linked to. - */ - public EcommerceOrder withCustomer(LinkedEcommerceCustomer customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = Optional.ofNullable(customer); - return this; - } - /** * The customer this entity is linked to. */ - public EcommerceOrder withCustomer(Optional customer) { - Utils.checkNotNull(customer, "customer"); + public EcommerceOrder withCustomer(@Nullable LinkedEcommerceCustomer customer) { this.customer = customer; return this; } - /** - * An object representing a shipping or billing address. - */ - public EcommerceOrder withBillingAddress(EcommerceAddress billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); - this.billingAddress = Optional.ofNullable(billingAddress); - return this; - } - /** * An object representing a shipping or billing address. */ - public EcommerceOrder withBillingAddress(Optional billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); + public EcommerceOrder withBillingAddress(@Nullable EcommerceAddress billingAddress) { this.billingAddress = billingAddress; return this; } - /** - * An object representing a shipping or billing address. - */ - public EcommerceOrder withShippingAddress(EcommerceAddress shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - /** * An object representing a shipping or billing address. */ - public EcommerceOrder withShippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public EcommerceOrder withShippingAddress(@Nullable EcommerceAddress shippingAddress) { this.shippingAddress = shippingAddress; return this; } - public EcommerceOrder withTracking(List tracking) { - Utils.checkNotNull(tracking, "tracking"); - this.tracking = Optional.ofNullable(tracking); - return this; - } - - public EcommerceOrder withTracking(Optional> tracking) { - Utils.checkNotNull(tracking, "tracking"); + public EcommerceOrder withTracking(@Nullable List tracking) { this.tracking = tracking; return this; } - public EcommerceOrder withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public EcommerceOrder withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public EcommerceOrder withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - /** - * Note for the order. - */ - public EcommerceOrder withNote(String note) { - Utils.checkNotNull(note, "note"); - this.note = JsonNullable.of(note); - return this; - } /** * Note for the order. */ - public EcommerceOrder withNote(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } - - public EcommerceOrder withRefunds(List refunds) { - Utils.checkNotNull(refunds, "refunds"); - this.refunds = Optional.ofNullable(refunds); + public EcommerceOrder withNote(@Nullable String note) { + this.note = JsonNullable.of(note); return this; } - public EcommerceOrder withRefunds(Optional> refunds) { - Utils.checkNotNull(refunds, "refunds"); + public EcommerceOrder withRefunds(@Nullable List refunds) { this.refunds = refunds; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public EcommerceOrder withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public EcommerceOrder withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public EcommerceOrder withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The date and time when the object was created. */ - public EcommerceOrder withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public EcommerceOrder withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public EcommerceOrder withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The date and time when the object was last updated. */ - public EcommerceOrder withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public EcommerceOrder withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public EcommerceOrder withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -994,502 +739,247 @@ public final static class Builder { private String id; - private JsonNullable orderNumber = JsonNullable.undefined(); + private JsonNullable orderNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private Optional> discounts = Optional.empty(); + private List discounts; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private JsonNullable shippingCost = JsonNullable.undefined(); + private JsonNullable shippingCost; - private JsonNullable couponDiscount = JsonNullable.undefined(); + private JsonNullable couponDiscount; - private JsonNullable totalDiscount = JsonNullable.undefined(); + private JsonNullable totalDiscount; - private JsonNullable totalTax = JsonNullable.undefined(); + private JsonNullable totalTax; - private JsonNullable totalAmount = JsonNullable.undefined(); + private JsonNullable totalAmount; - private JsonNullable refundedAmount = JsonNullable.undefined(); + private JsonNullable refundedAmount; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable paymentStatus = JsonNullable.undefined(); + private JsonNullable paymentStatus; - private JsonNullable fulfillmentStatus = JsonNullable.undefined(); + private JsonNullable fulfillmentStatus; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private Optional customer = Optional.empty(); + private LinkedEcommerceCustomer customer; - private Optional billingAddress = Optional.empty(); + private EcommerceAddress billingAddress; - private Optional shippingAddress = Optional.empty(); + private EcommerceAddress shippingAddress; - private Optional> tracking = Optional.empty(); + private List tracking; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private JsonNullable note = JsonNullable.undefined(); + private JsonNullable note; - private Optional> refunds = Optional.empty(); + private List refunds; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * Order number, if any. */ - public Builder orderNumber(String orderNumber) { - Utils.checkNotNull(orderNumber, "orderNumber"); + public Builder orderNumber(@Nullable String orderNumber) { this.orderNumber = JsonNullable.of(orderNumber); return this; } - /** - * Order number, if any. - */ - public Builder orderNumber(JsonNullable orderNumber) { - Utils.checkNotNull(orderNumber, "orderNumber"); - this.orderNumber = orderNumber; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - public Builder discounts(List discounts) { - Utils.checkNotNull(discounts, "discounts"); - this.discounts = Optional.ofNullable(discounts); - return this; - } - - public Builder discounts(Optional> discounts) { - Utils.checkNotNull(discounts, "discounts"); + public Builder discounts(@Nullable List discounts) { this.discounts = discounts; return this; } - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(String subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable String subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Shipping cost, if any. */ - public Builder shippingCost(String shippingCost) { - Utils.checkNotNull(shippingCost, "shippingCost"); + public Builder shippingCost(@Nullable String shippingCost) { this.shippingCost = JsonNullable.of(shippingCost); return this; } - /** - * Shipping cost, if any. - */ - public Builder shippingCost(JsonNullable shippingCost) { - Utils.checkNotNull(shippingCost, "shippingCost"); - this.shippingCost = shippingCost; - return this; - } - - /** * Coupon discount, if any. */ - public Builder couponDiscount(String couponDiscount) { - Utils.checkNotNull(couponDiscount, "couponDiscount"); + public Builder couponDiscount(@Nullable String couponDiscount) { this.couponDiscount = JsonNullable.of(couponDiscount); return this; } - /** - * Coupon discount, if any. - */ - public Builder couponDiscount(JsonNullable couponDiscount) { - Utils.checkNotNull(couponDiscount, "couponDiscount"); - this.couponDiscount = couponDiscount; - return this; - } - - /** * Total discount, if any. */ - public Builder totalDiscount(String totalDiscount) { - Utils.checkNotNull(totalDiscount, "totalDiscount"); + public Builder totalDiscount(@Nullable String totalDiscount) { this.totalDiscount = JsonNullable.of(totalDiscount); return this; } - /** - * Total discount, if any. - */ - public Builder totalDiscount(JsonNullable totalDiscount) { - Utils.checkNotNull(totalDiscount, "totalDiscount"); - this.totalDiscount = totalDiscount; - return this; - } - - /** * Total tax, if any. */ - public Builder totalTax(String totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Builder totalTax(@Nullable String totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax, if any. - */ - public Builder totalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } - - /** * Total amount due. */ - public Builder totalAmount(String totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable String totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Total amount due. - */ - public Builder totalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - /** * Refunded amount, if any. */ - public Builder refundedAmount(String refundedAmount) { - Utils.checkNotNull(refundedAmount, "refundedAmount"); + public Builder refundedAmount(@Nullable String refundedAmount) { this.refundedAmount = JsonNullable.of(refundedAmount); return this; } - /** - * Refunded amount, if any. - */ - public Builder refundedAmount(JsonNullable refundedAmount) { - Utils.checkNotNull(refundedAmount, "refundedAmount"); - this.refundedAmount = refundedAmount; - return this; - } - - /** * Current status of the order. */ - public Builder status(EcommerceOrderStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable EcommerceOrderStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Current status of the order. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Current payment status of the order. */ - public Builder paymentStatus(EcommerceOrderPaymentStatus paymentStatus) { - Utils.checkNotNull(paymentStatus, "paymentStatus"); + public Builder paymentStatus(@Nullable EcommerceOrderPaymentStatus paymentStatus) { this.paymentStatus = JsonNullable.of(paymentStatus); return this; } - /** - * Current payment status of the order. - */ - public Builder paymentStatus(JsonNullable paymentStatus) { - Utils.checkNotNull(paymentStatus, "paymentStatus"); - this.paymentStatus = paymentStatus; - return this; - } - - /** * Current fulfillment status of the order. */ - public Builder fulfillmentStatus(FulfillmentStatus fulfillmentStatus) { - Utils.checkNotNull(fulfillmentStatus, "fulfillmentStatus"); + public Builder fulfillmentStatus(@Nullable FulfillmentStatus fulfillmentStatus) { this.fulfillmentStatus = JsonNullable.of(fulfillmentStatus); return this; } - /** - * Current fulfillment status of the order. - */ - public Builder fulfillmentStatus(JsonNullable fulfillmentStatus) { - Utils.checkNotNull(fulfillmentStatus, "fulfillmentStatus"); - this.fulfillmentStatus = fulfillmentStatus; - return this; - } - - /** * Payment method used for this order. */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for this order. - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - - /** - * The customer this entity is linked to. - */ - public Builder customer(LinkedEcommerceCustomer customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = Optional.ofNullable(customer); - return this; - } - /** * The customer this entity is linked to. */ - public Builder customer(Optional customer) { - Utils.checkNotNull(customer, "customer"); + public Builder customer(@Nullable LinkedEcommerceCustomer customer) { this.customer = customer; return this; } - /** * An object representing a shipping or billing address. */ - public Builder billingAddress(EcommerceAddress billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); - this.billingAddress = Optional.ofNullable(billingAddress); - return this; - } - - /** - * An object representing a shipping or billing address. - */ - public Builder billingAddress(Optional billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); + public Builder billingAddress(@Nullable EcommerceAddress billingAddress) { this.billingAddress = billingAddress; return this; } - /** * An object representing a shipping or billing address. */ - public Builder shippingAddress(EcommerceAddress shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - /** - * An object representing a shipping or billing address. - */ - public Builder shippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public Builder shippingAddress(@Nullable EcommerceAddress shippingAddress) { this.shippingAddress = shippingAddress; return this; } - - public Builder tracking(List tracking) { - Utils.checkNotNull(tracking, "tracking"); - this.tracking = Optional.ofNullable(tracking); - return this; - } - - public Builder tracking(Optional> tracking) { - Utils.checkNotNull(tracking, "tracking"); + public Builder tracking(@Nullable List tracking) { this.tracking = tracking; return this; } - - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - /** * Note for the order. */ - public Builder note(String note) { - Utils.checkNotNull(note, "note"); + public Builder note(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Note for the order. - */ - public Builder note(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } - - - public Builder refunds(List refunds) { - Utils.checkNotNull(refunds, "refunds"); - this.refunds = Optional.ofNullable(refunds); - return this; - } - - public Builder refunds(Optional> refunds) { - Utils.checkNotNull(refunds, "refunds"); + public Builder refunds(@Nullable List refunds) { this.refunds = refunds; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - public EcommerceOrder build() { - return new EcommerceOrder( id, orderNumber, currency, discounts, subTotal, shippingCost, diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceOrderLineItem.java b/src/main/java/com/apideck/unify/models/components/EcommerceOrderLineItem.java index 9120e5f7..59edf175 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceOrderLineItem.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceOrderLineItem.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -56,7 +55,7 @@ public class EcommerceOrderLineItem { */ @JsonInclude(Include.ALWAYS) @JsonProperty("name") - private Optional name; + private JsonNullable name; /** * The description of the product or variant associated with the line item. @@ -68,14 +67,14 @@ public class EcommerceOrderLineItem { @JsonInclude(Include.NON_ABSENT) @JsonProperty("options") - private Optional> options; + private List options; /** * The quantity of the product or variant associated with the line item. */ @JsonInclude(Include.ALWAYS) @JsonProperty("quantity") - private Optional quantity; + private JsonNullable quantity; /** * The unit price of the product or variant associated with the line item. @@ -136,202 +135,179 @@ public class EcommerceOrderLineItem { @JsonInclude(Include.NON_ABSENT) @JsonProperty("discounts") - private Optional> discounts; + private List discounts; @JsonCreator public EcommerceOrderLineItem( - @JsonProperty("id") JsonNullable id, - @JsonProperty("product_id") JsonNullable productId, - @JsonProperty("variant_id") JsonNullable variantId, - @JsonProperty("sku") JsonNullable sku, - @JsonProperty("name") Optional name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("options") Optional> options, - @JsonProperty("quantity") Optional quantity, - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("tax_rate") JsonNullable taxRate, - @JsonProperty("tax_amount") JsonNullable taxAmount, - @JsonProperty("is_refunded") JsonNullable isRefunded, - @JsonProperty("refunded_amount") JsonNullable refundedAmount, - @JsonProperty("refunded_quantity") JsonNullable refundedQuantity, - @JsonProperty("sub_total") JsonNullable subTotal, - @JsonProperty("total_amount") JsonNullable totalAmount, - @JsonProperty("discounts") Optional> discounts) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(productId, "productId"); - Utils.checkNotNull(variantId, "variantId"); - Utils.checkNotNull(sku, "sku"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(options, "options"); - Utils.checkNotNull(quantity, "quantity"); - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(taxAmount, "taxAmount"); - Utils.checkNotNull(isRefunded, "isRefunded"); - Utils.checkNotNull(refundedAmount, "refundedAmount"); - Utils.checkNotNull(refundedQuantity, "refundedQuantity"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(discounts, "discounts"); - this.id = id; - this.productId = productId; - this.variantId = variantId; - this.sku = sku; - this.name = name; - this.description = description; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("product_id") @Nullable JsonNullable productId, + @JsonProperty("variant_id") @Nullable JsonNullable variantId, + @JsonProperty("sku") @Nullable JsonNullable sku, + @JsonProperty("name") @Nullable String name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("options") @Nullable List options, + @JsonProperty("quantity") @Nullable String quantity, + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("tax_rate") @Nullable JsonNullable taxRate, + @JsonProperty("tax_amount") @Nullable JsonNullable taxAmount, + @JsonProperty("is_refunded") @Nullable JsonNullable isRefunded, + @JsonProperty("refunded_amount") @Nullable JsonNullable refundedAmount, + @JsonProperty("refunded_quantity") @Nullable JsonNullable refundedQuantity, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, + @JsonProperty("total_amount") @Nullable JsonNullable totalAmount, + @JsonProperty("discounts") @Nullable List discounts) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.productId = Optional.ofNullable(productId) + .orElse(JsonNullable.undefined()); + this.variantId = Optional.ofNullable(variantId) + .orElse(JsonNullable.undefined()); + this.sku = Optional.ofNullable(sku) + .orElse(JsonNullable.undefined()); + this.name = JsonNullable.of(name); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.options = options; - this.quantity = quantity; - this.unitPrice = unitPrice; - this.taxRate = taxRate; - this.taxAmount = taxAmount; - this.isRefunded = isRefunded; - this.refundedAmount = refundedAmount; - this.refundedQuantity = refundedQuantity; - this.subTotal = subTotal; - this.totalAmount = totalAmount; + this.quantity = JsonNullable.of(quantity); + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.taxRate = Optional.ofNullable(taxRate) + .orElse(JsonNullable.undefined()); + this.taxAmount = Optional.ofNullable(taxAmount) + .orElse(JsonNullable.undefined()); + this.isRefunded = Optional.ofNullable(isRefunded) + .orElse(JsonNullable.undefined()); + this.refundedAmount = Optional.ofNullable(refundedAmount) + .orElse(JsonNullable.undefined()); + this.refundedQuantity = Optional.ofNullable(refundedQuantity) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); + this.totalAmount = Optional.ofNullable(totalAmount) + .orElse(JsonNullable.undefined()); this.discounts = discounts; } public EcommerceOrderLineItem() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * A unique identifier for the product associated with the line item. */ - @JsonIgnore public JsonNullable productId() { - return productId; + return this.productId; } /** * A unique identifier for the variant of the product associated with the line item, if applicable. */ - @JsonIgnore public JsonNullable variantId() { - return variantId; + return this.variantId; } /** * The SKU of the product or variant associated with the line item. */ - @JsonIgnore public JsonNullable sku() { - return sku; + return this.sku; } /** * The name of the product or variant associated with the line item. */ - @JsonIgnore - public Optional name() { - return name; + public JsonNullable name() { + return this.name; } /** * The description of the product or variant associated with the line item. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> options() { - return (Optional>) options; + return Optional.ofNullable(this.options); } /** * The quantity of the product or variant associated with the line item. */ - @JsonIgnore - public Optional quantity() { - return quantity; + public JsonNullable quantity() { + return this.quantity; } /** * The unit price of the product or variant associated with the line item. */ - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } /** * The tax rate applied to the product or variant associated with the line item. */ - @JsonIgnore public JsonNullable taxRate() { - return taxRate; + return this.taxRate; } /** * The total tax amount applied to the product or variant associated with the line item. */ - @JsonIgnore public JsonNullable taxAmount() { - return taxAmount; + return this.taxAmount; } /** * Whether the line item has been refunded. */ - @JsonIgnore public JsonNullable isRefunded() { - return isRefunded; + return this.isRefunded; } /** * The amount of the line item that has been refunded. */ - @JsonIgnore public JsonNullable refundedAmount() { - return refundedAmount; + return this.refundedAmount; } /** * The quantity of the line item that has been refunded. */ - @JsonIgnore public JsonNullable refundedQuantity() { - return refundedQuantity; + return this.refundedQuantity; } /** * The sub total for the product(s) or variant associated with the line item, excluding taxes and discounts. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * The total amount for the product(s) or variant associated with the line item, including taxes and discounts. */ - @JsonIgnore public JsonNullable totalAmount() { - return totalAmount; + return this.totalAmount; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> discounts() { - return (Optional>) discounts; + return Optional.ofNullable(this.discounts); } public static Builder builder() { @@ -342,301 +318,150 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EcommerceOrderLineItem withId(String id) { - Utils.checkNotNull(id, "id"); + public EcommerceOrderLineItem withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public EcommerceOrderLineItem withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * A unique identifier for the product associated with the line item. */ - public EcommerceOrderLineItem withProductId(String productId) { - Utils.checkNotNull(productId, "productId"); + public EcommerceOrderLineItem withProductId(@Nullable String productId) { this.productId = JsonNullable.of(productId); return this; } - /** - * A unique identifier for the product associated with the line item. - */ - public EcommerceOrderLineItem withProductId(JsonNullable productId) { - Utils.checkNotNull(productId, "productId"); - this.productId = productId; - return this; - } /** * A unique identifier for the variant of the product associated with the line item, if applicable. */ - public EcommerceOrderLineItem withVariantId(String variantId) { - Utils.checkNotNull(variantId, "variantId"); + public EcommerceOrderLineItem withVariantId(@Nullable String variantId) { this.variantId = JsonNullable.of(variantId); return this; } - /** - * A unique identifier for the variant of the product associated with the line item, if applicable. - */ - public EcommerceOrderLineItem withVariantId(JsonNullable variantId) { - Utils.checkNotNull(variantId, "variantId"); - this.variantId = variantId; - return this; - } /** * The SKU of the product or variant associated with the line item. */ - public EcommerceOrderLineItem withSku(String sku) { - Utils.checkNotNull(sku, "sku"); + public EcommerceOrderLineItem withSku(@Nullable String sku) { this.sku = JsonNullable.of(sku); return this; } - /** - * The SKU of the product or variant associated with the line item. - */ - public EcommerceOrderLineItem withSku(JsonNullable sku) { - Utils.checkNotNull(sku, "sku"); - this.sku = sku; - return this; - } /** * The name of the product or variant associated with the line item. */ - public EcommerceOrderLineItem withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); + public EcommerceOrderLineItem withName(@Nullable String name) { + this.name = JsonNullable.of(name); return this; } - /** - * The name of the product or variant associated with the line item. - */ - public EcommerceOrderLineItem withName(Optional name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - /** * The description of the product or variant associated with the line item. */ - public EcommerceOrderLineItem withDescription(String description) { - Utils.checkNotNull(description, "description"); + public EcommerceOrderLineItem withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the product or variant associated with the line item. - */ - public EcommerceOrderLineItem withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - public EcommerceOrderLineItem withOptions(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - - - public EcommerceOrderLineItem withOptions(Optional> options) { - Utils.checkNotNull(options, "options"); + public EcommerceOrderLineItem withOptions(@Nullable List options) { this.options = options; return this; } - /** - * The quantity of the product or variant associated with the line item. - */ - public EcommerceOrderLineItem withQuantity(String quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = Optional.ofNullable(quantity); - return this; - } - /** * The quantity of the product or variant associated with the line item. */ - public EcommerceOrderLineItem withQuantity(Optional quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; + public EcommerceOrderLineItem withQuantity(@Nullable String quantity) { + this.quantity = JsonNullable.of(quantity); return this; } + /** * The unit price of the product or variant associated with the line item. */ - public EcommerceOrderLineItem withUnitPrice(String unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public EcommerceOrderLineItem withUnitPrice(@Nullable String unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - /** - * The unit price of the product or variant associated with the line item. - */ - public EcommerceOrderLineItem withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } /** * The tax rate applied to the product or variant associated with the line item. */ - public EcommerceOrderLineItem withTaxRate(String taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public EcommerceOrderLineItem withTaxRate(@Nullable String taxRate) { this.taxRate = JsonNullable.of(taxRate); return this; } - /** - * The tax rate applied to the product or variant associated with the line item. - */ - public EcommerceOrderLineItem withTaxRate(JsonNullable taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = taxRate; - return this; - } /** * The total tax amount applied to the product or variant associated with the line item. */ - public EcommerceOrderLineItem withTaxAmount(String taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public EcommerceOrderLineItem withTaxAmount(@Nullable String taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * The total tax amount applied to the product or variant associated with the line item. - */ - public EcommerceOrderLineItem withTaxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } /** * Whether the line item has been refunded. */ - public EcommerceOrderLineItem withIsRefunded(boolean isRefunded) { - Utils.checkNotNull(isRefunded, "isRefunded"); + public EcommerceOrderLineItem withIsRefunded(@Nullable Boolean isRefunded) { this.isRefunded = JsonNullable.of(isRefunded); return this; } - /** - * Whether the line item has been refunded. - */ - public EcommerceOrderLineItem withIsRefunded(JsonNullable isRefunded) { - Utils.checkNotNull(isRefunded, "isRefunded"); - this.isRefunded = isRefunded; - return this; - } /** * The amount of the line item that has been refunded. */ - public EcommerceOrderLineItem withRefundedAmount(String refundedAmount) { - Utils.checkNotNull(refundedAmount, "refundedAmount"); + public EcommerceOrderLineItem withRefundedAmount(@Nullable String refundedAmount) { this.refundedAmount = JsonNullable.of(refundedAmount); return this; } - /** - * The amount of the line item that has been refunded. - */ - public EcommerceOrderLineItem withRefundedAmount(JsonNullable refundedAmount) { - Utils.checkNotNull(refundedAmount, "refundedAmount"); - this.refundedAmount = refundedAmount; - return this; - } /** * The quantity of the line item that has been refunded. */ - public EcommerceOrderLineItem withRefundedQuantity(String refundedQuantity) { - Utils.checkNotNull(refundedQuantity, "refundedQuantity"); + public EcommerceOrderLineItem withRefundedQuantity(@Nullable String refundedQuantity) { this.refundedQuantity = JsonNullable.of(refundedQuantity); return this; } - /** - * The quantity of the line item that has been refunded. - */ - public EcommerceOrderLineItem withRefundedQuantity(JsonNullable refundedQuantity) { - Utils.checkNotNull(refundedQuantity, "refundedQuantity"); - this.refundedQuantity = refundedQuantity; - return this; - } /** * The sub total for the product(s) or variant associated with the line item, excluding taxes and discounts. */ - public EcommerceOrderLineItem withSubTotal(String subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public EcommerceOrderLineItem withSubTotal(@Nullable String subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * The sub total for the product(s) or variant associated with the line item, excluding taxes and discounts. - */ - public EcommerceOrderLineItem withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * The total amount for the product(s) or variant associated with the line item, including taxes and discounts. */ - public EcommerceOrderLineItem withTotalAmount(String totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public EcommerceOrderLineItem withTotalAmount(@Nullable String totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * The total amount for the product(s) or variant associated with the line item, including taxes and discounts. - */ - public EcommerceOrderLineItem withTotalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - public EcommerceOrderLineItem withDiscounts(List discounts) { - Utils.checkNotNull(discounts, "discounts"); - this.discounts = Optional.ofNullable(discounts); - return this; - } - - - public EcommerceOrderLineItem withDiscounts(Optional> discounts) { - Utils.checkNotNull(discounts, "discounts"); + public EcommerceOrderLineItem withDiscounts(@Nullable List discounts) { this.discounts = discounts; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -702,357 +527,175 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable productId = JsonNullable.undefined(); + private JsonNullable productId; - private JsonNullable variantId = JsonNullable.undefined(); + private JsonNullable variantId; - private JsonNullable sku = JsonNullable.undefined(); + private JsonNullable sku; - private Optional name = Optional.empty(); + private String name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional> options = Optional.empty(); + private List options; - private Optional quantity = Optional.empty(); + private String quantity; - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable taxRate = JsonNullable.undefined(); + private JsonNullable taxRate; - private JsonNullable taxAmount = JsonNullable.undefined(); + private JsonNullable taxAmount; - private JsonNullable isRefunded = JsonNullable.undefined(); + private JsonNullable isRefunded; - private JsonNullable refundedAmount = JsonNullable.undefined(); + private JsonNullable refundedAmount; - private JsonNullable refundedQuantity = JsonNullable.undefined(); + private JsonNullable refundedQuantity; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private JsonNullable totalAmount = JsonNullable.undefined(); + private JsonNullable totalAmount; - private Optional> discounts = Optional.empty(); + private List discounts; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * A unique identifier for the product associated with the line item. */ - public Builder productId(String productId) { - Utils.checkNotNull(productId, "productId"); + public Builder productId(@Nullable String productId) { this.productId = JsonNullable.of(productId); return this; } - /** - * A unique identifier for the product associated with the line item. - */ - public Builder productId(JsonNullable productId) { - Utils.checkNotNull(productId, "productId"); - this.productId = productId; - return this; - } - - /** * A unique identifier for the variant of the product associated with the line item, if applicable. */ - public Builder variantId(String variantId) { - Utils.checkNotNull(variantId, "variantId"); + public Builder variantId(@Nullable String variantId) { this.variantId = JsonNullable.of(variantId); return this; } - /** - * A unique identifier for the variant of the product associated with the line item, if applicable. - */ - public Builder variantId(JsonNullable variantId) { - Utils.checkNotNull(variantId, "variantId"); - this.variantId = variantId; - return this; - } - - /** * The SKU of the product or variant associated with the line item. */ - public Builder sku(String sku) { - Utils.checkNotNull(sku, "sku"); + public Builder sku(@Nullable String sku) { this.sku = JsonNullable.of(sku); return this; } - /** - * The SKU of the product or variant associated with the line item. - */ - public Builder sku(JsonNullable sku) { - Utils.checkNotNull(sku, "sku"); - this.sku = sku; - return this; - } - - - /** - * The name of the product or variant associated with the line item. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the product or variant associated with the line item. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * The description of the product or variant associated with the line item. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the product or variant associated with the line item. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - public Builder options(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - - public Builder options(Optional> options) { - Utils.checkNotNull(options, "options"); + public Builder options(@Nullable List options) { this.options = options; return this; } - /** * The quantity of the product or variant associated with the line item. */ - public Builder quantity(String quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = Optional.ofNullable(quantity); - return this; - } - - /** - * The quantity of the product or variant associated with the line item. - */ - public Builder quantity(Optional quantity) { - Utils.checkNotNull(quantity, "quantity"); + public Builder quantity(@Nullable String quantity) { this.quantity = quantity; return this; } - /** * The unit price of the product or variant associated with the line item. */ - public Builder unitPrice(String unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable String unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - /** - * The unit price of the product or variant associated with the line item. - */ - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - /** * The tax rate applied to the product or variant associated with the line item. */ - public Builder taxRate(String taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable String taxRate) { this.taxRate = JsonNullable.of(taxRate); return this; } - /** - * The tax rate applied to the product or variant associated with the line item. - */ - public Builder taxRate(JsonNullable taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = taxRate; - return this; - } - - /** * The total tax amount applied to the product or variant associated with the line item. */ - public Builder taxAmount(String taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public Builder taxAmount(@Nullable String taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * The total tax amount applied to the product or variant associated with the line item. - */ - public Builder taxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } - - /** * Whether the line item has been refunded. */ - public Builder isRefunded(boolean isRefunded) { - Utils.checkNotNull(isRefunded, "isRefunded"); + public Builder isRefunded(@Nullable Boolean isRefunded) { this.isRefunded = JsonNullable.of(isRefunded); return this; } - /** - * Whether the line item has been refunded. - */ - public Builder isRefunded(JsonNullable isRefunded) { - Utils.checkNotNull(isRefunded, "isRefunded"); - this.isRefunded = isRefunded; - return this; - } - - /** * The amount of the line item that has been refunded. */ - public Builder refundedAmount(String refundedAmount) { - Utils.checkNotNull(refundedAmount, "refundedAmount"); + public Builder refundedAmount(@Nullable String refundedAmount) { this.refundedAmount = JsonNullable.of(refundedAmount); return this; } - /** - * The amount of the line item that has been refunded. - */ - public Builder refundedAmount(JsonNullable refundedAmount) { - Utils.checkNotNull(refundedAmount, "refundedAmount"); - this.refundedAmount = refundedAmount; - return this; - } - - /** * The quantity of the line item that has been refunded. */ - public Builder refundedQuantity(String refundedQuantity) { - Utils.checkNotNull(refundedQuantity, "refundedQuantity"); + public Builder refundedQuantity(@Nullable String refundedQuantity) { this.refundedQuantity = JsonNullable.of(refundedQuantity); return this; } - /** - * The quantity of the line item that has been refunded. - */ - public Builder refundedQuantity(JsonNullable refundedQuantity) { - Utils.checkNotNull(refundedQuantity, "refundedQuantity"); - this.refundedQuantity = refundedQuantity; - return this; - } - - /** * The sub total for the product(s) or variant associated with the line item, excluding taxes and discounts. */ - public Builder subTotal(String subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable String subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * The sub total for the product(s) or variant associated with the line item, excluding taxes and discounts. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * The total amount for the product(s) or variant associated with the line item, including taxes and discounts. */ - public Builder totalAmount(String totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable String totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * The total amount for the product(s) or variant associated with the line item, including taxes and discounts. - */ - public Builder totalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - - public Builder discounts(List discounts) { - Utils.checkNotNull(discounts, "discounts"); - this.discounts = Optional.ofNullable(discounts); - return this; - } - - public Builder discounts(Optional> discounts) { - Utils.checkNotNull(discounts, "discounts"); + public Builder discounts(@Nullable List discounts) { this.discounts = discounts; return this; } public EcommerceOrderLineItem build() { - return new EcommerceOrderLineItem( id, productId, variantId, sku, name, description, diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceOrderRefund.java b/src/main/java/com/apideck/unify/models/components/EcommerceOrderRefund.java index ec92c711..76872830 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceOrderRefund.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceOrderRefund.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -34,21 +33,21 @@ public class EcommerceOrderRefund { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("amount") - private Optional amount; + private String amount; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The reason for the refund. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("reason") - private Optional reason; + private String reason; /** * The date and time when the object was created. @@ -59,67 +58,59 @@ public class EcommerceOrderRefund { @JsonCreator public EcommerceOrderRefund( - @JsonProperty("id") JsonNullable id, - @JsonProperty("amount") Optional amount, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("reason") Optional reason, - @JsonProperty("created_at") JsonNullable createdAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(amount, "amount"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(reason, "reason"); - Utils.checkNotNull(createdAt, "createdAt"); - this.id = id; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("amount") @Nullable String amount, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("reason") @Nullable String reason, + @JsonProperty("created_at") @Nullable JsonNullable createdAt) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); this.amount = amount; - this.currency = currency; + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); this.reason = reason; - this.createdAt = createdAt; + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); } public EcommerceOrderRefund() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The amount of the refund. */ - @JsonIgnore public Optional amount() { - return amount; + return Optional.ofNullable(this.amount); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The reason for the refund. */ - @JsonIgnore public Optional reason() { - return reason; + return Optional.ofNullable(this.reason); } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } public static Builder builder() { @@ -130,64 +121,26 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EcommerceOrderRefund withId(String id) { - Utils.checkNotNull(id, "id"); + public EcommerceOrderRefund withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public EcommerceOrderRefund withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The amount of the refund. */ - public EcommerceOrderRefund withAmount(String amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = Optional.ofNullable(amount); - return this; - } - - - /** - * The amount of the refund. - */ - public EcommerceOrderRefund withAmount(Optional amount) { - Utils.checkNotNull(amount, "amount"); + public EcommerceOrderRefund withAmount(@Nullable String amount) { this.amount = amount; return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public EcommerceOrderRefund withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = JsonNullable.of(currency); - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public EcommerceOrderRefund withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** - * The reason for the refund. - */ - public EcommerceOrderRefund withReason(String reason) { - Utils.checkNotNull(reason, "reason"); - this.reason = Optional.ofNullable(reason); + public EcommerceOrderRefund withCurrency(@Nullable Currency currency) { + this.currency = JsonNullable.of(currency); return this; } @@ -195,29 +148,20 @@ public EcommerceOrderRefund withReason(String reason) { /** * The reason for the refund. */ - public EcommerceOrderRefund withReason(Optional reason) { - Utils.checkNotNull(reason, "reason"); + public EcommerceOrderRefund withReason(@Nullable String reason) { this.reason = reason; return this; } + /** * The date and time when the object was created. */ - public EcommerceOrderRefund withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public EcommerceOrderRefund withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public EcommerceOrderRefund withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -256,117 +200,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private Optional amount = Optional.empty(); + private String amount; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private Optional reason = Optional.empty(); + private String reason; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The amount of the refund. */ - public Builder amount(String amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = Optional.ofNullable(amount); - return this; - } - - /** - * The amount of the refund. - */ - public Builder amount(Optional amount) { - Utils.checkNotNull(amount, "amount"); + public Builder amount(@Nullable String amount) { this.amount = amount; return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - /** - * The reason for the refund. - */ - public Builder reason(String reason) { - Utils.checkNotNull(reason, "reason"); - this.reason = Optional.ofNullable(reason); - return this; - } - /** * The reason for the refund. */ - public Builder reason(Optional reason) { - Utils.checkNotNull(reason, "reason"); + public Builder reason(@Nullable String reason) { this.reason = reason; return this; } - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - public EcommerceOrderRefund build() { - return new EcommerceOrderRefund( id, amount, currency, reason, createdAt); diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceOrdersFilter.java b/src/main/java/com/apideck/unify/models/components/EcommerceOrdersFilter.java index f7435b91..cef0d592 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceOrdersFilter.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceOrdersFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,36 +17,32 @@ public class EcommerceOrdersFilter { * Customer email address to filter on */ @SpeakeasyMetadata("queryParam:name=email") - private Optional email; + private String email; /** * Customer id to filter on */ @SpeakeasyMetadata("queryParam:name=customer_id") - private Optional customerId; + private String customerId; /** * Minimum date the order was last modified */ @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private String updatedSince; /** * Minimum date the order was created */ @SpeakeasyMetadata("queryParam:name=created_since") - private Optional createdSince; + private String createdSince; @JsonCreator public EcommerceOrdersFilter( - Optional email, - Optional customerId, - Optional updatedSince, - Optional createdSince) { - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(customerId, "customerId"); - Utils.checkNotNull(updatedSince, "updatedSince"); - Utils.checkNotNull(createdSince, "createdSince"); + @Nullable String email, + @Nullable String customerId, + @Nullable String updatedSince, + @Nullable String createdSince) { this.email = email; this.customerId = customerId; this.updatedSince = updatedSince; @@ -54,40 +50,36 @@ public EcommerceOrdersFilter( } public EcommerceOrdersFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * Customer email address to filter on */ - @JsonIgnore public Optional email() { - return email; + return Optional.ofNullable(this.email); } /** * Customer id to filter on */ - @JsonIgnore public Optional customerId() { - return customerId; + return Optional.ofNullable(this.customerId); } /** * Minimum date the order was last modified */ - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } /** * Minimum date the order was created */ - @JsonIgnore public Optional createdSince() { - return createdSince; + return Optional.ofNullable(this.createdSince); } public static Builder builder() { @@ -98,79 +90,39 @@ public static Builder builder() { /** * Customer email address to filter on */ - public EcommerceOrdersFilter withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - - - /** - * Customer email address to filter on - */ - public EcommerceOrdersFilter withEmail(Optional email) { - Utils.checkNotNull(email, "email"); + public EcommerceOrdersFilter withEmail(@Nullable String email) { this.email = email; return this; } - /** - * Customer id to filter on - */ - public EcommerceOrdersFilter withCustomerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - /** * Customer id to filter on */ - public EcommerceOrdersFilter withCustomerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public EcommerceOrdersFilter withCustomerId(@Nullable String customerId) { this.customerId = customerId; return this; } - /** - * Minimum date the order was last modified - */ - public EcommerceOrdersFilter withUpdatedSince(String updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - /** * Minimum date the order was last modified */ - public EcommerceOrdersFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public EcommerceOrdersFilter withUpdatedSince(@Nullable String updatedSince) { this.updatedSince = updatedSince; return this; } - /** - * Minimum date the order was created - */ - public EcommerceOrdersFilter withCreatedSince(String createdSince) { - Utils.checkNotNull(createdSince, "createdSince"); - this.createdSince = Optional.ofNullable(createdSince); - return this; - } - /** * Minimum date the order was created */ - public EcommerceOrdersFilter withCreatedSince(Optional createdSince) { - Utils.checkNotNull(createdSince, "createdSince"); + public EcommerceOrdersFilter withCreatedSince(@Nullable String createdSince) { this.createdSince = createdSince; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -206,96 +158,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional email = Optional.empty(); + private String email; - private Optional customerId = Optional.empty(); + private String customerId; - private Optional updatedSince = Optional.empty(); + private String updatedSince; - private Optional createdSince = Optional.empty(); + private String createdSince; private Builder() { // force use of static builder() method } - /** * Customer email address to filter on */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - - /** - * Customer email address to filter on - */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } - - /** - * Customer id to filter on - */ - public Builder customerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - /** * Customer id to filter on */ - public Builder customerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public Builder customerId(@Nullable String customerId) { this.customerId = customerId; return this; } - /** * Minimum date the order was last modified */ - public Builder updatedSince(String updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - /** - * Minimum date the order was last modified - */ - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable String updatedSince) { this.updatedSince = updatedSince; return this; } - /** * Minimum date the order was created */ - public Builder createdSince(String createdSince) { - Utils.checkNotNull(createdSince, "createdSince"); - this.createdSince = Optional.ofNullable(createdSince); - return this; - } - - /** - * Minimum date the order was created - */ - public Builder createdSince(Optional createdSince) { - Utils.checkNotNull(createdSince, "createdSince"); + public Builder createdSince(@Nullable String createdSince) { this.createdSince = createdSince; return this; } public EcommerceOrdersFilter build() { - return new EcommerceOrdersFilter( email, customerId, updatedSince, createdSince); diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceProduct.java b/src/main/java/com/apideck/unify/models/components/EcommerceProduct.java index 30f52acb..216a52ec 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceProduct.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceProduct.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -46,7 +46,7 @@ public class EcommerceProduct { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * The price of the product. @@ -74,7 +74,7 @@ public class EcommerceProduct { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("images") - private JsonNullable> images; + private JsonNullable> images; /** * The weight of the product. @@ -95,33 +95,33 @@ public class EcommerceProduct { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("options") - private Optional> options; + private List options; @JsonInclude(Include.NON_ABSENT) @JsonProperty("variants") - private Optional> variants; + private List variants; /** * An array of tags for the product, used for organization and searching. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private Optional> tags; + private List tags; /** * An array of categories for the product, used for organization and searching. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("categories") - private Optional> categories; + private List categories; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The date and time when the object was created. @@ -139,207 +139,179 @@ public class EcommerceProduct { @JsonCreator public EcommerceProduct( - @JsonProperty("id") String id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("status") JsonNullable status, - @JsonProperty("price") JsonNullable price, - @JsonProperty("sku") JsonNullable sku, - @JsonProperty("inventory_quantity") JsonNullable inventoryQuantity, - @JsonProperty("images") JsonNullable> images, - @JsonProperty("weight") JsonNullable weight, - @JsonProperty("weight_unit") JsonNullable weightUnit, - @JsonProperty("options") Optional> options, - @JsonProperty("variants") Optional> variants, - @JsonProperty("tags") Optional> tags, - @JsonProperty("categories") Optional> categories, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("updated_at") JsonNullable updatedAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(price, "price"); - Utils.checkNotNull(sku, "sku"); - Utils.checkNotNull(inventoryQuantity, "inventoryQuantity"); - Utils.checkNotNull(images, "images"); - Utils.checkNotNull(weight, "weight"); - Utils.checkNotNull(weightUnit, "weightUnit"); - Utils.checkNotNull(options, "options"); - Utils.checkNotNull(variants, "variants"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(categories, "categories"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); - this.id = id; - this.name = name; - this.description = description; - this.status = status; - this.price = price; - this.sku = sku; - this.inventoryQuantity = inventoryQuantity; - this.images = images; - this.weight = weight; - this.weightUnit = weightUnit; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("price") @Nullable JsonNullable price, + @JsonProperty("sku") @Nullable JsonNullable sku, + @JsonProperty("inventory_quantity") @Nullable JsonNullable inventoryQuantity, + @JsonProperty("images") @Nullable JsonNullable> images, + @JsonProperty("weight") @Nullable JsonNullable weight, + @JsonProperty("weight_unit") @Nullable JsonNullable weightUnit, + @JsonProperty("options") @Nullable List options, + @JsonProperty("variants") @Nullable List variants, + @JsonProperty("tags") @Nullable List tags, + @JsonProperty("categories") @Nullable List categories, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.price = Optional.ofNullable(price) + .orElse(JsonNullable.undefined()); + this.sku = Optional.ofNullable(sku) + .orElse(JsonNullable.undefined()); + this.inventoryQuantity = Optional.ofNullable(inventoryQuantity) + .orElse(JsonNullable.undefined()); + this.images = Optional.ofNullable(images) + .orElse(JsonNullable.undefined()); + this.weight = Optional.ofNullable(weight) + .orElse(JsonNullable.undefined()); + this.weightUnit = Optional.ofNullable(weightUnit) + .orElse(JsonNullable.undefined()); this.options = options; this.variants = variants; this.tags = tags; this.categories = categories; - this.customMappings = customMappings; - this.createdAt = createdAt; - this.updatedAt = updatedAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); } public EcommerceProduct( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The name of the product as it should be displayed to customers. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * A detailed description of the product. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The current status of the product (active or archived). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * The price of the product. */ - @JsonIgnore public JsonNullable price() { - return price; + return this.price; } /** * The stock keeping unit of the product. */ - @JsonIgnore public JsonNullable sku() { - return sku; + return this.sku; } /** * The quantity of the product in stock. */ - @JsonIgnore public JsonNullable inventoryQuantity() { - return inventoryQuantity; + return this.inventoryQuantity; } /** * An array of image URLs for the product. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> images() { - return (JsonNullable>) images; + return this.images; } /** * The weight of the product. */ - @JsonIgnore public JsonNullable weight() { - return weight; + return this.weight; } /** * The unit of measurement for the weight of the product. */ - @JsonIgnore public JsonNullable weightUnit() { - return weightUnit; + return this.weightUnit; } /** * An array of options for the product. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> options() { - return (Optional>) options; + return Optional.ofNullable(this.options); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> variants() { - return (Optional>) variants; + return Optional.ofNullable(this.variants); } /** * An array of tags for the product, used for organization and searching. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> tags() { - return (Optional>) tags; + return Optional.ofNullable(this.tags); } /** * An array of categories for the product, used for organization and searching. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> categories() { - return (Optional>) categories; + return Optional.ofNullable(this.categories); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } public static Builder builder() { @@ -350,297 +322,152 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EcommerceProduct withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public EcommerceProduct withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The name of the product as it should be displayed to customers. */ - public EcommerceProduct withName(String name) { - Utils.checkNotNull(name, "name"); + public EcommerceProduct withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the product as it should be displayed to customers. - */ - public EcommerceProduct withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * A detailed description of the product. */ - public EcommerceProduct withDescription(String description) { - Utils.checkNotNull(description, "description"); + public EcommerceProduct withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A detailed description of the product. - */ - public EcommerceProduct withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The current status of the product (active or archived). */ - public EcommerceProduct withStatus(ProductStatus status) { - Utils.checkNotNull(status, "status"); + public EcommerceProduct withStatus(@Nullable ProductStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the product (active or archived). - */ - public EcommerceProduct withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The price of the product. */ - public EcommerceProduct withPrice(String price) { - Utils.checkNotNull(price, "price"); + public EcommerceProduct withPrice(@Nullable String price) { this.price = JsonNullable.of(price); return this; } - /** - * The price of the product. - */ - public EcommerceProduct withPrice(JsonNullable price) { - Utils.checkNotNull(price, "price"); - this.price = price; - return this; - } /** * The stock keeping unit of the product. */ - public EcommerceProduct withSku(String sku) { - Utils.checkNotNull(sku, "sku"); + public EcommerceProduct withSku(@Nullable String sku) { this.sku = JsonNullable.of(sku); return this; } - /** - * The stock keeping unit of the product. - */ - public EcommerceProduct withSku(JsonNullable sku) { - Utils.checkNotNull(sku, "sku"); - this.sku = sku; - return this; - } /** * The quantity of the product in stock. */ - public EcommerceProduct withInventoryQuantity(String inventoryQuantity) { - Utils.checkNotNull(inventoryQuantity, "inventoryQuantity"); + public EcommerceProduct withInventoryQuantity(@Nullable String inventoryQuantity) { this.inventoryQuantity = JsonNullable.of(inventoryQuantity); return this; } - /** - * The quantity of the product in stock. - */ - public EcommerceProduct withInventoryQuantity(JsonNullable inventoryQuantity) { - Utils.checkNotNull(inventoryQuantity, "inventoryQuantity"); - this.inventoryQuantity = inventoryQuantity; - return this; - } /** * An array of image URLs for the product. */ - public EcommerceProduct withImages(List images) { - Utils.checkNotNull(images, "images"); + public EcommerceProduct withImages(@Nullable List images) { this.images = JsonNullable.of(images); return this; } - /** - * An array of image URLs for the product. - */ - public EcommerceProduct withImages(JsonNullable> images) { - Utils.checkNotNull(images, "images"); - this.images = images; - return this; - } /** * The weight of the product. */ - public EcommerceProduct withWeight(String weight) { - Utils.checkNotNull(weight, "weight"); + public EcommerceProduct withWeight(@Nullable String weight) { this.weight = JsonNullable.of(weight); return this; } - /** - * The weight of the product. - */ - public EcommerceProduct withWeight(JsonNullable weight) { - Utils.checkNotNull(weight, "weight"); - this.weight = weight; - return this; - } /** * The unit of measurement for the weight of the product. */ - public EcommerceProduct withWeightUnit(String weightUnit) { - Utils.checkNotNull(weightUnit, "weightUnit"); + public EcommerceProduct withWeightUnit(@Nullable String weightUnit) { this.weightUnit = JsonNullable.of(weightUnit); return this; } - /** - * The unit of measurement for the weight of the product. - */ - public EcommerceProduct withWeightUnit(JsonNullable weightUnit) { - Utils.checkNotNull(weightUnit, "weightUnit"); - this.weightUnit = weightUnit; - return this; - } - - /** - * An array of options for the product. - */ - public EcommerceProduct withOptions(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - /** * An array of options for the product. */ - public EcommerceProduct withOptions(Optional> options) { - Utils.checkNotNull(options, "options"); + public EcommerceProduct withOptions(@Nullable List options) { this.options = options; return this; } - public EcommerceProduct withVariants(List variants) { - Utils.checkNotNull(variants, "variants"); - this.variants = Optional.ofNullable(variants); - return this; - } - - public EcommerceProduct withVariants(Optional> variants) { - Utils.checkNotNull(variants, "variants"); + public EcommerceProduct withVariants(@Nullable List variants) { this.variants = variants; return this; } - /** - * An array of tags for the product, used for organization and searching. - */ - public EcommerceProduct withTags(List tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = Optional.ofNullable(tags); - return this; - } - /** * An array of tags for the product, used for organization and searching. */ - public EcommerceProduct withTags(Optional> tags) { - Utils.checkNotNull(tags, "tags"); + public EcommerceProduct withTags(@Nullable List tags) { this.tags = tags; return this; } - /** - * An array of categories for the product, used for organization and searching. - */ - public EcommerceProduct withCategories(List categories) { - Utils.checkNotNull(categories, "categories"); - this.categories = Optional.ofNullable(categories); - return this; - } - /** * An array of categories for the product, used for organization and searching. */ - public EcommerceProduct withCategories(Optional> categories) { - Utils.checkNotNull(categories, "categories"); + public EcommerceProduct withCategories(@Nullable List categories) { this.categories = categories; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public EcommerceProduct withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public EcommerceProduct withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public EcommerceProduct withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The date and time when the object was created. */ - public EcommerceProduct withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public EcommerceProduct withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public EcommerceProduct withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The date and time when the object was last updated. */ - public EcommerceProduct withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public EcommerceProduct withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public EcommerceProduct withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -709,352 +536,176 @@ public final static class Builder { private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable price = JsonNullable.undefined(); + private JsonNullable price; - private JsonNullable sku = JsonNullable.undefined(); + private JsonNullable sku; - private JsonNullable inventoryQuantity = JsonNullable.undefined(); + private JsonNullable inventoryQuantity; - private JsonNullable> images = JsonNullable.undefined(); + private JsonNullable> images; - private JsonNullable weight = JsonNullable.undefined(); + private JsonNullable weight; - private JsonNullable weightUnit = JsonNullable.undefined(); + private JsonNullable weightUnit; - private Optional> options = Optional.empty(); + private List options; - private Optional> variants = Optional.empty(); + private List variants; - private Optional> tags = Optional.empty(); + private List tags; - private Optional> categories = Optional.empty(); + private List categories; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The name of the product as it should be displayed to customers. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the product as it should be displayed to customers. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * A detailed description of the product. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A detailed description of the product. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The current status of the product (active or archived). */ - public Builder status(ProductStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ProductStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the product (active or archived). - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The price of the product. */ - public Builder price(String price) { - Utils.checkNotNull(price, "price"); + public Builder price(@Nullable String price) { this.price = JsonNullable.of(price); return this; } - /** - * The price of the product. - */ - public Builder price(JsonNullable price) { - Utils.checkNotNull(price, "price"); - this.price = price; - return this; - } - - /** * The stock keeping unit of the product. */ - public Builder sku(String sku) { - Utils.checkNotNull(sku, "sku"); + public Builder sku(@Nullable String sku) { this.sku = JsonNullable.of(sku); return this; } - /** - * The stock keeping unit of the product. - */ - public Builder sku(JsonNullable sku) { - Utils.checkNotNull(sku, "sku"); - this.sku = sku; - return this; - } - - /** * The quantity of the product in stock. */ - public Builder inventoryQuantity(String inventoryQuantity) { - Utils.checkNotNull(inventoryQuantity, "inventoryQuantity"); + public Builder inventoryQuantity(@Nullable String inventoryQuantity) { this.inventoryQuantity = JsonNullable.of(inventoryQuantity); return this; } - /** - * The quantity of the product in stock. - */ - public Builder inventoryQuantity(JsonNullable inventoryQuantity) { - Utils.checkNotNull(inventoryQuantity, "inventoryQuantity"); - this.inventoryQuantity = inventoryQuantity; - return this; - } - - /** * An array of image URLs for the product. */ - public Builder images(List images) { - Utils.checkNotNull(images, "images"); + public Builder images(@Nullable List images) { this.images = JsonNullable.of(images); return this; } - /** - * An array of image URLs for the product. - */ - public Builder images(JsonNullable> images) { - Utils.checkNotNull(images, "images"); - this.images = images; - return this; - } - - /** * The weight of the product. */ - public Builder weight(String weight) { - Utils.checkNotNull(weight, "weight"); + public Builder weight(@Nullable String weight) { this.weight = JsonNullable.of(weight); return this; } - /** - * The weight of the product. - */ - public Builder weight(JsonNullable weight) { - Utils.checkNotNull(weight, "weight"); - this.weight = weight; - return this; - } - - /** * The unit of measurement for the weight of the product. */ - public Builder weightUnit(String weightUnit) { - Utils.checkNotNull(weightUnit, "weightUnit"); + public Builder weightUnit(@Nullable String weightUnit) { this.weightUnit = JsonNullable.of(weightUnit); return this; } - /** - * The unit of measurement for the weight of the product. - */ - public Builder weightUnit(JsonNullable weightUnit) { - Utils.checkNotNull(weightUnit, "weightUnit"); - this.weightUnit = weightUnit; - return this; - } - - - /** - * An array of options for the product. - */ - public Builder options(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - /** * An array of options for the product. */ - public Builder options(Optional> options) { - Utils.checkNotNull(options, "options"); + public Builder options(@Nullable List options) { this.options = options; return this; } - - public Builder variants(List variants) { - Utils.checkNotNull(variants, "variants"); - this.variants = Optional.ofNullable(variants); - return this; - } - - public Builder variants(Optional> variants) { - Utils.checkNotNull(variants, "variants"); + public Builder variants(@Nullable List variants) { this.variants = variants; return this; } - - /** - * An array of tags for the product, used for organization and searching. - */ - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = Optional.ofNullable(tags); - return this; - } - /** * An array of tags for the product, used for organization and searching. */ - public Builder tags(Optional> tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = tags; return this; } - - /** - * An array of categories for the product, used for organization and searching. - */ - public Builder categories(List categories) { - Utils.checkNotNull(categories, "categories"); - this.categories = Optional.ofNullable(categories); - return this; - } - /** * An array of categories for the product, used for organization and searching. */ - public Builder categories(Optional> categories) { - Utils.checkNotNull(categories, "categories"); + public Builder categories(@Nullable List categories) { this.categories = categories; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - public EcommerceProduct build() { - return new EcommerceProduct( id, name, description, status, price, sku, diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceProductCategories.java b/src/main/java/com/apideck/unify/models/components/EcommerceProductCategories.java index 19e93cba..679171f3 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceProductCategories.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceProductCategories.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -31,32 +32,30 @@ public class EcommerceProductCategories { @JsonCreator public EcommerceProductCategories( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - this.id = id; - this.name = name; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public EcommerceProductCategories() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The name of the category. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -67,38 +66,20 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EcommerceProductCategories withId(String id) { - Utils.checkNotNull(id, "id"); + public EcommerceProductCategories withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public EcommerceProductCategories withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The name of the category. */ - public EcommerceProductCategories withName(String name) { - Utils.checkNotNull(name, "name"); + public EcommerceProductCategories withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the category. - */ - public EcommerceProductCategories withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -130,54 +111,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The name of the category. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the category. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public EcommerceProductCategories build() { - return new EcommerceProductCategories( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceProductImages.java b/src/main/java/com/apideck/unify/models/components/EcommerceProductImages.java index b661a1b5..69aa63fd 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceProductImages.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceProductImages.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -31,32 +32,30 @@ public class EcommerceProductImages { @JsonCreator public EcommerceProductImages( - @JsonProperty("id") JsonNullable id, - @JsonProperty("url") JsonNullable url) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(url, "url"); - this.id = id; - this.url = url; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("url") @Nullable JsonNullable url) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.url = Optional.ofNullable(url) + .orElse(JsonNullable.undefined()); } public EcommerceProductImages() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The URL of an image of the variant. */ - @JsonIgnore public JsonNullable url() { - return url; + return this.url; } public static Builder builder() { @@ -67,38 +66,20 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EcommerceProductImages withId(String id) { - Utils.checkNotNull(id, "id"); + public EcommerceProductImages withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public EcommerceProductImages withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The URL of an image of the variant. */ - public EcommerceProductImages withUrl(String url) { - Utils.checkNotNull(url, "url"); + public EcommerceProductImages withUrl(@Nullable String url) { this.url = JsonNullable.of(url); return this; } - /** - * The URL of an image of the variant. - */ - public EcommerceProductImages withUrl(JsonNullable url) { - Utils.checkNotNull(url, "url"); - this.url = url; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -130,54 +111,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable url = JsonNullable.undefined(); + private JsonNullable url; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The URL of an image of the variant. */ - public Builder url(String url) { - Utils.checkNotNull(url, "url"); + public Builder url(@Nullable String url) { this.url = JsonNullable.of(url); return this; } - /** - * The URL of an image of the variant. - */ - public Builder url(JsonNullable url) { - Utils.checkNotNull(url, "url"); - this.url = url; - return this; - } - public EcommerceProductImages build() { - return new EcommerceProductImages( id, url); } diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceProductOptions.java b/src/main/java/com/apideck/unify/models/components/EcommerceProductOptions.java index 62dc610b..ed3f8eab 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceProductOptions.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceProductOptions.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -35,45 +34,40 @@ public class EcommerceProductOptions { @JsonInclude(Include.NON_ABSENT) @JsonProperty("values") - private Optional> values; + private List values; @JsonCreator public EcommerceProductOptions( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("values") Optional> values) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(values, "values"); - this.id = id; - this.name = name; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("values") @Nullable List values) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); this.values = values; } public EcommerceProductOptions() { - this(JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null); } /** * A unique identifier for the option of the product. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The name of the option for the product. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> values() { - return (Optional>) values; + return Optional.ofNullable(this.values); } public static Builder builder() { @@ -84,52 +78,27 @@ public static Builder builder() { /** * A unique identifier for the option of the product. */ - public EcommerceProductOptions withId(String id) { - Utils.checkNotNull(id, "id"); + public EcommerceProductOptions withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for the option of the product. - */ - public EcommerceProductOptions withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The name of the option for the product. */ - public EcommerceProductOptions withName(String name) { - Utils.checkNotNull(name, "name"); + public EcommerceProductOptions withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the option for the product. - */ - public EcommerceProductOptions withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - public EcommerceProductOptions withValues(List values) { - Utils.checkNotNull(values, "values"); - this.values = Optional.ofNullable(values); - return this; - } - - public EcommerceProductOptions withValues(Optional> values) { - Utils.checkNotNull(values, "values"); + public EcommerceProductOptions withValues(@Nullable List values) { this.values = values; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -162,69 +131,38 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private Optional> values = Optional.empty(); + private List values; private Builder() { // force use of static builder() method } - /** * A unique identifier for the option of the product. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for the option of the product. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The name of the option for the product. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the option for the product. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - - public Builder values(List values) { - Utils.checkNotNull(values, "values"); - this.values = Optional.ofNullable(values); - return this; - } - - public Builder values(Optional> values) { - Utils.checkNotNull(values, "values"); + public Builder values(@Nullable List values) { this.values = values; return this; } public EcommerceProductOptions build() { - return new EcommerceProductOptions( id, name, values); } diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceProductVariantsOptions.java b/src/main/java/com/apideck/unify/models/components/EcommerceProductVariantsOptions.java index b676f404..f6797009 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceProductVariantsOptions.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceProductVariantsOptions.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -38,43 +39,40 @@ public class EcommerceProductVariantsOptions { @JsonCreator public EcommerceProductVariantsOptions( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("value") JsonNullable value) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(value, "value"); - this.id = id; - this.name = name; - this.value = value; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("value") @Nullable JsonNullable value) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.value = Optional.ofNullable(value) + .orElse(JsonNullable.undefined()); } public EcommerceProductVariantsOptions() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * A unique identifier for the option of the variant. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The name of the option for the variant. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The value of the option for the variant. */ - @JsonIgnore public JsonNullable value() { - return value; + return this.value; } public static Builder builder() { @@ -85,56 +83,29 @@ public static Builder builder() { /** * A unique identifier for the option of the variant. */ - public EcommerceProductVariantsOptions withId(String id) { - Utils.checkNotNull(id, "id"); + public EcommerceProductVariantsOptions withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for the option of the variant. - */ - public EcommerceProductVariantsOptions withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The name of the option for the variant. */ - public EcommerceProductVariantsOptions withName(String name) { - Utils.checkNotNull(name, "name"); + public EcommerceProductVariantsOptions withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the option for the variant. - */ - public EcommerceProductVariantsOptions withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The value of the option for the variant. */ - public EcommerceProductVariantsOptions withValue(String value) { - Utils.checkNotNull(value, "value"); + public EcommerceProductVariantsOptions withValue(@Nullable String value) { this.value = JsonNullable.of(value); return this; } - /** - * The value of the option for the variant. - */ - public EcommerceProductVariantsOptions withValue(JsonNullable value) { - Utils.checkNotNull(value, "value"); - this.value = value; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -168,75 +139,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable value = JsonNullable.undefined(); + private JsonNullable value; private Builder() { // force use of static builder() method } - /** * A unique identifier for the option of the variant. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for the option of the variant. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The name of the option for the variant. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the option for the variant. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The value of the option for the variant. */ - public Builder value(String value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable String value) { this.value = JsonNullable.of(value); return this; } - /** - * The value of the option for the variant. - */ - public Builder value(JsonNullable value) { - Utils.checkNotNull(value, "value"); - this.value = value; - return this; - } - public EcommerceProductVariantsOptions build() { - return new EcommerceProductVariantsOptions( id, name, value); } diff --git a/src/main/java/com/apideck/unify/models/components/EcommerceStore.java b/src/main/java/com/apideck/unify/models/components/EcommerceStore.java index 7e9e78c2..2903d1ed 100644 --- a/src/main/java/com/apideck/unify/models/components/EcommerceStore.java +++ b/src/main/java/com/apideck/unify/models/components/EcommerceStore.java @@ -5,16 +5,17 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -51,7 +52,7 @@ public class EcommerceStore { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The date and time when the object was created. @@ -69,91 +70,83 @@ public class EcommerceStore { @JsonCreator public EcommerceStore( - @JsonProperty("id") String id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("store_url") JsonNullable storeUrl, - @JsonProperty("admin_url") JsonNullable adminUrl, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("updated_at") JsonNullable updatedAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(storeUrl, "storeUrl"); - Utils.checkNotNull(adminUrl, "adminUrl"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); - this.id = id; - this.name = name; - this.storeUrl = storeUrl; - this.adminUrl = adminUrl; - this.customMappings = customMappings; - this.createdAt = createdAt; - this.updatedAt = updatedAt; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("store_url") @Nullable JsonNullable storeUrl, + @JsonProperty("admin_url") @Nullable JsonNullable adminUrl, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.storeUrl = Optional.ofNullable(storeUrl) + .orElse(JsonNullable.undefined()); + this.adminUrl = Optional.ofNullable(adminUrl) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); } public EcommerceStore( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The store's name */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The store's website URL */ - @JsonIgnore public JsonNullable storeUrl() { - return storeUrl; + return this.storeUrl; } /** * The store's admin login URL */ - @JsonIgnore public JsonNullable adminUrl() { - return adminUrl; + return this.adminUrl; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } public static Builder builder() { @@ -164,119 +157,65 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EcommerceStore withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public EcommerceStore withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The store's name */ - public EcommerceStore withName(String name) { - Utils.checkNotNull(name, "name"); + public EcommerceStore withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The store's name - */ - public EcommerceStore withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The store's website URL */ - public EcommerceStore withStoreUrl(String storeUrl) { - Utils.checkNotNull(storeUrl, "storeUrl"); + public EcommerceStore withStoreUrl(@Nullable String storeUrl) { this.storeUrl = JsonNullable.of(storeUrl); return this; } - /** - * The store's website URL - */ - public EcommerceStore withStoreUrl(JsonNullable storeUrl) { - Utils.checkNotNull(storeUrl, "storeUrl"); - this.storeUrl = storeUrl; - return this; - } /** * The store's admin login URL */ - public EcommerceStore withAdminUrl(String adminUrl) { - Utils.checkNotNull(adminUrl, "adminUrl"); + public EcommerceStore withAdminUrl(@Nullable String adminUrl) { this.adminUrl = JsonNullable.of(adminUrl); return this; } - /** - * The store's admin login URL - */ - public EcommerceStore withAdminUrl(JsonNullable adminUrl) { - Utils.checkNotNull(adminUrl, "adminUrl"); - this.adminUrl = adminUrl; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public EcommerceStore withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public EcommerceStore withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public EcommerceStore withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The date and time when the object was created. */ - public EcommerceStore withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public EcommerceStore withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public EcommerceStore withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The date and time when the object was last updated. */ - public EcommerceStore withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public EcommerceStore withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public EcommerceStore withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -322,148 +261,79 @@ public final static class Builder { private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable storeUrl = JsonNullable.undefined(); + private JsonNullable storeUrl; - private JsonNullable adminUrl = JsonNullable.undefined(); + private JsonNullable adminUrl; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The store's name */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The store's name - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The store's website URL */ - public Builder storeUrl(String storeUrl) { - Utils.checkNotNull(storeUrl, "storeUrl"); + public Builder storeUrl(@Nullable String storeUrl) { this.storeUrl = JsonNullable.of(storeUrl); return this; } - /** - * The store's website URL - */ - public Builder storeUrl(JsonNullable storeUrl) { - Utils.checkNotNull(storeUrl, "storeUrl"); - this.storeUrl = storeUrl; - return this; - } - - /** * The store's admin login URL */ - public Builder adminUrl(String adminUrl) { - Utils.checkNotNull(adminUrl, "adminUrl"); + public Builder adminUrl(@Nullable String adminUrl) { this.adminUrl = JsonNullable.of(adminUrl); return this; } - /** - * The store's admin login URL - */ - public Builder adminUrl(JsonNullable adminUrl) { - Utils.checkNotNull(adminUrl, "adminUrl"); - this.adminUrl = adminUrl; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - public EcommerceStore build() { - return new EcommerceStore( id, name, storeUrl, adminUrl, customMappings, createdAt, diff --git a/src/main/java/com/apideck/unify/models/components/Email.java b/src/main/java/com/apideck/unify/models/components/Email.java index 6227dd4e..8711a8f3 100644 --- a/src/main/java/com/apideck/unify/models/components/Email.java +++ b/src/main/java/com/apideck/unify/models/components/Email.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -29,55 +28,50 @@ public class Email { */ @JsonInclude(Include.ALWAYS) @JsonProperty("email") - private Optional email; + private JsonNullable email; /** * Email type */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; @JsonCreator public Email( - @JsonProperty("id") JsonNullable id, - @JsonProperty("email") Optional email, - @JsonProperty("type") JsonNullable type) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(type, "type"); - this.id = id; - this.email = email; - this.type = type; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("email") @Nullable String email, + @JsonProperty("type") @Nullable JsonNullable type) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.email = JsonNullable.of(email); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); } public Email() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null); } /** * Unique identifier for the email address */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Email address */ - @JsonIgnore - public Optional email() { - return email; + public JsonNullable email() { + return this.email; } /** * Email type */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } public static Builder builder() { @@ -88,57 +82,29 @@ public static Builder builder() { /** * Unique identifier for the email address */ - public Email withId(String id) { - Utils.checkNotNull(id, "id"); + public Email withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the email address - */ - public Email withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * Email address */ - public Email withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); + public Email withEmail(@Nullable String email) { + this.email = JsonNullable.of(email); return this; } - /** - * Email address - */ - public Email withEmail(Optional email) { - Utils.checkNotNull(email, "email"); - this.email = email; - return this; - } - /** * Email type */ - public Email withType(EmailType type) { - Utils.checkNotNull(type, "type"); + public Email withType(@Nullable EmailType type) { this.type = JsonNullable.of(type); return this; } - /** - * Email type - */ - public Email withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -172,75 +138,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private Optional email = Optional.empty(); + private String email; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; private Builder() { // force use of static builder() method } - /** * Unique identifier for the email address */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the email address - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * Email address */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - - /** - * Email address - */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } - /** * Email type */ - public Builder type(EmailType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable EmailType type) { this.type = JsonNullable.of(type); return this; } - /** - * Email type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - public Email build() { - return new Email( id, email, type); } diff --git a/src/main/java/com/apideck/unify/models/components/Employee.java b/src/main/java/com/apideck/unify/models/components/Employee.java index 0a06c0b1..83ae396d 100644 --- a/src/main/java/com/apideck/unify/models/components/Employee.java +++ b/src/main/java/com/apideck/unify/models/components/Employee.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -104,7 +103,7 @@ public class Employee { @JsonInclude(Include.NON_ABSENT) @JsonProperty("partner") - private Optional partner; + private Person partner; /** * The division the person is currently in. Usually a collection of departments or teams or regions. @@ -149,7 +148,7 @@ public class Employee { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("team") - private JsonNullable team; + private JsonNullable team; /** * The unique identifier of the company. @@ -184,7 +183,7 @@ public class Employee { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("leaving_reason") - private JsonNullable leavingReason; + private JsonNullable leavingReason; /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. @@ -198,12 +197,12 @@ public class Employee { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("employment_status") - private JsonNullable employmentStatus; + private JsonNullable employmentStatus; @JsonInclude(Include.NON_ABSENT) @JsonProperty("employment_role") - private Optional employmentRole; + private EmploymentRole employmentRole; /** * The ethnicity of the employee @@ -215,14 +214,14 @@ public class Employee { @JsonInclude(Include.NON_ABSENT) @JsonProperty("manager") - private Optional manager; + private Manager manager; /** * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("direct_reports") - private JsonNullable> directReports; + private JsonNullable> directReports; /** * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. @@ -264,7 +263,7 @@ public class Employee { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("gender") - private JsonNullable gender; + private JsonNullable gender; /** * The preferred pronouns of the person. @@ -283,12 +282,12 @@ public class Employee { @JsonInclude(Include.NON_ABSENT) @JsonProperty("languages") - private Optional> languages; + private List languages; @JsonInclude(Include.NON_ABSENT) @JsonProperty("nationalities") - private Optional> nationalities; + private List nationalities; /** * The URL of the photo of a person. @@ -326,12 +325,12 @@ public class Employee { @JsonInclude(Include.NON_ABSENT) @JsonProperty("jobs") - private JsonNullable> jobs; + private JsonNullable> jobs; @JsonInclude(Include.NON_ABSENT) @JsonProperty("compensations") - private JsonNullable> compensations; + private JsonNullable> compensations; /** * Indicates if the employee works from a remote location. @@ -343,32 +342,32 @@ public class Employee { @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("social_links") - private Optional> socialLinks; + private List socialLinks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_accounts") - private Optional> bankAccounts; + private List bankAccounts; @JsonInclude(Include.NON_ABSENT) @@ -392,24 +391,24 @@ public class Employee { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("food_allergies") - private JsonNullable> foodAllergies; + private JsonNullable> foodAllergies; @JsonInclude(Include.NON_ABSENT) @JsonProperty("probation_period") - private Optional probationPeriod; + private ProbationPeriod probationPeriod; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -458,347 +457,319 @@ public class Employee { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Employee( - @JsonProperty("id") JsonNullable id, - @JsonProperty("downstream_id") JsonNullable downstreamId, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("preferred_name") JsonNullable preferredName, - @JsonProperty("initials") JsonNullable initials, - @JsonProperty("salutation") JsonNullable salutation, - @JsonProperty("title") JsonNullable title, - @JsonProperty("marital_status") JsonNullable maritalStatus, - @JsonProperty("partner") Optional partner, - @JsonProperty("division") JsonNullable division, - @JsonProperty("division_id") JsonNullable divisionId, - @JsonProperty("department") JsonNullable department, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("department_name") JsonNullable departmentName, - @JsonProperty("team") JsonNullable team, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("employment_start_date") JsonNullable employmentStartDate, - @JsonProperty("employment_end_date") JsonNullable employmentEndDate, - @JsonProperty("leaving_reason") JsonNullable leavingReason, - @JsonProperty("employee_number") JsonNullable employeeNumber, - @JsonProperty("employment_status") JsonNullable employmentStatus, - @JsonProperty("employment_role") Optional employmentRole, - @JsonProperty("ethnicity") JsonNullable ethnicity, - @JsonProperty("manager") Optional manager, - @JsonProperty("direct_reports") JsonNullable> directReports, - @JsonProperty("social_security_number") JsonNullable socialSecurityNumber, - @JsonProperty("birthday") JsonNullable birthday, - @JsonProperty("deceased_on") JsonNullable deceasedOn, - @JsonProperty("country_of_birth") JsonNullable countryOfBirth, - @JsonProperty("description") JsonNullable description, - @JsonProperty("gender") JsonNullable gender, - @JsonProperty("pronouns") JsonNullable pronouns, - @JsonProperty("preferred_language") JsonNullable preferredLanguage, - @JsonProperty("languages") Optional> languages, - @JsonProperty("nationalities") Optional> nationalities, - @JsonProperty("photo_url") JsonNullable photoUrl, - @JsonProperty("timezone") JsonNullable timezone, - @JsonProperty("source") JsonNullable source, - @JsonProperty("source_id") JsonNullable sourceId, - @JsonProperty("record_url") JsonNullable recordUrl, - @JsonProperty("jobs") JsonNullable> jobs, - @JsonProperty("compensations") JsonNullable> compensations, - @JsonProperty("works_remote") JsonNullable worksRemote, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("social_links") Optional> socialLinks, - @JsonProperty("bank_accounts") Optional> bankAccounts, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("tax_id") JsonNullable taxId, - @JsonProperty("dietary_preference") JsonNullable dietaryPreference, - @JsonProperty("food_allergies") JsonNullable> foodAllergies, - @JsonProperty("probation_period") Optional probationPeriod, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("deleted") JsonNullable deleted, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(preferredName, "preferredName"); - Utils.checkNotNull(initials, "initials"); - Utils.checkNotNull(salutation, "salutation"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(maritalStatus, "maritalStatus"); - Utils.checkNotNull(partner, "partner"); - Utils.checkNotNull(division, "division"); - Utils.checkNotNull(divisionId, "divisionId"); - Utils.checkNotNull(department, "department"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(departmentName, "departmentName"); - Utils.checkNotNull(team, "team"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(employmentStartDate, "employmentStartDate"); - Utils.checkNotNull(employmentEndDate, "employmentEndDate"); - Utils.checkNotNull(leavingReason, "leavingReason"); - Utils.checkNotNull(employeeNumber, "employeeNumber"); - Utils.checkNotNull(employmentStatus, "employmentStatus"); - Utils.checkNotNull(employmentRole, "employmentRole"); - Utils.checkNotNull(ethnicity, "ethnicity"); - Utils.checkNotNull(manager, "manager"); - Utils.checkNotNull(directReports, "directReports"); - Utils.checkNotNull(socialSecurityNumber, "socialSecurityNumber"); - Utils.checkNotNull(birthday, "birthday"); - Utils.checkNotNull(deceasedOn, "deceasedOn"); - Utils.checkNotNull(countryOfBirth, "countryOfBirth"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(gender, "gender"); - Utils.checkNotNull(pronouns, "pronouns"); - Utils.checkNotNull(preferredLanguage, "preferredLanguage"); - Utils.checkNotNull(languages, "languages"); - Utils.checkNotNull(nationalities, "nationalities"); - Utils.checkNotNull(photoUrl, "photoUrl"); - Utils.checkNotNull(timezone, "timezone"); - Utils.checkNotNull(source, "source"); - Utils.checkNotNull(sourceId, "sourceId"); - Utils.checkNotNull(recordUrl, "recordUrl"); - Utils.checkNotNull(jobs, "jobs"); - Utils.checkNotNull(compensations, "compensations"); - Utils.checkNotNull(worksRemote, "worksRemote"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(socialLinks, "socialLinks"); - Utils.checkNotNull(bankAccounts, "bankAccounts"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(taxId, "taxId"); - Utils.checkNotNull(dietaryPreference, "dietaryPreference"); - Utils.checkNotNull(foodAllergies, "foodAllergies"); - Utils.checkNotNull(probationPeriod, "probationPeriod"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(deleted, "deleted"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); - this.id = id; - this.downstreamId = downstreamId; - this.firstName = firstName; - this.lastName = lastName; - this.middleName = middleName; - this.displayName = displayName; - this.preferredName = preferredName; - this.initials = initials; - this.salutation = salutation; - this.title = title; - this.maritalStatus = maritalStatus; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("preferred_name") @Nullable JsonNullable preferredName, + @JsonProperty("initials") @Nullable JsonNullable initials, + @JsonProperty("salutation") @Nullable JsonNullable salutation, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("marital_status") @Nullable JsonNullable maritalStatus, + @JsonProperty("partner") @Nullable Person partner, + @JsonProperty("division") @Nullable JsonNullable division, + @JsonProperty("division_id") @Nullable JsonNullable divisionId, + @JsonProperty("department") @Nullable JsonNullable department, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("department_name") @Nullable JsonNullable departmentName, + @JsonProperty("team") @Nullable JsonNullable team, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("employment_start_date") @Nullable JsonNullable employmentStartDate, + @JsonProperty("employment_end_date") @Nullable JsonNullable employmentEndDate, + @JsonProperty("leaving_reason") @Nullable JsonNullable leavingReason, + @JsonProperty("employee_number") @Nullable JsonNullable employeeNumber, + @JsonProperty("employment_status") @Nullable JsonNullable employmentStatus, + @JsonProperty("employment_role") @Nullable EmploymentRole employmentRole, + @JsonProperty("ethnicity") @Nullable JsonNullable ethnicity, + @JsonProperty("manager") @Nullable Manager manager, + @JsonProperty("direct_reports") @Nullable JsonNullable> directReports, + @JsonProperty("social_security_number") @Nullable JsonNullable socialSecurityNumber, + @JsonProperty("birthday") @Nullable JsonNullable birthday, + @JsonProperty("deceased_on") @Nullable JsonNullable deceasedOn, + @JsonProperty("country_of_birth") @Nullable JsonNullable countryOfBirth, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("gender") @Nullable JsonNullable gender, + @JsonProperty("pronouns") @Nullable JsonNullable pronouns, + @JsonProperty("preferred_language") @Nullable JsonNullable preferredLanguage, + @JsonProperty("languages") @Nullable List languages, + @JsonProperty("nationalities") @Nullable List nationalities, + @JsonProperty("photo_url") @Nullable JsonNullable photoUrl, + @JsonProperty("timezone") @Nullable JsonNullable timezone, + @JsonProperty("source") @Nullable JsonNullable source, + @JsonProperty("source_id") @Nullable JsonNullable sourceId, + @JsonProperty("record_url") @Nullable JsonNullable recordUrl, + @JsonProperty("jobs") @Nullable JsonNullable> jobs, + @JsonProperty("compensations") @Nullable JsonNullable> compensations, + @JsonProperty("works_remote") @Nullable JsonNullable worksRemote, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("social_links") @Nullable List socialLinks, + @JsonProperty("bank_accounts") @Nullable List bankAccounts, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("tax_id") @Nullable JsonNullable taxId, + @JsonProperty("dietary_preference") @Nullable JsonNullable dietaryPreference, + @JsonProperty("food_allergies") @Nullable JsonNullable> foodAllergies, + @JsonProperty("probation_period") @Nullable ProbationPeriod probationPeriod, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("deleted") @Nullable JsonNullable deleted, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.preferredName = Optional.ofNullable(preferredName) + .orElse(JsonNullable.undefined()); + this.initials = Optional.ofNullable(initials) + .orElse(JsonNullable.undefined()); + this.salutation = Optional.ofNullable(salutation) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.maritalStatus = Optional.ofNullable(maritalStatus) + .orElse(JsonNullable.undefined()); this.partner = partner; - this.division = division; - this.divisionId = divisionId; - this.department = department; - this.departmentId = departmentId; - this.departmentName = departmentName; - this.team = team; - this.companyId = companyId; - this.companyName = companyName; - this.employmentStartDate = employmentStartDate; - this.employmentEndDate = employmentEndDate; - this.leavingReason = leavingReason; - this.employeeNumber = employeeNumber; - this.employmentStatus = employmentStatus; + this.division = Optional.ofNullable(division) + .orElse(JsonNullable.undefined()); + this.divisionId = Optional.ofNullable(divisionId) + .orElse(JsonNullable.undefined()); + this.department = Optional.ofNullable(department) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); + this.departmentName = Optional.ofNullable(departmentName) + .orElse(JsonNullable.undefined()); + this.team = Optional.ofNullable(team) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.employmentStartDate = Optional.ofNullable(employmentStartDate) + .orElse(JsonNullable.undefined()); + this.employmentEndDate = Optional.ofNullable(employmentEndDate) + .orElse(JsonNullable.undefined()); + this.leavingReason = Optional.ofNullable(leavingReason) + .orElse(JsonNullable.undefined()); + this.employeeNumber = Optional.ofNullable(employeeNumber) + .orElse(JsonNullable.undefined()); + this.employmentStatus = Optional.ofNullable(employmentStatus) + .orElse(JsonNullable.undefined()); this.employmentRole = employmentRole; - this.ethnicity = ethnicity; + this.ethnicity = Optional.ofNullable(ethnicity) + .orElse(JsonNullable.undefined()); this.manager = manager; - this.directReports = directReports; - this.socialSecurityNumber = socialSecurityNumber; - this.birthday = birthday; - this.deceasedOn = deceasedOn; - this.countryOfBirth = countryOfBirth; - this.description = description; - this.gender = gender; - this.pronouns = pronouns; - this.preferredLanguage = preferredLanguage; + this.directReports = Optional.ofNullable(directReports) + .orElse(JsonNullable.undefined()); + this.socialSecurityNumber = Optional.ofNullable(socialSecurityNumber) + .orElse(JsonNullable.undefined()); + this.birthday = Optional.ofNullable(birthday) + .orElse(JsonNullable.undefined()); + this.deceasedOn = Optional.ofNullable(deceasedOn) + .orElse(JsonNullable.undefined()); + this.countryOfBirth = Optional.ofNullable(countryOfBirth) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.gender = Optional.ofNullable(gender) + .orElse(JsonNullable.undefined()); + this.pronouns = Optional.ofNullable(pronouns) + .orElse(JsonNullable.undefined()); + this.preferredLanguage = Optional.ofNullable(preferredLanguage) + .orElse(JsonNullable.undefined()); this.languages = languages; this.nationalities = nationalities; - this.photoUrl = photoUrl; - this.timezone = timezone; - this.source = source; - this.sourceId = sourceId; - this.recordUrl = recordUrl; - this.jobs = jobs; - this.compensations = compensations; - this.worksRemote = worksRemote; + this.photoUrl = Optional.ofNullable(photoUrl) + .orElse(JsonNullable.undefined()); + this.timezone = Optional.ofNullable(timezone) + .orElse(JsonNullable.undefined()); + this.source = Optional.ofNullable(source) + .orElse(JsonNullable.undefined()); + this.sourceId = Optional.ofNullable(sourceId) + .orElse(JsonNullable.undefined()); + this.recordUrl = Optional.ofNullable(recordUrl) + .orElse(JsonNullable.undefined()); + this.jobs = Optional.ofNullable(jobs) + .orElse(JsonNullable.undefined()); + this.compensations = Optional.ofNullable(compensations) + .orElse(JsonNullable.undefined()); + this.worksRemote = Optional.ofNullable(worksRemote) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.phoneNumbers = phoneNumbers; this.emails = emails; this.customFields = customFields; this.socialLinks = socialLinks; this.bankAccounts = bankAccounts; - this.taxCode = taxCode; - this.taxId = taxId; - this.dietaryPreference = dietaryPreference; - this.foodAllergies = foodAllergies; + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.taxId = Optional.ofNullable(taxId) + .orElse(JsonNullable.undefined()); + this.dietaryPreference = Optional.ofNullable(dietaryPreference) + .orElse(JsonNullable.undefined()); + this.foodAllergies = Optional.ofNullable(foodAllergies) + .orElse(JsonNullable.undefined()); this.probationPeriod = probationPeriod; - this.tags = tags; - this.customMappings = customMappings; - this.rowVersion = rowVersion; - this.deleted = deleted; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.deleted = Optional.ofNullable(deleted) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Employee() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Middle name of the person. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The name used to display the employee, often a combination of their first and last names. */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * The name the employee prefers to be addressed by, which may be different from their legal name. */ - @JsonIgnore public JsonNullable preferredName() { - return preferredName; + return this.preferredName; } /** * The initials of the person, usually derived from their first, middle, and last names. */ - @JsonIgnore public JsonNullable initials() { - return initials; + return this.initials; } /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - @JsonIgnore public JsonNullable salutation() { - return salutation; + return this.salutation; } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The marital status of the employee. */ - @JsonIgnore public JsonNullable maritalStatus() { - return maritalStatus; + return this.maritalStatus; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional partner() { - return (Optional) partner; + return Optional.ofNullable(this.partner); } /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - @JsonIgnore public JsonNullable division() { - return division; + return this.division; } /** * Unique identifier of the division this employee belongs to. */ - @JsonIgnore public JsonNullable divisionId() { - return divisionId; + return this.divisionId; } /** @@ -807,396 +778,321 @@ public JsonNullable divisionId() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable department() { - return department; + return this.department; } /** * Unique identifier of the department ID this employee belongs to. */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } /** * Name of the department this employee belongs to. */ - @JsonIgnore public JsonNullable departmentName() { - return departmentName; + return this.departmentName; } /** * The team the person is currently in. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable team() { - return (JsonNullable) team; + return this.team; } /** * The unique identifier of the company. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * A Start Date is the date that the employee started working at the company */ - @JsonIgnore public JsonNullable employmentStartDate() { - return employmentStartDate; + return this.employmentStartDate; } /** * An End Date is the date that the employee ended working at the company */ - @JsonIgnore public JsonNullable employmentEndDate() { - return employmentEndDate; + return this.employmentEndDate; } /** * The reason because the employment ended. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable leavingReason() { - return (JsonNullable) leavingReason; + return this.leavingReason; } /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - @JsonIgnore public JsonNullable employeeNumber() { - return employeeNumber; + return this.employeeNumber; } /** * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable employmentStatus() { - return (JsonNullable) employmentStatus; + return this.employmentStatus; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional employmentRole() { - return (Optional) employmentRole; + return Optional.ofNullable(this.employmentRole); } /** * The ethnicity of the employee */ - @JsonIgnore public JsonNullable ethnicity() { - return ethnicity; + return this.ethnicity; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional manager() { - return (Optional) manager; + return Optional.ofNullable(this.manager); } /** * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> directReports() { - return (JsonNullable>) directReports; + return this.directReports; } /** * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. */ - @JsonIgnore public JsonNullable socialSecurityNumber() { - return socialSecurityNumber; + return this.socialSecurityNumber; } /** * The date of birth of the person. */ - @JsonIgnore public JsonNullable birthday() { - return birthday; + return this.birthday; } /** * The date the person deceased. */ - @JsonIgnore public JsonNullable deceasedOn() { - return deceasedOn; + return this.deceasedOn; } /** * Country code according to ISO 3166-1 alpha-2. */ - @JsonIgnore public JsonNullable countryOfBirth() { - return countryOfBirth; + return this.countryOfBirth; } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The gender represents the gender identity of a person. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable gender() { - return (JsonNullable) gender; + return this.gender; } /** * The preferred pronouns of the person. */ - @JsonIgnore public JsonNullable pronouns() { - return pronouns; + return this.pronouns; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable preferredLanguage() { - return preferredLanguage; + return this.preferredLanguage; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> languages() { - return (Optional>) languages; + return Optional.ofNullable(this.languages); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> nationalities() { - return (Optional>) nationalities; + return Optional.ofNullable(this.nationalities); } /** * The URL of the photo of a person. */ - @JsonIgnore public JsonNullable photoUrl() { - return photoUrl; + return this.photoUrl; } /** * The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. */ - @JsonIgnore public JsonNullable timezone() { - return timezone; + return this.timezone; } /** * When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. */ - @JsonIgnore public JsonNullable source() { - return source; + return this.source; } /** * Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). */ - @JsonIgnore public JsonNullable sourceId() { - return sourceId; + return this.sourceId; } - @JsonIgnore public JsonNullable recordUrl() { - return recordUrl; + return this.recordUrl; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> jobs() { - return (JsonNullable>) jobs; + return this.jobs; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> compensations() { - return (JsonNullable>) compensations; + return this.compensations; } /** * Indicates if the employee works from a remote location. */ - @JsonIgnore public JsonNullable worksRemote() { - return worksRemote; + return this.worksRemote; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> socialLinks() { - return (Optional>) socialLinks; + return Optional.ofNullable(this.socialLinks); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> bankAccounts() { - return (Optional>) bankAccounts; + return Optional.ofNullable(this.bankAccounts); } - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } - @JsonIgnore public JsonNullable taxId() { - return taxId; + return this.taxId; } /** * Indicate the employee's dietary preference. */ - @JsonIgnore public JsonNullable dietaryPreference() { - return dietaryPreference; + return this.dietaryPreference; } /** * Indicate the employee's food allergies. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> foodAllergies() { - return (JsonNullable>) foodAllergies; + return this.foodAllergies; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional probationPeriod() { - return (Optional) probationPeriod; + return Optional.ofNullable(this.probationPeriod); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * Flag to indicate if the object is deleted. */ - @JsonIgnore public JsonNullable deleted() { - return deleted; + return this.deleted; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -1207,249 +1103,125 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Employee withId(String id) { - Utils.checkNotNull(id, "id"); + public Employee withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Employee withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The third-party API ID of original entity */ - public Employee withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Employee withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Employee withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } /** * The first name of the person. */ - public Employee withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Employee withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Employee withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public Employee withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Employee withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Employee withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Middle name of the person. */ - public Employee withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Employee withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Employee withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The name used to display the employee, often a combination of their first and last names. */ - public Employee withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Employee withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The name used to display the employee, often a combination of their first and last names. - */ - public Employee withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } /** * The name the employee prefers to be addressed by, which may be different from their legal name. */ - public Employee withPreferredName(String preferredName) { - Utils.checkNotNull(preferredName, "preferredName"); + public Employee withPreferredName(@Nullable String preferredName) { this.preferredName = JsonNullable.of(preferredName); return this; } - /** - * The name the employee prefers to be addressed by, which may be different from their legal name. - */ - public Employee withPreferredName(JsonNullable preferredName) { - Utils.checkNotNull(preferredName, "preferredName"); - this.preferredName = preferredName; - return this; - } /** * The initials of the person, usually derived from their first, middle, and last names. */ - public Employee withInitials(String initials) { - Utils.checkNotNull(initials, "initials"); + public Employee withInitials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * The initials of the person, usually derived from their first, middle, and last names. - */ - public Employee withInitials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - public Employee withSalutation(String salutation) { - Utils.checkNotNull(salutation, "salutation"); + public Employee withSalutation(@Nullable String salutation) { this.salutation = JsonNullable.of(salutation); return this; } - /** - * A formal salutation for the person. For example, 'Mr', 'Mrs' - */ - public Employee withSalutation(JsonNullable salutation) { - Utils.checkNotNull(salutation, "salutation"); - this.salutation = salutation; - return this; - } /** * The job title of the person. */ - public Employee withTitle(String title) { - Utils.checkNotNull(title, "title"); + public Employee withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Employee withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The marital status of the employee. */ - public Employee withMaritalStatus(String maritalStatus) { - Utils.checkNotNull(maritalStatus, "maritalStatus"); + public Employee withMaritalStatus(@Nullable String maritalStatus) { this.maritalStatus = JsonNullable.of(maritalStatus); return this; } - /** - * The marital status of the employee. - */ - public Employee withMaritalStatus(JsonNullable maritalStatus) { - Utils.checkNotNull(maritalStatus, "maritalStatus"); - this.maritalStatus = maritalStatus; - return this; - } - - public Employee withPartner(Person partner) { - Utils.checkNotNull(partner, "partner"); - this.partner = Optional.ofNullable(partner); - return this; - } - - public Employee withPartner(Optional partner) { - Utils.checkNotNull(partner, "partner"); + public Employee withPartner(@Nullable Person partner) { this.partner = partner; return this; } + /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - public Employee withDivision(String division) { - Utils.checkNotNull(division, "division"); + public Employee withDivision(@Nullable String division) { this.division = JsonNullable.of(division); return this; } - /** - * The division the person is currently in. Usually a collection of departments or teams or regions. - */ - public Employee withDivision(JsonNullable division) { - Utils.checkNotNull(division, "division"); - this.division = division; - return this; - } /** * Unique identifier of the division this employee belongs to. */ - public Employee withDivisionId(String divisionId) { - Utils.checkNotNull(divisionId, "divisionId"); + public Employee withDivisionId(@Nullable String divisionId) { this.divisionId = JsonNullable.of(divisionId); return this; } - /** - * Unique identifier of the division this employee belongs to. - */ - public Employee withDivisionId(JsonNullable divisionId) { - Utils.checkNotNull(divisionId, "divisionId"); - this.divisionId = divisionId; - return this; - } /** * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. @@ -1457,870 +1229,429 @@ public Employee withDivisionId(JsonNullable divisionId) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Employee withDepartment(String department) { - Utils.checkNotNull(department, "department"); + public Employee withDepartment(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Employee withDepartment(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } /** * Unique identifier of the department ID this employee belongs to. */ - public Employee withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Employee withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * Unique identifier of the department ID this employee belongs to. - */ - public Employee withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } /** * Name of the department this employee belongs to. */ - public Employee withDepartmentName(String departmentName) { - Utils.checkNotNull(departmentName, "departmentName"); + public Employee withDepartmentName(@Nullable String departmentName) { this.departmentName = JsonNullable.of(departmentName); return this; } - /** - * Name of the department this employee belongs to. - */ - public Employee withDepartmentName(JsonNullable departmentName) { - Utils.checkNotNull(departmentName, "departmentName"); - this.departmentName = departmentName; - return this; - } /** * The team the person is currently in. */ - public Employee withTeam(Team team) { - Utils.checkNotNull(team, "team"); + public Employee withTeam(@Nullable Team team) { this.team = JsonNullable.of(team); return this; } - /** - * The team the person is currently in. - */ - public Employee withTeam(JsonNullable team) { - Utils.checkNotNull(team, "team"); - this.team = team; - return this; - } /** * The unique identifier of the company. */ - public Employee withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Employee withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company. - */ - public Employee withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The name of the company. */ - public Employee withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Employee withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Employee withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * A Start Date is the date that the employee started working at the company */ - public Employee withEmploymentStartDate(String employmentStartDate) { - Utils.checkNotNull(employmentStartDate, "employmentStartDate"); + public Employee withEmploymentStartDate(@Nullable String employmentStartDate) { this.employmentStartDate = JsonNullable.of(employmentStartDate); return this; } - /** - * A Start Date is the date that the employee started working at the company - */ - public Employee withEmploymentStartDate(JsonNullable employmentStartDate) { - Utils.checkNotNull(employmentStartDate, "employmentStartDate"); - this.employmentStartDate = employmentStartDate; - return this; - } /** * An End Date is the date that the employee ended working at the company */ - public Employee withEmploymentEndDate(String employmentEndDate) { - Utils.checkNotNull(employmentEndDate, "employmentEndDate"); + public Employee withEmploymentEndDate(@Nullable String employmentEndDate) { this.employmentEndDate = JsonNullable.of(employmentEndDate); return this; } - /** - * An End Date is the date that the employee ended working at the company - */ - public Employee withEmploymentEndDate(JsonNullable employmentEndDate) { - Utils.checkNotNull(employmentEndDate, "employmentEndDate"); - this.employmentEndDate = employmentEndDate; - return this; - } /** * The reason because the employment ended. */ - public Employee withLeavingReason(LeavingReason leavingReason) { - Utils.checkNotNull(leavingReason, "leavingReason"); + public Employee withLeavingReason(@Nullable LeavingReason leavingReason) { this.leavingReason = JsonNullable.of(leavingReason); return this; } - /** - * The reason because the employment ended. - */ - public Employee withLeavingReason(JsonNullable leavingReason) { - Utils.checkNotNull(leavingReason, "leavingReason"); - this.leavingReason = leavingReason; - return this; - } /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - public Employee withEmployeeNumber(String employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); + public Employee withEmployeeNumber(@Nullable String employeeNumber) { this.employeeNumber = JsonNullable.of(employeeNumber); return this; } - /** - * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - */ - public Employee withEmployeeNumber(JsonNullable employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); - this.employeeNumber = employeeNumber; - return this; - } /** * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. */ - public Employee withEmploymentStatus(EmploymentStatus employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); + public Employee withEmploymentStatus(@Nullable EmploymentStatus employmentStatus) { this.employmentStatus = JsonNullable.of(employmentStatus); return this; } - /** - * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. - */ - public Employee withEmploymentStatus(JsonNullable employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); - this.employmentStatus = employmentStatus; - return this; - } - - public Employee withEmploymentRole(EmploymentRole employmentRole) { - Utils.checkNotNull(employmentRole, "employmentRole"); - this.employmentRole = Optional.ofNullable(employmentRole); - return this; - } - - public Employee withEmploymentRole(Optional employmentRole) { - Utils.checkNotNull(employmentRole, "employmentRole"); + public Employee withEmploymentRole(@Nullable EmploymentRole employmentRole) { this.employmentRole = employmentRole; return this; } - /** - * The ethnicity of the employee - */ - public Employee withEthnicity(String ethnicity) { - Utils.checkNotNull(ethnicity, "ethnicity"); - this.ethnicity = JsonNullable.of(ethnicity); - return this; - } /** * The ethnicity of the employee */ - public Employee withEthnicity(JsonNullable ethnicity) { - Utils.checkNotNull(ethnicity, "ethnicity"); - this.ethnicity = ethnicity; - return this; - } - - public Employee withManager(Manager manager) { - Utils.checkNotNull(manager, "manager"); - this.manager = Optional.ofNullable(manager); + public Employee withEthnicity(@Nullable String ethnicity) { + this.ethnicity = JsonNullable.of(ethnicity); return this; } - public Employee withManager(Optional manager) { - Utils.checkNotNull(manager, "manager"); + public Employee withManager(@Nullable Manager manager) { this.manager = manager; return this; } + /** * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. */ - public Employee withDirectReports(List directReports) { - Utils.checkNotNull(directReports, "directReports"); + public Employee withDirectReports(@Nullable List directReports) { this.directReports = JsonNullable.of(directReports); return this; } - /** - * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. - */ - public Employee withDirectReports(JsonNullable> directReports) { - Utils.checkNotNull(directReports, "directReports"); - this.directReports = directReports; - return this; - } /** * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. */ - public Employee withSocialSecurityNumber(String socialSecurityNumber) { - Utils.checkNotNull(socialSecurityNumber, "socialSecurityNumber"); + public Employee withSocialSecurityNumber(@Nullable String socialSecurityNumber) { this.socialSecurityNumber = JsonNullable.of(socialSecurityNumber); return this; } - /** - * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. - */ - public Employee withSocialSecurityNumber(JsonNullable socialSecurityNumber) { - Utils.checkNotNull(socialSecurityNumber, "socialSecurityNumber"); - this.socialSecurityNumber = socialSecurityNumber; - return this; - } /** * The date of birth of the person. */ - public Employee withBirthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Employee withBirthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public Employee withBirthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } /** * The date the person deceased. */ - public Employee withDeceasedOn(LocalDate deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); + public Employee withDeceasedOn(@Nullable LocalDate deceasedOn) { this.deceasedOn = JsonNullable.of(deceasedOn); return this; } - /** - * The date the person deceased. - */ - public Employee withDeceasedOn(JsonNullable deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); - this.deceasedOn = deceasedOn; - return this; - } /** * Country code according to ISO 3166-1 alpha-2. */ - public Employee withCountryOfBirth(String countryOfBirth) { - Utils.checkNotNull(countryOfBirth, "countryOfBirth"); + public Employee withCountryOfBirth(@Nullable String countryOfBirth) { this.countryOfBirth = JsonNullable.of(countryOfBirth); return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public Employee withCountryOfBirth(JsonNullable countryOfBirth) { - Utils.checkNotNull(countryOfBirth, "countryOfBirth"); - this.countryOfBirth = countryOfBirth; - return this; - } /** * A description of the object. */ - public Employee withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Employee withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Employee withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The gender represents the gender identity of a person. */ - public Employee withGender(Gender gender) { - Utils.checkNotNull(gender, "gender"); + public Employee withGender(@Nullable Gender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender represents the gender identity of a person. - */ - public Employee withGender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } /** * The preferred pronouns of the person. */ - public Employee withPronouns(String pronouns) { - Utils.checkNotNull(pronouns, "pronouns"); + public Employee withPronouns(@Nullable String pronouns) { this.pronouns = JsonNullable.of(pronouns); return this; } - /** - * The preferred pronouns of the person. - */ - public Employee withPronouns(JsonNullable pronouns) { - Utils.checkNotNull(pronouns, "pronouns"); - this.pronouns = pronouns; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public Employee withPreferredLanguage(String preferredLanguage) { - Utils.checkNotNull(preferredLanguage, "preferredLanguage"); + public Employee withPreferredLanguage(@Nullable String preferredLanguage) { this.preferredLanguage = JsonNullable.of(preferredLanguage); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Employee withPreferredLanguage(JsonNullable preferredLanguage) { - Utils.checkNotNull(preferredLanguage, "preferredLanguage"); - this.preferredLanguage = preferredLanguage; - return this; - } - - public Employee withLanguages(List languages) { - Utils.checkNotNull(languages, "languages"); - this.languages = Optional.ofNullable(languages); - return this; - } - - public Employee withLanguages(Optional> languages) { - Utils.checkNotNull(languages, "languages"); + public Employee withLanguages(@Nullable List languages) { this.languages = languages; return this; } - public Employee withNationalities(List nationalities) { - Utils.checkNotNull(nationalities, "nationalities"); - this.nationalities = Optional.ofNullable(nationalities); - return this; - } - - public Employee withNationalities(Optional> nationalities) { - Utils.checkNotNull(nationalities, "nationalities"); + public Employee withNationalities(@Nullable List nationalities) { this.nationalities = nationalities; return this; } + /** * The URL of the photo of a person. */ - public Employee withPhotoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public Employee withPhotoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public Employee withPhotoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } /** * The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. */ - public Employee withTimezone(String timezone) { - Utils.checkNotNull(timezone, "timezone"); + public Employee withTimezone(@Nullable String timezone) { this.timezone = JsonNullable.of(timezone); return this; } - /** - * The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. - */ - public Employee withTimezone(JsonNullable timezone) { - Utils.checkNotNull(timezone, "timezone"); - this.timezone = timezone; - return this; - } /** * When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. */ - public Employee withSource(String source) { - Utils.checkNotNull(source, "source"); + public Employee withSource(@Nullable String source) { this.source = JsonNullable.of(source); return this; } - /** - * When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. - */ - public Employee withSource(JsonNullable source) { - Utils.checkNotNull(source, "source"); - this.source = source; - return this; - } /** * Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). */ - public Employee withSourceId(String sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); + public Employee withSourceId(@Nullable String sourceId) { this.sourceId = JsonNullable.of(sourceId); return this; } - /** - * Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). - */ - public Employee withSourceId(JsonNullable sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); - this.sourceId = sourceId; - return this; - } - public Employee withRecordUrl(String recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); + public Employee withRecordUrl(@Nullable String recordUrl) { this.recordUrl = JsonNullable.of(recordUrl); return this; } - public Employee withRecordUrl(JsonNullable recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); - this.recordUrl = recordUrl; - return this; - } - public Employee withJobs(List jobs) { - Utils.checkNotNull(jobs, "jobs"); + public Employee withJobs(@Nullable List jobs) { this.jobs = JsonNullable.of(jobs); return this; } - public Employee withJobs(JsonNullable> jobs) { - Utils.checkNotNull(jobs, "jobs"); - this.jobs = jobs; - return this; - } - public Employee withCompensations(List compensations) { - Utils.checkNotNull(compensations, "compensations"); + public Employee withCompensations(@Nullable List compensations) { this.compensations = JsonNullable.of(compensations); return this; } - public Employee withCompensations(JsonNullable> compensations) { - Utils.checkNotNull(compensations, "compensations"); - this.compensations = compensations; - return this; - } /** * Indicates if the employee works from a remote location. */ - public Employee withWorksRemote(boolean worksRemote) { - Utils.checkNotNull(worksRemote, "worksRemote"); + public Employee withWorksRemote(@Nullable Boolean worksRemote) { this.worksRemote = JsonNullable.of(worksRemote); return this; } - /** - * Indicates if the employee works from a remote location. - */ - public Employee withWorksRemote(JsonNullable worksRemote) { - Utils.checkNotNull(worksRemote, "worksRemote"); - this.worksRemote = worksRemote; - return this; - } - - public Employee withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Employee withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Employee withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public Employee withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Employee withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Employee withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Employee withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Employee withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Employee withEmails(@Nullable List emails) { this.emails = emails; return this; } - public Employee withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Employee withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Employee withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - public Employee withSocialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Employee withSocialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Employee withSocialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - public Employee withBankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Employee withBankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Employee withBankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - public Employee withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + + public Employee withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - public Employee withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - public Employee withTaxId(String taxId) { - Utils.checkNotNull(taxId, "taxId"); + public Employee withTaxId(@Nullable String taxId) { this.taxId = JsonNullable.of(taxId); return this; } - public Employee withTaxId(JsonNullable taxId) { - Utils.checkNotNull(taxId, "taxId"); - this.taxId = taxId; - return this; - } /** * Indicate the employee's dietary preference. */ - public Employee withDietaryPreference(String dietaryPreference) { - Utils.checkNotNull(dietaryPreference, "dietaryPreference"); + public Employee withDietaryPreference(@Nullable String dietaryPreference) { this.dietaryPreference = JsonNullable.of(dietaryPreference); return this; } - /** - * Indicate the employee's dietary preference. - */ - public Employee withDietaryPreference(JsonNullable dietaryPreference) { - Utils.checkNotNull(dietaryPreference, "dietaryPreference"); - this.dietaryPreference = dietaryPreference; - return this; - } /** * Indicate the employee's food allergies. */ - public Employee withFoodAllergies(List foodAllergies) { - Utils.checkNotNull(foodAllergies, "foodAllergies"); + public Employee withFoodAllergies(@Nullable List foodAllergies) { this.foodAllergies = JsonNullable.of(foodAllergies); return this; } - /** - * Indicate the employee's food allergies. - */ - public Employee withFoodAllergies(JsonNullable> foodAllergies) { - Utils.checkNotNull(foodAllergies, "foodAllergies"); - this.foodAllergies = foodAllergies; - return this; - } - - public Employee withProbationPeriod(ProbationPeriod probationPeriod) { - Utils.checkNotNull(probationPeriod, "probationPeriod"); - this.probationPeriod = Optional.ofNullable(probationPeriod); - return this; - } - - public Employee withProbationPeriod(Optional probationPeriod) { - Utils.checkNotNull(probationPeriod, "probationPeriod"); + public Employee withProbationPeriod(@Nullable ProbationPeriod probationPeriod) { this.probationPeriod = probationPeriod; return this; } - public Employee withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + + public Employee withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Employee withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Employee withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Employee withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Employee withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Employee withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Employee withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Employee withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * Flag to indicate if the object is deleted. */ - public Employee withDeleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Employee withDeleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Flag to indicate if the object is deleted. - */ - public Employee withDeleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } /** * The user who last updated the object. */ - public Employee withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Employee withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Employee withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Employee withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Employee withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Employee withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Employee withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Employee withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Employee withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Employee withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Employee withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Employee withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Employee withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Employee withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Employee withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -2503,1318 +1834,631 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable preferredName = JsonNullable.undefined(); + private JsonNullable preferredName; - private JsonNullable initials = JsonNullable.undefined(); + private JsonNullable initials; - private JsonNullable salutation = JsonNullable.undefined(); + private JsonNullable salutation; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable maritalStatus = JsonNullable.undefined(); + private JsonNullable maritalStatus; - private Optional partner = Optional.empty(); + private Person partner; - private JsonNullable division = JsonNullable.undefined(); + private JsonNullable division; - private JsonNullable divisionId = JsonNullable.undefined(); + private JsonNullable divisionId; @Deprecated - private JsonNullable department = JsonNullable.undefined(); + private JsonNullable department; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private JsonNullable departmentName = JsonNullable.undefined(); + private JsonNullable departmentName; - private JsonNullable team = JsonNullable.undefined(); + private JsonNullable team; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable employmentStartDate = JsonNullable.undefined(); + private JsonNullable employmentStartDate; - private JsonNullable employmentEndDate = JsonNullable.undefined(); + private JsonNullable employmentEndDate; - private JsonNullable leavingReason = JsonNullable.undefined(); + private JsonNullable leavingReason; - private JsonNullable employeeNumber = JsonNullable.undefined(); + private JsonNullable employeeNumber; - private JsonNullable employmentStatus = JsonNullable.undefined(); + private JsonNullable employmentStatus; - private Optional employmentRole = Optional.empty(); + private EmploymentRole employmentRole; - private JsonNullable ethnicity = JsonNullable.undefined(); + private JsonNullable ethnicity; - private Optional manager = Optional.empty(); + private Manager manager; - private JsonNullable> directReports = JsonNullable.undefined(); + private JsonNullable> directReports; - private JsonNullable socialSecurityNumber = JsonNullable.undefined(); + private JsonNullable socialSecurityNumber; - private JsonNullable birthday = JsonNullable.undefined(); + private JsonNullable birthday; - private JsonNullable deceasedOn = JsonNullable.undefined(); + private JsonNullable deceasedOn; - private JsonNullable countryOfBirth = JsonNullable.undefined(); + private JsonNullable countryOfBirth; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable gender = JsonNullable.undefined(); + private JsonNullable gender; - private JsonNullable pronouns = JsonNullable.undefined(); + private JsonNullable pronouns; - private JsonNullable preferredLanguage = JsonNullable.undefined(); + private JsonNullable preferredLanguage; - private Optional> languages = Optional.empty(); + private List languages; - private Optional> nationalities = Optional.empty(); + private List nationalities; - private JsonNullable photoUrl = JsonNullable.undefined(); + private JsonNullable photoUrl; - private JsonNullable timezone = JsonNullable.undefined(); + private JsonNullable timezone; - private JsonNullable source = JsonNullable.undefined(); + private JsonNullable source; - private JsonNullable sourceId = JsonNullable.undefined(); + private JsonNullable sourceId; - private JsonNullable recordUrl = JsonNullable.undefined(); + private JsonNullable recordUrl; - private JsonNullable> jobs = JsonNullable.undefined(); + private JsonNullable> jobs; - private JsonNullable> compensations = JsonNullable.undefined(); + private JsonNullable> compensations; - private JsonNullable worksRemote = JsonNullable.undefined(); + private JsonNullable worksRemote; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private Optional> customFields = Optional.empty(); + private List customFields; - private Optional> socialLinks = Optional.empty(); + private List socialLinks; - private Optional> bankAccounts = Optional.empty(); + private List bankAccounts; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable taxId = JsonNullable.undefined(); + private JsonNullable taxId; - private JsonNullable dietaryPreference = JsonNullable.undefined(); + private JsonNullable dietaryPreference; - private JsonNullable> foodAllergies = JsonNullable.undefined(); + private JsonNullable> foodAllergies; - private Optional probationPeriod = Optional.empty(); + private ProbationPeriod probationPeriod; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable deleted = JsonNullable.undefined(); + private JsonNullable deleted; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Middle name of the person. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The name used to display the employee, often a combination of their first and last names. */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The name used to display the employee, often a combination of their first and last names. - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * The name the employee prefers to be addressed by, which may be different from their legal name. */ - public Builder preferredName(String preferredName) { - Utils.checkNotNull(preferredName, "preferredName"); + public Builder preferredName(@Nullable String preferredName) { this.preferredName = JsonNullable.of(preferredName); return this; } - /** - * The name the employee prefers to be addressed by, which may be different from their legal name. - */ - public Builder preferredName(JsonNullable preferredName) { - Utils.checkNotNull(preferredName, "preferredName"); - this.preferredName = preferredName; - return this; - } - - /** * The initials of the person, usually derived from their first, middle, and last names. */ - public Builder initials(String initials) { - Utils.checkNotNull(initials, "initials"); + public Builder initials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * The initials of the person, usually derived from their first, middle, and last names. - */ - public Builder initials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } - - /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - public Builder salutation(String salutation) { - Utils.checkNotNull(salutation, "salutation"); + public Builder salutation(@Nullable String salutation) { this.salutation = JsonNullable.of(salutation); return this; } - /** - * A formal salutation for the person. For example, 'Mr', 'Mrs' - */ - public Builder salutation(JsonNullable salutation) { - Utils.checkNotNull(salutation, "salutation"); - this.salutation = salutation; - return this; - } - - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The marital status of the employee. */ - public Builder maritalStatus(String maritalStatus) { - Utils.checkNotNull(maritalStatus, "maritalStatus"); + public Builder maritalStatus(@Nullable String maritalStatus) { this.maritalStatus = JsonNullable.of(maritalStatus); return this; } - /** - * The marital status of the employee. - */ - public Builder maritalStatus(JsonNullable maritalStatus) { - Utils.checkNotNull(maritalStatus, "maritalStatus"); - this.maritalStatus = maritalStatus; - return this; - } - - - public Builder partner(Person partner) { - Utils.checkNotNull(partner, "partner"); - this.partner = Optional.ofNullable(partner); - return this; - } - - public Builder partner(Optional partner) { - Utils.checkNotNull(partner, "partner"); + public Builder partner(@Nullable Person partner) { this.partner = partner; return this; } - /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - public Builder division(String division) { - Utils.checkNotNull(division, "division"); + public Builder division(@Nullable String division) { this.division = JsonNullable.of(division); return this; } - /** - * The division the person is currently in. Usually a collection of departments or teams or regions. - */ - public Builder division(JsonNullable division) { - Utils.checkNotNull(division, "division"); - this.division = division; - return this; - } - - /** * Unique identifier of the division this employee belongs to. */ - public Builder divisionId(String divisionId) { - Utils.checkNotNull(divisionId, "divisionId"); + public Builder divisionId(@Nullable String divisionId) { this.divisionId = JsonNullable.of(divisionId); return this; } - /** - * Unique identifier of the division this employee belongs to. - */ - public Builder divisionId(JsonNullable divisionId) { - Utils.checkNotNull(divisionId, "divisionId"); - this.divisionId = divisionId; - return this; - } - - /** * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder department(String department) { - Utils.checkNotNull(department, "department"); + public Builder department(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder department(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } - - /** * Unique identifier of the department ID this employee belongs to. */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * Unique identifier of the department ID this employee belongs to. - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - /** * Name of the department this employee belongs to. */ - public Builder departmentName(String departmentName) { - Utils.checkNotNull(departmentName, "departmentName"); + public Builder departmentName(@Nullable String departmentName) { this.departmentName = JsonNullable.of(departmentName); return this; } - /** - * Name of the department this employee belongs to. - */ - public Builder departmentName(JsonNullable departmentName) { - Utils.checkNotNull(departmentName, "departmentName"); - this.departmentName = departmentName; - return this; - } - - /** * The team the person is currently in. */ - public Builder team(Team team) { - Utils.checkNotNull(team, "team"); + public Builder team(@Nullable Team team) { this.team = JsonNullable.of(team); return this; } - /** - * The team the person is currently in. - */ - public Builder team(JsonNullable team) { - Utils.checkNotNull(team, "team"); - this.team = team; - return this; - } - - /** * The unique identifier of the company. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * A Start Date is the date that the employee started working at the company */ - public Builder employmentStartDate(String employmentStartDate) { - Utils.checkNotNull(employmentStartDate, "employmentStartDate"); + public Builder employmentStartDate(@Nullable String employmentStartDate) { this.employmentStartDate = JsonNullable.of(employmentStartDate); return this; } - /** - * A Start Date is the date that the employee started working at the company - */ - public Builder employmentStartDate(JsonNullable employmentStartDate) { - Utils.checkNotNull(employmentStartDate, "employmentStartDate"); - this.employmentStartDate = employmentStartDate; - return this; - } - - /** * An End Date is the date that the employee ended working at the company */ - public Builder employmentEndDate(String employmentEndDate) { - Utils.checkNotNull(employmentEndDate, "employmentEndDate"); + public Builder employmentEndDate(@Nullable String employmentEndDate) { this.employmentEndDate = JsonNullable.of(employmentEndDate); return this; } - /** - * An End Date is the date that the employee ended working at the company - */ - public Builder employmentEndDate(JsonNullable employmentEndDate) { - Utils.checkNotNull(employmentEndDate, "employmentEndDate"); - this.employmentEndDate = employmentEndDate; - return this; - } - - /** * The reason because the employment ended. */ - public Builder leavingReason(LeavingReason leavingReason) { - Utils.checkNotNull(leavingReason, "leavingReason"); + public Builder leavingReason(@Nullable LeavingReason leavingReason) { this.leavingReason = JsonNullable.of(leavingReason); return this; } - /** - * The reason because the employment ended. - */ - public Builder leavingReason(JsonNullable leavingReason) { - Utils.checkNotNull(leavingReason, "leavingReason"); - this.leavingReason = leavingReason; - return this; - } - - /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - public Builder employeeNumber(String employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); + public Builder employeeNumber(@Nullable String employeeNumber) { this.employeeNumber = JsonNullable.of(employeeNumber); return this; } - /** - * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - */ - public Builder employeeNumber(JsonNullable employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); - this.employeeNumber = employeeNumber; - return this; - } - - /** * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. */ - public Builder employmentStatus(EmploymentStatus employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); + public Builder employmentStatus(@Nullable EmploymentStatus employmentStatus) { this.employmentStatus = JsonNullable.of(employmentStatus); return this; } - /** - * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. - */ - public Builder employmentStatus(JsonNullable employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); - this.employmentStatus = employmentStatus; - return this; - } - - - public Builder employmentRole(EmploymentRole employmentRole) { - Utils.checkNotNull(employmentRole, "employmentRole"); - this.employmentRole = Optional.ofNullable(employmentRole); - return this; - } - - public Builder employmentRole(Optional employmentRole) { - Utils.checkNotNull(employmentRole, "employmentRole"); + public Builder employmentRole(@Nullable EmploymentRole employmentRole) { this.employmentRole = employmentRole; return this; } - /** * The ethnicity of the employee */ - public Builder ethnicity(String ethnicity) { - Utils.checkNotNull(ethnicity, "ethnicity"); + public Builder ethnicity(@Nullable String ethnicity) { this.ethnicity = JsonNullable.of(ethnicity); return this; } - /** - * The ethnicity of the employee - */ - public Builder ethnicity(JsonNullable ethnicity) { - Utils.checkNotNull(ethnicity, "ethnicity"); - this.ethnicity = ethnicity; - return this; - } - - - public Builder manager(Manager manager) { - Utils.checkNotNull(manager, "manager"); - this.manager = Optional.ofNullable(manager); - return this; - } - - public Builder manager(Optional manager) { - Utils.checkNotNull(manager, "manager"); + public Builder manager(@Nullable Manager manager) { this.manager = manager; return this; } - /** * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. */ - public Builder directReports(List directReports) { - Utils.checkNotNull(directReports, "directReports"); + public Builder directReports(@Nullable List directReports) { this.directReports = JsonNullable.of(directReports); return this; } - /** - * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. - */ - public Builder directReports(JsonNullable> directReports) { - Utils.checkNotNull(directReports, "directReports"); - this.directReports = directReports; - return this; - } - - /** * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. */ - public Builder socialSecurityNumber(String socialSecurityNumber) { - Utils.checkNotNull(socialSecurityNumber, "socialSecurityNumber"); + public Builder socialSecurityNumber(@Nullable String socialSecurityNumber) { this.socialSecurityNumber = JsonNullable.of(socialSecurityNumber); return this; } - /** - * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. - */ - public Builder socialSecurityNumber(JsonNullable socialSecurityNumber) { - Utils.checkNotNull(socialSecurityNumber, "socialSecurityNumber"); - this.socialSecurityNumber = socialSecurityNumber; - return this; - } - - /** * The date of birth of the person. */ - public Builder birthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Builder birthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public Builder birthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - /** * The date the person deceased. */ - public Builder deceasedOn(LocalDate deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); + public Builder deceasedOn(@Nullable LocalDate deceasedOn) { this.deceasedOn = JsonNullable.of(deceasedOn); return this; } - /** - * The date the person deceased. - */ - public Builder deceasedOn(JsonNullable deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); - this.deceasedOn = deceasedOn; - return this; - } - - /** * Country code according to ISO 3166-1 alpha-2. */ - public Builder countryOfBirth(String countryOfBirth) { - Utils.checkNotNull(countryOfBirth, "countryOfBirth"); + public Builder countryOfBirth(@Nullable String countryOfBirth) { this.countryOfBirth = JsonNullable.of(countryOfBirth); return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public Builder countryOfBirth(JsonNullable countryOfBirth) { - Utils.checkNotNull(countryOfBirth, "countryOfBirth"); - this.countryOfBirth = countryOfBirth; - return this; - } - - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The gender represents the gender identity of a person. */ - public Builder gender(Gender gender) { - Utils.checkNotNull(gender, "gender"); + public Builder gender(@Nullable Gender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender represents the gender identity of a person. - */ - public Builder gender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } - - /** * The preferred pronouns of the person. */ - public Builder pronouns(String pronouns) { - Utils.checkNotNull(pronouns, "pronouns"); + public Builder pronouns(@Nullable String pronouns) { this.pronouns = JsonNullable.of(pronouns); return this; } - /** - * The preferred pronouns of the person. - */ - public Builder pronouns(JsonNullable pronouns) { - Utils.checkNotNull(pronouns, "pronouns"); - this.pronouns = pronouns; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder preferredLanguage(String preferredLanguage) { - Utils.checkNotNull(preferredLanguage, "preferredLanguage"); + public Builder preferredLanguage(@Nullable String preferredLanguage) { this.preferredLanguage = JsonNullable.of(preferredLanguage); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder preferredLanguage(JsonNullable preferredLanguage) { - Utils.checkNotNull(preferredLanguage, "preferredLanguage"); - this.preferredLanguage = preferredLanguage; - return this; - } - - - public Builder languages(List languages) { - Utils.checkNotNull(languages, "languages"); - this.languages = Optional.ofNullable(languages); - return this; - } - - public Builder languages(Optional> languages) { - Utils.checkNotNull(languages, "languages"); + public Builder languages(@Nullable List languages) { this.languages = languages; return this; } - - public Builder nationalities(List nationalities) { - Utils.checkNotNull(nationalities, "nationalities"); - this.nationalities = Optional.ofNullable(nationalities); - return this; - } - - public Builder nationalities(Optional> nationalities) { - Utils.checkNotNull(nationalities, "nationalities"); + public Builder nationalities(@Nullable List nationalities) { this.nationalities = nationalities; return this; } - /** * The URL of the photo of a person. */ - public Builder photoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public Builder photoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public Builder photoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } - - /** * The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. */ - public Builder timezone(String timezone) { - Utils.checkNotNull(timezone, "timezone"); + public Builder timezone(@Nullable String timezone) { this.timezone = JsonNullable.of(timezone); return this; } - /** - * The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. - */ - public Builder timezone(JsonNullable timezone) { - Utils.checkNotNull(timezone, "timezone"); - this.timezone = timezone; - return this; - } - - /** * When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. */ - public Builder source(String source) { - Utils.checkNotNull(source, "source"); + public Builder source(@Nullable String source) { this.source = JsonNullable.of(source); return this; } - /** - * When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. - */ - public Builder source(JsonNullable source) { - Utils.checkNotNull(source, "source"); - this.source = source; - return this; - } - - /** * Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). */ - public Builder sourceId(String sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); + public Builder sourceId(@Nullable String sourceId) { this.sourceId = JsonNullable.of(sourceId); return this; } - /** - * Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). - */ - public Builder sourceId(JsonNullable sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); - this.sourceId = sourceId; - return this; - } - - - public Builder recordUrl(String recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); + public Builder recordUrl(@Nullable String recordUrl) { this.recordUrl = JsonNullable.of(recordUrl); return this; } - public Builder recordUrl(JsonNullable recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); - this.recordUrl = recordUrl; - return this; - } - - - public Builder jobs(List jobs) { - Utils.checkNotNull(jobs, "jobs"); + public Builder jobs(@Nullable List jobs) { this.jobs = JsonNullable.of(jobs); return this; } - public Builder jobs(JsonNullable> jobs) { - Utils.checkNotNull(jobs, "jobs"); - this.jobs = jobs; - return this; - } - - - public Builder compensations(List compensations) { - Utils.checkNotNull(compensations, "compensations"); + public Builder compensations(@Nullable List compensations) { this.compensations = JsonNullable.of(compensations); return this; } - public Builder compensations(JsonNullable> compensations) { - Utils.checkNotNull(compensations, "compensations"); - this.compensations = compensations; - return this; - } - - /** * Indicates if the employee works from a remote location. */ - public Builder worksRemote(boolean worksRemote) { - Utils.checkNotNull(worksRemote, "worksRemote"); + public Builder worksRemote(@Nullable Boolean worksRemote) { this.worksRemote = JsonNullable.of(worksRemote); return this; } - /** - * Indicates if the employee works from a remote location. - */ - public Builder worksRemote(JsonNullable worksRemote) { - Utils.checkNotNull(worksRemote, "worksRemote"); - this.worksRemote = worksRemote; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - - public Builder socialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Builder socialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Builder socialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - - public Builder bankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Builder bankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Builder bankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - - public Builder taxId(String taxId) { - Utils.checkNotNull(taxId, "taxId"); + public Builder taxId(@Nullable String taxId) { this.taxId = JsonNullable.of(taxId); return this; } - public Builder taxId(JsonNullable taxId) { - Utils.checkNotNull(taxId, "taxId"); - this.taxId = taxId; - return this; - } - - /** * Indicate the employee's dietary preference. */ - public Builder dietaryPreference(String dietaryPreference) { - Utils.checkNotNull(dietaryPreference, "dietaryPreference"); + public Builder dietaryPreference(@Nullable String dietaryPreference) { this.dietaryPreference = JsonNullable.of(dietaryPreference); return this; } - /** - * Indicate the employee's dietary preference. - */ - public Builder dietaryPreference(JsonNullable dietaryPreference) { - Utils.checkNotNull(dietaryPreference, "dietaryPreference"); - this.dietaryPreference = dietaryPreference; - return this; - } - - /** * Indicate the employee's food allergies. */ - public Builder foodAllergies(List foodAllergies) { - Utils.checkNotNull(foodAllergies, "foodAllergies"); + public Builder foodAllergies(@Nullable List foodAllergies) { this.foodAllergies = JsonNullable.of(foodAllergies); return this; } - /** - * Indicate the employee's food allergies. - */ - public Builder foodAllergies(JsonNullable> foodAllergies) { - Utils.checkNotNull(foodAllergies, "foodAllergies"); - this.foodAllergies = foodAllergies; - return this; - } - - - public Builder probationPeriod(ProbationPeriod probationPeriod) { - Utils.checkNotNull(probationPeriod, "probationPeriod"); - this.probationPeriod = Optional.ofNullable(probationPeriod); - return this; - } - - public Builder probationPeriod(Optional probationPeriod) { - Utils.checkNotNull(probationPeriod, "probationPeriod"); + public Builder probationPeriod(@Nullable ProbationPeriod probationPeriod) { this.probationPeriod = probationPeriod; return this; } - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * Flag to indicate if the object is deleted. */ - public Builder deleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Builder deleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Flag to indicate if the object is deleted. - */ - public Builder deleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Employee build() { - return new Employee( id, downstreamId, firstName, lastName, middleName, displayName, diff --git a/src/main/java/com/apideck/unify/models/components/EmployeeCompensation.java b/src/main/java/com/apideck/unify/models/components/EmployeeCompensation.java index ec6e5ba5..deaddadf 100644 --- a/src/main/java/com/apideck/unify/models/components/EmployeeCompensation.java +++ b/src/main/java/com/apideck/unify/models/components/EmployeeCompensation.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -43,21 +43,21 @@ public class EmployeeCompensation { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_unit") - private JsonNullable paymentUnit; + private JsonNullable paymentUnit; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The FLSA status for this compensation. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("flsa_status") - private JsonNullable flsaStatus; + private JsonNullable flsaStatus; /** * The date on which a change to an employee's compensation takes effect. @@ -71,108 +71,96 @@ public class EmployeeCompensation { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_frequency") - private JsonNullable paymentFrequency; + private JsonNullable paymentFrequency; @JsonCreator public EmployeeCompensation( - @JsonProperty("id") JsonNullable id, - @JsonProperty("job_id") JsonNullable jobId, - @JsonProperty("rate") JsonNullable rate, - @JsonProperty("payment_unit") JsonNullable paymentUnit, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("flsa_status") JsonNullable flsaStatus, - @JsonProperty("effective_date") JsonNullable effectiveDate, - @JsonProperty("payment_frequency") JsonNullable paymentFrequency) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(jobId, "jobId"); - Utils.checkNotNull(rate, "rate"); - Utils.checkNotNull(paymentUnit, "paymentUnit"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(flsaStatus, "flsaStatus"); - Utils.checkNotNull(effectiveDate, "effectiveDate"); - Utils.checkNotNull(paymentFrequency, "paymentFrequency"); - this.id = id; - this.jobId = jobId; - this.rate = rate; - this.paymentUnit = paymentUnit; - this.currency = currency; - this.flsaStatus = flsaStatus; - this.effectiveDate = effectiveDate; - this.paymentFrequency = paymentFrequency; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("job_id") @Nullable JsonNullable jobId, + @JsonProperty("rate") @Nullable JsonNullable rate, + @JsonProperty("payment_unit") @Nullable JsonNullable paymentUnit, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("flsa_status") @Nullable JsonNullable flsaStatus, + @JsonProperty("effective_date") @Nullable JsonNullable effectiveDate, + @JsonProperty("payment_frequency") @Nullable JsonNullable paymentFrequency) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.jobId = Optional.ofNullable(jobId) + .orElse(JsonNullable.undefined()); + this.rate = Optional.ofNullable(rate) + .orElse(JsonNullable.undefined()); + this.paymentUnit = Optional.ofNullable(paymentUnit) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.flsaStatus = Optional.ofNullable(flsaStatus) + .orElse(JsonNullable.undefined()); + this.effectiveDate = Optional.ofNullable(effectiveDate) + .orElse(JsonNullable.undefined()); + this.paymentFrequency = Optional.ofNullable(paymentFrequency) + .orElse(JsonNullable.undefined()); } public EmployeeCompensation() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The ID of the job to which the compensation belongs. */ - @JsonIgnore public JsonNullable jobId() { - return jobId; + return this.jobId; } /** * The amount paid per payment unit. */ - @JsonIgnore public JsonNullable rate() { - return rate; + return this.rate; } /** * Unit of measurement for employee compensation. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable paymentUnit() { - return (JsonNullable) paymentUnit; + return this.paymentUnit; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The FLSA status for this compensation. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable flsaStatus() { - return (JsonNullable) flsaStatus; + return this.flsaStatus; } /** * The date on which a change to an employee's compensation takes effect. */ - @JsonIgnore public JsonNullable effectiveDate() { - return effectiveDate; + return this.effectiveDate; } /** * Frequency of employee compensation. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable paymentFrequency() { - return (JsonNullable) paymentFrequency; + return this.paymentFrequency; } public static Builder builder() { @@ -183,146 +171,74 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EmployeeCompensation withId(String id) { - Utils.checkNotNull(id, "id"); + public EmployeeCompensation withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public EmployeeCompensation withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The ID of the job to which the compensation belongs. */ - public EmployeeCompensation withJobId(String jobId) { - Utils.checkNotNull(jobId, "jobId"); + public EmployeeCompensation withJobId(@Nullable String jobId) { this.jobId = JsonNullable.of(jobId); return this; } - /** - * The ID of the job to which the compensation belongs. - */ - public EmployeeCompensation withJobId(JsonNullable jobId) { - Utils.checkNotNull(jobId, "jobId"); - this.jobId = jobId; - return this; - } /** * The amount paid per payment unit. */ - public EmployeeCompensation withRate(double rate) { - Utils.checkNotNull(rate, "rate"); + public EmployeeCompensation withRate(@Nullable Double rate) { this.rate = JsonNullable.of(rate); return this; } - /** - * The amount paid per payment unit. - */ - public EmployeeCompensation withRate(JsonNullable rate) { - Utils.checkNotNull(rate, "rate"); - this.rate = rate; - return this; - } /** * Unit of measurement for employee compensation. */ - public EmployeeCompensation withPaymentUnit(PaymentUnit paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); + public EmployeeCompensation withPaymentUnit(@Nullable PaymentUnit paymentUnit) { this.paymentUnit = JsonNullable.of(paymentUnit); return this; } - /** - * Unit of measurement for employee compensation. - */ - public EmployeeCompensation withPaymentUnit(JsonNullable paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); - this.paymentUnit = paymentUnit; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public EmployeeCompensation withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public EmployeeCompensation withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public EmployeeCompensation withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The FLSA status for this compensation. */ - public EmployeeCompensation withFlsaStatus(FlsaStatus flsaStatus) { - Utils.checkNotNull(flsaStatus, "flsaStatus"); + public EmployeeCompensation withFlsaStatus(@Nullable FlsaStatus flsaStatus) { this.flsaStatus = JsonNullable.of(flsaStatus); return this; } - /** - * The FLSA status for this compensation. - */ - public EmployeeCompensation withFlsaStatus(JsonNullable flsaStatus) { - Utils.checkNotNull(flsaStatus, "flsaStatus"); - this.flsaStatus = flsaStatus; - return this; - } /** * The date on which a change to an employee's compensation takes effect. */ - public EmployeeCompensation withEffectiveDate(String effectiveDate) { - Utils.checkNotNull(effectiveDate, "effectiveDate"); + public EmployeeCompensation withEffectiveDate(@Nullable String effectiveDate) { this.effectiveDate = JsonNullable.of(effectiveDate); return this; } - /** - * The date on which a change to an employee's compensation takes effect. - */ - public EmployeeCompensation withEffectiveDate(JsonNullable effectiveDate) { - Utils.checkNotNull(effectiveDate, "effectiveDate"); - this.effectiveDate = effectiveDate; - return this; - } /** * Frequency of employee compensation. */ - public EmployeeCompensation withPaymentFrequency(PaymentFrequency paymentFrequency) { - Utils.checkNotNull(paymentFrequency, "paymentFrequency"); + public EmployeeCompensation withPaymentFrequency(@Nullable PaymentFrequency paymentFrequency) { this.paymentFrequency = JsonNullable.of(paymentFrequency); return this; } - /** - * Frequency of employee compensation. - */ - public EmployeeCompensation withPaymentFrequency(JsonNullable paymentFrequency) { - Utils.checkNotNull(paymentFrequency, "paymentFrequency"); - this.paymentFrequency = paymentFrequency; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -368,180 +284,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable jobId = JsonNullable.undefined(); + private JsonNullable jobId; - private JsonNullable rate = JsonNullable.undefined(); + private JsonNullable rate; - private JsonNullable paymentUnit = JsonNullable.undefined(); + private JsonNullable paymentUnit; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable flsaStatus = JsonNullable.undefined(); + private JsonNullable flsaStatus; - private JsonNullable effectiveDate = JsonNullable.undefined(); + private JsonNullable effectiveDate; - private JsonNullable paymentFrequency = JsonNullable.undefined(); + private JsonNullable paymentFrequency; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The ID of the job to which the compensation belongs. */ - public Builder jobId(String jobId) { - Utils.checkNotNull(jobId, "jobId"); + public Builder jobId(@Nullable String jobId) { this.jobId = JsonNullable.of(jobId); return this; } - /** - * The ID of the job to which the compensation belongs. - */ - public Builder jobId(JsonNullable jobId) { - Utils.checkNotNull(jobId, "jobId"); - this.jobId = jobId; - return this; - } - - /** * The amount paid per payment unit. */ - public Builder rate(double rate) { - Utils.checkNotNull(rate, "rate"); + public Builder rate(@Nullable Double rate) { this.rate = JsonNullable.of(rate); return this; } - /** - * The amount paid per payment unit. - */ - public Builder rate(JsonNullable rate) { - Utils.checkNotNull(rate, "rate"); - this.rate = rate; - return this; - } - - /** * Unit of measurement for employee compensation. */ - public Builder paymentUnit(PaymentUnit paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); + public Builder paymentUnit(@Nullable PaymentUnit paymentUnit) { this.paymentUnit = JsonNullable.of(paymentUnit); return this; } - /** - * Unit of measurement for employee compensation. - */ - public Builder paymentUnit(JsonNullable paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); - this.paymentUnit = paymentUnit; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The FLSA status for this compensation. */ - public Builder flsaStatus(FlsaStatus flsaStatus) { - Utils.checkNotNull(flsaStatus, "flsaStatus"); + public Builder flsaStatus(@Nullable FlsaStatus flsaStatus) { this.flsaStatus = JsonNullable.of(flsaStatus); return this; } - /** - * The FLSA status for this compensation. - */ - public Builder flsaStatus(JsonNullable flsaStatus) { - Utils.checkNotNull(flsaStatus, "flsaStatus"); - this.flsaStatus = flsaStatus; - return this; - } - - /** * The date on which a change to an employee's compensation takes effect. */ - public Builder effectiveDate(String effectiveDate) { - Utils.checkNotNull(effectiveDate, "effectiveDate"); + public Builder effectiveDate(@Nullable String effectiveDate) { this.effectiveDate = JsonNullable.of(effectiveDate); return this; } - /** - * The date on which a change to an employee's compensation takes effect. - */ - public Builder effectiveDate(JsonNullable effectiveDate) { - Utils.checkNotNull(effectiveDate, "effectiveDate"); - this.effectiveDate = effectiveDate; - return this; - } - - /** * Frequency of employee compensation. */ - public Builder paymentFrequency(PaymentFrequency paymentFrequency) { - Utils.checkNotNull(paymentFrequency, "paymentFrequency"); + public Builder paymentFrequency(@Nullable PaymentFrequency paymentFrequency) { this.paymentFrequency = JsonNullable.of(paymentFrequency); return this; } - /** - * Frequency of employee compensation. - */ - public Builder paymentFrequency(JsonNullable paymentFrequency) { - Utils.checkNotNull(paymentFrequency, "paymentFrequency"); - this.paymentFrequency = paymentFrequency; - return this; - } - public EmployeeCompensation build() { - return new EmployeeCompensation( id, jobId, rate, paymentUnit, currency, flsaStatus, diff --git a/src/main/java/com/apideck/unify/models/components/EmployeeCompensationInput.java b/src/main/java/com/apideck/unify/models/components/EmployeeCompensationInput.java index 607a6bc9..bab0e5c8 100644 --- a/src/main/java/com/apideck/unify/models/components/EmployeeCompensationInput.java +++ b/src/main/java/com/apideck/unify/models/components/EmployeeCompensationInput.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -29,21 +29,21 @@ public class EmployeeCompensationInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_unit") - private JsonNullable paymentUnit; + private JsonNullable paymentUnit; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The FLSA status for this compensation. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("flsa_status") - private JsonNullable flsaStatus; + private JsonNullable flsaStatus; /** * The date on which a change to an employee's compensation takes effect. @@ -57,85 +57,75 @@ public class EmployeeCompensationInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_frequency") - private JsonNullable paymentFrequency; + private JsonNullable paymentFrequency; @JsonCreator public EmployeeCompensationInput( - @JsonProperty("rate") JsonNullable rate, - @JsonProperty("payment_unit") JsonNullable paymentUnit, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("flsa_status") JsonNullable flsaStatus, - @JsonProperty("effective_date") JsonNullable effectiveDate, - @JsonProperty("payment_frequency") JsonNullable paymentFrequency) { - Utils.checkNotNull(rate, "rate"); - Utils.checkNotNull(paymentUnit, "paymentUnit"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(flsaStatus, "flsaStatus"); - Utils.checkNotNull(effectiveDate, "effectiveDate"); - Utils.checkNotNull(paymentFrequency, "paymentFrequency"); - this.rate = rate; - this.paymentUnit = paymentUnit; - this.currency = currency; - this.flsaStatus = flsaStatus; - this.effectiveDate = effectiveDate; - this.paymentFrequency = paymentFrequency; + @JsonProperty("rate") @Nullable JsonNullable rate, + @JsonProperty("payment_unit") @Nullable JsonNullable paymentUnit, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("flsa_status") @Nullable JsonNullable flsaStatus, + @JsonProperty("effective_date") @Nullable JsonNullable effectiveDate, + @JsonProperty("payment_frequency") @Nullable JsonNullable paymentFrequency) { + this.rate = Optional.ofNullable(rate) + .orElse(JsonNullable.undefined()); + this.paymentUnit = Optional.ofNullable(paymentUnit) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.flsaStatus = Optional.ofNullable(flsaStatus) + .orElse(JsonNullable.undefined()); + this.effectiveDate = Optional.ofNullable(effectiveDate) + .orElse(JsonNullable.undefined()); + this.paymentFrequency = Optional.ofNullable(paymentFrequency) + .orElse(JsonNullable.undefined()); } public EmployeeCompensationInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null); } /** * The amount paid per payment unit. */ - @JsonIgnore public JsonNullable rate() { - return rate; + return this.rate; } /** * Unit of measurement for employee compensation. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable paymentUnit() { - return (JsonNullable) paymentUnit; + return this.paymentUnit; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The FLSA status for this compensation. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable flsaStatus() { - return (JsonNullable) flsaStatus; + return this.flsaStatus; } /** * The date on which a change to an employee's compensation takes effect. */ - @JsonIgnore public JsonNullable effectiveDate() { - return effectiveDate; + return this.effectiveDate; } /** * Frequency of employee compensation. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable paymentFrequency() { - return (JsonNullable) paymentFrequency; + return this.paymentFrequency; } public static Builder builder() { @@ -146,110 +136,56 @@ public static Builder builder() { /** * The amount paid per payment unit. */ - public EmployeeCompensationInput withRate(double rate) { - Utils.checkNotNull(rate, "rate"); + public EmployeeCompensationInput withRate(@Nullable Double rate) { this.rate = JsonNullable.of(rate); return this; } - /** - * The amount paid per payment unit. - */ - public EmployeeCompensationInput withRate(JsonNullable rate) { - Utils.checkNotNull(rate, "rate"); - this.rate = rate; - return this; - } /** * Unit of measurement for employee compensation. */ - public EmployeeCompensationInput withPaymentUnit(PaymentUnit paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); + public EmployeeCompensationInput withPaymentUnit(@Nullable PaymentUnit paymentUnit) { this.paymentUnit = JsonNullable.of(paymentUnit); return this; } - /** - * Unit of measurement for employee compensation. - */ - public EmployeeCompensationInput withPaymentUnit(JsonNullable paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); - this.paymentUnit = paymentUnit; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public EmployeeCompensationInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public EmployeeCompensationInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public EmployeeCompensationInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The FLSA status for this compensation. */ - public EmployeeCompensationInput withFlsaStatus(FlsaStatus flsaStatus) { - Utils.checkNotNull(flsaStatus, "flsaStatus"); + public EmployeeCompensationInput withFlsaStatus(@Nullable FlsaStatus flsaStatus) { this.flsaStatus = JsonNullable.of(flsaStatus); return this; } - /** - * The FLSA status for this compensation. - */ - public EmployeeCompensationInput withFlsaStatus(JsonNullable flsaStatus) { - Utils.checkNotNull(flsaStatus, "flsaStatus"); - this.flsaStatus = flsaStatus; - return this; - } /** * The date on which a change to an employee's compensation takes effect. */ - public EmployeeCompensationInput withEffectiveDate(String effectiveDate) { - Utils.checkNotNull(effectiveDate, "effectiveDate"); + public EmployeeCompensationInput withEffectiveDate(@Nullable String effectiveDate) { this.effectiveDate = JsonNullable.of(effectiveDate); return this; } - /** - * The date on which a change to an employee's compensation takes effect. - */ - public EmployeeCompensationInput withEffectiveDate(JsonNullable effectiveDate) { - Utils.checkNotNull(effectiveDate, "effectiveDate"); - this.effectiveDate = effectiveDate; - return this; - } /** * Frequency of employee compensation. */ - public EmployeeCompensationInput withPaymentFrequency(PaymentFrequency paymentFrequency) { - Utils.checkNotNull(paymentFrequency, "paymentFrequency"); + public EmployeeCompensationInput withPaymentFrequency(@Nullable PaymentFrequency paymentFrequency) { this.paymentFrequency = JsonNullable.of(paymentFrequency); return this; } - /** - * Frequency of employee compensation. - */ - public EmployeeCompensationInput withPaymentFrequency(JsonNullable paymentFrequency) { - Utils.checkNotNull(paymentFrequency, "paymentFrequency"); - this.paymentFrequency = paymentFrequency; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -290,138 +226,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable rate = JsonNullable.undefined(); + private JsonNullable rate; - private JsonNullable paymentUnit = JsonNullable.undefined(); + private JsonNullable paymentUnit; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable flsaStatus = JsonNullable.undefined(); + private JsonNullable flsaStatus; - private JsonNullable effectiveDate = JsonNullable.undefined(); + private JsonNullable effectiveDate; - private JsonNullable paymentFrequency = JsonNullable.undefined(); + private JsonNullable paymentFrequency; private Builder() { // force use of static builder() method } - /** * The amount paid per payment unit. */ - public Builder rate(double rate) { - Utils.checkNotNull(rate, "rate"); + public Builder rate(@Nullable Double rate) { this.rate = JsonNullable.of(rate); return this; } - /** - * The amount paid per payment unit. - */ - public Builder rate(JsonNullable rate) { - Utils.checkNotNull(rate, "rate"); - this.rate = rate; - return this; - } - - /** * Unit of measurement for employee compensation. */ - public Builder paymentUnit(PaymentUnit paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); + public Builder paymentUnit(@Nullable PaymentUnit paymentUnit) { this.paymentUnit = JsonNullable.of(paymentUnit); return this; } - /** - * Unit of measurement for employee compensation. - */ - public Builder paymentUnit(JsonNullable paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); - this.paymentUnit = paymentUnit; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The FLSA status for this compensation. */ - public Builder flsaStatus(FlsaStatus flsaStatus) { - Utils.checkNotNull(flsaStatus, "flsaStatus"); + public Builder flsaStatus(@Nullable FlsaStatus flsaStatus) { this.flsaStatus = JsonNullable.of(flsaStatus); return this; } - /** - * The FLSA status for this compensation. - */ - public Builder flsaStatus(JsonNullable flsaStatus) { - Utils.checkNotNull(flsaStatus, "flsaStatus"); - this.flsaStatus = flsaStatus; - return this; - } - - /** * The date on which a change to an employee's compensation takes effect. */ - public Builder effectiveDate(String effectiveDate) { - Utils.checkNotNull(effectiveDate, "effectiveDate"); + public Builder effectiveDate(@Nullable String effectiveDate) { this.effectiveDate = JsonNullable.of(effectiveDate); return this; } - /** - * The date on which a change to an employee's compensation takes effect. - */ - public Builder effectiveDate(JsonNullable effectiveDate) { - Utils.checkNotNull(effectiveDate, "effectiveDate"); - this.effectiveDate = effectiveDate; - return this; - } - - /** * Frequency of employee compensation. */ - public Builder paymentFrequency(PaymentFrequency paymentFrequency) { - Utils.checkNotNull(paymentFrequency, "paymentFrequency"); + public Builder paymentFrequency(@Nullable PaymentFrequency paymentFrequency) { this.paymentFrequency = JsonNullable.of(paymentFrequency); return this; } - /** - * Frequency of employee compensation. - */ - public Builder paymentFrequency(JsonNullable paymentFrequency) { - Utils.checkNotNull(paymentFrequency, "paymentFrequency"); - this.paymentFrequency = paymentFrequency; - return this; - } - public EmployeeCompensationInput build() { - return new EmployeeCompensationInput( rate, paymentUnit, currency, flsaStatus, effectiveDate, paymentFrequency); diff --git a/src/main/java/com/apideck/unify/models/components/EmployeeInput.java b/src/main/java/com/apideck/unify/models/components/EmployeeInput.java index 718b7107..9eb169a1 100644 --- a/src/main/java/com/apideck/unify/models/components/EmployeeInput.java +++ b/src/main/java/com/apideck/unify/models/components/EmployeeInput.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -94,7 +93,7 @@ public class EmployeeInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("partner") - private Optional partner; + private PersonInput partner; /** * The division the person is currently in. Usually a collection of departments or teams or regions. @@ -139,7 +138,7 @@ public class EmployeeInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("team") - private JsonNullable team; + private JsonNullable team; /** * The unique identifier of the company. @@ -174,7 +173,7 @@ public class EmployeeInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("leaving_reason") - private JsonNullable leavingReason; + private JsonNullable leavingReason; /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. @@ -188,12 +187,12 @@ public class EmployeeInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("employment_status") - private JsonNullable employmentStatus; + private JsonNullable employmentStatus; @JsonInclude(Include.NON_ABSENT) @JsonProperty("employment_role") - private Optional employmentRole; + private EmploymentRole employmentRole; /** * The ethnicity of the employee @@ -205,14 +204,14 @@ public class EmployeeInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("manager") - private Optional manager; + private Manager manager; /** * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("direct_reports") - private JsonNullable> directReports; + private JsonNullable> directReports; /** * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. @@ -254,7 +253,7 @@ public class EmployeeInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("gender") - private JsonNullable gender; + private JsonNullable gender; /** * The preferred pronouns of the person. @@ -273,12 +272,12 @@ public class EmployeeInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("languages") - private Optional> languages; + private List languages; @JsonInclude(Include.NON_ABSENT) @JsonProperty("nationalities") - private Optional> nationalities; + private List nationalities; /** * The URL of the photo of a person. @@ -316,12 +315,12 @@ public class EmployeeInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("jobs") - private JsonNullable> jobs; + private JsonNullable> jobs; @JsonInclude(Include.NON_ABSENT) @JsonProperty("compensations") - private JsonNullable> compensations; + private JsonNullable> compensations; /** * Indicates if the employee works from a remote location. @@ -333,32 +332,32 @@ public class EmployeeInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("social_links") - private Optional> socialLinks; + private List socialLinks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_accounts") - private Optional> bankAccounts; + private List bankAccounts; @JsonInclude(Include.NON_ABSENT) @@ -382,17 +381,17 @@ public class EmployeeInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("food_allergies") - private JsonNullable> foodAllergies; + private JsonNullable> foodAllergies; @JsonInclude(Include.NON_ABSENT) @JsonProperty("probation_period") - private Optional probationPeriod; + private ProbationPeriod probationPeriod; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -413,319 +412,292 @@ public class EmployeeInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public EmployeeInput( - @JsonProperty("id") JsonNullable id, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("preferred_name") JsonNullable preferredName, - @JsonProperty("initials") JsonNullable initials, - @JsonProperty("salutation") JsonNullable salutation, - @JsonProperty("title") JsonNullable title, - @JsonProperty("marital_status") JsonNullable maritalStatus, - @JsonProperty("partner") Optional partner, - @JsonProperty("division") JsonNullable division, - @JsonProperty("division_id") JsonNullable divisionId, - @JsonProperty("department") JsonNullable department, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("department_name") JsonNullable departmentName, - @JsonProperty("team") JsonNullable team, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("employment_start_date") JsonNullable employmentStartDate, - @JsonProperty("employment_end_date") JsonNullable employmentEndDate, - @JsonProperty("leaving_reason") JsonNullable leavingReason, - @JsonProperty("employee_number") JsonNullable employeeNumber, - @JsonProperty("employment_status") JsonNullable employmentStatus, - @JsonProperty("employment_role") Optional employmentRole, - @JsonProperty("ethnicity") JsonNullable ethnicity, - @JsonProperty("manager") Optional manager, - @JsonProperty("direct_reports") JsonNullable> directReports, - @JsonProperty("social_security_number") JsonNullable socialSecurityNumber, - @JsonProperty("birthday") JsonNullable birthday, - @JsonProperty("deceased_on") JsonNullable deceasedOn, - @JsonProperty("country_of_birth") JsonNullable countryOfBirth, - @JsonProperty("description") JsonNullable description, - @JsonProperty("gender") JsonNullable gender, - @JsonProperty("pronouns") JsonNullable pronouns, - @JsonProperty("preferred_language") JsonNullable preferredLanguage, - @JsonProperty("languages") Optional> languages, - @JsonProperty("nationalities") Optional> nationalities, - @JsonProperty("photo_url") JsonNullable photoUrl, - @JsonProperty("timezone") JsonNullable timezone, - @JsonProperty("source") JsonNullable source, - @JsonProperty("source_id") JsonNullable sourceId, - @JsonProperty("record_url") JsonNullable recordUrl, - @JsonProperty("jobs") JsonNullable> jobs, - @JsonProperty("compensations") JsonNullable> compensations, - @JsonProperty("works_remote") JsonNullable worksRemote, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("social_links") Optional> socialLinks, - @JsonProperty("bank_accounts") Optional> bankAccounts, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("tax_id") JsonNullable taxId, - @JsonProperty("dietary_preference") JsonNullable dietaryPreference, - @JsonProperty("food_allergies") JsonNullable> foodAllergies, - @JsonProperty("probation_period") Optional probationPeriod, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("deleted") JsonNullable deleted, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(preferredName, "preferredName"); - Utils.checkNotNull(initials, "initials"); - Utils.checkNotNull(salutation, "salutation"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(maritalStatus, "maritalStatus"); - Utils.checkNotNull(partner, "partner"); - Utils.checkNotNull(division, "division"); - Utils.checkNotNull(divisionId, "divisionId"); - Utils.checkNotNull(department, "department"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(departmentName, "departmentName"); - Utils.checkNotNull(team, "team"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(employmentStartDate, "employmentStartDate"); - Utils.checkNotNull(employmentEndDate, "employmentEndDate"); - Utils.checkNotNull(leavingReason, "leavingReason"); - Utils.checkNotNull(employeeNumber, "employeeNumber"); - Utils.checkNotNull(employmentStatus, "employmentStatus"); - Utils.checkNotNull(employmentRole, "employmentRole"); - Utils.checkNotNull(ethnicity, "ethnicity"); - Utils.checkNotNull(manager, "manager"); - Utils.checkNotNull(directReports, "directReports"); - Utils.checkNotNull(socialSecurityNumber, "socialSecurityNumber"); - Utils.checkNotNull(birthday, "birthday"); - Utils.checkNotNull(deceasedOn, "deceasedOn"); - Utils.checkNotNull(countryOfBirth, "countryOfBirth"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(gender, "gender"); - Utils.checkNotNull(pronouns, "pronouns"); - Utils.checkNotNull(preferredLanguage, "preferredLanguage"); - Utils.checkNotNull(languages, "languages"); - Utils.checkNotNull(nationalities, "nationalities"); - Utils.checkNotNull(photoUrl, "photoUrl"); - Utils.checkNotNull(timezone, "timezone"); - Utils.checkNotNull(source, "source"); - Utils.checkNotNull(sourceId, "sourceId"); - Utils.checkNotNull(recordUrl, "recordUrl"); - Utils.checkNotNull(jobs, "jobs"); - Utils.checkNotNull(compensations, "compensations"); - Utils.checkNotNull(worksRemote, "worksRemote"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(socialLinks, "socialLinks"); - Utils.checkNotNull(bankAccounts, "bankAccounts"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(taxId, "taxId"); - Utils.checkNotNull(dietaryPreference, "dietaryPreference"); - Utils.checkNotNull(foodAllergies, "foodAllergies"); - Utils.checkNotNull(probationPeriod, "probationPeriod"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(deleted, "deleted"); - Utils.checkNotNull(passThrough, "passThrough"); - this.id = id; - this.firstName = firstName; - this.lastName = lastName; - this.middleName = middleName; - this.displayName = displayName; - this.preferredName = preferredName; - this.initials = initials; - this.salutation = salutation; - this.title = title; - this.maritalStatus = maritalStatus; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("preferred_name") @Nullable JsonNullable preferredName, + @JsonProperty("initials") @Nullable JsonNullable initials, + @JsonProperty("salutation") @Nullable JsonNullable salutation, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("marital_status") @Nullable JsonNullable maritalStatus, + @JsonProperty("partner") @Nullable PersonInput partner, + @JsonProperty("division") @Nullable JsonNullable division, + @JsonProperty("division_id") @Nullable JsonNullable divisionId, + @JsonProperty("department") @Nullable JsonNullable department, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("department_name") @Nullable JsonNullable departmentName, + @JsonProperty("team") @Nullable JsonNullable team, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("employment_start_date") @Nullable JsonNullable employmentStartDate, + @JsonProperty("employment_end_date") @Nullable JsonNullable employmentEndDate, + @JsonProperty("leaving_reason") @Nullable JsonNullable leavingReason, + @JsonProperty("employee_number") @Nullable JsonNullable employeeNumber, + @JsonProperty("employment_status") @Nullable JsonNullable employmentStatus, + @JsonProperty("employment_role") @Nullable EmploymentRole employmentRole, + @JsonProperty("ethnicity") @Nullable JsonNullable ethnicity, + @JsonProperty("manager") @Nullable Manager manager, + @JsonProperty("direct_reports") @Nullable JsonNullable> directReports, + @JsonProperty("social_security_number") @Nullable JsonNullable socialSecurityNumber, + @JsonProperty("birthday") @Nullable JsonNullable birthday, + @JsonProperty("deceased_on") @Nullable JsonNullable deceasedOn, + @JsonProperty("country_of_birth") @Nullable JsonNullable countryOfBirth, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("gender") @Nullable JsonNullable gender, + @JsonProperty("pronouns") @Nullable JsonNullable pronouns, + @JsonProperty("preferred_language") @Nullable JsonNullable preferredLanguage, + @JsonProperty("languages") @Nullable List languages, + @JsonProperty("nationalities") @Nullable List nationalities, + @JsonProperty("photo_url") @Nullable JsonNullable photoUrl, + @JsonProperty("timezone") @Nullable JsonNullable timezone, + @JsonProperty("source") @Nullable JsonNullable source, + @JsonProperty("source_id") @Nullable JsonNullable sourceId, + @JsonProperty("record_url") @Nullable JsonNullable recordUrl, + @JsonProperty("jobs") @Nullable JsonNullable> jobs, + @JsonProperty("compensations") @Nullable JsonNullable> compensations, + @JsonProperty("works_remote") @Nullable JsonNullable worksRemote, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("social_links") @Nullable List socialLinks, + @JsonProperty("bank_accounts") @Nullable List bankAccounts, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("tax_id") @Nullable JsonNullable taxId, + @JsonProperty("dietary_preference") @Nullable JsonNullable dietaryPreference, + @JsonProperty("food_allergies") @Nullable JsonNullable> foodAllergies, + @JsonProperty("probation_period") @Nullable ProbationPeriod probationPeriod, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("deleted") @Nullable JsonNullable deleted, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.preferredName = Optional.ofNullable(preferredName) + .orElse(JsonNullable.undefined()); + this.initials = Optional.ofNullable(initials) + .orElse(JsonNullable.undefined()); + this.salutation = Optional.ofNullable(salutation) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.maritalStatus = Optional.ofNullable(maritalStatus) + .orElse(JsonNullable.undefined()); this.partner = partner; - this.division = division; - this.divisionId = divisionId; - this.department = department; - this.departmentId = departmentId; - this.departmentName = departmentName; - this.team = team; - this.companyId = companyId; - this.companyName = companyName; - this.employmentStartDate = employmentStartDate; - this.employmentEndDate = employmentEndDate; - this.leavingReason = leavingReason; - this.employeeNumber = employeeNumber; - this.employmentStatus = employmentStatus; + this.division = Optional.ofNullable(division) + .orElse(JsonNullable.undefined()); + this.divisionId = Optional.ofNullable(divisionId) + .orElse(JsonNullable.undefined()); + this.department = Optional.ofNullable(department) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); + this.departmentName = Optional.ofNullable(departmentName) + .orElse(JsonNullable.undefined()); + this.team = Optional.ofNullable(team) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.employmentStartDate = Optional.ofNullable(employmentStartDate) + .orElse(JsonNullable.undefined()); + this.employmentEndDate = Optional.ofNullable(employmentEndDate) + .orElse(JsonNullable.undefined()); + this.leavingReason = Optional.ofNullable(leavingReason) + .orElse(JsonNullable.undefined()); + this.employeeNumber = Optional.ofNullable(employeeNumber) + .orElse(JsonNullable.undefined()); + this.employmentStatus = Optional.ofNullable(employmentStatus) + .orElse(JsonNullable.undefined()); this.employmentRole = employmentRole; - this.ethnicity = ethnicity; + this.ethnicity = Optional.ofNullable(ethnicity) + .orElse(JsonNullable.undefined()); this.manager = manager; - this.directReports = directReports; - this.socialSecurityNumber = socialSecurityNumber; - this.birthday = birthday; - this.deceasedOn = deceasedOn; - this.countryOfBirth = countryOfBirth; - this.description = description; - this.gender = gender; - this.pronouns = pronouns; - this.preferredLanguage = preferredLanguage; + this.directReports = Optional.ofNullable(directReports) + .orElse(JsonNullable.undefined()); + this.socialSecurityNumber = Optional.ofNullable(socialSecurityNumber) + .orElse(JsonNullable.undefined()); + this.birthday = Optional.ofNullable(birthday) + .orElse(JsonNullable.undefined()); + this.deceasedOn = Optional.ofNullable(deceasedOn) + .orElse(JsonNullable.undefined()); + this.countryOfBirth = Optional.ofNullable(countryOfBirth) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.gender = Optional.ofNullable(gender) + .orElse(JsonNullable.undefined()); + this.pronouns = Optional.ofNullable(pronouns) + .orElse(JsonNullable.undefined()); + this.preferredLanguage = Optional.ofNullable(preferredLanguage) + .orElse(JsonNullable.undefined()); this.languages = languages; this.nationalities = nationalities; - this.photoUrl = photoUrl; - this.timezone = timezone; - this.source = source; - this.sourceId = sourceId; - this.recordUrl = recordUrl; - this.jobs = jobs; - this.compensations = compensations; - this.worksRemote = worksRemote; + this.photoUrl = Optional.ofNullable(photoUrl) + .orElse(JsonNullable.undefined()); + this.timezone = Optional.ofNullable(timezone) + .orElse(JsonNullable.undefined()); + this.source = Optional.ofNullable(source) + .orElse(JsonNullable.undefined()); + this.sourceId = Optional.ofNullable(sourceId) + .orElse(JsonNullable.undefined()); + this.recordUrl = Optional.ofNullable(recordUrl) + .orElse(JsonNullable.undefined()); + this.jobs = Optional.ofNullable(jobs) + .orElse(JsonNullable.undefined()); + this.compensations = Optional.ofNullable(compensations) + .orElse(JsonNullable.undefined()); + this.worksRemote = Optional.ofNullable(worksRemote) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.phoneNumbers = phoneNumbers; this.emails = emails; this.customFields = customFields; this.socialLinks = socialLinks; this.bankAccounts = bankAccounts; - this.taxCode = taxCode; - this.taxId = taxId; - this.dietaryPreference = dietaryPreference; - this.foodAllergies = foodAllergies; + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.taxId = Optional.ofNullable(taxId) + .orElse(JsonNullable.undefined()); + this.dietaryPreference = Optional.ofNullable(dietaryPreference) + .orElse(JsonNullable.undefined()); + this.foodAllergies = Optional.ofNullable(foodAllergies) + .orElse(JsonNullable.undefined()); this.probationPeriod = probationPeriod; - this.tags = tags; - this.rowVersion = rowVersion; - this.deleted = deleted; + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.deleted = Optional.ofNullable(deleted) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public EmployeeInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Middle name of the person. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The name used to display the employee, often a combination of their first and last names. */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * The name the employee prefers to be addressed by, which may be different from their legal name. */ - @JsonIgnore public JsonNullable preferredName() { - return preferredName; + return this.preferredName; } /** * The initials of the person, usually derived from their first, middle, and last names. */ - @JsonIgnore public JsonNullable initials() { - return initials; + return this.initials; } /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - @JsonIgnore public JsonNullable salutation() { - return salutation; + return this.salutation; } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The marital status of the employee. */ - @JsonIgnore public JsonNullable maritalStatus() { - return maritalStatus; + return this.maritalStatus; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional partner() { - return (Optional) partner; + return Optional.ofNullable(this.partner); } /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - @JsonIgnore public JsonNullable division() { - return division; + return this.division; } /** * Unique identifier of the division this employee belongs to. */ - @JsonIgnore public JsonNullable divisionId() { - return divisionId; + return this.divisionId; } /** @@ -734,355 +706,286 @@ public JsonNullable divisionId() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable department() { - return department; + return this.department; } /** * Unique identifier of the department ID this employee belongs to. */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } /** * Name of the department this employee belongs to. */ - @JsonIgnore public JsonNullable departmentName() { - return departmentName; + return this.departmentName; } /** * The team the person is currently in. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable team() { - return (JsonNullable) team; + return this.team; } /** * The unique identifier of the company. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * A Start Date is the date that the employee started working at the company */ - @JsonIgnore public JsonNullable employmentStartDate() { - return employmentStartDate; + return this.employmentStartDate; } /** * An End Date is the date that the employee ended working at the company */ - @JsonIgnore public JsonNullable employmentEndDate() { - return employmentEndDate; + return this.employmentEndDate; } /** * The reason because the employment ended. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable leavingReason() { - return (JsonNullable) leavingReason; + return this.leavingReason; } /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - @JsonIgnore public JsonNullable employeeNumber() { - return employeeNumber; + return this.employeeNumber; } /** * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable employmentStatus() { - return (JsonNullable) employmentStatus; + return this.employmentStatus; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional employmentRole() { - return (Optional) employmentRole; + return Optional.ofNullable(this.employmentRole); } /** * The ethnicity of the employee */ - @JsonIgnore public JsonNullable ethnicity() { - return ethnicity; + return this.ethnicity; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional manager() { - return (Optional) manager; + return Optional.ofNullable(this.manager); } /** * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> directReports() { - return (JsonNullable>) directReports; + return this.directReports; } /** * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. */ - @JsonIgnore public JsonNullable socialSecurityNumber() { - return socialSecurityNumber; + return this.socialSecurityNumber; } /** * The date of birth of the person. */ - @JsonIgnore public JsonNullable birthday() { - return birthday; + return this.birthday; } /** * The date the person deceased. */ - @JsonIgnore public JsonNullable deceasedOn() { - return deceasedOn; + return this.deceasedOn; } /** * Country code according to ISO 3166-1 alpha-2. */ - @JsonIgnore public JsonNullable countryOfBirth() { - return countryOfBirth; + return this.countryOfBirth; } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The gender represents the gender identity of a person. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable gender() { - return (JsonNullable) gender; + return this.gender; } /** * The preferred pronouns of the person. */ - @JsonIgnore public JsonNullable pronouns() { - return pronouns; + return this.pronouns; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable preferredLanguage() { - return preferredLanguage; + return this.preferredLanguage; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> languages() { - return (Optional>) languages; + return Optional.ofNullable(this.languages); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> nationalities() { - return (Optional>) nationalities; + return Optional.ofNullable(this.nationalities); } /** * The URL of the photo of a person. */ - @JsonIgnore public JsonNullable photoUrl() { - return photoUrl; + return this.photoUrl; } /** * The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. */ - @JsonIgnore public JsonNullable timezone() { - return timezone; + return this.timezone; } /** * When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. */ - @JsonIgnore public JsonNullable source() { - return source; + return this.source; } /** * Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). */ - @JsonIgnore public JsonNullable sourceId() { - return sourceId; + return this.sourceId; } - @JsonIgnore public JsonNullable recordUrl() { - return recordUrl; + return this.recordUrl; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> jobs() { - return (JsonNullable>) jobs; + return this.jobs; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> compensations() { - return (JsonNullable>) compensations; + return this.compensations; } /** * Indicates if the employee works from a remote location. */ - @JsonIgnore public JsonNullable worksRemote() { - return worksRemote; + return this.worksRemote; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> socialLinks() { - return (Optional>) socialLinks; + return Optional.ofNullable(this.socialLinks); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> bankAccounts() { - return (Optional>) bankAccounts; + return Optional.ofNullable(this.bankAccounts); } - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } - @JsonIgnore public JsonNullable taxId() { - return taxId; + return this.taxId; } /** * Indicate the employee's dietary preference. */ - @JsonIgnore public JsonNullable dietaryPreference() { - return dietaryPreference; + return this.dietaryPreference; } /** * Indicate the employee's food allergies. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> foodAllergies() { - return (JsonNullable>) foodAllergies; + return this.foodAllergies; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional probationPeriod() { - return (Optional) probationPeriod; + return Optional.ofNullable(this.probationPeriod); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * Flag to indicate if the object is deleted. */ - @JsonIgnore public JsonNullable deleted() { - return deleted; + return this.deleted; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -1093,231 +996,116 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EmployeeInput withId(String id) { - Utils.checkNotNull(id, "id"); + public EmployeeInput withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public EmployeeInput withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The first name of the person. */ - public EmployeeInput withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public EmployeeInput withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public EmployeeInput withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public EmployeeInput withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public EmployeeInput withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public EmployeeInput withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Middle name of the person. */ - public EmployeeInput withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public EmployeeInput withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public EmployeeInput withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The name used to display the employee, often a combination of their first and last names. */ - public EmployeeInput withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public EmployeeInput withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The name used to display the employee, often a combination of their first and last names. - */ - public EmployeeInput withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } /** * The name the employee prefers to be addressed by, which may be different from their legal name. */ - public EmployeeInput withPreferredName(String preferredName) { - Utils.checkNotNull(preferredName, "preferredName"); + public EmployeeInput withPreferredName(@Nullable String preferredName) { this.preferredName = JsonNullable.of(preferredName); return this; } - /** - * The name the employee prefers to be addressed by, which may be different from their legal name. - */ - public EmployeeInput withPreferredName(JsonNullable preferredName) { - Utils.checkNotNull(preferredName, "preferredName"); - this.preferredName = preferredName; - return this; - } /** * The initials of the person, usually derived from their first, middle, and last names. */ - public EmployeeInput withInitials(String initials) { - Utils.checkNotNull(initials, "initials"); + public EmployeeInput withInitials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * The initials of the person, usually derived from their first, middle, and last names. - */ - public EmployeeInput withInitials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - public EmployeeInput withSalutation(String salutation) { - Utils.checkNotNull(salutation, "salutation"); + public EmployeeInput withSalutation(@Nullable String salutation) { this.salutation = JsonNullable.of(salutation); return this; } - /** - * A formal salutation for the person. For example, 'Mr', 'Mrs' - */ - public EmployeeInput withSalutation(JsonNullable salutation) { - Utils.checkNotNull(salutation, "salutation"); - this.salutation = salutation; - return this; - } /** * The job title of the person. */ - public EmployeeInput withTitle(String title) { - Utils.checkNotNull(title, "title"); + public EmployeeInput withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public EmployeeInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The marital status of the employee. */ - public EmployeeInput withMaritalStatus(String maritalStatus) { - Utils.checkNotNull(maritalStatus, "maritalStatus"); + public EmployeeInput withMaritalStatus(@Nullable String maritalStatus) { this.maritalStatus = JsonNullable.of(maritalStatus); return this; } - /** - * The marital status of the employee. - */ - public EmployeeInput withMaritalStatus(JsonNullable maritalStatus) { - Utils.checkNotNull(maritalStatus, "maritalStatus"); - this.maritalStatus = maritalStatus; - return this; - } - - public EmployeeInput withPartner(PersonInput partner) { - Utils.checkNotNull(partner, "partner"); - this.partner = Optional.ofNullable(partner); - return this; - } - - public EmployeeInput withPartner(Optional partner) { - Utils.checkNotNull(partner, "partner"); + public EmployeeInput withPartner(@Nullable PersonInput partner) { this.partner = partner; return this; } + /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - public EmployeeInput withDivision(String division) { - Utils.checkNotNull(division, "division"); + public EmployeeInput withDivision(@Nullable String division) { this.division = JsonNullable.of(division); return this; } - /** - * The division the person is currently in. Usually a collection of departments or teams or regions. - */ - public EmployeeInput withDivision(JsonNullable division) { - Utils.checkNotNull(division, "division"); - this.division = division; - return this; - } /** * Unique identifier of the division this employee belongs to. */ - public EmployeeInput withDivisionId(String divisionId) { - Utils.checkNotNull(divisionId, "divisionId"); + public EmployeeInput withDivisionId(@Nullable String divisionId) { this.divisionId = JsonNullable.of(divisionId); return this; } - /** - * Unique identifier of the division this employee belongs to. - */ - public EmployeeInput withDivisionId(JsonNullable divisionId) { - Utils.checkNotNull(divisionId, "divisionId"); - this.divisionId = divisionId; - return this; - } /** * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. @@ -1325,780 +1113,384 @@ public EmployeeInput withDivisionId(JsonNullable divisionId) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public EmployeeInput withDepartment(String department) { - Utils.checkNotNull(department, "department"); + public EmployeeInput withDepartment(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public EmployeeInput withDepartment(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } /** * Unique identifier of the department ID this employee belongs to. */ - public EmployeeInput withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public EmployeeInput withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * Unique identifier of the department ID this employee belongs to. - */ - public EmployeeInput withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } /** * Name of the department this employee belongs to. */ - public EmployeeInput withDepartmentName(String departmentName) { - Utils.checkNotNull(departmentName, "departmentName"); + public EmployeeInput withDepartmentName(@Nullable String departmentName) { this.departmentName = JsonNullable.of(departmentName); return this; } - /** - * Name of the department this employee belongs to. - */ - public EmployeeInput withDepartmentName(JsonNullable departmentName) { - Utils.checkNotNull(departmentName, "departmentName"); - this.departmentName = departmentName; - return this; - } /** * The team the person is currently in. */ - public EmployeeInput withTeam(Team team) { - Utils.checkNotNull(team, "team"); + public EmployeeInput withTeam(@Nullable Team team) { this.team = JsonNullable.of(team); return this; } - /** - * The team the person is currently in. - */ - public EmployeeInput withTeam(JsonNullable team) { - Utils.checkNotNull(team, "team"); - this.team = team; - return this; - } /** * The unique identifier of the company. */ - public EmployeeInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public EmployeeInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company. - */ - public EmployeeInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The name of the company. */ - public EmployeeInput withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public EmployeeInput withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public EmployeeInput withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * A Start Date is the date that the employee started working at the company */ - public EmployeeInput withEmploymentStartDate(String employmentStartDate) { - Utils.checkNotNull(employmentStartDate, "employmentStartDate"); + public EmployeeInput withEmploymentStartDate(@Nullable String employmentStartDate) { this.employmentStartDate = JsonNullable.of(employmentStartDate); return this; } - /** - * A Start Date is the date that the employee started working at the company - */ - public EmployeeInput withEmploymentStartDate(JsonNullable employmentStartDate) { - Utils.checkNotNull(employmentStartDate, "employmentStartDate"); - this.employmentStartDate = employmentStartDate; - return this; - } /** * An End Date is the date that the employee ended working at the company */ - public EmployeeInput withEmploymentEndDate(String employmentEndDate) { - Utils.checkNotNull(employmentEndDate, "employmentEndDate"); + public EmployeeInput withEmploymentEndDate(@Nullable String employmentEndDate) { this.employmentEndDate = JsonNullable.of(employmentEndDate); return this; } - /** - * An End Date is the date that the employee ended working at the company - */ - public EmployeeInput withEmploymentEndDate(JsonNullable employmentEndDate) { - Utils.checkNotNull(employmentEndDate, "employmentEndDate"); - this.employmentEndDate = employmentEndDate; - return this; - } /** * The reason because the employment ended. */ - public EmployeeInput withLeavingReason(LeavingReason leavingReason) { - Utils.checkNotNull(leavingReason, "leavingReason"); + public EmployeeInput withLeavingReason(@Nullable LeavingReason leavingReason) { this.leavingReason = JsonNullable.of(leavingReason); return this; } - /** - * The reason because the employment ended. - */ - public EmployeeInput withLeavingReason(JsonNullable leavingReason) { - Utils.checkNotNull(leavingReason, "leavingReason"); - this.leavingReason = leavingReason; - return this; - } /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - public EmployeeInput withEmployeeNumber(String employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); + public EmployeeInput withEmployeeNumber(@Nullable String employeeNumber) { this.employeeNumber = JsonNullable.of(employeeNumber); return this; } - /** - * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - */ - public EmployeeInput withEmployeeNumber(JsonNullable employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); - this.employeeNumber = employeeNumber; - return this; - } /** * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. */ - public EmployeeInput withEmploymentStatus(EmploymentStatus employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); + public EmployeeInput withEmploymentStatus(@Nullable EmploymentStatus employmentStatus) { this.employmentStatus = JsonNullable.of(employmentStatus); return this; } - /** - * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. - */ - public EmployeeInput withEmploymentStatus(JsonNullable employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); - this.employmentStatus = employmentStatus; - return this; - } - - public EmployeeInput withEmploymentRole(EmploymentRole employmentRole) { - Utils.checkNotNull(employmentRole, "employmentRole"); - this.employmentRole = Optional.ofNullable(employmentRole); - return this; - } - - public EmployeeInput withEmploymentRole(Optional employmentRole) { - Utils.checkNotNull(employmentRole, "employmentRole"); + public EmployeeInput withEmploymentRole(@Nullable EmploymentRole employmentRole) { this.employmentRole = employmentRole; return this; } - /** - * The ethnicity of the employee - */ - public EmployeeInput withEthnicity(String ethnicity) { - Utils.checkNotNull(ethnicity, "ethnicity"); - this.ethnicity = JsonNullable.of(ethnicity); - return this; - } /** * The ethnicity of the employee */ - public EmployeeInput withEthnicity(JsonNullable ethnicity) { - Utils.checkNotNull(ethnicity, "ethnicity"); - this.ethnicity = ethnicity; - return this; - } - - public EmployeeInput withManager(Manager manager) { - Utils.checkNotNull(manager, "manager"); - this.manager = Optional.ofNullable(manager); + public EmployeeInput withEthnicity(@Nullable String ethnicity) { + this.ethnicity = JsonNullable.of(ethnicity); return this; } - public EmployeeInput withManager(Optional manager) { - Utils.checkNotNull(manager, "manager"); + public EmployeeInput withManager(@Nullable Manager manager) { this.manager = manager; return this; } + /** * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. */ - public EmployeeInput withDirectReports(List directReports) { - Utils.checkNotNull(directReports, "directReports"); + public EmployeeInput withDirectReports(@Nullable List directReports) { this.directReports = JsonNullable.of(directReports); return this; } - /** - * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. - */ - public EmployeeInput withDirectReports(JsonNullable> directReports) { - Utils.checkNotNull(directReports, "directReports"); - this.directReports = directReports; - return this; - } /** * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. */ - public EmployeeInput withSocialSecurityNumber(String socialSecurityNumber) { - Utils.checkNotNull(socialSecurityNumber, "socialSecurityNumber"); + public EmployeeInput withSocialSecurityNumber(@Nullable String socialSecurityNumber) { this.socialSecurityNumber = JsonNullable.of(socialSecurityNumber); return this; } - /** - * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. - */ - public EmployeeInput withSocialSecurityNumber(JsonNullable socialSecurityNumber) { - Utils.checkNotNull(socialSecurityNumber, "socialSecurityNumber"); - this.socialSecurityNumber = socialSecurityNumber; - return this; - } /** * The date of birth of the person. */ - public EmployeeInput withBirthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public EmployeeInput withBirthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public EmployeeInput withBirthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } /** * The date the person deceased. */ - public EmployeeInput withDeceasedOn(LocalDate deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); + public EmployeeInput withDeceasedOn(@Nullable LocalDate deceasedOn) { this.deceasedOn = JsonNullable.of(deceasedOn); return this; } - /** - * The date the person deceased. - */ - public EmployeeInput withDeceasedOn(JsonNullable deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); - this.deceasedOn = deceasedOn; - return this; - } /** * Country code according to ISO 3166-1 alpha-2. */ - public EmployeeInput withCountryOfBirth(String countryOfBirth) { - Utils.checkNotNull(countryOfBirth, "countryOfBirth"); + public EmployeeInput withCountryOfBirth(@Nullable String countryOfBirth) { this.countryOfBirth = JsonNullable.of(countryOfBirth); return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public EmployeeInput withCountryOfBirth(JsonNullable countryOfBirth) { - Utils.checkNotNull(countryOfBirth, "countryOfBirth"); - this.countryOfBirth = countryOfBirth; - return this; - } /** * A description of the object. */ - public EmployeeInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public EmployeeInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public EmployeeInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The gender represents the gender identity of a person. */ - public EmployeeInput withGender(Gender gender) { - Utils.checkNotNull(gender, "gender"); + public EmployeeInput withGender(@Nullable Gender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender represents the gender identity of a person. - */ - public EmployeeInput withGender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } /** * The preferred pronouns of the person. */ - public EmployeeInput withPronouns(String pronouns) { - Utils.checkNotNull(pronouns, "pronouns"); + public EmployeeInput withPronouns(@Nullable String pronouns) { this.pronouns = JsonNullable.of(pronouns); return this; } - /** - * The preferred pronouns of the person. - */ - public EmployeeInput withPronouns(JsonNullable pronouns) { - Utils.checkNotNull(pronouns, "pronouns"); - this.pronouns = pronouns; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public EmployeeInput withPreferredLanguage(String preferredLanguage) { - Utils.checkNotNull(preferredLanguage, "preferredLanguage"); + public EmployeeInput withPreferredLanguage(@Nullable String preferredLanguage) { this.preferredLanguage = JsonNullable.of(preferredLanguage); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public EmployeeInput withPreferredLanguage(JsonNullable preferredLanguage) { - Utils.checkNotNull(preferredLanguage, "preferredLanguage"); - this.preferredLanguage = preferredLanguage; - return this; - } - - public EmployeeInput withLanguages(List languages) { - Utils.checkNotNull(languages, "languages"); - this.languages = Optional.ofNullable(languages); - return this; - } - - public EmployeeInput withLanguages(Optional> languages) { - Utils.checkNotNull(languages, "languages"); + public EmployeeInput withLanguages(@Nullable List languages) { this.languages = languages; return this; } - public EmployeeInput withNationalities(List nationalities) { - Utils.checkNotNull(nationalities, "nationalities"); - this.nationalities = Optional.ofNullable(nationalities); - return this; - } - - public EmployeeInput withNationalities(Optional> nationalities) { - Utils.checkNotNull(nationalities, "nationalities"); + public EmployeeInput withNationalities(@Nullable List nationalities) { this.nationalities = nationalities; return this; } + /** * The URL of the photo of a person. */ - public EmployeeInput withPhotoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public EmployeeInput withPhotoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public EmployeeInput withPhotoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } /** * The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. */ - public EmployeeInput withTimezone(String timezone) { - Utils.checkNotNull(timezone, "timezone"); + public EmployeeInput withTimezone(@Nullable String timezone) { this.timezone = JsonNullable.of(timezone); return this; } - /** - * The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. - */ - public EmployeeInput withTimezone(JsonNullable timezone) { - Utils.checkNotNull(timezone, "timezone"); - this.timezone = timezone; - return this; - } /** * When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. */ - public EmployeeInput withSource(String source) { - Utils.checkNotNull(source, "source"); + public EmployeeInput withSource(@Nullable String source) { this.source = JsonNullable.of(source); return this; } - /** - * When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. - */ - public EmployeeInput withSource(JsonNullable source) { - Utils.checkNotNull(source, "source"); - this.source = source; - return this; - } /** * Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). */ - public EmployeeInput withSourceId(String sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); + public EmployeeInput withSourceId(@Nullable String sourceId) { this.sourceId = JsonNullable.of(sourceId); return this; } - /** - * Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). - */ - public EmployeeInput withSourceId(JsonNullable sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); - this.sourceId = sourceId; - return this; - } - public EmployeeInput withRecordUrl(String recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); + public EmployeeInput withRecordUrl(@Nullable String recordUrl) { this.recordUrl = JsonNullable.of(recordUrl); return this; } - public EmployeeInput withRecordUrl(JsonNullable recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); - this.recordUrl = recordUrl; - return this; - } - public EmployeeInput withJobs(List jobs) { - Utils.checkNotNull(jobs, "jobs"); + public EmployeeInput withJobs(@Nullable List jobs) { this.jobs = JsonNullable.of(jobs); return this; } - public EmployeeInput withJobs(JsonNullable> jobs) { - Utils.checkNotNull(jobs, "jobs"); - this.jobs = jobs; - return this; - } - public EmployeeInput withCompensations(List compensations) { - Utils.checkNotNull(compensations, "compensations"); + public EmployeeInput withCompensations(@Nullable List compensations) { this.compensations = JsonNullable.of(compensations); return this; } - public EmployeeInput withCompensations(JsonNullable> compensations) { - Utils.checkNotNull(compensations, "compensations"); - this.compensations = compensations; - return this; - } /** * Indicates if the employee works from a remote location. */ - public EmployeeInput withWorksRemote(boolean worksRemote) { - Utils.checkNotNull(worksRemote, "worksRemote"); + public EmployeeInput withWorksRemote(@Nullable Boolean worksRemote) { this.worksRemote = JsonNullable.of(worksRemote); return this; } - /** - * Indicates if the employee works from a remote location. - */ - public EmployeeInput withWorksRemote(JsonNullable worksRemote) { - Utils.checkNotNull(worksRemote, "worksRemote"); - this.worksRemote = worksRemote; - return this; - } - - public EmployeeInput withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public EmployeeInput withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public EmployeeInput withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public EmployeeInput withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public EmployeeInput withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public EmployeeInput withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public EmployeeInput withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public EmployeeInput withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public EmployeeInput withEmails(@Nullable List emails) { this.emails = emails; return this; } - public EmployeeInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public EmployeeInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public EmployeeInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - public EmployeeInput withSocialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public EmployeeInput withSocialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public EmployeeInput withSocialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - public EmployeeInput withBankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public EmployeeInput withBankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public EmployeeInput withBankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - public EmployeeInput withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + + public EmployeeInput withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - public EmployeeInput withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - public EmployeeInput withTaxId(String taxId) { - Utils.checkNotNull(taxId, "taxId"); + public EmployeeInput withTaxId(@Nullable String taxId) { this.taxId = JsonNullable.of(taxId); return this; } - public EmployeeInput withTaxId(JsonNullable taxId) { - Utils.checkNotNull(taxId, "taxId"); - this.taxId = taxId; - return this; - } /** * Indicate the employee's dietary preference. */ - public EmployeeInput withDietaryPreference(String dietaryPreference) { - Utils.checkNotNull(dietaryPreference, "dietaryPreference"); + public EmployeeInput withDietaryPreference(@Nullable String dietaryPreference) { this.dietaryPreference = JsonNullable.of(dietaryPreference); return this; } - /** - * Indicate the employee's dietary preference. - */ - public EmployeeInput withDietaryPreference(JsonNullable dietaryPreference) { - Utils.checkNotNull(dietaryPreference, "dietaryPreference"); - this.dietaryPreference = dietaryPreference; - return this; - } /** * Indicate the employee's food allergies. */ - public EmployeeInput withFoodAllergies(List foodAllergies) { - Utils.checkNotNull(foodAllergies, "foodAllergies"); + public EmployeeInput withFoodAllergies(@Nullable List foodAllergies) { this.foodAllergies = JsonNullable.of(foodAllergies); return this; } - /** - * Indicate the employee's food allergies. - */ - public EmployeeInput withFoodAllergies(JsonNullable> foodAllergies) { - Utils.checkNotNull(foodAllergies, "foodAllergies"); - this.foodAllergies = foodAllergies; + + public EmployeeInput withProbationPeriod(@Nullable ProbationPeriod probationPeriod) { + this.probationPeriod = probationPeriod; return this; } - public EmployeeInput withProbationPeriod(ProbationPeriod probationPeriod) { - Utils.checkNotNull(probationPeriod, "probationPeriod"); - this.probationPeriod = Optional.ofNullable(probationPeriod); - return this; - } - - - public EmployeeInput withProbationPeriod(Optional probationPeriod) { - Utils.checkNotNull(probationPeriod, "probationPeriod"); - this.probationPeriod = probationPeriod; - return this; - } - public EmployeeInput withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + public EmployeeInput withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public EmployeeInput withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public EmployeeInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public EmployeeInput withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public EmployeeInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * Flag to indicate if the object is deleted. */ - public EmployeeInput withDeleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public EmployeeInput withDeleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Flag to indicate if the object is deleted. - */ - public EmployeeInput withDeleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public EmployeeInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public EmployeeInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public EmployeeInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -2267,1192 +1659,571 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable preferredName = JsonNullable.undefined(); + private JsonNullable preferredName; - private JsonNullable initials = JsonNullable.undefined(); + private JsonNullable initials; - private JsonNullable salutation = JsonNullable.undefined(); + private JsonNullable salutation; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable maritalStatus = JsonNullable.undefined(); + private JsonNullable maritalStatus; - private Optional partner = Optional.empty(); + private PersonInput partner; - private JsonNullable division = JsonNullable.undefined(); + private JsonNullable division; - private JsonNullable divisionId = JsonNullable.undefined(); + private JsonNullable divisionId; @Deprecated - private JsonNullable department = JsonNullable.undefined(); + private JsonNullable department; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private JsonNullable departmentName = JsonNullable.undefined(); + private JsonNullable departmentName; - private JsonNullable team = JsonNullable.undefined(); + private JsonNullable team; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable employmentStartDate = JsonNullable.undefined(); + private JsonNullable employmentStartDate; - private JsonNullable employmentEndDate = JsonNullable.undefined(); + private JsonNullable employmentEndDate; - private JsonNullable leavingReason = JsonNullable.undefined(); + private JsonNullable leavingReason; - private JsonNullable employeeNumber = JsonNullable.undefined(); + private JsonNullable employeeNumber; - private JsonNullable employmentStatus = JsonNullable.undefined(); + private JsonNullable employmentStatus; - private Optional employmentRole = Optional.empty(); + private EmploymentRole employmentRole; - private JsonNullable ethnicity = JsonNullable.undefined(); + private JsonNullable ethnicity; - private Optional manager = Optional.empty(); + private Manager manager; - private JsonNullable> directReports = JsonNullable.undefined(); + private JsonNullable> directReports; - private JsonNullable socialSecurityNumber = JsonNullable.undefined(); + private JsonNullable socialSecurityNumber; - private JsonNullable birthday = JsonNullable.undefined(); + private JsonNullable birthday; - private JsonNullable deceasedOn = JsonNullable.undefined(); + private JsonNullable deceasedOn; - private JsonNullable countryOfBirth = JsonNullable.undefined(); + private JsonNullable countryOfBirth; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable gender = JsonNullable.undefined(); + private JsonNullable gender; - private JsonNullable pronouns = JsonNullable.undefined(); + private JsonNullable pronouns; - private JsonNullable preferredLanguage = JsonNullable.undefined(); + private JsonNullable preferredLanguage; - private Optional> languages = Optional.empty(); + private List languages; - private Optional> nationalities = Optional.empty(); + private List nationalities; - private JsonNullable photoUrl = JsonNullable.undefined(); + private JsonNullable photoUrl; - private JsonNullable timezone = JsonNullable.undefined(); + private JsonNullable timezone; - private JsonNullable source = JsonNullable.undefined(); + private JsonNullable source; - private JsonNullable sourceId = JsonNullable.undefined(); + private JsonNullable sourceId; - private JsonNullable recordUrl = JsonNullable.undefined(); + private JsonNullable recordUrl; - private JsonNullable> jobs = JsonNullable.undefined(); + private JsonNullable> jobs; - private JsonNullable> compensations = JsonNullable.undefined(); + private JsonNullable> compensations; - private JsonNullable worksRemote = JsonNullable.undefined(); + private JsonNullable worksRemote; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private Optional> customFields = Optional.empty(); + private List customFields; - private Optional> socialLinks = Optional.empty(); + private List socialLinks; - private Optional> bankAccounts = Optional.empty(); + private List bankAccounts; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable taxId = JsonNullable.undefined(); + private JsonNullable taxId; - private JsonNullable dietaryPreference = JsonNullable.undefined(); + private JsonNullable dietaryPreference; - private JsonNullable> foodAllergies = JsonNullable.undefined(); + private JsonNullable> foodAllergies; - private Optional probationPeriod = Optional.empty(); + private ProbationPeriod probationPeriod; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable deleted = JsonNullable.undefined(); + private JsonNullable deleted; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Middle name of the person. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The name used to display the employee, often a combination of their first and last names. */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The name used to display the employee, often a combination of their first and last names. - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * The name the employee prefers to be addressed by, which may be different from their legal name. */ - public Builder preferredName(String preferredName) { - Utils.checkNotNull(preferredName, "preferredName"); + public Builder preferredName(@Nullable String preferredName) { this.preferredName = JsonNullable.of(preferredName); return this; } - /** - * The name the employee prefers to be addressed by, which may be different from their legal name. - */ - public Builder preferredName(JsonNullable preferredName) { - Utils.checkNotNull(preferredName, "preferredName"); - this.preferredName = preferredName; - return this; - } - - /** * The initials of the person, usually derived from their first, middle, and last names. */ - public Builder initials(String initials) { - Utils.checkNotNull(initials, "initials"); + public Builder initials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * The initials of the person, usually derived from their first, middle, and last names. - */ - public Builder initials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } - - /** * A formal salutation for the person. For example, 'Mr', 'Mrs' */ - public Builder salutation(String salutation) { - Utils.checkNotNull(salutation, "salutation"); + public Builder salutation(@Nullable String salutation) { this.salutation = JsonNullable.of(salutation); return this; } - /** - * A formal salutation for the person. For example, 'Mr', 'Mrs' - */ - public Builder salutation(JsonNullable salutation) { - Utils.checkNotNull(salutation, "salutation"); - this.salutation = salutation; - return this; - } - - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The marital status of the employee. */ - public Builder maritalStatus(String maritalStatus) { - Utils.checkNotNull(maritalStatus, "maritalStatus"); + public Builder maritalStatus(@Nullable String maritalStatus) { this.maritalStatus = JsonNullable.of(maritalStatus); return this; } - /** - * The marital status of the employee. - */ - public Builder maritalStatus(JsonNullable maritalStatus) { - Utils.checkNotNull(maritalStatus, "maritalStatus"); - this.maritalStatus = maritalStatus; - return this; - } - - - public Builder partner(PersonInput partner) { - Utils.checkNotNull(partner, "partner"); - this.partner = Optional.ofNullable(partner); - return this; - } - - public Builder partner(Optional partner) { - Utils.checkNotNull(partner, "partner"); + public Builder partner(@Nullable PersonInput partner) { this.partner = partner; return this; } - /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - public Builder division(String division) { - Utils.checkNotNull(division, "division"); + public Builder division(@Nullable String division) { this.division = JsonNullable.of(division); return this; } - /** - * The division the person is currently in. Usually a collection of departments or teams or regions. - */ - public Builder division(JsonNullable division) { - Utils.checkNotNull(division, "division"); - this.division = division; - return this; - } - - /** * Unique identifier of the division this employee belongs to. */ - public Builder divisionId(String divisionId) { - Utils.checkNotNull(divisionId, "divisionId"); + public Builder divisionId(@Nullable String divisionId) { this.divisionId = JsonNullable.of(divisionId); return this; } - /** - * Unique identifier of the division this employee belongs to. - */ - public Builder divisionId(JsonNullable divisionId) { - Utils.checkNotNull(divisionId, "divisionId"); - this.divisionId = divisionId; - return this; - } - - /** * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder department(String department) { - Utils.checkNotNull(department, "department"); + public Builder department(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder department(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } - - /** * Unique identifier of the department ID this employee belongs to. */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * Unique identifier of the department ID this employee belongs to. - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - /** * Name of the department this employee belongs to. */ - public Builder departmentName(String departmentName) { - Utils.checkNotNull(departmentName, "departmentName"); + public Builder departmentName(@Nullable String departmentName) { this.departmentName = JsonNullable.of(departmentName); return this; } - /** - * Name of the department this employee belongs to. - */ - public Builder departmentName(JsonNullable departmentName) { - Utils.checkNotNull(departmentName, "departmentName"); - this.departmentName = departmentName; - return this; - } - - /** * The team the person is currently in. */ - public Builder team(Team team) { - Utils.checkNotNull(team, "team"); + public Builder team(@Nullable Team team) { this.team = JsonNullable.of(team); return this; } - /** - * The team the person is currently in. - */ - public Builder team(JsonNullable team) { - Utils.checkNotNull(team, "team"); - this.team = team; - return this; - } - - /** * The unique identifier of the company. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * A Start Date is the date that the employee started working at the company */ - public Builder employmentStartDate(String employmentStartDate) { - Utils.checkNotNull(employmentStartDate, "employmentStartDate"); + public Builder employmentStartDate(@Nullable String employmentStartDate) { this.employmentStartDate = JsonNullable.of(employmentStartDate); return this; } - /** - * A Start Date is the date that the employee started working at the company - */ - public Builder employmentStartDate(JsonNullable employmentStartDate) { - Utils.checkNotNull(employmentStartDate, "employmentStartDate"); - this.employmentStartDate = employmentStartDate; - return this; - } - - /** * An End Date is the date that the employee ended working at the company */ - public Builder employmentEndDate(String employmentEndDate) { - Utils.checkNotNull(employmentEndDate, "employmentEndDate"); + public Builder employmentEndDate(@Nullable String employmentEndDate) { this.employmentEndDate = JsonNullable.of(employmentEndDate); return this; } - /** - * An End Date is the date that the employee ended working at the company - */ - public Builder employmentEndDate(JsonNullable employmentEndDate) { - Utils.checkNotNull(employmentEndDate, "employmentEndDate"); - this.employmentEndDate = employmentEndDate; - return this; - } - - /** * The reason because the employment ended. */ - public Builder leavingReason(LeavingReason leavingReason) { - Utils.checkNotNull(leavingReason, "leavingReason"); + public Builder leavingReason(@Nullable LeavingReason leavingReason) { this.leavingReason = JsonNullable.of(leavingReason); return this; } - /** - * The reason because the employment ended. - */ - public Builder leavingReason(JsonNullable leavingReason) { - Utils.checkNotNull(leavingReason, "leavingReason"); - this.leavingReason = leavingReason; - return this; - } - - /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - public Builder employeeNumber(String employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); + public Builder employeeNumber(@Nullable String employeeNumber) { this.employeeNumber = JsonNullable.of(employeeNumber); return this; } - /** - * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - */ - public Builder employeeNumber(JsonNullable employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); - this.employeeNumber = employeeNumber; - return this; - } - - /** * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. */ - public Builder employmentStatus(EmploymentStatus employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); + public Builder employmentStatus(@Nullable EmploymentStatus employmentStatus) { this.employmentStatus = JsonNullable.of(employmentStatus); return this; } - /** - * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. - */ - public Builder employmentStatus(JsonNullable employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); - this.employmentStatus = employmentStatus; - return this; - } - - - public Builder employmentRole(EmploymentRole employmentRole) { - Utils.checkNotNull(employmentRole, "employmentRole"); - this.employmentRole = Optional.ofNullable(employmentRole); - return this; - } - - public Builder employmentRole(Optional employmentRole) { - Utils.checkNotNull(employmentRole, "employmentRole"); + public Builder employmentRole(@Nullable EmploymentRole employmentRole) { this.employmentRole = employmentRole; return this; } - /** * The ethnicity of the employee */ - public Builder ethnicity(String ethnicity) { - Utils.checkNotNull(ethnicity, "ethnicity"); + public Builder ethnicity(@Nullable String ethnicity) { this.ethnicity = JsonNullable.of(ethnicity); return this; } - /** - * The ethnicity of the employee - */ - public Builder ethnicity(JsonNullable ethnicity) { - Utils.checkNotNull(ethnicity, "ethnicity"); - this.ethnicity = ethnicity; - return this; - } - - - public Builder manager(Manager manager) { - Utils.checkNotNull(manager, "manager"); - this.manager = Optional.ofNullable(manager); - return this; - } - - public Builder manager(Optional manager) { - Utils.checkNotNull(manager, "manager"); + public Builder manager(@Nullable Manager manager) { this.manager = manager; return this; } - /** * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. */ - public Builder directReports(List directReports) { - Utils.checkNotNull(directReports, "directReports"); + public Builder directReports(@Nullable List directReports) { this.directReports = JsonNullable.of(directReports); return this; } - /** - * Direct reports is an array of ids that reflect the individuals in an organizational hierarchy who are directly supervised by this specific employee. - */ - public Builder directReports(JsonNullable> directReports) { - Utils.checkNotNull(directReports, "directReports"); - this.directReports = directReports; - return this; - } - - /** * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. */ - public Builder socialSecurityNumber(String socialSecurityNumber) { - Utils.checkNotNull(socialSecurityNumber, "socialSecurityNumber"); + public Builder socialSecurityNumber(@Nullable String socialSecurityNumber) { this.socialSecurityNumber = JsonNullable.of(socialSecurityNumber); return this; } - /** - * A unique identifier assigned by the government. This field is considered sensitive information and may be subject to special security and privacy restrictions. - */ - public Builder socialSecurityNumber(JsonNullable socialSecurityNumber) { - Utils.checkNotNull(socialSecurityNumber, "socialSecurityNumber"); - this.socialSecurityNumber = socialSecurityNumber; - return this; - } - - /** * The date of birth of the person. */ - public Builder birthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Builder birthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * The date of birth of the person. - */ - public Builder birthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - /** * The date the person deceased. */ - public Builder deceasedOn(LocalDate deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); + public Builder deceasedOn(@Nullable LocalDate deceasedOn) { this.deceasedOn = JsonNullable.of(deceasedOn); return this; } - /** - * The date the person deceased. - */ - public Builder deceasedOn(JsonNullable deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); - this.deceasedOn = deceasedOn; - return this; - } - - /** * Country code according to ISO 3166-1 alpha-2. */ - public Builder countryOfBirth(String countryOfBirth) { - Utils.checkNotNull(countryOfBirth, "countryOfBirth"); + public Builder countryOfBirth(@Nullable String countryOfBirth) { this.countryOfBirth = JsonNullable.of(countryOfBirth); return this; } - /** - * Country code according to ISO 3166-1 alpha-2. - */ - public Builder countryOfBirth(JsonNullable countryOfBirth) { - Utils.checkNotNull(countryOfBirth, "countryOfBirth"); - this.countryOfBirth = countryOfBirth; - return this; - } - - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The gender represents the gender identity of a person. */ - public Builder gender(Gender gender) { - Utils.checkNotNull(gender, "gender"); + public Builder gender(@Nullable Gender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender represents the gender identity of a person. - */ - public Builder gender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } - - /** * The preferred pronouns of the person. */ - public Builder pronouns(String pronouns) { - Utils.checkNotNull(pronouns, "pronouns"); + public Builder pronouns(@Nullable String pronouns) { this.pronouns = JsonNullable.of(pronouns); return this; } - /** - * The preferred pronouns of the person. - */ - public Builder pronouns(JsonNullable pronouns) { - Utils.checkNotNull(pronouns, "pronouns"); - this.pronouns = pronouns; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder preferredLanguage(String preferredLanguage) { - Utils.checkNotNull(preferredLanguage, "preferredLanguage"); + public Builder preferredLanguage(@Nullable String preferredLanguage) { this.preferredLanguage = JsonNullable.of(preferredLanguage); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder preferredLanguage(JsonNullable preferredLanguage) { - Utils.checkNotNull(preferredLanguage, "preferredLanguage"); - this.preferredLanguage = preferredLanguage; - return this; - } - - - public Builder languages(List languages) { - Utils.checkNotNull(languages, "languages"); - this.languages = Optional.ofNullable(languages); - return this; - } - - public Builder languages(Optional> languages) { - Utils.checkNotNull(languages, "languages"); + public Builder languages(@Nullable List languages) { this.languages = languages; return this; } - - public Builder nationalities(List nationalities) { - Utils.checkNotNull(nationalities, "nationalities"); - this.nationalities = Optional.ofNullable(nationalities); - return this; - } - - public Builder nationalities(Optional> nationalities) { - Utils.checkNotNull(nationalities, "nationalities"); + public Builder nationalities(@Nullable List nationalities) { this.nationalities = nationalities; return this; } - /** * The URL of the photo of a person. */ - public Builder photoUrl(String photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); + public Builder photoUrl(@Nullable String photoUrl) { this.photoUrl = JsonNullable.of(photoUrl); return this; } - /** - * The URL of the photo of a person. - */ - public Builder photoUrl(JsonNullable photoUrl) { - Utils.checkNotNull(photoUrl, "photoUrl"); - this.photoUrl = photoUrl; - return this; - } - - /** * The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. */ - public Builder timezone(String timezone) { - Utils.checkNotNull(timezone, "timezone"); + public Builder timezone(@Nullable String timezone) { this.timezone = JsonNullable.of(timezone); return this; } - /** - * The time zone related to the resource. The value is a string containing a standard time zone identifier, e.g. Europe/London. - */ - public Builder timezone(JsonNullable timezone) { - Utils.checkNotNull(timezone, "timezone"); - this.timezone = timezone; - return this; - } - - /** * When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. */ - public Builder source(String source) { - Utils.checkNotNull(source, "source"); + public Builder source(@Nullable String source) { this.source = JsonNullable.of(source); return this; } - /** - * When the employee is imported as a new hire, this field indicates what system (e.g. the name of the ATS) this employee was imported from. - */ - public Builder source(JsonNullable source) { - Utils.checkNotNull(source, "source"); - this.source = source; - return this; - } - - /** * Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). */ - public Builder sourceId(String sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); + public Builder sourceId(@Nullable String sourceId) { this.sourceId = JsonNullable.of(sourceId); return this; } - /** - * Unique identifier of the employee in the system this employee was imported from (e.g. the ID in the ATS). - */ - public Builder sourceId(JsonNullable sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); - this.sourceId = sourceId; - return this; - } - - - public Builder recordUrl(String recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); + public Builder recordUrl(@Nullable String recordUrl) { this.recordUrl = JsonNullable.of(recordUrl); return this; } - public Builder recordUrl(JsonNullable recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); - this.recordUrl = recordUrl; - return this; - } - - - public Builder jobs(List jobs) { - Utils.checkNotNull(jobs, "jobs"); + public Builder jobs(@Nullable List jobs) { this.jobs = JsonNullable.of(jobs); return this; } - public Builder jobs(JsonNullable> jobs) { - Utils.checkNotNull(jobs, "jobs"); - this.jobs = jobs; - return this; - } - - - public Builder compensations(List compensations) { - Utils.checkNotNull(compensations, "compensations"); + public Builder compensations(@Nullable List compensations) { this.compensations = JsonNullable.of(compensations); return this; } - public Builder compensations(JsonNullable> compensations) { - Utils.checkNotNull(compensations, "compensations"); - this.compensations = compensations; - return this; - } - - /** * Indicates if the employee works from a remote location. */ - public Builder worksRemote(boolean worksRemote) { - Utils.checkNotNull(worksRemote, "worksRemote"); + public Builder worksRemote(@Nullable Boolean worksRemote) { this.worksRemote = JsonNullable.of(worksRemote); return this; } - /** - * Indicates if the employee works from a remote location. - */ - public Builder worksRemote(JsonNullable worksRemote) { - Utils.checkNotNull(worksRemote, "worksRemote"); - this.worksRemote = worksRemote; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - - public Builder socialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Builder socialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Builder socialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - - public Builder bankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Builder bankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Builder bankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - - public Builder taxId(String taxId) { - Utils.checkNotNull(taxId, "taxId"); + public Builder taxId(@Nullable String taxId) { this.taxId = JsonNullable.of(taxId); return this; } - public Builder taxId(JsonNullable taxId) { - Utils.checkNotNull(taxId, "taxId"); - this.taxId = taxId; - return this; - } - - /** * Indicate the employee's dietary preference. */ - public Builder dietaryPreference(String dietaryPreference) { - Utils.checkNotNull(dietaryPreference, "dietaryPreference"); + public Builder dietaryPreference(@Nullable String dietaryPreference) { this.dietaryPreference = JsonNullable.of(dietaryPreference); return this; } - /** - * Indicate the employee's dietary preference. - */ - public Builder dietaryPreference(JsonNullable dietaryPreference) { - Utils.checkNotNull(dietaryPreference, "dietaryPreference"); - this.dietaryPreference = dietaryPreference; - return this; - } - - /** * Indicate the employee's food allergies. */ - public Builder foodAllergies(List foodAllergies) { - Utils.checkNotNull(foodAllergies, "foodAllergies"); + public Builder foodAllergies(@Nullable List foodAllergies) { this.foodAllergies = JsonNullable.of(foodAllergies); return this; } - /** - * Indicate the employee's food allergies. - */ - public Builder foodAllergies(JsonNullable> foodAllergies) { - Utils.checkNotNull(foodAllergies, "foodAllergies"); - this.foodAllergies = foodAllergies; - return this; - } - - - public Builder probationPeriod(ProbationPeriod probationPeriod) { - Utils.checkNotNull(probationPeriod, "probationPeriod"); - this.probationPeriod = Optional.ofNullable(probationPeriod); - return this; - } - - public Builder probationPeriod(Optional probationPeriod) { - Utils.checkNotNull(probationPeriod, "probationPeriod"); + public Builder probationPeriod(@Nullable ProbationPeriod probationPeriod) { this.probationPeriod = probationPeriod; return this; } - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * Flag to indicate if the object is deleted. */ - public Builder deleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Builder deleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Flag to indicate if the object is deleted. - */ - public Builder deleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public EmployeeInput build() { - return new EmployeeInput( id, firstName, lastName, middleName, displayName, preferredName, diff --git a/src/main/java/com/apideck/unify/models/components/EmployeeJob.java b/src/main/java/com/apideck/unify/models/components/EmployeeJob.java index ca8da3c8..90266afd 100644 --- a/src/main/java/com/apideck/unify/models/components/EmployeeJob.java +++ b/src/main/java/com/apideck/unify/models/components/EmployeeJob.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -74,14 +73,14 @@ public class EmployeeJob { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Unit of measurement for employee compensation. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_unit") - private JsonNullable paymentUnit; + private JsonNullable paymentUnit; /** * The date on which the employee was hired by the organization @@ -109,178 +108,159 @@ public class EmployeeJob { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("location") - private Optional location; + private Address location; @JsonCreator public EmployeeJob( - @JsonProperty("id") JsonNullable id, - @JsonProperty("employee_id") JsonNullable employeeId, - @JsonProperty("title") JsonNullable title, - @JsonProperty("role") JsonNullable role, - @JsonProperty("start_date") JsonNullable startDate, - @JsonProperty("end_date") JsonNullable endDate, - @JsonProperty("compensation_rate") JsonNullable compensationRate, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("payment_unit") JsonNullable paymentUnit, - @JsonProperty("hired_at") JsonNullable hiredAt, - @JsonProperty("is_primary") JsonNullable isPrimary, - @JsonProperty("is_manager") JsonNullable isManager, - @JsonProperty("status") JsonNullable status, - @JsonProperty("location") Optional location) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(employeeId, "employeeId"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(role, "role"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(compensationRate, "compensationRate"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(paymentUnit, "paymentUnit"); - Utils.checkNotNull(hiredAt, "hiredAt"); - Utils.checkNotNull(isPrimary, "isPrimary"); - Utils.checkNotNull(isManager, "isManager"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(location, "location"); - this.id = id; - this.employeeId = employeeId; - this.title = title; - this.role = role; - this.startDate = startDate; - this.endDate = endDate; - this.compensationRate = compensationRate; - this.currency = currency; - this.paymentUnit = paymentUnit; - this.hiredAt = hiredAt; - this.isPrimary = isPrimary; - this.isManager = isManager; - this.status = status; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("employee_id") @Nullable JsonNullable employeeId, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("role") @Nullable JsonNullable role, + @JsonProperty("start_date") @Nullable JsonNullable startDate, + @JsonProperty("end_date") @Nullable JsonNullable endDate, + @JsonProperty("compensation_rate") @Nullable JsonNullable compensationRate, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("payment_unit") @Nullable JsonNullable paymentUnit, + @JsonProperty("hired_at") @Nullable JsonNullable hiredAt, + @JsonProperty("is_primary") @Nullable JsonNullable isPrimary, + @JsonProperty("is_manager") @Nullable JsonNullable isManager, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("location") @Nullable Address location) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.employeeId = Optional.ofNullable(employeeId) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.role = Optional.ofNullable(role) + .orElse(JsonNullable.undefined()); + this.startDate = Optional.ofNullable(startDate) + .orElse(JsonNullable.undefined()); + this.endDate = Optional.ofNullable(endDate) + .orElse(JsonNullable.undefined()); + this.compensationRate = Optional.ofNullable(compensationRate) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.paymentUnit = Optional.ofNullable(paymentUnit) + .orElse(JsonNullable.undefined()); + this.hiredAt = Optional.ofNullable(hiredAt) + .orElse(JsonNullable.undefined()); + this.isPrimary = Optional.ofNullable(isPrimary) + .orElse(JsonNullable.undefined()); + this.isManager = Optional.ofNullable(isManager) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); this.location = location; } public EmployeeJob() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable employeeId() { - return employeeId; + return this.employeeId; } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The position and responsibilities of the person within the organization. */ - @JsonIgnore public JsonNullable role() { - return role; + return this.role; } /** * The date on which the employee starts working in their current job role. */ - @JsonIgnore public JsonNullable startDate() { - return startDate; + return this.startDate; } /** * The date on which the employee leaves or is expected to leave their current job role. */ - @JsonIgnore public JsonNullable endDate() { - return endDate; + return this.endDate; } /** * The rate of pay for the employee in their current job role. */ - @JsonIgnore public JsonNullable compensationRate() { - return compensationRate; + return this.compensationRate; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Unit of measurement for employee compensation. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable paymentUnit() { - return (JsonNullable) paymentUnit; + return this.paymentUnit; } /** * The date on which the employee was hired by the organization */ - @JsonIgnore public JsonNullable hiredAt() { - return hiredAt; + return this.hiredAt; } /** * Indicates whether this the employee's primary job. */ - @JsonIgnore public JsonNullable isPrimary() { - return isPrimary; + return this.isPrimary; } /** * Indicates whether this the employee has a manager role. */ - @JsonIgnore public JsonNullable isManager() { - return isManager; + return this.isManager; } /** * Indicates the status of the job. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
location() { - return (Optional
) location; + return Optional.ofNullable(this.location); } public static Builder builder() { @@ -291,250 +271,126 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EmployeeJob withId(String id) { - Utils.checkNotNull(id, "id"); + public EmployeeJob withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public EmployeeJob withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * A unique identifier for an object. */ - public EmployeeJob withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public EmployeeJob withEmployeeId(@Nullable String employeeId) { this.employeeId = JsonNullable.of(employeeId); return this; } - /** - * A unique identifier for an object. - */ - public EmployeeJob withEmployeeId(JsonNullable employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } /** * The job title of the person. */ - public EmployeeJob withTitle(String title) { - Utils.checkNotNull(title, "title"); + public EmployeeJob withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public EmployeeJob withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The position and responsibilities of the person within the organization. */ - public EmployeeJob withRole(String role) { - Utils.checkNotNull(role, "role"); + public EmployeeJob withRole(@Nullable String role) { this.role = JsonNullable.of(role); return this; } - /** - * The position and responsibilities of the person within the organization. - */ - public EmployeeJob withRole(JsonNullable role) { - Utils.checkNotNull(role, "role"); - this.role = role; - return this; - } /** * The date on which the employee starts working in their current job role. */ - public EmployeeJob withStartDate(LocalDate startDate) { - Utils.checkNotNull(startDate, "startDate"); + public EmployeeJob withStartDate(@Nullable LocalDate startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The date on which the employee starts working in their current job role. - */ - public EmployeeJob withStartDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } /** * The date on which the employee leaves or is expected to leave their current job role. */ - public EmployeeJob withEndDate(LocalDate endDate) { - Utils.checkNotNull(endDate, "endDate"); + public EmployeeJob withEndDate(@Nullable LocalDate endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The date on which the employee leaves or is expected to leave their current job role. - */ - public EmployeeJob withEndDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } /** * The rate of pay for the employee in their current job role. */ - public EmployeeJob withCompensationRate(double compensationRate) { - Utils.checkNotNull(compensationRate, "compensationRate"); + public EmployeeJob withCompensationRate(@Nullable Double compensationRate) { this.compensationRate = JsonNullable.of(compensationRate); return this; } - /** - * The rate of pay for the employee in their current job role. - */ - public EmployeeJob withCompensationRate(JsonNullable compensationRate) { - Utils.checkNotNull(compensationRate, "compensationRate"); - this.compensationRate = compensationRate; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public EmployeeJob withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public EmployeeJob withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public EmployeeJob withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Unit of measurement for employee compensation. */ - public EmployeeJob withPaymentUnit(PaymentUnit paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); + public EmployeeJob withPaymentUnit(@Nullable PaymentUnit paymentUnit) { this.paymentUnit = JsonNullable.of(paymentUnit); return this; } - /** - * Unit of measurement for employee compensation. - */ - public EmployeeJob withPaymentUnit(JsonNullable paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); - this.paymentUnit = paymentUnit; - return this; - } /** * The date on which the employee was hired by the organization */ - public EmployeeJob withHiredAt(LocalDate hiredAt) { - Utils.checkNotNull(hiredAt, "hiredAt"); + public EmployeeJob withHiredAt(@Nullable LocalDate hiredAt) { this.hiredAt = JsonNullable.of(hiredAt); return this; } - /** - * The date on which the employee was hired by the organization - */ - public EmployeeJob withHiredAt(JsonNullable hiredAt) { - Utils.checkNotNull(hiredAt, "hiredAt"); - this.hiredAt = hiredAt; - return this; - } /** * Indicates whether this the employee's primary job. */ - public EmployeeJob withIsPrimary(boolean isPrimary) { - Utils.checkNotNull(isPrimary, "isPrimary"); + public EmployeeJob withIsPrimary(@Nullable Boolean isPrimary) { this.isPrimary = JsonNullable.of(isPrimary); return this; } - /** - * Indicates whether this the employee's primary job. - */ - public EmployeeJob withIsPrimary(JsonNullable isPrimary) { - Utils.checkNotNull(isPrimary, "isPrimary"); - this.isPrimary = isPrimary; - return this; - } /** * Indicates whether this the employee has a manager role. */ - public EmployeeJob withIsManager(boolean isManager) { - Utils.checkNotNull(isManager, "isManager"); + public EmployeeJob withIsManager(@Nullable Boolean isManager) { this.isManager = JsonNullable.of(isManager); return this; } - /** - * Indicates whether this the employee has a manager role. - */ - public EmployeeJob withIsManager(JsonNullable isManager) { - Utils.checkNotNull(isManager, "isManager"); - this.isManager = isManager; - return this; - } /** * Indicates the status of the job. */ - public EmployeeJob withStatus(EmployeeJobStatus status) { - Utils.checkNotNull(status, "status"); + public EmployeeJob withStatus(@Nullable EmployeeJobStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Indicates the status of the job. - */ - public EmployeeJob withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - public EmployeeJob withLocation(Address location) { - Utils.checkNotNull(location, "location"); - this.location = Optional.ofNullable(location); - return this; - } - - public EmployeeJob withLocation(Optional location) { - Utils.checkNotNull(location, "location"); + public EmployeeJob withLocation(@Nullable Address location) { this.location = location; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -593,44 +449,42 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable employeeId = JsonNullable.undefined(); + private JsonNullable employeeId; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable role = JsonNullable.undefined(); + private JsonNullable role; - private JsonNullable startDate = JsonNullable.undefined(); + private JsonNullable startDate; - private JsonNullable endDate = JsonNullable.undefined(); + private JsonNullable endDate; - private JsonNullable compensationRate = JsonNullable.undefined(); + private JsonNullable compensationRate; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable paymentUnit = JsonNullable.undefined(); + private JsonNullable paymentUnit; - private JsonNullable hiredAt = JsonNullable.undefined(); + private JsonNullable hiredAt; - private JsonNullable isPrimary = JsonNullable.undefined(); + private JsonNullable isPrimary; - private JsonNullable isManager = JsonNullable.undefined(); + private JsonNullable isManager; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private Optional location = Optional.empty(); + private Address location; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } @@ -638,255 +492,105 @@ public Builder id(String id) { /** * A unique identifier for an object. */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * A unique identifier for an object. - */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public Builder employeeId(@Nullable String employeeId) { this.employeeId = JsonNullable.of(employeeId); return this; } - /** - * A unique identifier for an object. - */ - public Builder employeeId(JsonNullable employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } - - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The position and responsibilities of the person within the organization. */ - public Builder role(String role) { - Utils.checkNotNull(role, "role"); + public Builder role(@Nullable String role) { this.role = JsonNullable.of(role); return this; } - /** - * The position and responsibilities of the person within the organization. - */ - public Builder role(JsonNullable role) { - Utils.checkNotNull(role, "role"); - this.role = role; - return this; - } - - /** * The date on which the employee starts working in their current job role. */ - public Builder startDate(LocalDate startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable LocalDate startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The date on which the employee starts working in their current job role. - */ - public Builder startDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } - - /** * The date on which the employee leaves or is expected to leave their current job role. */ - public Builder endDate(LocalDate endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable LocalDate endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The date on which the employee leaves or is expected to leave their current job role. - */ - public Builder endDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** * The rate of pay for the employee in their current job role. */ - public Builder compensationRate(double compensationRate) { - Utils.checkNotNull(compensationRate, "compensationRate"); + public Builder compensationRate(@Nullable Double compensationRate) { this.compensationRate = JsonNullable.of(compensationRate); return this; } - /** - * The rate of pay for the employee in their current job role. - */ - public Builder compensationRate(JsonNullable compensationRate) { - Utils.checkNotNull(compensationRate, "compensationRate"); - this.compensationRate = compensationRate; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Unit of measurement for employee compensation. */ - public Builder paymentUnit(PaymentUnit paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); + public Builder paymentUnit(@Nullable PaymentUnit paymentUnit) { this.paymentUnit = JsonNullable.of(paymentUnit); return this; } - /** - * Unit of measurement for employee compensation. - */ - public Builder paymentUnit(JsonNullable paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); - this.paymentUnit = paymentUnit; - return this; - } - - /** * The date on which the employee was hired by the organization */ - public Builder hiredAt(LocalDate hiredAt) { - Utils.checkNotNull(hiredAt, "hiredAt"); + public Builder hiredAt(@Nullable LocalDate hiredAt) { this.hiredAt = JsonNullable.of(hiredAt); return this; } - /** - * The date on which the employee was hired by the organization - */ - public Builder hiredAt(JsonNullable hiredAt) { - Utils.checkNotNull(hiredAt, "hiredAt"); - this.hiredAt = hiredAt; - return this; - } - - /** * Indicates whether this the employee's primary job. */ - public Builder isPrimary(boolean isPrimary) { - Utils.checkNotNull(isPrimary, "isPrimary"); + public Builder isPrimary(@Nullable Boolean isPrimary) { this.isPrimary = JsonNullable.of(isPrimary); return this; } - /** - * Indicates whether this the employee's primary job. - */ - public Builder isPrimary(JsonNullable isPrimary) { - Utils.checkNotNull(isPrimary, "isPrimary"); - this.isPrimary = isPrimary; - return this; - } - - /** * Indicates whether this the employee has a manager role. */ - public Builder isManager(boolean isManager) { - Utils.checkNotNull(isManager, "isManager"); + public Builder isManager(@Nullable Boolean isManager) { this.isManager = JsonNullable.of(isManager); return this; } - /** - * Indicates whether this the employee has a manager role. - */ - public Builder isManager(JsonNullable isManager) { - Utils.checkNotNull(isManager, "isManager"); - this.isManager = isManager; - return this; - } - - /** * Indicates the status of the job. */ - public Builder status(EmployeeJobStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable EmployeeJobStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Indicates the status of the job. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - - public Builder location(Address location) { - Utils.checkNotNull(location, "location"); - this.location = Optional.ofNullable(location); - return this; - } - - public Builder location(Optional location) { - Utils.checkNotNull(location, "location"); + public Builder location(@Nullable Address location) { this.location = location; return this; } public EmployeeJob build() { - return new EmployeeJob( id, employeeId, title, role, startDate, endDate, diff --git a/src/main/java/com/apideck/unify/models/components/EmployeeJobInput.java b/src/main/java/com/apideck/unify/models/components/EmployeeJobInput.java index 5c8fda9c..8b59901c 100644 --- a/src/main/java/com/apideck/unify/models/components/EmployeeJobInput.java +++ b/src/main/java/com/apideck/unify/models/components/EmployeeJobInput.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -60,14 +59,14 @@ public class EmployeeJobInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Unit of measurement for employee compensation. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_unit") - private JsonNullable paymentUnit; + private JsonNullable paymentUnit; /** * The date on which the employee was hired by the organization @@ -95,155 +94,138 @@ public class EmployeeJobInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; @JsonInclude(Include.NON_ABSENT) @JsonProperty("location") - private Optional location; + private Address location; @JsonCreator public EmployeeJobInput( - @JsonProperty("title") JsonNullable title, - @JsonProperty("role") JsonNullable role, - @JsonProperty("start_date") JsonNullable startDate, - @JsonProperty("end_date") JsonNullable endDate, - @JsonProperty("compensation_rate") JsonNullable compensationRate, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("payment_unit") JsonNullable paymentUnit, - @JsonProperty("hired_at") JsonNullable hiredAt, - @JsonProperty("is_primary") JsonNullable isPrimary, - @JsonProperty("is_manager") JsonNullable isManager, - @JsonProperty("status") JsonNullable status, - @JsonProperty("location") Optional location) { - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(role, "role"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(compensationRate, "compensationRate"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(paymentUnit, "paymentUnit"); - Utils.checkNotNull(hiredAt, "hiredAt"); - Utils.checkNotNull(isPrimary, "isPrimary"); - Utils.checkNotNull(isManager, "isManager"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(location, "location"); - this.title = title; - this.role = role; - this.startDate = startDate; - this.endDate = endDate; - this.compensationRate = compensationRate; - this.currency = currency; - this.paymentUnit = paymentUnit; - this.hiredAt = hiredAt; - this.isPrimary = isPrimary; - this.isManager = isManager; - this.status = status; + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("role") @Nullable JsonNullable role, + @JsonProperty("start_date") @Nullable JsonNullable startDate, + @JsonProperty("end_date") @Nullable JsonNullable endDate, + @JsonProperty("compensation_rate") @Nullable JsonNullable compensationRate, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("payment_unit") @Nullable JsonNullable paymentUnit, + @JsonProperty("hired_at") @Nullable JsonNullable hiredAt, + @JsonProperty("is_primary") @Nullable JsonNullable isPrimary, + @JsonProperty("is_manager") @Nullable JsonNullable isManager, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("location") @Nullable Address location) { + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.role = Optional.ofNullable(role) + .orElse(JsonNullable.undefined()); + this.startDate = Optional.ofNullable(startDate) + .orElse(JsonNullable.undefined()); + this.endDate = Optional.ofNullable(endDate) + .orElse(JsonNullable.undefined()); + this.compensationRate = Optional.ofNullable(compensationRate) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.paymentUnit = Optional.ofNullable(paymentUnit) + .orElse(JsonNullable.undefined()); + this.hiredAt = Optional.ofNullable(hiredAt) + .orElse(JsonNullable.undefined()); + this.isPrimary = Optional.ofNullable(isPrimary) + .orElse(JsonNullable.undefined()); + this.isManager = Optional.ofNullable(isManager) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); this.location = location; } public EmployeeJobInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The position and responsibilities of the person within the organization. */ - @JsonIgnore public JsonNullable role() { - return role; + return this.role; } /** * The date on which the employee starts working in their current job role. */ - @JsonIgnore public JsonNullable startDate() { - return startDate; + return this.startDate; } /** * The date on which the employee leaves or is expected to leave their current job role. */ - @JsonIgnore public JsonNullable endDate() { - return endDate; + return this.endDate; } /** * The rate of pay for the employee in their current job role. */ - @JsonIgnore public JsonNullable compensationRate() { - return compensationRate; + return this.compensationRate; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Unit of measurement for employee compensation. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable paymentUnit() { - return (JsonNullable) paymentUnit; + return this.paymentUnit; } /** * The date on which the employee was hired by the organization */ - @JsonIgnore public JsonNullable hiredAt() { - return hiredAt; + return this.hiredAt; } /** * Indicates whether this the employee's primary job. */ - @JsonIgnore public JsonNullable isPrimary() { - return isPrimary; + return this.isPrimary; } /** * Indicates whether this the employee has a manager role. */ - @JsonIgnore public JsonNullable isManager() { - return isManager; + return this.isManager; } /** * Indicates the status of the job. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
location() { - return (Optional
) location; + return Optional.ofNullable(this.location); } public static Builder builder() { @@ -254,214 +236,108 @@ public static Builder builder() { /** * The job title of the person. */ - public EmployeeJobInput withTitle(String title) { - Utils.checkNotNull(title, "title"); + public EmployeeJobInput withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public EmployeeJobInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The position and responsibilities of the person within the organization. */ - public EmployeeJobInput withRole(String role) { - Utils.checkNotNull(role, "role"); + public EmployeeJobInput withRole(@Nullable String role) { this.role = JsonNullable.of(role); return this; } - /** - * The position and responsibilities of the person within the organization. - */ - public EmployeeJobInput withRole(JsonNullable role) { - Utils.checkNotNull(role, "role"); - this.role = role; - return this; - } /** * The date on which the employee starts working in their current job role. */ - public EmployeeJobInput withStartDate(LocalDate startDate) { - Utils.checkNotNull(startDate, "startDate"); + public EmployeeJobInput withStartDate(@Nullable LocalDate startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The date on which the employee starts working in their current job role. - */ - public EmployeeJobInput withStartDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } /** * The date on which the employee leaves or is expected to leave their current job role. */ - public EmployeeJobInput withEndDate(LocalDate endDate) { - Utils.checkNotNull(endDate, "endDate"); + public EmployeeJobInput withEndDate(@Nullable LocalDate endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The date on which the employee leaves or is expected to leave their current job role. - */ - public EmployeeJobInput withEndDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } /** * The rate of pay for the employee in their current job role. */ - public EmployeeJobInput withCompensationRate(double compensationRate) { - Utils.checkNotNull(compensationRate, "compensationRate"); + public EmployeeJobInput withCompensationRate(@Nullable Double compensationRate) { this.compensationRate = JsonNullable.of(compensationRate); return this; } - /** - * The rate of pay for the employee in their current job role. - */ - public EmployeeJobInput withCompensationRate(JsonNullable compensationRate) { - Utils.checkNotNull(compensationRate, "compensationRate"); - this.compensationRate = compensationRate; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public EmployeeJobInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public EmployeeJobInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public EmployeeJobInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Unit of measurement for employee compensation. */ - public EmployeeJobInput withPaymentUnit(PaymentUnit paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); + public EmployeeJobInput withPaymentUnit(@Nullable PaymentUnit paymentUnit) { this.paymentUnit = JsonNullable.of(paymentUnit); return this; } - /** - * Unit of measurement for employee compensation. - */ - public EmployeeJobInput withPaymentUnit(JsonNullable paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); - this.paymentUnit = paymentUnit; - return this; - } /** * The date on which the employee was hired by the organization */ - public EmployeeJobInput withHiredAt(LocalDate hiredAt) { - Utils.checkNotNull(hiredAt, "hiredAt"); + public EmployeeJobInput withHiredAt(@Nullable LocalDate hiredAt) { this.hiredAt = JsonNullable.of(hiredAt); return this; } - /** - * The date on which the employee was hired by the organization - */ - public EmployeeJobInput withHiredAt(JsonNullable hiredAt) { - Utils.checkNotNull(hiredAt, "hiredAt"); - this.hiredAt = hiredAt; - return this; - } /** * Indicates whether this the employee's primary job. */ - public EmployeeJobInput withIsPrimary(boolean isPrimary) { - Utils.checkNotNull(isPrimary, "isPrimary"); + public EmployeeJobInput withIsPrimary(@Nullable Boolean isPrimary) { this.isPrimary = JsonNullable.of(isPrimary); return this; } - /** - * Indicates whether this the employee's primary job. - */ - public EmployeeJobInput withIsPrimary(JsonNullable isPrimary) { - Utils.checkNotNull(isPrimary, "isPrimary"); - this.isPrimary = isPrimary; - return this; - } /** * Indicates whether this the employee has a manager role. */ - public EmployeeJobInput withIsManager(boolean isManager) { - Utils.checkNotNull(isManager, "isManager"); + public EmployeeJobInput withIsManager(@Nullable Boolean isManager) { this.isManager = JsonNullable.of(isManager); return this; } - /** - * Indicates whether this the employee has a manager role. - */ - public EmployeeJobInput withIsManager(JsonNullable isManager) { - Utils.checkNotNull(isManager, "isManager"); - this.isManager = isManager; - return this; - } /** * Indicates the status of the job. */ - public EmployeeJobInput withStatus(EmployeeJobStatus status) { - Utils.checkNotNull(status, "status"); + public EmployeeJobInput withStatus(@Nullable EmployeeJobStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Indicates the status of the job. - */ - public EmployeeJobInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - public EmployeeJobInput withLocation(Address location) { - Utils.checkNotNull(location, "location"); - this.location = Optional.ofNullable(location); - return this; - } - - public EmployeeJobInput withLocation(Optional location) { - Utils.checkNotNull(location, "location"); + public EmployeeJobInput withLocation(@Nullable Address location) { this.location = location; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -515,258 +391,128 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable role = JsonNullable.undefined(); + private JsonNullable role; - private JsonNullable startDate = JsonNullable.undefined(); + private JsonNullable startDate; - private JsonNullable endDate = JsonNullable.undefined(); + private JsonNullable endDate; - private JsonNullable compensationRate = JsonNullable.undefined(); + private JsonNullable compensationRate; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable paymentUnit = JsonNullable.undefined(); + private JsonNullable paymentUnit; - private JsonNullable hiredAt = JsonNullable.undefined(); + private JsonNullable hiredAt; - private JsonNullable isPrimary = JsonNullable.undefined(); + private JsonNullable isPrimary; - private JsonNullable isManager = JsonNullable.undefined(); + private JsonNullable isManager; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private Optional location = Optional.empty(); + private Address location; private Builder() { // force use of static builder() method } - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The position and responsibilities of the person within the organization. */ - public Builder role(String role) { - Utils.checkNotNull(role, "role"); + public Builder role(@Nullable String role) { this.role = JsonNullable.of(role); return this; } - /** - * The position and responsibilities of the person within the organization. - */ - public Builder role(JsonNullable role) { - Utils.checkNotNull(role, "role"); - this.role = role; - return this; - } - - /** * The date on which the employee starts working in their current job role. */ - public Builder startDate(LocalDate startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable LocalDate startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The date on which the employee starts working in their current job role. - */ - public Builder startDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } - - /** * The date on which the employee leaves or is expected to leave their current job role. */ - public Builder endDate(LocalDate endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable LocalDate endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The date on which the employee leaves or is expected to leave their current job role. - */ - public Builder endDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** * The rate of pay for the employee in their current job role. */ - public Builder compensationRate(double compensationRate) { - Utils.checkNotNull(compensationRate, "compensationRate"); + public Builder compensationRate(@Nullable Double compensationRate) { this.compensationRate = JsonNullable.of(compensationRate); return this; } - /** - * The rate of pay for the employee in their current job role. - */ - public Builder compensationRate(JsonNullable compensationRate) { - Utils.checkNotNull(compensationRate, "compensationRate"); - this.compensationRate = compensationRate; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Unit of measurement for employee compensation. */ - public Builder paymentUnit(PaymentUnit paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); + public Builder paymentUnit(@Nullable PaymentUnit paymentUnit) { this.paymentUnit = JsonNullable.of(paymentUnit); return this; } - /** - * Unit of measurement for employee compensation. - */ - public Builder paymentUnit(JsonNullable paymentUnit) { - Utils.checkNotNull(paymentUnit, "paymentUnit"); - this.paymentUnit = paymentUnit; - return this; - } - - /** * The date on which the employee was hired by the organization */ - public Builder hiredAt(LocalDate hiredAt) { - Utils.checkNotNull(hiredAt, "hiredAt"); + public Builder hiredAt(@Nullable LocalDate hiredAt) { this.hiredAt = JsonNullable.of(hiredAt); return this; } - /** - * The date on which the employee was hired by the organization - */ - public Builder hiredAt(JsonNullable hiredAt) { - Utils.checkNotNull(hiredAt, "hiredAt"); - this.hiredAt = hiredAt; - return this; - } - - /** * Indicates whether this the employee's primary job. */ - public Builder isPrimary(boolean isPrimary) { - Utils.checkNotNull(isPrimary, "isPrimary"); + public Builder isPrimary(@Nullable Boolean isPrimary) { this.isPrimary = JsonNullable.of(isPrimary); return this; } - /** - * Indicates whether this the employee's primary job. - */ - public Builder isPrimary(JsonNullable isPrimary) { - Utils.checkNotNull(isPrimary, "isPrimary"); - this.isPrimary = isPrimary; - return this; - } - - /** * Indicates whether this the employee has a manager role. */ - public Builder isManager(boolean isManager) { - Utils.checkNotNull(isManager, "isManager"); + public Builder isManager(@Nullable Boolean isManager) { this.isManager = JsonNullable.of(isManager); return this; } - /** - * Indicates whether this the employee has a manager role. - */ - public Builder isManager(JsonNullable isManager) { - Utils.checkNotNull(isManager, "isManager"); - this.isManager = isManager; - return this; - } - - /** * Indicates the status of the job. */ - public Builder status(EmployeeJobStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable EmployeeJobStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Indicates the status of the job. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - - public Builder location(Address location) { - Utils.checkNotNull(location, "location"); - this.location = Optional.ofNullable(location); - return this; - } - - public Builder location(Optional location) { - Utils.checkNotNull(location, "location"); + public Builder location(@Nullable Address location) { this.location = location; return this; } public EmployeeJobInput build() { - return new EmployeeJobInput( title, role, startDate, endDate, compensationRate, currency, diff --git a/src/main/java/com/apideck/unify/models/components/EmployeePayroll.java b/src/main/java/com/apideck/unify/models/components/EmployeePayroll.java index daab50ff..79dfe628 100644 --- a/src/main/java/com/apideck/unify/models/components/EmployeePayroll.java +++ b/src/main/java/com/apideck/unify/models/components/EmployeePayroll.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,7 +23,7 @@ public class EmployeePayroll { */ @JsonInclude(Include.ALWAYS) @JsonProperty("id") - private Optional id; + private JsonNullable id; /** * ID of the employee @@ -45,7 +44,7 @@ public class EmployeePayroll { */ @JsonInclude(Include.ALWAYS) @JsonProperty("processed") - private Optional processed; + private JsonNullable processed; /** * The date the payroll was processed. @@ -59,157 +58,138 @@ public class EmployeePayroll { */ @JsonInclude(Include.ALWAYS) @JsonProperty("check_date") - private Optional checkDate; + private JsonNullable checkDate; /** * The start date, inclusive, of the pay period. */ @JsonInclude(Include.ALWAYS) @JsonProperty("start_date") - private Optional startDate; + private JsonNullable startDate; /** * The end date, inclusive, of the pay period. */ @JsonInclude(Include.ALWAYS) @JsonProperty("end_date") - private Optional endDate; + private JsonNullable endDate; /** * The overview of the payroll totals. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("totals") - private Optional totals; + private PayrollTotals totals; /** * An array of compensations for the payroll. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("compensations") - private Optional> compensations; + private List compensations; @JsonCreator public EmployeePayroll( - @JsonProperty("id") Optional id, - @JsonProperty("employee_id") JsonNullable employeeId, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("processed") Optional processed, - @JsonProperty("processed_date") JsonNullable processedDate, - @JsonProperty("check_date") Optional checkDate, - @JsonProperty("start_date") Optional startDate, - @JsonProperty("end_date") Optional endDate, - @JsonProperty("totals") Optional totals, - @JsonProperty("compensations") Optional> compensations) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(employeeId, "employeeId"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(processed, "processed"); - Utils.checkNotNull(processedDate, "processedDate"); - Utils.checkNotNull(checkDate, "checkDate"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(totals, "totals"); - Utils.checkNotNull(compensations, "compensations"); - this.id = id; - this.employeeId = employeeId; - this.companyId = companyId; - this.processed = processed; - this.processedDate = processedDate; - this.checkDate = checkDate; - this.startDate = startDate; - this.endDate = endDate; + @JsonProperty("id") @Nullable String id, + @JsonProperty("employee_id") @Nullable JsonNullable employeeId, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("processed") @Nullable Boolean processed, + @JsonProperty("processed_date") @Nullable JsonNullable processedDate, + @JsonProperty("check_date") @Nullable String checkDate, + @JsonProperty("start_date") @Nullable String startDate, + @JsonProperty("end_date") @Nullable String endDate, + @JsonProperty("totals") @Nullable PayrollTotals totals, + @JsonProperty("compensations") @Nullable List compensations) { + this.id = JsonNullable.of(id); + this.employeeId = Optional.ofNullable(employeeId) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.processed = JsonNullable.of(processed); + this.processedDate = Optional.ofNullable(processedDate) + .orElse(JsonNullable.undefined()); + this.checkDate = JsonNullable.of(checkDate); + this.startDate = JsonNullable.of(startDate); + this.endDate = JsonNullable.of(endDate); this.totals = totals; this.compensations = compensations; } public EmployeePayroll() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore - public Optional id() { - return id; + public JsonNullable id() { + return this.id; } /** * ID of the employee */ - @JsonIgnore public JsonNullable employeeId() { - return employeeId; + return this.employeeId; } /** * The unique identifier of the company. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. */ - @JsonIgnore - public Optional processed() { - return processed; + public JsonNullable processed() { + return this.processed; } /** * The date the payroll was processed. */ - @JsonIgnore public JsonNullable processedDate() { - return processedDate; + return this.processedDate; } /** * The date on which employees will be paid for the payroll. */ - @JsonIgnore - public Optional checkDate() { - return checkDate; + public JsonNullable checkDate() { + return this.checkDate; } /** * The start date, inclusive, of the pay period. */ - @JsonIgnore - public Optional startDate() { - return startDate; + public JsonNullable startDate() { + return this.startDate; } /** * The end date, inclusive, of the pay period. */ - @JsonIgnore - public Optional endDate() { - return endDate; + public JsonNullable endDate() { + return this.endDate; } /** * The overview of the payroll totals. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional totals() { - return (Optional) totals; + return Optional.ofNullable(this.totals); } /** * An array of compensations for the payroll. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> compensations() { - return (Optional>) compensations; + return Optional.ofNullable(this.compensations); } public static Builder builder() { @@ -220,139 +200,62 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public EmployeePayroll withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); + public EmployeePayroll withId(@Nullable String id) { + this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public EmployeePayroll withId(Optional id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - /** * ID of the employee */ - public EmployeePayroll withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public EmployeePayroll withEmployeeId(@Nullable String employeeId) { this.employeeId = JsonNullable.of(employeeId); return this; } - /** - * ID of the employee - */ - public EmployeePayroll withEmployeeId(JsonNullable employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } /** * The unique identifier of the company. */ - public EmployeePayroll withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public EmployeePayroll withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company. - */ - public EmployeePayroll withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. */ - public EmployeePayroll withProcessed(boolean processed) { - Utils.checkNotNull(processed, "processed"); - this.processed = Optional.ofNullable(processed); + public EmployeePayroll withProcessed(@Nullable Boolean processed) { + this.processed = JsonNullable.of(processed); return this; } - /** - * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. - */ - public EmployeePayroll withProcessed(Optional processed) { - Utils.checkNotNull(processed, "processed"); - this.processed = processed; - return this; - } - /** * The date the payroll was processed. */ - public EmployeePayroll withProcessedDate(String processedDate) { - Utils.checkNotNull(processedDate, "processedDate"); + public EmployeePayroll withProcessedDate(@Nullable String processedDate) { this.processedDate = JsonNullable.of(processedDate); return this; } - /** - * The date the payroll was processed. - */ - public EmployeePayroll withProcessedDate(JsonNullable processedDate) { - Utils.checkNotNull(processedDate, "processedDate"); - this.processedDate = processedDate; - return this; - } /** * The date on which employees will be paid for the payroll. */ - public EmployeePayroll withCheckDate(String checkDate) { - Utils.checkNotNull(checkDate, "checkDate"); - this.checkDate = Optional.ofNullable(checkDate); + public EmployeePayroll withCheckDate(@Nullable String checkDate) { + this.checkDate = JsonNullable.of(checkDate); return this; } - /** - * The date on which employees will be paid for the payroll. - */ - public EmployeePayroll withCheckDate(Optional checkDate) { - Utils.checkNotNull(checkDate, "checkDate"); - this.checkDate = checkDate; - return this; - } - /** * The start date, inclusive, of the pay period. */ - public EmployeePayroll withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - - - /** - * The start date, inclusive, of the pay period. - */ - public EmployeePayroll withStartDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } - - /** - * The end date, inclusive, of the pay period. - */ - public EmployeePayroll withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); + public EmployeePayroll withStartDate(@Nullable String startDate) { + this.startDate = JsonNullable.of(startDate); return this; } @@ -360,18 +263,8 @@ public EmployeePayroll withEndDate(String endDate) { /** * The end date, inclusive, of the pay period. */ - public EmployeePayroll withEndDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** - * The overview of the payroll totals. - */ - public EmployeePayroll withTotals(PayrollTotals totals) { - Utils.checkNotNull(totals, "totals"); - this.totals = Optional.ofNullable(totals); + public EmployeePayroll withEndDate(@Nullable String endDate) { + this.endDate = JsonNullable.of(endDate); return this; } @@ -379,31 +272,21 @@ public EmployeePayroll withTotals(PayrollTotals totals) { /** * The overview of the payroll totals. */ - public EmployeePayroll withTotals(Optional totals) { - Utils.checkNotNull(totals, "totals"); + public EmployeePayroll withTotals(@Nullable PayrollTotals totals) { this.totals = totals; return this; } - /** - * An array of compensations for the payroll. - */ - public EmployeePayroll withCompensations(List compensations) { - Utils.checkNotNull(compensations, "compensations"); - this.compensations = Optional.ofNullable(compensations); - return this; - } - /** * An array of compensations for the payroll. */ - public EmployeePayroll withCompensations(Optional> compensations) { - Utils.checkNotNull(compensations, "compensations"); + public EmployeePayroll withCompensations(@Nullable List compensations) { this.compensations = compensations; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -453,222 +336,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable employeeId = JsonNullable.undefined(); + private JsonNullable employeeId; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private Optional processed = Optional.empty(); + private Boolean processed; - private JsonNullable processedDate = JsonNullable.undefined(); + private JsonNullable processedDate; - private Optional checkDate = Optional.empty(); + private String checkDate; - private Optional startDate = Optional.empty(); + private String startDate; - private Optional endDate = Optional.empty(); + private String endDate; - private Optional totals = Optional.empty(); + private PayrollTotals totals; - private Optional> compensations = Optional.empty(); + private List compensations; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * ID of the employee */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public Builder employeeId(@Nullable String employeeId) { this.employeeId = JsonNullable.of(employeeId); return this; } - /** - * ID of the employee - */ - public Builder employeeId(JsonNullable employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } - - /** * The unique identifier of the company. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. */ - public Builder processed(boolean processed) { - Utils.checkNotNull(processed, "processed"); - this.processed = Optional.ofNullable(processed); - return this; - } - - /** - * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. - */ - public Builder processed(Optional processed) { - Utils.checkNotNull(processed, "processed"); + public Builder processed(@Nullable Boolean processed) { this.processed = processed; return this; } - /** * The date the payroll was processed. */ - public Builder processedDate(String processedDate) { - Utils.checkNotNull(processedDate, "processedDate"); + public Builder processedDate(@Nullable String processedDate) { this.processedDate = JsonNullable.of(processedDate); return this; } - /** - * The date the payroll was processed. - */ - public Builder processedDate(JsonNullable processedDate) { - Utils.checkNotNull(processedDate, "processedDate"); - this.processedDate = processedDate; - return this; - } - - /** * The date on which employees will be paid for the payroll. */ - public Builder checkDate(String checkDate) { - Utils.checkNotNull(checkDate, "checkDate"); - this.checkDate = Optional.ofNullable(checkDate); - return this; - } - - /** - * The date on which employees will be paid for the payroll. - */ - public Builder checkDate(Optional checkDate) { - Utils.checkNotNull(checkDate, "checkDate"); + public Builder checkDate(@Nullable String checkDate) { this.checkDate = checkDate; return this; } - - /** - * The start date, inclusive, of the pay period. - */ - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - /** * The start date, inclusive, of the pay period. */ - public Builder startDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable String startDate) { this.startDate = startDate; return this; } - - /** - * The end date, inclusive, of the pay period. - */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * The end date, inclusive, of the pay period. */ - public Builder endDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable String endDate) { this.endDate = endDate; return this; } - - /** - * The overview of the payroll totals. - */ - public Builder totals(PayrollTotals totals) { - Utils.checkNotNull(totals, "totals"); - this.totals = Optional.ofNullable(totals); - return this; - } - /** * The overview of the payroll totals. */ - public Builder totals(Optional totals) { - Utils.checkNotNull(totals, "totals"); + public Builder totals(@Nullable PayrollTotals totals) { this.totals = totals; return this; } - - /** - * An array of compensations for the payroll. - */ - public Builder compensations(List compensations) { - Utils.checkNotNull(compensations, "compensations"); - this.compensations = Optional.ofNullable(compensations); - return this; - } - /** * An array of compensations for the payroll. */ - public Builder compensations(Optional> compensations) { - Utils.checkNotNull(compensations, "compensations"); + public Builder compensations(@Nullable List compensations) { this.compensations = compensations; return this; } public EmployeePayroll build() { - return new EmployeePayroll( id, employeeId, companyId, processed, processedDate, checkDate, diff --git a/src/main/java/com/apideck/unify/models/components/EmployeeSchedules.java b/src/main/java/com/apideck/unify/models/components/EmployeeSchedules.java index 58a70d60..79c97acf 100644 --- a/src/main/java/com/apideck/unify/models/components/EmployeeSchedules.java +++ b/src/main/java/com/apideck/unify/models/components/EmployeeSchedules.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -21,37 +20,32 @@ public class EmployeeSchedules { @JsonInclude(Include.NON_ABSENT) @JsonProperty("employee") - private Optional employee; + private Employee employee; @JsonInclude(Include.NON_ABSENT) @JsonProperty("schedules") - private JsonNullable> schedules; + private JsonNullable> schedules; @JsonCreator public EmployeeSchedules( - @JsonProperty("employee") Optional employee, - @JsonProperty("schedules") JsonNullable> schedules) { - Utils.checkNotNull(employee, "employee"); - Utils.checkNotNull(schedules, "schedules"); + @JsonProperty("employee") @Nullable Employee employee, + @JsonProperty("schedules") @Nullable JsonNullable> schedules) { this.employee = employee; - this.schedules = schedules; + this.schedules = Optional.ofNullable(schedules) + .orElse(JsonNullable.undefined()); } public EmployeeSchedules() { - this(Optional.empty(), JsonNullable.undefined()); + this(null, null); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional employee() { - return (Optional) employee; + return Optional.ofNullable(this.employee); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> schedules() { - return (JsonNullable>) schedules; + return this.schedules; } public static Builder builder() { @@ -59,30 +53,17 @@ public static Builder builder() { } - public EmployeeSchedules withEmployee(Employee employee) { - Utils.checkNotNull(employee, "employee"); - this.employee = Optional.ofNullable(employee); - return this; - } - - - public EmployeeSchedules withEmployee(Optional employee) { - Utils.checkNotNull(employee, "employee"); + public EmployeeSchedules withEmployee(@Nullable Employee employee) { this.employee = employee; return this; } - public EmployeeSchedules withSchedules(List schedules) { - Utils.checkNotNull(schedules, "schedules"); + + public EmployeeSchedules withSchedules(@Nullable List schedules) { this.schedules = JsonNullable.of(schedules); return this; } - public EmployeeSchedules withSchedules(JsonNullable> schedules) { - Utils.checkNotNull(schedules, "schedules"); - this.schedules = schedules; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -114,42 +95,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional employee = Optional.empty(); + private Employee employee; - private JsonNullable> schedules = JsonNullable.undefined(); + private JsonNullable> schedules; private Builder() { // force use of static builder() method } - - public Builder employee(Employee employee) { - Utils.checkNotNull(employee, "employee"); - this.employee = Optional.ofNullable(employee); - return this; - } - - public Builder employee(Optional employee) { - Utils.checkNotNull(employee, "employee"); + public Builder employee(@Nullable Employee employee) { this.employee = employee; return this; } - - public Builder schedules(List schedules) { - Utils.checkNotNull(schedules, "schedules"); + public Builder schedules(@Nullable List schedules) { this.schedules = JsonNullable.of(schedules); return this; } - public Builder schedules(JsonNullable> schedules) { - Utils.checkNotNull(schedules, "schedules"); - this.schedules = schedules; - return this; - } - public EmployeeSchedules build() { - return new EmployeeSchedules( employee, schedules); } diff --git a/src/main/java/com/apideck/unify/models/components/EmployeesFilter.java b/src/main/java/com/apideck/unify/models/components/EmployeesFilter.java index 31c87338..d8123553 100644 --- a/src/main/java/com/apideck/unify/models/components/EmployeesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/EmployeesFilter.java @@ -6,10 +6,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -18,92 +17,81 @@ public class EmployeesFilter { * Company ID to filter on */ @SpeakeasyMetadata("queryParam:name=company_id") - private Optional companyId; + private String companyId; /** * Email to filter on */ @SpeakeasyMetadata("queryParam:name=email") - private Optional email; + private String email; /** * First Name to filter on */ @SpeakeasyMetadata("queryParam:name=first_name") - private Optional firstName; + private String firstName; /** * Job title to filter on */ @SpeakeasyMetadata("queryParam:name=title") - private Optional title; + private String title; /** * Last Name to filter on */ @SpeakeasyMetadata("queryParam:name=last_name") - private Optional lastName; + private String lastName; /** * Manager id to filter on */ @SpeakeasyMetadata("queryParam:name=manager_id") - private Optional managerId; + private String managerId; /** * Employment status to filter on */ @SpeakeasyMetadata("queryParam:name=employment_status") - private Optional employmentStatus; + private EmployeesFilterEmploymentStatus employmentStatus; /** * Employee number to filter on */ @SpeakeasyMetadata("queryParam:name=employee_number") - private Optional employeeNumber; + private String employeeNumber; /** * ID of the department to filter on */ @SpeakeasyMetadata("queryParam:name=department_id") - private Optional departmentId; + private String departmentId; /** * City to filter on */ @SpeakeasyMetadata("queryParam:name=city") - private Optional city; + private String city; /** * Country to filter on */ @SpeakeasyMetadata("queryParam:name=country") - private Optional country; + private String country; @JsonCreator public EmployeesFilter( - Optional companyId, - Optional email, - Optional firstName, - Optional title, - Optional lastName, - Optional managerId, - Optional employmentStatus, - Optional employeeNumber, - Optional departmentId, - Optional city, - Optional country) { - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(managerId, "managerId"); - Utils.checkNotNull(employmentStatus, "employmentStatus"); - Utils.checkNotNull(employeeNumber, "employeeNumber"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(city, "city"); - Utils.checkNotNull(country, "country"); + @Nullable String companyId, + @Nullable String email, + @Nullable String firstName, + @Nullable String title, + @Nullable String lastName, + @Nullable String managerId, + @Nullable EmployeesFilterEmploymentStatus employmentStatus, + @Nullable String employeeNumber, + @Nullable String departmentId, + @Nullable String city, + @Nullable String country) { this.companyId = companyId; this.email = email; this.firstName = firstName; @@ -118,99 +106,87 @@ public EmployeesFilter( } public EmployeesFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null); } /** * Company ID to filter on */ - @JsonIgnore public Optional companyId() { - return companyId; + return Optional.ofNullable(this.companyId); } /** * Email to filter on */ - @JsonIgnore public Optional email() { - return email; + return Optional.ofNullable(this.email); } /** * First Name to filter on */ - @JsonIgnore public Optional firstName() { - return firstName; + return Optional.ofNullable(this.firstName); } /** * Job title to filter on */ - @JsonIgnore public Optional title() { - return title; + return Optional.ofNullable(this.title); } /** * Last Name to filter on */ - @JsonIgnore public Optional lastName() { - return lastName; + return Optional.ofNullable(this.lastName); } /** * Manager id to filter on */ - @JsonIgnore public Optional managerId() { - return managerId; + return Optional.ofNullable(this.managerId); } /** * Employment status to filter on */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional employmentStatus() { - return (Optional) employmentStatus; + return Optional.ofNullable(this.employmentStatus); } /** * Employee number to filter on */ - @JsonIgnore public Optional employeeNumber() { - return employeeNumber; + return Optional.ofNullable(this.employeeNumber); } /** * ID of the department to filter on */ - @JsonIgnore public Optional departmentId() { - return departmentId; + return Optional.ofNullable(this.departmentId); } /** * City to filter on */ - @JsonIgnore public Optional city() { - return city; + return Optional.ofNullable(this.city); } /** * Country to filter on */ - @JsonIgnore public Optional country() { - return country; + return Optional.ofNullable(this.country); } public static Builder builder() { @@ -221,212 +197,102 @@ public static Builder builder() { /** * Company ID to filter on */ - public EmployeesFilter withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - - - /** - * Company ID to filter on - */ - public EmployeesFilter withCompanyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public EmployeesFilter withCompanyId(@Nullable String companyId) { this.companyId = companyId; return this; } - /** - * Email to filter on - */ - public EmployeesFilter withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - /** * Email to filter on */ - public EmployeesFilter withEmail(Optional email) { - Utils.checkNotNull(email, "email"); + public EmployeesFilter withEmail(@Nullable String email) { this.email = email; return this; } - /** - * First Name to filter on - */ - public EmployeesFilter withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = Optional.ofNullable(firstName); - return this; - } - /** * First Name to filter on */ - public EmployeesFilter withFirstName(Optional firstName) { - Utils.checkNotNull(firstName, "firstName"); + public EmployeesFilter withFirstName(@Nullable String firstName) { this.firstName = firstName; return this; } - /** - * Job title to filter on - */ - public EmployeesFilter withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * Job title to filter on */ - public EmployeesFilter withTitle(Optional title) { - Utils.checkNotNull(title, "title"); + public EmployeesFilter withTitle(@Nullable String title) { this.title = title; return this; } - /** - * Last Name to filter on - */ - public EmployeesFilter withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = Optional.ofNullable(lastName); - return this; - } - /** * Last Name to filter on */ - public EmployeesFilter withLastName(Optional lastName) { - Utils.checkNotNull(lastName, "lastName"); + public EmployeesFilter withLastName(@Nullable String lastName) { this.lastName = lastName; return this; } - /** - * Manager id to filter on - */ - public EmployeesFilter withManagerId(String managerId) { - Utils.checkNotNull(managerId, "managerId"); - this.managerId = Optional.ofNullable(managerId); - return this; - } - /** * Manager id to filter on */ - public EmployeesFilter withManagerId(Optional managerId) { - Utils.checkNotNull(managerId, "managerId"); + public EmployeesFilter withManagerId(@Nullable String managerId) { this.managerId = managerId; return this; } - /** - * Employment status to filter on - */ - public EmployeesFilter withEmploymentStatus(EmployeesFilterEmploymentStatus employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); - this.employmentStatus = Optional.ofNullable(employmentStatus); - return this; - } - /** * Employment status to filter on */ - public EmployeesFilter withEmploymentStatus(Optional employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); + public EmployeesFilter withEmploymentStatus(@Nullable EmployeesFilterEmploymentStatus employmentStatus) { this.employmentStatus = employmentStatus; return this; } - /** - * Employee number to filter on - */ - public EmployeesFilter withEmployeeNumber(String employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); - this.employeeNumber = Optional.ofNullable(employeeNumber); - return this; - } - /** * Employee number to filter on */ - public EmployeesFilter withEmployeeNumber(Optional employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); + public EmployeesFilter withEmployeeNumber(@Nullable String employeeNumber) { this.employeeNumber = employeeNumber; return this; } - /** - * ID of the department to filter on - */ - public EmployeesFilter withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = Optional.ofNullable(departmentId); - return this; - } - /** * ID of the department to filter on */ - public EmployeesFilter withDepartmentId(Optional departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public EmployeesFilter withDepartmentId(@Nullable String departmentId) { this.departmentId = departmentId; return this; } - /** - * City to filter on - */ - public EmployeesFilter withCity(String city) { - Utils.checkNotNull(city, "city"); - this.city = Optional.ofNullable(city); - return this; - } - /** * City to filter on */ - public EmployeesFilter withCity(Optional city) { - Utils.checkNotNull(city, "city"); + public EmployeesFilter withCity(@Nullable String city) { this.city = city; return this; } - /** - * Country to filter on - */ - public EmployeesFilter withCountry(String country) { - Utils.checkNotNull(country, "country"); - this.country = Optional.ofNullable(country); - return this; - } - /** * Country to filter on */ - public EmployeesFilter withCountry(Optional country) { - Utils.checkNotNull(country, "country"); + public EmployeesFilter withCountry(@Nullable String country) { this.country = country; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -478,243 +344,121 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional companyId = Optional.empty(); + private String companyId; - private Optional email = Optional.empty(); + private String email; - private Optional firstName = Optional.empty(); + private String firstName; - private Optional title = Optional.empty(); + private String title; - private Optional lastName = Optional.empty(); + private String lastName; - private Optional managerId = Optional.empty(); + private String managerId; - private Optional employmentStatus = Optional.empty(); + private EmployeesFilterEmploymentStatus employmentStatus; - private Optional employeeNumber = Optional.empty(); + private String employeeNumber; - private Optional departmentId = Optional.empty(); + private String departmentId; - private Optional city = Optional.empty(); + private String city; - private Optional country = Optional.empty(); + private String country; private Builder() { // force use of static builder() method } - - /** - * Company ID to filter on - */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - /** * Company ID to filter on */ - public Builder companyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = companyId; return this; } - - /** - * Email to filter on - */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - /** * Email to filter on */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } - /** * First Name to filter on */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = Optional.ofNullable(firstName); - return this; - } - - /** - * First Name to filter on - */ - public Builder firstName(Optional firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = firstName; return this; } - /** * Job title to filter on */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - /** - * Job title to filter on - */ - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = title; return this; } - - /** - * Last Name to filter on - */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = Optional.ofNullable(lastName); - return this; - } - /** * Last Name to filter on */ - public Builder lastName(Optional lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = lastName; return this; } - - /** - * Manager id to filter on - */ - public Builder managerId(String managerId) { - Utils.checkNotNull(managerId, "managerId"); - this.managerId = Optional.ofNullable(managerId); - return this; - } - /** * Manager id to filter on */ - public Builder managerId(Optional managerId) { - Utils.checkNotNull(managerId, "managerId"); + public Builder managerId(@Nullable String managerId) { this.managerId = managerId; return this; } - /** * Employment status to filter on */ - public Builder employmentStatus(EmployeesFilterEmploymentStatus employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); - this.employmentStatus = Optional.ofNullable(employmentStatus); - return this; - } - - /** - * Employment status to filter on - */ - public Builder employmentStatus(Optional employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); + public Builder employmentStatus(@Nullable EmployeesFilterEmploymentStatus employmentStatus) { this.employmentStatus = employmentStatus; return this; } - - /** - * Employee number to filter on - */ - public Builder employeeNumber(String employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); - this.employeeNumber = Optional.ofNullable(employeeNumber); - return this; - } - /** * Employee number to filter on */ - public Builder employeeNumber(Optional employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); + public Builder employeeNumber(@Nullable String employeeNumber) { this.employeeNumber = employeeNumber; return this; } - - /** - * ID of the department to filter on - */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = Optional.ofNullable(departmentId); - return this; - } - /** * ID of the department to filter on */ - public Builder departmentId(Optional departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = departmentId; return this; } - - /** - * City to filter on - */ - public Builder city(String city) { - Utils.checkNotNull(city, "city"); - this.city = Optional.ofNullable(city); - return this; - } - /** * City to filter on */ - public Builder city(Optional city) { - Utils.checkNotNull(city, "city"); + public Builder city(@Nullable String city) { this.city = city; return this; } - /** * Country to filter on */ - public Builder country(String country) { - Utils.checkNotNull(country, "country"); - this.country = Optional.ofNullable(country); - return this; - } - - /** - * Country to filter on - */ - public Builder country(Optional country) { - Utils.checkNotNull(country, "country"); + public Builder country(@Nullable String country) { this.country = country; return this; } public EmployeesFilter build() { - return new EmployeesFilter( companyId, email, firstName, title, lastName, managerId, diff --git a/src/main/java/com/apideck/unify/models/components/EmployeesOneFilter.java b/src/main/java/com/apideck/unify/models/components/EmployeesOneFilter.java index b7522f79..bc0737e8 100644 --- a/src/main/java/com/apideck/unify/models/components/EmployeesOneFilter.java +++ b/src/main/java/com/apideck/unify/models/components/EmployeesOneFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,25 +17,23 @@ public class EmployeesOneFilter { * Company ID to filter on */ @SpeakeasyMetadata("queryParam:name=company_id") - private Optional companyId; + private String companyId; @JsonCreator public EmployeesOneFilter( - Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + @Nullable String companyId) { this.companyId = companyId; } public EmployeesOneFilter() { - this(Optional.empty()); + this(null); } /** * Company ID to filter on */ - @JsonIgnore public Optional companyId() { - return companyId; + return Optional.ofNullable(this.companyId); } public static Builder builder() { @@ -46,22 +44,12 @@ public static Builder builder() { /** * Company ID to filter on */ - public EmployeesOneFilter withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - - - /** - * Company ID to filter on - */ - public EmployeesOneFilter withCompanyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public EmployeesOneFilter withCompanyId(@Nullable String companyId) { this.companyId = companyId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -90,33 +78,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional companyId = Optional.empty(); + private String companyId; private Builder() { // force use of static builder() method } - - /** - * Company ID to filter on - */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - /** * Company ID to filter on */ - public Builder companyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = companyId; return this; } public EmployeesOneFilter build() { - return new EmployeesOneFilter( companyId); } diff --git a/src/main/java/com/apideck/unify/models/components/EmployeesSort.java b/src/main/java/com/apideck/unify/models/components/EmployeesSort.java index 6749cb44..8d02322e 100644 --- a/src/main/java/com/apideck/unify/models/components/EmployeesSort.java +++ b/src/main/java/com/apideck/unify/models/components/EmployeesSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class EmployeesSort { * The field on which to sort the Employees */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private EmployeesSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public EmployeesSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable EmployeesSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public EmployeesSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Employees */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Employees */ - public EmployeesSort withBy(EmployeesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Employees - */ - public EmployeesSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public EmployeesSort withBy(@Nullable EmployeesSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public EmployeesSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public EmployeesSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public EmployeesSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private EmployeesSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Employees - */ - public Builder by(EmployeesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Employees */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable EmployeesSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public EmployeesSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new EmployeesSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/EmploymentRole.java b/src/main/java/com/apideck/unify/models/components/EmploymentRole.java index 7c3b40fc..7d738349 100644 --- a/src/main/java/com/apideck/unify/models/components/EmploymentRole.java +++ b/src/main/java/com/apideck/unify/models/components/EmploymentRole.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -21,45 +21,41 @@ public class EmploymentRole { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The work schedule of the employee. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("sub_type") - private JsonNullable subType; + private JsonNullable subType; @JsonCreator public EmploymentRole( - @JsonProperty("type") JsonNullable type, - @JsonProperty("sub_type") JsonNullable subType) { - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(subType, "subType"); - this.type = type; - this.subType = subType; + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("sub_type") @Nullable JsonNullable subType) { + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.subType = Optional.ofNullable(subType) + .orElse(JsonNullable.undefined()); } public EmploymentRole() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } /** * The type of employment relationship the employee has with the organization. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The work schedule of the employee. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable subType() { - return (JsonNullable) subType; + return this.subType; } public static Builder builder() { @@ -70,38 +66,20 @@ public static Builder builder() { /** * The type of employment relationship the employee has with the organization. */ - public EmploymentRole withType(EmploymentType type) { - Utils.checkNotNull(type, "type"); + public EmploymentRole withType(@Nullable EmploymentType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of employment relationship the employee has with the organization. - */ - public EmploymentRole withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The work schedule of the employee. */ - public EmploymentRole withSubType(EmploymentSubType subType) { - Utils.checkNotNull(subType, "subType"); + public EmploymentRole withSubType(@Nullable EmploymentSubType subType) { this.subType = JsonNullable.of(subType); return this; } - /** - * The work schedule of the employee. - */ - public EmploymentRole withSubType(JsonNullable subType) { - Utils.checkNotNull(subType, "subType"); - this.subType = subType; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -133,54 +111,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable subType = JsonNullable.undefined(); + private JsonNullable subType; private Builder() { // force use of static builder() method } - /** * The type of employment relationship the employee has with the organization. */ - public Builder type(EmploymentType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable EmploymentType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of employment relationship the employee has with the organization. - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The work schedule of the employee. */ - public Builder subType(EmploymentSubType subType) { - Utils.checkNotNull(subType, "subType"); + public Builder subType(@Nullable EmploymentSubType subType) { this.subType = JsonNullable.of(subType); return this; } - /** - * The work schedule of the employee. - */ - public Builder subType(JsonNullable subType) { - Utils.checkNotNull(subType, "subType"); - this.subType = subType; - return this; - } - public EmploymentRole build() { - return new EmploymentRole( type, subType); } diff --git a/src/main/java/com/apideck/unify/models/components/Error.java b/src/main/java/com/apideck/unify/models/components/Error.java index 060bd690..689d4dc6 100644 --- a/src/main/java/com/apideck/unify/models/components/Error.java +++ b/src/main/java/com/apideck/unify/models/components/Error.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -24,38 +24,34 @@ public class Error { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") - private Optional message; + private String message; @JsonCreator public Error( - @JsonProperty("code") Optional code, - @JsonProperty("message") Optional message) { - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(message, "message"); + @JsonProperty("code") @Nullable String code, + @JsonProperty("message") @Nullable String message) { this.code = code; this.message = message; } public Error() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The error_code provides more information about the failure. If the message was successful, this value is null */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } - @JsonIgnore public Optional message() { - return message; + return Optional.ofNullable(this.message); } public static Builder builder() { @@ -66,35 +62,18 @@ public static Builder builder() { /** * The error_code provides more information about the failure. If the message was successful, this value is null */ - public Error withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - - /** - * The error_code provides more information about the failure. If the message was successful, this value is null - */ - public Error withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public Error withCode(@Nullable String code) { this.code = code; return this; } - public Error withMessage(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - - public Error withMessage(Optional message) { - Utils.checkNotNull(message, "message"); + public Error withMessage(@Nullable String message) { this.message = message; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -125,48 +104,28 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional code = Optional.empty(); + private String code; - private Optional message = Optional.empty(); + private String message; private Builder() { // force use of static builder() method } - /** * The error_code provides more information about the failure. If the message was successful, this value is null */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The error_code provides more information about the failure. If the message was successful, this value is null - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - public Builder message(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - - public Builder message(Optional message) { - Utils.checkNotNull(message, "message"); + public Builder message(@Nullable String message) { this.message = message; return this; } public Error build() { - return new Error( code, message); } diff --git a/src/main/java/com/apideck/unify/models/components/EvenWeeks.java b/src/main/java/com/apideck/unify/models/components/EvenWeeks.java index 08ef1f18..ff3b7eca 100644 --- a/src/main/java/com/apideck/unify/models/components/EvenWeeks.java +++ b/src/main/java/com/apideck/unify/models/components/EvenWeeks.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; @@ -19,54 +19,47 @@ public class EvenWeeks { @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_monday") - private Optional hoursMonday; + private Double hoursMonday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_tuesday") - private Optional hoursTuesday; + private Double hoursTuesday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_wednesday") - private Optional hoursWednesday; + private Double hoursWednesday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_thursday") - private Optional hoursThursday; + private Double hoursThursday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_friday") - private Optional hoursFriday; + private Double hoursFriday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_saturday") - private Optional hoursSaturday; + private Double hoursSaturday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_sunday") - private Optional hoursSunday; + private Double hoursSunday; @JsonCreator public EvenWeeks( - @JsonProperty("hours_monday") Optional hoursMonday, - @JsonProperty("hours_tuesday") Optional hoursTuesday, - @JsonProperty("hours_wednesday") Optional hoursWednesday, - @JsonProperty("hours_thursday") Optional hoursThursday, - @JsonProperty("hours_friday") Optional hoursFriday, - @JsonProperty("hours_saturday") Optional hoursSaturday, - @JsonProperty("hours_sunday") Optional hoursSunday) { - Utils.checkNotNull(hoursMonday, "hoursMonday"); - Utils.checkNotNull(hoursTuesday, "hoursTuesday"); - Utils.checkNotNull(hoursWednesday, "hoursWednesday"); - Utils.checkNotNull(hoursThursday, "hoursThursday"); - Utils.checkNotNull(hoursFriday, "hoursFriday"); - Utils.checkNotNull(hoursSaturday, "hoursSaturday"); - Utils.checkNotNull(hoursSunday, "hoursSunday"); + @JsonProperty("hours_monday") @Nullable Double hoursMonday, + @JsonProperty("hours_tuesday") @Nullable Double hoursTuesday, + @JsonProperty("hours_wednesday") @Nullable Double hoursWednesday, + @JsonProperty("hours_thursday") @Nullable Double hoursThursday, + @JsonProperty("hours_friday") @Nullable Double hoursFriday, + @JsonProperty("hours_saturday") @Nullable Double hoursSaturday, + @JsonProperty("hours_sunday") @Nullable Double hoursSunday) { this.hoursMonday = hoursMonday; this.hoursTuesday = hoursTuesday; this.hoursWednesday = hoursWednesday; @@ -77,44 +70,37 @@ public EvenWeeks( } public EvenWeeks() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } - @JsonIgnore public Optional hoursMonday() { - return hoursMonday; + return Optional.ofNullable(this.hoursMonday); } - @JsonIgnore public Optional hoursTuesday() { - return hoursTuesday; + return Optional.ofNullable(this.hoursTuesday); } - @JsonIgnore public Optional hoursWednesday() { - return hoursWednesday; + return Optional.ofNullable(this.hoursWednesday); } - @JsonIgnore public Optional hoursThursday() { - return hoursThursday; + return Optional.ofNullable(this.hoursThursday); } - @JsonIgnore public Optional hoursFriday() { - return hoursFriday; + return Optional.ofNullable(this.hoursFriday); } - @JsonIgnore public Optional hoursSaturday() { - return hoursSaturday; + return Optional.ofNullable(this.hoursSaturday); } - @JsonIgnore public Optional hoursSunday() { - return hoursSunday; + return Optional.ofNullable(this.hoursSunday); } public static Builder builder() { @@ -122,97 +108,48 @@ public static Builder builder() { } - public EvenWeeks withHoursMonday(double hoursMonday) { - Utils.checkNotNull(hoursMonday, "hoursMonday"); - this.hoursMonday = Optional.ofNullable(hoursMonday); - return this; - } - - - public EvenWeeks withHoursMonday(Optional hoursMonday) { - Utils.checkNotNull(hoursMonday, "hoursMonday"); + public EvenWeeks withHoursMonday(@Nullable Double hoursMonday) { this.hoursMonday = hoursMonday; return this; } - public EvenWeeks withHoursTuesday(double hoursTuesday) { - Utils.checkNotNull(hoursTuesday, "hoursTuesday"); - this.hoursTuesday = Optional.ofNullable(hoursTuesday); - return this; - } - - public EvenWeeks withHoursTuesday(Optional hoursTuesday) { - Utils.checkNotNull(hoursTuesday, "hoursTuesday"); + public EvenWeeks withHoursTuesday(@Nullable Double hoursTuesday) { this.hoursTuesday = hoursTuesday; return this; } - public EvenWeeks withHoursWednesday(double hoursWednesday) { - Utils.checkNotNull(hoursWednesday, "hoursWednesday"); - this.hoursWednesday = Optional.ofNullable(hoursWednesday); - return this; - } - - public EvenWeeks withHoursWednesday(Optional hoursWednesday) { - Utils.checkNotNull(hoursWednesday, "hoursWednesday"); + public EvenWeeks withHoursWednesday(@Nullable Double hoursWednesday) { this.hoursWednesday = hoursWednesday; return this; } - public EvenWeeks withHoursThursday(double hoursThursday) { - Utils.checkNotNull(hoursThursday, "hoursThursday"); - this.hoursThursday = Optional.ofNullable(hoursThursday); - return this; - } - - public EvenWeeks withHoursThursday(Optional hoursThursday) { - Utils.checkNotNull(hoursThursday, "hoursThursday"); + public EvenWeeks withHoursThursday(@Nullable Double hoursThursday) { this.hoursThursday = hoursThursday; return this; } - public EvenWeeks withHoursFriday(double hoursFriday) { - Utils.checkNotNull(hoursFriday, "hoursFriday"); - this.hoursFriday = Optional.ofNullable(hoursFriday); - return this; - } - - public EvenWeeks withHoursFriday(Optional hoursFriday) { - Utils.checkNotNull(hoursFriday, "hoursFriday"); + public EvenWeeks withHoursFriday(@Nullable Double hoursFriday) { this.hoursFriday = hoursFriday; return this; } - public EvenWeeks withHoursSaturday(double hoursSaturday) { - Utils.checkNotNull(hoursSaturday, "hoursSaturday"); - this.hoursSaturday = Optional.ofNullable(hoursSaturday); - return this; - } - - public EvenWeeks withHoursSaturday(Optional hoursSaturday) { - Utils.checkNotNull(hoursSaturday, "hoursSaturday"); + public EvenWeeks withHoursSaturday(@Nullable Double hoursSaturday) { this.hoursSaturday = hoursSaturday; return this; } - public EvenWeeks withHoursSunday(double hoursSunday) { - Utils.checkNotNull(hoursSunday, "hoursSunday"); - this.hoursSunday = Optional.ofNullable(hoursSunday); - return this; - } - - public EvenWeeks withHoursSunday(Optional hoursSunday) { - Utils.checkNotNull(hoursSunday, "hoursSunday"); + public EvenWeeks withHoursSunday(@Nullable Double hoursSunday) { this.hoursSunday = hoursSunday; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -255,117 +192,60 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional hoursMonday = Optional.empty(); + private Double hoursMonday; - private Optional hoursTuesday = Optional.empty(); + private Double hoursTuesday; - private Optional hoursWednesday = Optional.empty(); + private Double hoursWednesday; - private Optional hoursThursday = Optional.empty(); + private Double hoursThursday; - private Optional hoursFriday = Optional.empty(); + private Double hoursFriday; - private Optional hoursSaturday = Optional.empty(); + private Double hoursSaturday; - private Optional hoursSunday = Optional.empty(); + private Double hoursSunday; private Builder() { // force use of static builder() method } - - public Builder hoursMonday(double hoursMonday) { - Utils.checkNotNull(hoursMonday, "hoursMonday"); - this.hoursMonday = Optional.ofNullable(hoursMonday); - return this; - } - - public Builder hoursMonday(Optional hoursMonday) { - Utils.checkNotNull(hoursMonday, "hoursMonday"); + public Builder hoursMonday(@Nullable Double hoursMonday) { this.hoursMonday = hoursMonday; return this; } - - public Builder hoursTuesday(double hoursTuesday) { - Utils.checkNotNull(hoursTuesday, "hoursTuesday"); - this.hoursTuesday = Optional.ofNullable(hoursTuesday); - return this; - } - - public Builder hoursTuesday(Optional hoursTuesday) { - Utils.checkNotNull(hoursTuesday, "hoursTuesday"); + public Builder hoursTuesday(@Nullable Double hoursTuesday) { this.hoursTuesday = hoursTuesday; return this; } - - public Builder hoursWednesday(double hoursWednesday) { - Utils.checkNotNull(hoursWednesday, "hoursWednesday"); - this.hoursWednesday = Optional.ofNullable(hoursWednesday); - return this; - } - - public Builder hoursWednesday(Optional hoursWednesday) { - Utils.checkNotNull(hoursWednesday, "hoursWednesday"); + public Builder hoursWednesday(@Nullable Double hoursWednesday) { this.hoursWednesday = hoursWednesday; return this; } - - public Builder hoursThursday(double hoursThursday) { - Utils.checkNotNull(hoursThursday, "hoursThursday"); - this.hoursThursday = Optional.ofNullable(hoursThursday); - return this; - } - - public Builder hoursThursday(Optional hoursThursday) { - Utils.checkNotNull(hoursThursday, "hoursThursday"); + public Builder hoursThursday(@Nullable Double hoursThursday) { this.hoursThursday = hoursThursday; return this; } - - public Builder hoursFriday(double hoursFriday) { - Utils.checkNotNull(hoursFriday, "hoursFriday"); - this.hoursFriday = Optional.ofNullable(hoursFriday); - return this; - } - - public Builder hoursFriday(Optional hoursFriday) { - Utils.checkNotNull(hoursFriday, "hoursFriday"); + public Builder hoursFriday(@Nullable Double hoursFriday) { this.hoursFriday = hoursFriday; return this; } - - public Builder hoursSaturday(double hoursSaturday) { - Utils.checkNotNull(hoursSaturday, "hoursSaturday"); - this.hoursSaturday = Optional.ofNullable(hoursSaturday); - return this; - } - - public Builder hoursSaturday(Optional hoursSaturday) { - Utils.checkNotNull(hoursSaturday, "hoursSaturday"); + public Builder hoursSaturday(@Nullable Double hoursSaturday) { this.hoursSaturday = hoursSaturday; return this; } - - public Builder hoursSunday(double hoursSunday) { - Utils.checkNotNull(hoursSunday, "hoursSunday"); - this.hoursSunday = Optional.ofNullable(hoursSunday); - return this; - } - - public Builder hoursSunday(Optional hoursSunday) { - Utils.checkNotNull(hoursSunday, "hoursSunday"); + public Builder hoursSunday(@Nullable Double hoursSunday) { this.hoursSunday = hoursSunday; return this; } public EvenWeeks build() { - return new EvenWeeks( hoursMonday, hoursTuesday, hoursWednesday, hoursThursday, hoursFriday, hoursSaturday, diff --git a/src/main/java/com/apideck/unify/models/components/Expense.java b/src/main/java/com/apideck/unify/models/components/Expense.java index 34ee64a9..cb5fbda5 100644 --- a/src/main/java/com/apideck/unify/models/components/Expense.java +++ b/src/main/java/com/apideck/unify/models/components/Expense.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -27,7 +27,7 @@ public class Expense { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Number. @@ -41,7 +41,7 @@ public class Expense { */ @JsonInclude(Include.ALWAYS) @JsonProperty("transaction_date") - private Optional transactionDate; + private JsonNullable transactionDate; /** * The unique identifier for the ledger account that this expense should be credited to. @@ -54,14 +54,14 @@ public class Expense { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer_id") - private Optional customerId; + private String customerId; /** * The ID of the supplier this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier_id") - private Optional supplierId; + private String supplierId; /** * The company or subsidiary id the transaction belongs to @@ -82,14 +82,14 @@ public class Expense { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_type") - private JsonNullable paymentType; + private JsonNullable paymentType; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -103,7 +103,7 @@ public class Expense { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The memo of the expense. @@ -115,7 +115,7 @@ public class Expense { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRate taxRate; /** * The total amount of the expense line item. @@ -140,14 +140,14 @@ public class Expense { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The date and time when the object was last updated. @@ -189,300 +189,261 @@ public class Expense { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Expense( - @JsonProperty("id") Optional id, - @JsonProperty("number") JsonNullable number, - @JsonProperty("transaction_date") Optional transactionDate, - @JsonProperty("account_id") String accountId, - @JsonProperty("customer_id") Optional customerId, - @JsonProperty("supplier_id") Optional supplierId, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("payment_type") JsonNullable paymentType, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("type") JsonNullable type, - @JsonProperty("memo") JsonNullable memo, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("total_amount") JsonNullable totalAmount, - @JsonProperty("line_items") List lineItems, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(transactionDate, "transactionDate"); - Utils.checkNotNull(accountId, "accountId"); - Utils.checkNotNull(customerId, "customerId"); - Utils.checkNotNull(supplierId, "supplierId"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(paymentType, "paymentType"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(memo, "memo"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("transaction_date") @Nullable OffsetDateTime transactionDate, + @JsonProperty("account_id") @Nonnull String accountId, + @JsonProperty("customer_id") @Nullable String customerId, + @JsonProperty("supplier_id") @Nullable String supplierId, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("payment_type") @Nullable JsonNullable paymentType, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("memo") @Nullable JsonNullable memo, + @JsonProperty("tax_rate") @Nullable LinkedTaxRate taxRate, + @JsonProperty("total_amount") @Nullable JsonNullable totalAmount, + @JsonProperty("line_items") @Nonnull List lineItems, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.number = number; - this.transactionDate = transactionDate; - this.accountId = accountId; + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.transactionDate = JsonNullable.of(transactionDate); + this.accountId = Optional.ofNullable(accountId) + .orElseThrow(() -> new IllegalArgumentException("accountId cannot be null")); this.customerId = customerId; this.supplierId = supplierId; - this.companyId = companyId; - this.departmentId = departmentId; - this.paymentType = paymentType; - this.currency = currency; - this.currencyRate = currencyRate; - this.type = type; - this.memo = memo; + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); + this.paymentType = Optional.ofNullable(paymentType) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.memo = Optional.ofNullable(memo) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; - this.totalAmount = totalAmount; - this.lineItems = lineItems; - this.reference = reference; + this.totalAmount = Optional.ofNullable(totalAmount) + .orElse(JsonNullable.undefined()); + this.lineItems = Optional.ofNullable(lineItems) + .orElseThrow(() -> new IllegalArgumentException("lineItems cannot be null")); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.customMappings = customMappings; - this.updatedAt = updatedAt; - this.createdAt = createdAt; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Expense( - String accountId, - List lineItems) { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - accountId, Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - lineItems, JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + @Nonnull String accountId, + @Nonnull List lineItems) { + this(null, null, null, + accountId, null, null, + null, null, null, + null, null, null, + null, null, null, + lineItems, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Number. */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore - public Optional transactionDate() { - return transactionDate; + public JsonNullable transactionDate() { + return this.transactionDate; } /** * The unique identifier for the ledger account that this expense should be credited to. */ - @JsonIgnore public String accountId() { - return accountId; + return this.accountId; } /** * The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. */ - @JsonIgnore public Optional customerId() { - return customerId; + return Optional.ofNullable(this.customerId); } /** * The ID of the supplier this entity is linked to. */ - @JsonIgnore public Optional supplierId() { - return supplierId; + return Optional.ofNullable(this.supplierId); } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } /** * The type of payment for the expense. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable paymentType() { - return (JsonNullable) paymentType; + return this.paymentType; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * The type of expense. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The memo of the expense. */ - @JsonIgnore public JsonNullable memo() { - return memo; + return this.memo; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } /** * The total amount of the expense line item. */ - @JsonIgnore public JsonNullable totalAmount() { - return totalAmount; + return this.totalAmount; } /** * Expense line items linked to this expense. */ - @JsonIgnore public List lineItems() { - return lineItems; + return this.lineItems; } /** * Optional reference identifier for the transaction. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -493,74 +454,35 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Expense withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Expense withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Expense withId(@Nullable String id) { this.id = id; return this; } + /** * Number. */ - public Expense withNumber(String number) { - Utils.checkNotNull(number, "number"); + public Expense withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number. - */ - public Expense withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public Expense withTransactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); + public Expense withTransactionDate(@Nullable OffsetDateTime transactionDate) { + this.transactionDate = JsonNullable.of(transactionDate); return this; } - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Expense withTransactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = transactionDate; - return this; - } - /** * The unique identifier for the ledger account that this expense should be credited to. */ - public Expense withAccountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = accountId; - return this; - } - - /** - * The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. - */ - public Expense withCustomerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); + public Expense withAccountId(@Nonnull String accountId) { + this.accountId = Utils.checkNotNull(accountId, "accountId"); return this; } @@ -568,355 +490,186 @@ public Expense withCustomerId(String customerId) { /** * The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. */ - public Expense withCustomerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public Expense withCustomerId(@Nullable String customerId) { this.customerId = customerId; return this; } - /** - * The ID of the supplier this entity is linked to. - */ - public Expense withSupplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - /** * The ID of the supplier this entity is linked to. */ - public Expense withSupplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public Expense withSupplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } + /** * The company or subsidiary id the transaction belongs to */ - public Expense withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Expense withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Expense withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The ID of the department */ - public Expense withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Expense withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Expense withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } /** * The type of payment for the expense. */ - public Expense withPaymentType(ExpensePaymentType paymentType) { - Utils.checkNotNull(paymentType, "paymentType"); + public Expense withPaymentType(@Nullable ExpensePaymentType paymentType) { this.paymentType = JsonNullable.of(paymentType); return this; } - /** - * The type of payment for the expense. - */ - public Expense withPaymentType(JsonNullable paymentType) { - Utils.checkNotNull(paymentType, "paymentType"); - this.paymentType = paymentType; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Expense withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Expense withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Expense withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Expense withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Expense withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Expense withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * The type of expense. */ - public Expense withType(ExpenseType type) { - Utils.checkNotNull(type, "type"); + public Expense withType(@Nullable ExpenseType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of expense. - */ - public Expense withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The memo of the expense. */ - public Expense withMemo(String memo) { - Utils.checkNotNull(memo, "memo"); + public Expense withMemo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * The memo of the expense. - */ - public Expense withMemo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } - - public Expense withTaxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Expense withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Expense withTaxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } + /** * The total amount of the expense line item. */ - public Expense withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Expense withTotalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * The total amount of the expense line item. - */ - public Expense withTotalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } /** * Expense line items linked to this expense. */ - public Expense withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = lineItems; + public Expense withLineItems(@Nonnull List lineItems) { + this.lineItems = Utils.checkNotNull(lineItems, "lineItems"); return this; } - /** - * Optional reference identifier for the transaction. - */ - public Expense withReference(String reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = JsonNullable.of(reference); - return this; - } /** * Optional reference identifier for the transaction. */ - public Expense withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - public Expense withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); + public Expense withReference(@Nullable String reference) { + this.reference = JsonNullable.of(reference); return this; } - public Expense withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Expense withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public Expense withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Expense withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Expense withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The date and time when the object was last updated. */ - public Expense withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Expense withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Expense withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Expense withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Expense withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Expense withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Expense withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Expense withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Expense withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public Expense withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Expense withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Expense withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Expense withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Expense withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Expense withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Expense withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Expense withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Expense withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1001,507 +754,255 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private Optional transactionDate = Optional.empty(); + private OffsetDateTime transactionDate; private String accountId; - private Optional customerId = Optional.empty(); + private String customerId; - private Optional supplierId = Optional.empty(); + private String supplierId; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private JsonNullable paymentType = JsonNullable.undefined(); + private JsonNullable paymentType; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable memo = JsonNullable.undefined(); + private JsonNullable memo; - private Optional taxRate = Optional.empty(); + private LinkedTaxRate taxRate; - private JsonNullable totalAmount = JsonNullable.undefined(); + private JsonNullable totalAmount; private List lineItems; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Number. */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number. - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Builder transactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); - return this; - } - /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder transactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); + public Builder transactionDate(@Nullable OffsetDateTime transactionDate) { this.transactionDate = transactionDate; return this; } - /** * The unique identifier for the ledger account that this expense should be credited to. */ - public Builder accountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = accountId; - return this; - } - - - /** - * The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. - */ - public Builder customerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); + public Builder accountId(@Nonnull String accountId) { + this.accountId = Utils.checkNotNull(accountId, "accountId"); return this; } /** * The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. */ - public Builder customerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public Builder customerId(@Nullable String customerId) { this.customerId = customerId; return this; } - - /** - * The ID of the supplier this entity is linked to. - */ - public Builder supplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - /** * The ID of the supplier this entity is linked to. */ - public Builder supplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public Builder supplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - /** * The type of payment for the expense. */ - public Builder paymentType(ExpensePaymentType paymentType) { - Utils.checkNotNull(paymentType, "paymentType"); + public Builder paymentType(@Nullable ExpensePaymentType paymentType) { this.paymentType = JsonNullable.of(paymentType); return this; } - /** - * The type of payment for the expense. - */ - public Builder paymentType(JsonNullable paymentType) { - Utils.checkNotNull(paymentType, "paymentType"); - this.paymentType = paymentType; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * The type of expense. */ - public Builder type(ExpenseType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ExpenseType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of expense. - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The memo of the expense. */ - public Builder memo(String memo) { - Utils.checkNotNull(memo, "memo"); + public Builder memo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * The memo of the expense. - */ - public Builder memo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } - - - public Builder taxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - /** * The total amount of the expense line item. */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * The total amount of the expense line item. - */ - public Builder totalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - /** * Expense line items linked to this expense. */ - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = lineItems; + public Builder lineItems(@Nonnull List lineItems) { + this.lineItems = Utils.checkNotNull(lineItems, "lineItems"); return this; } - /** * Optional reference identifier for the transaction. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference identifier for the transaction. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Expense build() { - return new Expense( id, number, transactionDate, accountId, customerId, supplierId, diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseInput.java b/src/main/java/com/apideck/unify/models/components/ExpenseInput.java index f3148b58..9ea51cb5 100644 --- a/src/main/java/com/apideck/unify/models/components/ExpenseInput.java +++ b/src/main/java/com/apideck/unify/models/components/ExpenseInput.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -32,7 +32,7 @@ public class ExpenseInput { */ @JsonInclude(Include.ALWAYS) @JsonProperty("transaction_date") - private Optional transactionDate; + private JsonNullable transactionDate; /** * The unique identifier for the ledger account that this expense should be credited to. @@ -45,14 +45,14 @@ public class ExpenseInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer_id") - private Optional customerId; + private String customerId; /** * The ID of the supplier this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier_id") - private Optional supplierId; + private String supplierId; /** * The company or subsidiary id the transaction belongs to @@ -73,14 +73,14 @@ public class ExpenseInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_type") - private JsonNullable paymentType; + private JsonNullable paymentType; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -94,7 +94,7 @@ public class ExpenseInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The memo of the expense. @@ -106,7 +106,7 @@ public class ExpenseInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRateInput taxRate; /** * The total amount of the expense line item. @@ -131,7 +131,7 @@ public class ExpenseInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -145,231 +145,200 @@ public class ExpenseInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public ExpenseInput( - @JsonProperty("number") JsonNullable number, - @JsonProperty("transaction_date") Optional transactionDate, - @JsonProperty("account_id") String accountId, - @JsonProperty("customer_id") Optional customerId, - @JsonProperty("supplier_id") Optional supplierId, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("payment_type") JsonNullable paymentType, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("type") JsonNullable type, - @JsonProperty("memo") JsonNullable memo, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("total_amount") JsonNullable totalAmount, - @JsonProperty("line_items") List lineItems, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(transactionDate, "transactionDate"); - Utils.checkNotNull(accountId, "accountId"); - Utils.checkNotNull(customerId, "customerId"); - Utils.checkNotNull(supplierId, "supplierId"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(paymentType, "paymentType"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(memo, "memo"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - this.number = number; - this.transactionDate = transactionDate; - this.accountId = accountId; + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("transaction_date") @Nullable OffsetDateTime transactionDate, + @JsonProperty("account_id") @Nonnull String accountId, + @JsonProperty("customer_id") @Nullable String customerId, + @JsonProperty("supplier_id") @Nullable String supplierId, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("payment_type") @Nullable JsonNullable paymentType, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("memo") @Nullable JsonNullable memo, + @JsonProperty("tax_rate") @Nullable LinkedTaxRateInput taxRate, + @JsonProperty("total_amount") @Nullable JsonNullable totalAmount, + @JsonProperty("line_items") @Nonnull List lineItems, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.transactionDate = JsonNullable.of(transactionDate); + this.accountId = Optional.ofNullable(accountId) + .orElseThrow(() -> new IllegalArgumentException("accountId cannot be null")); this.customerId = customerId; this.supplierId = supplierId; - this.companyId = companyId; - this.departmentId = departmentId; - this.paymentType = paymentType; - this.currency = currency; - this.currencyRate = currencyRate; - this.type = type; - this.memo = memo; + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); + this.paymentType = Optional.ofNullable(paymentType) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.memo = Optional.ofNullable(memo) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; - this.totalAmount = totalAmount; - this.lineItems = lineItems; - this.reference = reference; + this.totalAmount = Optional.ofNullable(totalAmount) + .orElse(JsonNullable.undefined()); + this.lineItems = Optional.ofNullable(lineItems) + .orElseThrow(() -> new IllegalArgumentException("lineItems cannot be null")); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public ExpenseInput( - String accountId, - List lineItems) { - this(JsonNullable.undefined(), Optional.empty(), accountId, - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), lineItems, - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + @Nonnull String accountId, + @Nonnull List lineItems) { + this(null, null, accountId, + null, null, null, + null, null, null, + null, null, null, + null, null, lineItems, + null, null, null, + null); } /** * Number. */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore - public Optional transactionDate() { - return transactionDate; + public JsonNullable transactionDate() { + return this.transactionDate; } /** * The unique identifier for the ledger account that this expense should be credited to. */ - @JsonIgnore public String accountId() { - return accountId; + return this.accountId; } /** * The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. */ - @JsonIgnore public Optional customerId() { - return customerId; + return Optional.ofNullable(this.customerId); } /** * The ID of the supplier this entity is linked to. */ - @JsonIgnore public Optional supplierId() { - return supplierId; + return Optional.ofNullable(this.supplierId); } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } /** * The type of payment for the expense. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable paymentType() { - return (JsonNullable) paymentType; + return this.paymentType; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * The type of expense. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The memo of the expense. */ - @JsonIgnore public JsonNullable memo() { - return memo; + return this.memo; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } /** * The total amount of the expense line item. */ - @JsonIgnore public JsonNullable totalAmount() { - return totalAmount; + return this.totalAmount; } /** * Expense line items linked to this expense. */ - @JsonIgnore public List lineItems() { - return lineItems; + return this.lineItems; } /** * Optional reference identifier for the transaction. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -380,55 +349,26 @@ public static Builder builder() { /** * Number. */ - public ExpenseInput withNumber(String number) { - Utils.checkNotNull(number, "number"); + public ExpenseInput withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number. - */ - public ExpenseInput withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public ExpenseInput withTransactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); + public ExpenseInput withTransactionDate(@Nullable OffsetDateTime transactionDate) { + this.transactionDate = JsonNullable.of(transactionDate); return this; } - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public ExpenseInput withTransactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = transactionDate; - return this; - } - /** * The unique identifier for the ledger account that this expense should be credited to. */ - public ExpenseInput withAccountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = accountId; - return this; - } - - /** - * The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. - */ - public ExpenseInput withCustomerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); + public ExpenseInput withAccountId(@Nonnull String accountId) { + this.accountId = Utils.checkNotNull(accountId, "accountId"); return this; } @@ -436,252 +376,128 @@ public ExpenseInput withCustomerId(String customerId) { /** * The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. */ - public ExpenseInput withCustomerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public ExpenseInput withCustomerId(@Nullable String customerId) { this.customerId = customerId; return this; } - /** - * The ID of the supplier this entity is linked to. - */ - public ExpenseInput withSupplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - /** * The ID of the supplier this entity is linked to. */ - public ExpenseInput withSupplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public ExpenseInput withSupplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } + /** * The company or subsidiary id the transaction belongs to */ - public ExpenseInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public ExpenseInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public ExpenseInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The ID of the department */ - public ExpenseInput withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public ExpenseInput withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public ExpenseInput withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } /** * The type of payment for the expense. */ - public ExpenseInput withPaymentType(ExpensePaymentType paymentType) { - Utils.checkNotNull(paymentType, "paymentType"); + public ExpenseInput withPaymentType(@Nullable ExpensePaymentType paymentType) { this.paymentType = JsonNullable.of(paymentType); return this; } - /** - * The type of payment for the expense. - */ - public ExpenseInput withPaymentType(JsonNullable paymentType) { - Utils.checkNotNull(paymentType, "paymentType"); - this.paymentType = paymentType; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public ExpenseInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public ExpenseInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public ExpenseInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public ExpenseInput withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public ExpenseInput withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public ExpenseInput withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * The type of expense. */ - public ExpenseInput withType(ExpenseType type) { - Utils.checkNotNull(type, "type"); + public ExpenseInput withType(@Nullable ExpenseType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of expense. - */ - public ExpenseInput withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The memo of the expense. */ - public ExpenseInput withMemo(String memo) { - Utils.checkNotNull(memo, "memo"); + public ExpenseInput withMemo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * The memo of the expense. - */ - public ExpenseInput withMemo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } - public ExpenseInput withTaxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - - public ExpenseInput withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public ExpenseInput withTaxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } + /** * The total amount of the expense line item. */ - public ExpenseInput withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public ExpenseInput withTotalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * The total amount of the expense line item. - */ - public ExpenseInput withTotalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } /** * Expense line items linked to this expense. */ - public ExpenseInput withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = lineItems; + public ExpenseInput withLineItems(@Nonnull List lineItems) { + this.lineItems = Utils.checkNotNull(lineItems, "lineItems"); return this; } - /** - * Optional reference identifier for the transaction. - */ - public ExpenseInput withReference(String reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = JsonNullable.of(reference); - return this; - } /** * Optional reference identifier for the transaction. */ - public ExpenseInput withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - public ExpenseInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); + public ExpenseInput withReference(@Nullable String reference) { + this.reference = JsonNullable.of(reference); return this; } - public ExpenseInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public ExpenseInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public ExpenseInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public ExpenseInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public ExpenseInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public ExpenseInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -689,12 +505,12 @@ public ExpenseInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public ExpenseInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public ExpenseInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -765,381 +581,195 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private Optional transactionDate = Optional.empty(); + private OffsetDateTime transactionDate; private String accountId; - private Optional customerId = Optional.empty(); + private String customerId; - private Optional supplierId = Optional.empty(); + private String supplierId; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private JsonNullable paymentType = JsonNullable.undefined(); + private JsonNullable paymentType; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable memo = JsonNullable.undefined(); + private JsonNullable memo; - private Optional taxRate = Optional.empty(); + private LinkedTaxRateInput taxRate; - private JsonNullable totalAmount = JsonNullable.undefined(); + private JsonNullable totalAmount; private List lineItems; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Number. */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number. - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder transactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); - return this; - } - - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Builder transactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); + public Builder transactionDate(@Nullable OffsetDateTime transactionDate) { this.transactionDate = transactionDate; return this; } - /** * The unique identifier for the ledger account that this expense should be credited to. */ - public Builder accountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = accountId; + public Builder accountId(@Nonnull String accountId) { + this.accountId = Utils.checkNotNull(accountId, "accountId"); return this; } - /** * The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. */ - public Builder customerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - - /** - * The ID of the customer this entity is linked to. Used for expenses that should be marked as billable to customers. - */ - public Builder customerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public Builder customerId(@Nullable String customerId) { this.customerId = customerId; return this; } - - /** - * The ID of the supplier this entity is linked to. - */ - public Builder supplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - /** * The ID of the supplier this entity is linked to. */ - public Builder supplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public Builder supplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - /** * The type of payment for the expense. */ - public Builder paymentType(ExpensePaymentType paymentType) { - Utils.checkNotNull(paymentType, "paymentType"); + public Builder paymentType(@Nullable ExpensePaymentType paymentType) { this.paymentType = JsonNullable.of(paymentType); return this; } - /** - * The type of payment for the expense. - */ - public Builder paymentType(JsonNullable paymentType) { - Utils.checkNotNull(paymentType, "paymentType"); - this.paymentType = paymentType; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * The type of expense. */ - public Builder type(ExpenseType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ExpenseType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of expense. - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The memo of the expense. */ - public Builder memo(String memo) { - Utils.checkNotNull(memo, "memo"); + public Builder memo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * The memo of the expense. - */ - public Builder memo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } - - - public Builder taxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - /** * The total amount of the expense line item. */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * The total amount of the expense line item. - */ - public Builder totalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - /** * Expense line items linked to this expense. */ - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = lineItems; + public Builder lineItems(@Nonnull List lineItems) { + this.lineItems = Utils.checkNotNull(lineItems, "lineItems"); return this; } - /** * Optional reference identifier for the transaction. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference identifier for the transaction. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public ExpenseInput build() { - return new ExpenseInput( number, transactionDate, accountId, customerId, supplierId, companyId, diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseLineItem.java b/src/main/java/com/apideck/unify/models/components/ExpenseLineItem.java index 2d284126..7b70b916 100644 --- a/src/main/java/com/apideck/unify/models/components/ExpenseLineItem.java +++ b/src/main/java/com/apideck/unify/models/components/ExpenseLineItem.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,28 +25,28 @@ public class ExpenseLineItem { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; /** * The unique identifier for the ledger account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("account_id") - private Optional accountId; + private String accountId; /** * The ID of the customer this expense item is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer_id") - private Optional customerId; + private String customerId; /** * The ID of the department @@ -73,7 +72,7 @@ public class ExpenseLineItem { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRate taxRate; /** * The expense line item description @@ -87,14 +86,14 @@ public class ExpenseLineItem { */ @JsonInclude(Include.ALWAYS) @JsonProperty("total_amount") - private Optional totalAmount; + private JsonNullable totalAmount; /** * Boolean that indicates if the line item is billable or not. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("billable") - private Optional billable; + private Boolean billable; /** * Line number of the resource @@ -105,144 +104,124 @@ public class ExpenseLineItem { @JsonCreator public ExpenseLineItem( - @JsonProperty("id") Optional id, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("account_id") Optional accountId, - @JsonProperty("customer_id") Optional customerId, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("location_id") JsonNullable locationId, - @JsonProperty("subsidiary_id") JsonNullable subsidiaryId, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("description") JsonNullable description, - @JsonProperty("total_amount") Optional totalAmount, - @JsonProperty("billable") Optional billable, - @JsonProperty("line_number") JsonNullable lineNumber) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(accountId, "accountId"); - Utils.checkNotNull(customerId, "customerId"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(locationId, "locationId"); - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(billable, "billable"); - Utils.checkNotNull(lineNumber, "lineNumber"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("account_id") @Nullable String accountId, + @JsonProperty("customer_id") @Nullable String customerId, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("location_id") @Nullable JsonNullable locationId, + @JsonProperty("subsidiary_id") @Nullable JsonNullable subsidiaryId, + @JsonProperty("tax_rate") @Nullable LinkedTaxRate taxRate, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("total_amount") @Nullable Double totalAmount, + @JsonProperty("billable") @Nullable Boolean billable, + @JsonProperty("line_number") @Nullable JsonNullable lineNumber) { this.id = id; - this.trackingCategories = trackingCategories; + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); this.accountId = accountId; this.customerId = customerId; - this.departmentId = departmentId; - this.locationId = locationId; - this.subsidiaryId = subsidiaryId; + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); + this.locationId = Optional.ofNullable(locationId) + .orElse(JsonNullable.undefined()); + this.subsidiaryId = Optional.ofNullable(subsidiaryId) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; - this.description = description; - this.totalAmount = totalAmount; + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.totalAmount = JsonNullable.of(totalAmount); this.billable = billable; - this.lineNumber = lineNumber; + this.lineNumber = Optional.ofNullable(lineNumber) + .orElse(JsonNullable.undefined()); } public ExpenseLineItem() { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } /** * The unique identifier for the ledger account. */ - @JsonIgnore public Optional accountId() { - return accountId; + return Optional.ofNullable(this.accountId); } /** * The ID of the customer this expense item is linked to. */ - @JsonIgnore public Optional customerId() { - return customerId; + return Optional.ofNullable(this.customerId); } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } /** * The ID of the location */ - @JsonIgnore public JsonNullable locationId() { - return locationId; + return this.locationId; } /** * The ID of the subsidiary */ - @JsonIgnore public JsonNullable subsidiaryId() { - return subsidiaryId; + return this.subsidiaryId; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } /** * The expense line item description */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The total amount of the expense line item. */ - @JsonIgnore - public Optional totalAmount() { - return totalAmount; + public JsonNullable totalAmount() { + return this.totalAmount; } /** * Boolean that indicates if the line item is billable or not. */ - @JsonIgnore public Optional billable() { - return billable; + return Optional.ofNullable(this.billable); } /** * Line number of the resource */ - @JsonIgnore public JsonNullable lineNumber() { - return lineNumber; + return this.lineNumber; } public static Builder builder() { @@ -253,46 +232,17 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public ExpenseLineItem withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public ExpenseLineItem withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ExpenseLineItem withId(@Nullable String id) { this.id = id; return this; } - /** - * A list of linked tracking categories. - */ - public ExpenseLineItem withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = JsonNullable.of(trackingCategories); - return this; - } /** * A list of linked tracking categories. */ - public ExpenseLineItem withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** - * The unique identifier for the ledger account. - */ - public ExpenseLineItem withAccountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); + public ExpenseLineItem withTrackingCategories(@Nullable List trackingCategories) { + this.trackingCategories = JsonNullable.of(trackingCategories); return this; } @@ -300,122 +250,59 @@ public ExpenseLineItem withAccountId(String accountId) { /** * The unique identifier for the ledger account. */ - public ExpenseLineItem withAccountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public ExpenseLineItem withAccountId(@Nullable String accountId) { this.accountId = accountId; return this; } - /** - * The ID of the customer this expense item is linked to. - */ - public ExpenseLineItem withCustomerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - /** * The ID of the customer this expense item is linked to. */ - public ExpenseLineItem withCustomerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public ExpenseLineItem withCustomerId(@Nullable String customerId) { this.customerId = customerId; return this; } + /** * The ID of the department */ - public ExpenseLineItem withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public ExpenseLineItem withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public ExpenseLineItem withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } /** * The ID of the location */ - public ExpenseLineItem withLocationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public ExpenseLineItem withLocationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public ExpenseLineItem withLocationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } /** * The ID of the subsidiary */ - public ExpenseLineItem withSubsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public ExpenseLineItem withSubsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public ExpenseLineItem withSubsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } - - public ExpenseLineItem withTaxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public ExpenseLineItem withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public ExpenseLineItem withTaxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - /** - * The expense line item description - */ - public ExpenseLineItem withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = JsonNullable.of(description); - return this; - } /** * The expense line item description */ - public ExpenseLineItem withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * The total amount of the expense line item. - */ - public ExpenseLineItem withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); + public ExpenseLineItem withDescription(@Nullable String description) { + this.description = JsonNullable.of(description); return this; } @@ -423,18 +310,8 @@ public ExpenseLineItem withTotalAmount(double totalAmount) { /** * The total amount of the expense line item. */ - public ExpenseLineItem withTotalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - /** - * Boolean that indicates if the line item is billable or not. - */ - public ExpenseLineItem withBillable(boolean billable) { - Utils.checkNotNull(billable, "billable"); - this.billable = Optional.ofNullable(billable); + public ExpenseLineItem withTotalAmount(@Nullable Double totalAmount) { + this.totalAmount = JsonNullable.of(totalAmount); return this; } @@ -442,29 +319,20 @@ public ExpenseLineItem withBillable(boolean billable) { /** * Boolean that indicates if the line item is billable or not. */ - public ExpenseLineItem withBillable(Optional billable) { - Utils.checkNotNull(billable, "billable"); + public ExpenseLineItem withBillable(@Nullable Boolean billable) { this.billable = billable; return this; } + /** * Line number of the resource */ - public ExpenseLineItem withLineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public ExpenseLineItem withLineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public ExpenseLineItem withLineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -519,258 +387,128 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional accountId = Optional.empty(); + private String accountId; - private Optional customerId = Optional.empty(); + private String customerId; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private JsonNullable locationId = JsonNullable.undefined(); + private JsonNullable locationId; - private JsonNullable subsidiaryId = JsonNullable.undefined(); + private JsonNullable subsidiaryId; - private Optional taxRate = Optional.empty(); + private LinkedTaxRate taxRate; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional totalAmount = Optional.empty(); + private Double totalAmount; - private Optional billable = Optional.empty(); + private Boolean billable; - private JsonNullable lineNumber = JsonNullable.undefined(); + private JsonNullable lineNumber; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** * The unique identifier for the ledger account. */ - public Builder accountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - - /** - * The unique identifier for the ledger account. - */ - public Builder accountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public Builder accountId(@Nullable String accountId) { this.accountId = accountId; return this; } - - /** - * The ID of the customer this expense item is linked to. - */ - public Builder customerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - /** * The ID of the customer this expense item is linked to. */ - public Builder customerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public Builder customerId(@Nullable String customerId) { this.customerId = customerId; return this; } - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - /** * The ID of the location */ - public Builder locationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public Builder locationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public Builder locationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } - - /** * The ID of the subsidiary */ - public Builder subsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public Builder subsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public Builder subsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } - - - public Builder taxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - /** * The expense line item description */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The expense line item description - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * The total amount of the expense line item. - */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - /** * The total amount of the expense line item. */ - public Builder totalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = totalAmount; return this; } - /** * Boolean that indicates if the line item is billable or not. */ - public Builder billable(boolean billable) { - Utils.checkNotNull(billable, "billable"); - this.billable = Optional.ofNullable(billable); - return this; - } - - /** - * Boolean that indicates if the line item is billable or not. - */ - public Builder billable(Optional billable) { - Utils.checkNotNull(billable, "billable"); + public Builder billable(@Nullable Boolean billable) { this.billable = billable; return this; } - /** * Line number of the resource */ - public Builder lineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public Builder lineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public Builder lineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } - public ExpenseLineItem build() { - return new ExpenseLineItem( id, trackingCategories, accountId, customerId, departmentId, locationId, diff --git a/src/main/java/com/apideck/unify/models/components/ExpenseLineItemInput.java b/src/main/java/com/apideck/unify/models/components/ExpenseLineItemInput.java index 5bd3cff3..ad5b9e75 100644 --- a/src/main/java/com/apideck/unify/models/components/ExpenseLineItemInput.java +++ b/src/main/java/com/apideck/unify/models/components/ExpenseLineItemInput.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,21 +25,21 @@ public class ExpenseLineItemInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; /** * The unique identifier for the ledger account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("account_id") - private Optional accountId; + private String accountId; /** * The ID of the customer this expense item is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer_id") - private Optional customerId; + private String customerId; /** * The ID of the department @@ -66,7 +65,7 @@ public class ExpenseLineItemInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRateInput taxRate; /** * The expense line item description @@ -80,14 +79,14 @@ public class ExpenseLineItemInput { */ @JsonInclude(Include.ALWAYS) @JsonProperty("total_amount") - private Optional totalAmount; + private JsonNullable totalAmount; /** * Boolean that indicates if the line item is billable or not. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("billable") - private Optional billable; + private Boolean billable; /** * Line number of the resource @@ -98,133 +97,115 @@ public class ExpenseLineItemInput { @JsonCreator public ExpenseLineItemInput( - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("account_id") Optional accountId, - @JsonProperty("customer_id") Optional customerId, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("location_id") JsonNullable locationId, - @JsonProperty("subsidiary_id") JsonNullable subsidiaryId, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("description") JsonNullable description, - @JsonProperty("total_amount") Optional totalAmount, - @JsonProperty("billable") Optional billable, - @JsonProperty("line_number") JsonNullable lineNumber) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(accountId, "accountId"); - Utils.checkNotNull(customerId, "customerId"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(locationId, "locationId"); - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(billable, "billable"); - Utils.checkNotNull(lineNumber, "lineNumber"); - this.trackingCategories = trackingCategories; + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("account_id") @Nullable String accountId, + @JsonProperty("customer_id") @Nullable String customerId, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("location_id") @Nullable JsonNullable locationId, + @JsonProperty("subsidiary_id") @Nullable JsonNullable subsidiaryId, + @JsonProperty("tax_rate") @Nullable LinkedTaxRateInput taxRate, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("total_amount") @Nullable Double totalAmount, + @JsonProperty("billable") @Nullable Boolean billable, + @JsonProperty("line_number") @Nullable JsonNullable lineNumber) { + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); this.accountId = accountId; this.customerId = customerId; - this.departmentId = departmentId; - this.locationId = locationId; - this.subsidiaryId = subsidiaryId; + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); + this.locationId = Optional.ofNullable(locationId) + .orElse(JsonNullable.undefined()); + this.subsidiaryId = Optional.ofNullable(subsidiaryId) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; - this.description = description; - this.totalAmount = totalAmount; + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.totalAmount = JsonNullable.of(totalAmount); this.billable = billable; - this.lineNumber = lineNumber; + this.lineNumber = Optional.ofNullable(lineNumber) + .orElse(JsonNullable.undefined()); } public ExpenseLineItemInput() { - this(JsonNullable.undefined(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } /** * The unique identifier for the ledger account. */ - @JsonIgnore public Optional accountId() { - return accountId; + return Optional.ofNullable(this.accountId); } /** * The ID of the customer this expense item is linked to. */ - @JsonIgnore public Optional customerId() { - return customerId; + return Optional.ofNullable(this.customerId); } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } /** * The ID of the location */ - @JsonIgnore public JsonNullable locationId() { - return locationId; + return this.locationId; } /** * The ID of the subsidiary */ - @JsonIgnore public JsonNullable subsidiaryId() { - return subsidiaryId; + return this.subsidiaryId; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } /** * The expense line item description */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The total amount of the expense line item. */ - @JsonIgnore - public Optional totalAmount() { - return totalAmount; + public JsonNullable totalAmount() { + return this.totalAmount; } /** * Boolean that indicates if the line item is billable or not. */ - @JsonIgnore public Optional billable() { - return billable; + return Optional.ofNullable(this.billable); } /** * Line number of the resource */ - @JsonIgnore public JsonNullable lineNumber() { - return lineNumber; + return this.lineNumber; } public static Builder builder() { @@ -235,150 +216,68 @@ public static Builder builder() { /** * A list of linked tracking categories. */ - public ExpenseLineItemInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public ExpenseLineItemInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public ExpenseLineItemInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** - * The unique identifier for the ledger account. - */ - public ExpenseLineItemInput withAccountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - /** * The unique identifier for the ledger account. */ - public ExpenseLineItemInput withAccountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public ExpenseLineItemInput withAccountId(@Nullable String accountId) { this.accountId = accountId; return this; } - /** - * The ID of the customer this expense item is linked to. - */ - public ExpenseLineItemInput withCustomerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - /** * The ID of the customer this expense item is linked to. */ - public ExpenseLineItemInput withCustomerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public ExpenseLineItemInput withCustomerId(@Nullable String customerId) { this.customerId = customerId; return this; } + /** * The ID of the department */ - public ExpenseLineItemInput withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public ExpenseLineItemInput withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public ExpenseLineItemInput withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } /** * The ID of the location */ - public ExpenseLineItemInput withLocationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public ExpenseLineItemInput withLocationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public ExpenseLineItemInput withLocationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } /** * The ID of the subsidiary */ - public ExpenseLineItemInput withSubsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public ExpenseLineItemInput withSubsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public ExpenseLineItemInput withSubsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } - public ExpenseLineItemInput withTaxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - - public ExpenseLineItemInput withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public ExpenseLineItemInput withTaxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - /** - * The expense line item description - */ - public ExpenseLineItemInput withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = JsonNullable.of(description); - return this; - } /** * The expense line item description */ - public ExpenseLineItemInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * The total amount of the expense line item. - */ - public ExpenseLineItemInput withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); + public ExpenseLineItemInput withDescription(@Nullable String description) { + this.description = JsonNullable.of(description); return this; } @@ -386,18 +285,8 @@ public ExpenseLineItemInput withTotalAmount(double totalAmount) { /** * The total amount of the expense line item. */ - public ExpenseLineItemInput withTotalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - /** - * Boolean that indicates if the line item is billable or not. - */ - public ExpenseLineItemInput withBillable(boolean billable) { - Utils.checkNotNull(billable, "billable"); - this.billable = Optional.ofNullable(billable); + public ExpenseLineItemInput withTotalAmount(@Nullable Double totalAmount) { + this.totalAmount = JsonNullable.of(totalAmount); return this; } @@ -405,29 +294,20 @@ public ExpenseLineItemInput withBillable(boolean billable) { /** * Boolean that indicates if the line item is billable or not. */ - public ExpenseLineItemInput withBillable(Optional billable) { - Utils.checkNotNull(billable, "billable"); + public ExpenseLineItemInput withBillable(@Nullable Boolean billable) { this.billable = billable; return this; } + /** * Line number of the resource */ - public ExpenseLineItemInput withLineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public ExpenseLineItemInput withLineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public ExpenseLineItemInput withLineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -480,237 +360,118 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional accountId = Optional.empty(); + private String accountId; - private Optional customerId = Optional.empty(); + private String customerId; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private JsonNullable locationId = JsonNullable.undefined(); + private JsonNullable locationId; - private JsonNullable subsidiaryId = JsonNullable.undefined(); + private JsonNullable subsidiaryId; - private Optional taxRate = Optional.empty(); + private LinkedTaxRateInput taxRate; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional totalAmount = Optional.empty(); + private Double totalAmount; - private Optional billable = Optional.empty(); + private Boolean billable; - private JsonNullable lineNumber = JsonNullable.undefined(); + private JsonNullable lineNumber; private Builder() { // force use of static builder() method } - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** * The unique identifier for the ledger account. */ - public Builder accountId(String accountId) { - Utils.checkNotNull(accountId, "accountId"); - this.accountId = Optional.ofNullable(accountId); - return this; - } - - /** - * The unique identifier for the ledger account. - */ - public Builder accountId(Optional accountId) { - Utils.checkNotNull(accountId, "accountId"); + public Builder accountId(@Nullable String accountId) { this.accountId = accountId; return this; } - - /** - * The ID of the customer this expense item is linked to. - */ - public Builder customerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - /** * The ID of the customer this expense item is linked to. */ - public Builder customerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public Builder customerId(@Nullable String customerId) { this.customerId = customerId; return this; } - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - /** * The ID of the location */ - public Builder locationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public Builder locationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public Builder locationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } - - /** * The ID of the subsidiary */ - public Builder subsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public Builder subsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public Builder subsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } - - - public Builder taxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - /** * The expense line item description */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The expense line item description - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * The total amount of the expense line item. - */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - /** * The total amount of the expense line item. */ - public Builder totalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = totalAmount; return this; } - - /** - * Boolean that indicates if the line item is billable or not. - */ - public Builder billable(boolean billable) { - Utils.checkNotNull(billable, "billable"); - this.billable = Optional.ofNullable(billable); - return this; - } - /** * Boolean that indicates if the line item is billable or not. */ - public Builder billable(Optional billable) { - Utils.checkNotNull(billable, "billable"); + public Builder billable(@Nullable Boolean billable) { this.billable = billable; return this; } - /** * Line number of the resource */ - public Builder lineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public Builder lineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public Builder lineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } - public ExpenseLineItemInput build() { - return new ExpenseLineItemInput( trackingCategories, accountId, customerId, departmentId, locationId, subsidiaryId, diff --git a/src/main/java/com/apideck/unify/models/components/Expenses.java b/src/main/java/com/apideck/unify/models/components/Expenses.java index 5e63ae22..6a3d328d 100644 --- a/src/main/java/com/apideck/unify/models/components/Expenses.java +++ b/src/main/java/com/apideck/unify/models/components/Expenses.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -28,35 +28,35 @@ public class Expenses { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The account code of the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * The name of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") - private Optional title; + private String title; /** * The type of profit and loss */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The aggregated total of all accounts within this category. */ @JsonInclude(Include.ALWAYS) @JsonProperty("total") - private Optional total; + private JsonNullable total; @JsonProperty("records") @@ -64,76 +64,65 @@ public class Expenses { @JsonCreator public Expenses( - @JsonProperty("id") Optional id, - @JsonProperty("code") Optional code, - @JsonProperty("title") Optional title, - @JsonProperty("type") JsonNullable type, - @JsonProperty("total") Optional total, - @JsonProperty("records") Object records) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(records, "records"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("code") @Nullable String code, + @JsonProperty("title") @Nullable String title, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("total") @Nullable Double total, + @JsonProperty("records") @Nonnull Object records) { this.id = id; this.code = code; this.title = title; - this.type = type; - this.total = total; - this.records = records; + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.total = JsonNullable.of(total); + this.records = Optional.ofNullable(records) + .orElseThrow(() -> new IllegalArgumentException("records cannot be null")); } public Expenses( - Object records) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), records); + @Nonnull Object records) { + this(null, null, null, + null, null, records); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The account code of the account */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * The name of the account. */ - @JsonIgnore public Optional title() { - return title; + return Optional.ofNullable(this.title); } /** * The type of profit and loss */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The aggregated total of all accounts within this category. */ - @JsonIgnore - public Optional total() { - return total; + public JsonNullable total() { + return this.total; } - @JsonIgnore public Object records() { - return records; + return this.records; } public static Builder builder() { @@ -144,102 +133,53 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Expenses withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Expenses withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Expenses withId(@Nullable String id) { this.id = id; return this; } - /** - * The account code of the account - */ - public Expenses withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The account code of the account */ - public Expenses withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public Expenses withCode(@Nullable String code) { this.code = code; return this; } - /** - * The name of the account. - */ - public Expenses withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public Expenses withTitle(Optional title) { - Utils.checkNotNull(title, "title"); + public Expenses withTitle(@Nullable String title) { this.title = title; return this; } + /** * The type of profit and loss */ - public Expenses withType(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public Expenses withType(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public Expenses withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The aggregated total of all accounts within this category. */ - public Expenses withTotal(double total) { - Utils.checkNotNull(total, "total"); - this.total = Optional.ofNullable(total); + public Expenses withTotal(@Nullable Double total) { + this.total = JsonNullable.of(total); return this; } - /** - * The aggregated total of all accounts within this category. - */ - public Expenses withTotal(Optional total) { - Utils.checkNotNull(total, "total"); - this.total = total; + public Expenses withRecords(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } - public Expenses withRecords(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -280,15 +220,15 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional code = Optional.empty(); + private String code; - private Optional title = Optional.empty(); + private String title; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private Optional total = Optional.empty(); + private Double total; private Object records; @@ -296,110 +236,52 @@ private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The account code of the account */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The account code of the account - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - /** - * The name of the account. - */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = title; return this; } - /** * The type of profit and loss */ - public Builder type(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - - /** - * The aggregated total of all accounts within this category. - */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); - this.total = Optional.ofNullable(total); - return this; - } - /** * The aggregated total of all accounts within this category. */ - public Builder total(Optional total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = total; return this; } - - public Builder records(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; + public Builder records(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } public Expenses build() { - return new Expenses( id, code, title, type, total, records); diff --git a/src/main/java/com/apideck/unify/models/components/ExtendPaths.java b/src/main/java/com/apideck/unify/models/components/ExtendPaths.java index 9922fff8..f969d375 100644 --- a/src/main/java/com/apideck/unify/models/components/ExtendPaths.java +++ b/src/main/java/com/apideck/unify/models/components/ExtendPaths.java @@ -5,11 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; import java.lang.Object; import java.lang.Override; import java.lang.String; +import java.util.Optional; public class ExtendPaths { @@ -27,28 +28,26 @@ public class ExtendPaths { @JsonCreator public ExtendPaths( - @JsonProperty("path") String path, - @JsonProperty("value") Object value) { - Utils.checkNotNull(path, "path"); - Utils.checkNotNull(value, "value"); - this.path = path; - this.value = value; + @JsonProperty("path") @Nonnull String path, + @JsonProperty("value") @Nonnull Object value) { + this.path = Optional.ofNullable(path) + .orElseThrow(() -> new IllegalArgumentException("path cannot be null")); + this.value = Optional.ofNullable(value) + .orElseThrow(() -> new IllegalArgumentException("value cannot be null")); } /** * JSONPath string specifying where to apply the value. */ - @JsonIgnore public String path() { - return path; + return this.path; } /** * The value to set at the specified path, can be any type. */ - @JsonIgnore public Object value() { - return value; + return this.value; } public static Builder builder() { @@ -59,21 +58,21 @@ public static Builder builder() { /** * JSONPath string specifying where to apply the value. */ - public ExtendPaths withPath(String path) { - Utils.checkNotNull(path, "path"); - this.path = path; + public ExtendPaths withPath(@Nonnull String path) { + this.path = Utils.checkNotNull(path, "path"); return this; } + /** * The value to set at the specified path, can be any type. */ - public ExtendPaths withValue(Object value) { - Utils.checkNotNull(value, "value"); - this.value = value; + public ExtendPaths withValue(@Nonnull Object value) { + this.value = Utils.checkNotNull(value, "value"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,28 +111,23 @@ private Builder() { // force use of static builder() method } - /** * JSONPath string specifying where to apply the value. */ - public Builder path(String path) { - Utils.checkNotNull(path, "path"); - this.path = path; + public Builder path(@Nonnull String path) { + this.path = Utils.checkNotNull(path, "path"); return this; } - /** * The value to set at the specified path, can be any type. */ - public Builder value(Object value) { - Utils.checkNotNull(value, "value"); - this.value = value; + public Builder value(@Nonnull Object value) { + this.value = Utils.checkNotNull(value, "value"); return this; } public ExtendPaths build() { - return new ExtendPaths( path, value); } diff --git a/src/main/java/com/apideck/unify/models/components/Fields.java b/src/main/java/com/apideck/unify/models/components/Fields.java index 64ead056..e9ce9699 100644 --- a/src/main/java/com/apideck/unify/models/components/Fields.java +++ b/src/main/java/com/apideck/unify/models/components/Fields.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -22,12 +21,12 @@ public class Fields { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; @JsonInclude(Include.NON_ABSENT) @@ -37,19 +36,19 @@ public class Fields { @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private CustomObjectSchemaType type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("required") - private Optional required; + private Boolean required; /** * Options for select and multiselect types */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("options") - private JsonNullable> options; + private JsonNullable> options; /** * Default value for the field @@ -60,76 +59,63 @@ public class Fields { @JsonCreator public Fields( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("type") Optional type, - @JsonProperty("required") Optional required, - @JsonProperty("options") JsonNullable> options, - @JsonProperty("default_value") JsonNullable defaultValue) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(required, "required"); - Utils.checkNotNull(options, "options"); - Utils.checkNotNull(defaultValue, "defaultValue"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("type") @Nullable CustomObjectSchemaType type, + @JsonProperty("required") @Nullable Boolean required, + @JsonProperty("options") @Nullable JsonNullable> options, + @JsonProperty("default_value") @Nullable JsonNullable defaultValue) { this.id = id; this.name = name; - this.description = description; + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.type = type; this.required = required; - this.options = options; - this.defaultValue = defaultValue; + this.options = Optional.ofNullable(options) + .orElse(JsonNullable.undefined()); + this.defaultValue = Optional.ofNullable(defaultValue) + .orElse(JsonNullable.undefined()); } public Fields() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null); } - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } - @JsonIgnore public Optional required() { - return required; + return Optional.ofNullable(this.required); } /** * Options for select and multiselect types */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> options() { - return (JsonNullable>) options; + return this.options; } /** * Default value for the field */ - @JsonIgnore public JsonNullable defaultValue() { - return defaultValue; + return this.defaultValue; } public static Builder builder() { @@ -137,105 +123,53 @@ public static Builder builder() { } - public Fields withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - public Fields withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Fields withId(@Nullable String id) { this.id = id; return this; } - public Fields withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - public Fields withName(Optional name) { - Utils.checkNotNull(name, "name"); + public Fields withName(@Nullable String name) { this.name = name; return this; } - public Fields withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = JsonNullable.of(description); - return this; - } - - public Fields withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - public Fields withType(CustomObjectSchemaType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); + public Fields withDescription(@Nullable String description) { + this.description = JsonNullable.of(description); return this; } - public Fields withType(Optional type) { - Utils.checkNotNull(type, "type"); + public Fields withType(@Nullable CustomObjectSchemaType type) { this.type = type; return this; } - public Fields withRequired(boolean required) { - Utils.checkNotNull(required, "required"); - this.required = Optional.ofNullable(required); - return this; - } - - public Fields withRequired(Optional required) { - Utils.checkNotNull(required, "required"); + public Fields withRequired(@Nullable Boolean required) { this.required = required; return this; } + /** * Options for select and multiselect types */ - public Fields withOptions(List options) { - Utils.checkNotNull(options, "options"); + public Fields withOptions(@Nullable List options) { this.options = JsonNullable.of(options); return this; } - /** - * Options for select and multiselect types - */ - public Fields withOptions(JsonNullable> options) { - Utils.checkNotNull(options, "options"); - this.options = options; - return this; - } /** * Default value for the field */ - public Fields withDefaultValue(String defaultValue) { - Utils.checkNotNull(defaultValue, "defaultValue"); + public Fields withDefaultValue(@Nullable String defaultValue) { this.defaultValue = JsonNullable.of(defaultValue); return this; } - /** - * Default value for the field - */ - public Fields withDefaultValue(JsonNullable defaultValue) { - Utils.checkNotNull(defaultValue, "defaultValue"); - this.defaultValue = defaultValue; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,129 +213,66 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional type = Optional.empty(); + private CustomObjectSchemaType type; - private Optional required = Optional.empty(); + private Boolean required; - private JsonNullable> options = JsonNullable.undefined(); + private JsonNullable> options; - private JsonNullable defaultValue = JsonNullable.undefined(); + private JsonNullable defaultValue; private Builder() { // force use of static builder() method } - - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - public Builder type(CustomObjectSchemaType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable CustomObjectSchemaType type) { this.type = type; return this; } - - public Builder required(boolean required) { - Utils.checkNotNull(required, "required"); - this.required = Optional.ofNullable(required); - return this; - } - - public Builder required(Optional required) { - Utils.checkNotNull(required, "required"); + public Builder required(@Nullable Boolean required) { this.required = required; return this; } - /** * Options for select and multiselect types */ - public Builder options(List options) { - Utils.checkNotNull(options, "options"); + public Builder options(@Nullable List options) { this.options = JsonNullable.of(options); return this; } - /** - * Options for select and multiselect types - */ - public Builder options(JsonNullable> options) { - Utils.checkNotNull(options, "options"); - this.options = options; - return this; - } - - /** * Default value for the field */ - public Builder defaultValue(String defaultValue) { - Utils.checkNotNull(defaultValue, "defaultValue"); + public Builder defaultValue(@Nullable String defaultValue) { this.defaultValue = JsonNullable.of(defaultValue); return this; } - /** - * Default value for the field - */ - public Builder defaultValue(JsonNullable defaultValue) { - Utils.checkNotNull(defaultValue, "defaultValue"); - this.defaultValue = defaultValue; - return this; - } - public Fields build() { - return new Fields( id, name, description, type, required, options, diff --git a/src/main/java/com/apideck/unify/models/components/FilesFilter.java b/src/main/java/com/apideck/unify/models/components/FilesFilter.java index 60344b46..f2d23210 100644 --- a/src/main/java/com/apideck/unify/models/components/FilesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/FilesFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -18,59 +18,53 @@ public class FilesFilter { * ID of the drive to filter on */ @SpeakeasyMetadata("queryParam:name=drive_id") - private Optional driveId; + private String driveId; /** * ID of the folder to filter on. The root folder has an alias "root" */ @SpeakeasyMetadata("queryParam:name=folder_id") - private Optional folderId; + private String folderId; /** * Only return files and folders that are shared */ @SpeakeasyMetadata("queryParam:name=shared") - private Optional shared; + private Boolean shared; @JsonCreator public FilesFilter( - Optional driveId, - Optional folderId, - Optional shared) { - Utils.checkNotNull(driveId, "driveId"); - Utils.checkNotNull(folderId, "folderId"); - Utils.checkNotNull(shared, "shared"); + @Nullable String driveId, + @Nullable String folderId, + @Nullable Boolean shared) { this.driveId = driveId; this.folderId = folderId; this.shared = shared; } public FilesFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } /** * ID of the drive to filter on */ - @JsonIgnore public Optional driveId() { - return driveId; + return Optional.ofNullable(this.driveId); } /** * ID of the folder to filter on. The root folder has an alias "root" */ - @JsonIgnore public Optional folderId() { - return folderId; + return Optional.ofNullable(this.folderId); } /** * Only return files and folders that are shared */ - @JsonIgnore public Optional shared() { - return shared; + return Optional.ofNullable(this.shared); } public static Builder builder() { @@ -81,60 +75,30 @@ public static Builder builder() { /** * ID of the drive to filter on */ - public FilesFilter withDriveId(String driveId) { - Utils.checkNotNull(driveId, "driveId"); - this.driveId = Optional.ofNullable(driveId); - return this; - } - - - /** - * ID of the drive to filter on - */ - public FilesFilter withDriveId(Optional driveId) { - Utils.checkNotNull(driveId, "driveId"); + public FilesFilter withDriveId(@Nullable String driveId) { this.driveId = driveId; return this; } - /** - * ID of the folder to filter on. The root folder has an alias "root" - */ - public FilesFilter withFolderId(String folderId) { - Utils.checkNotNull(folderId, "folderId"); - this.folderId = Optional.ofNullable(folderId); - return this; - } - /** * ID of the folder to filter on. The root folder has an alias "root" */ - public FilesFilter withFolderId(Optional folderId) { - Utils.checkNotNull(folderId, "folderId"); + public FilesFilter withFolderId(@Nullable String folderId) { this.folderId = folderId; return this; } - /** - * Only return files and folders that are shared - */ - public FilesFilter withShared(boolean shared) { - Utils.checkNotNull(shared, "shared"); - this.shared = Optional.ofNullable(shared); - return this; - } - /** * Only return files and folders that are shared */ - public FilesFilter withShared(Optional shared) { - Utils.checkNotNull(shared, "shared"); + public FilesFilter withShared(@Nullable Boolean shared) { this.shared = shared; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -167,75 +131,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional driveId = Optional.empty(); + private String driveId; - private Optional folderId = Optional.empty(); + private String folderId; - private Optional shared = Optional.empty(); + private Boolean shared; private Builder() { // force use of static builder() method } - - /** - * ID of the drive to filter on - */ - public Builder driveId(String driveId) { - Utils.checkNotNull(driveId, "driveId"); - this.driveId = Optional.ofNullable(driveId); - return this; - } - /** * ID of the drive to filter on */ - public Builder driveId(Optional driveId) { - Utils.checkNotNull(driveId, "driveId"); + public Builder driveId(@Nullable String driveId) { this.driveId = driveId; return this; } - /** * ID of the folder to filter on. The root folder has an alias "root" */ - public Builder folderId(String folderId) { - Utils.checkNotNull(folderId, "folderId"); - this.folderId = Optional.ofNullable(folderId); - return this; - } - - /** - * ID of the folder to filter on. The root folder has an alias "root" - */ - public Builder folderId(Optional folderId) { - Utils.checkNotNull(folderId, "folderId"); + public Builder folderId(@Nullable String folderId) { this.folderId = folderId; return this; } - - /** - * Only return files and folders that are shared - */ - public Builder shared(boolean shared) { - Utils.checkNotNull(shared, "shared"); - this.shared = Optional.ofNullable(shared); - return this; - } - /** * Only return files and folders that are shared */ - public Builder shared(Optional shared) { - Utils.checkNotNull(shared, "shared"); + public Builder shared(@Nullable Boolean shared) { this.shared = shared; return this; } public FilesFilter build() { - return new FilesFilter( driveId, folderId, shared); } diff --git a/src/main/java/com/apideck/unify/models/components/FilesSearch.java b/src/main/java/com/apideck/unify/models/components/FilesSearch.java index a454f72f..b2fbd0fb 100644 --- a/src/main/java/com/apideck/unify/models/components/FilesSearch.java +++ b/src/main/java/com/apideck/unify/models/components/FilesSearch.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -28,56 +28,50 @@ public class FilesSearch { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("drive_id") - private Optional driveId; + private String driveId; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public FilesSearch( - @JsonProperty("query") String query, - @JsonProperty("drive_id") Optional driveId, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(query, "query"); - Utils.checkNotNull(driveId, "driveId"); - Utils.checkNotNull(passThrough, "passThrough"); - this.query = query; + @JsonProperty("query") @Nonnull String query, + @JsonProperty("drive_id") @Nullable String driveId, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.query = Optional.ofNullable(query) + .orElseThrow(() -> new IllegalArgumentException("query cannot be null")); this.driveId = driveId; this.passThrough = passThrough; } public FilesSearch( - String query) { - this(query, Optional.empty(), Optional.empty()); + @Nonnull String query) { + this(query, null, null); } /** * The query to search for. May match across multiple fields. */ - @JsonIgnore public String query() { - return query; + return this.query; } /** * ID of the drive to filter on */ - @JsonIgnore public Optional driveId() { - return driveId; + return Optional.ofNullable(this.driveId); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -88,18 +82,8 @@ public static Builder builder() { /** * The query to search for. May match across multiple fields. */ - public FilesSearch withQuery(String query) { - Utils.checkNotNull(query, "query"); - this.query = query; - return this; - } - - /** - * ID of the drive to filter on - */ - public FilesSearch withDriveId(String driveId) { - Utils.checkNotNull(driveId, "driveId"); - this.driveId = Optional.ofNullable(driveId); + public FilesSearch withQuery(@Nonnull String query) { + this.query = Utils.checkNotNull(query, "query"); return this; } @@ -107,31 +91,21 @@ public FilesSearch withDriveId(String driveId) { /** * ID of the drive to filter on */ - public FilesSearch withDriveId(Optional driveId) { - Utils.checkNotNull(driveId, "driveId"); + public FilesSearch withDriveId(@Nullable String driveId) { this.driveId = driveId; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public FilesSearch withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public FilesSearch withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public FilesSearch withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -166,64 +140,39 @@ public final static class Builder { private String query; - private Optional driveId = Optional.empty(); + private String driveId; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The query to search for. May match across multiple fields. */ - public Builder query(String query) { - Utils.checkNotNull(query, "query"); - this.query = query; + public Builder query(@Nonnull String query) { + this.query = Utils.checkNotNull(query, "query"); return this; } - /** * ID of the drive to filter on */ - public Builder driveId(String driveId) { - Utils.checkNotNull(driveId, "driveId"); - this.driveId = Optional.ofNullable(driveId); - return this; - } - - /** - * ID of the drive to filter on - */ - public Builder driveId(Optional driveId) { - Utils.checkNotNull(driveId, "driveId"); + public Builder driveId(@Nullable String driveId) { this.driveId = driveId; return this; } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public FilesSearch build() { - return new FilesSearch( query, driveId, passThrough); } diff --git a/src/main/java/com/apideck/unify/models/components/FilesSort.java b/src/main/java/com/apideck/unify/models/components/FilesSort.java index 19494188..f720b2d2 100644 --- a/src/main/java/com/apideck/unify/models/components/FilesSort.java +++ b/src/main/java/com/apideck/unify/models/components/FilesSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class FilesSort { * The field on which to sort the Files */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private FilesSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public FilesSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable FilesSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public FilesSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Files */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Files */ - public FilesSort withBy(FilesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Files - */ - public FilesSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public FilesSort withBy(@Nullable FilesSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public FilesSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public FilesSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public FilesSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private FilesSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Files - */ - public Builder by(FilesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Files */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable FilesSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public FilesSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new FilesSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/Folder.java b/src/main/java/com/apideck/unify/models/components/Folder.java index 09290b54..5129e066 100644 --- a/src/main/java/com/apideck/unify/models/components/Folder.java +++ b/src/main/java/com/apideck/unify/models/components/Folder.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -28,7 +28,7 @@ public class Folder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the folder @@ -60,7 +60,7 @@ public class Folder { @JsonInclude(Include.NON_ABSENT) @JsonProperty("owner") - private Optional owner; + private Owner owner; /** * The parent folders of the file, starting from the root @@ -73,14 +73,14 @@ public class Folder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("parent_folders_complete") - private Optional parentFoldersComplete; + private Boolean parentFoldersComplete; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -112,158 +112,140 @@ public class Folder { @JsonCreator public Folder( - @JsonProperty("id") Optional id, - @JsonProperty("name") String name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("path") JsonNullable path, - @JsonProperty("size") JsonNullable size, - @JsonProperty("owner") Optional owner, - @JsonProperty("parent_folders") List parentFolders, - @JsonProperty("parent_folders_complete") Optional parentFoldersComplete, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(path, "path"); - Utils.checkNotNull(size, "size"); - Utils.checkNotNull(owner, "owner"); - Utils.checkNotNull(parentFolders, "parentFolders"); - Utils.checkNotNull(parentFoldersComplete, "parentFoldersComplete"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nonnull String name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("path") @Nullable JsonNullable path, + @JsonProperty("size") @Nullable JsonNullable size, + @JsonProperty("owner") @Nullable Owner owner, + @JsonProperty("parent_folders") @Nonnull List parentFolders, + @JsonProperty("parent_folders_complete") @Nullable Boolean parentFoldersComplete, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt) { this.id = id; - this.name = name; - this.description = description; - this.path = path; - this.size = size; + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.path = Optional.ofNullable(path) + .orElse(JsonNullable.undefined()); + this.size = Optional.ofNullable(size) + .orElse(JsonNullable.undefined()); this.owner = owner; - this.parentFolders = parentFolders; + this.parentFolders = Optional.ofNullable(parentFolders) + .orElseThrow(() -> new IllegalArgumentException("parentFolders cannot be null")); this.parentFoldersComplete = parentFoldersComplete; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); } public Folder( - String name, - List parentFolders) { - this(Optional.empty(), name, JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - parentFolders, Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + @Nonnull String name, + @Nonnull List parentFolders) { + this(null, name, null, + null, null, null, + parentFolders, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the folder */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * Optional description of the folder */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The full path of the folder (includes the folder name) */ - @JsonIgnore public JsonNullable path() { - return path; + return this.path; } /** * The size of the folder in bytes */ - @JsonIgnore public JsonNullable size() { - return size; + return this.size; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional owner() { - return (Optional) owner; + return Optional.ofNullable(this.owner); } /** * The parent folders of the file, starting from the root */ - @JsonIgnore public List parentFolders() { - return parentFolders; + return this.parentFolders; } /** * Whether the list of parent folder is complete. Some connectors only return the direct parent of a folder */ - @JsonIgnore public Optional parentFoldersComplete() { - return parentFoldersComplete; + return Optional.ofNullable(this.parentFoldersComplete); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } public static Builder builder() { @@ -274,113 +256,59 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Folder withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Folder withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Folder withId(@Nullable String id) { this.id = id; return this; } + /** * The name of the folder */ - public Folder withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Folder withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } + /** * Optional description of the folder */ - public Folder withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Folder withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Optional description of the folder - */ - public Folder withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The full path of the folder (includes the folder name) */ - public Folder withPath(String path) { - Utils.checkNotNull(path, "path"); + public Folder withPath(@Nullable String path) { this.path = JsonNullable.of(path); return this; } - /** - * The full path of the folder (includes the folder name) - */ - public Folder withPath(JsonNullable path) { - Utils.checkNotNull(path, "path"); - this.path = path; - return this; - } /** * The size of the folder in bytes */ - public Folder withSize(long size) { - Utils.checkNotNull(size, "size"); + public Folder withSize(@Nullable Long size) { this.size = JsonNullable.of(size); return this; } - /** - * The size of the folder in bytes - */ - public Folder withSize(JsonNullable size) { - Utils.checkNotNull(size, "size"); - this.size = size; - return this; - } - - public Folder withOwner(Owner owner) { - Utils.checkNotNull(owner, "owner"); - this.owner = Optional.ofNullable(owner); - return this; - } - - public Folder withOwner(Optional owner) { - Utils.checkNotNull(owner, "owner"); + public Folder withOwner(@Nullable Owner owner) { this.owner = owner; return this; } - /** - * The parent folders of the file, starting from the root - */ - public Folder withParentFolders(List parentFolders) { - Utils.checkNotNull(parentFolders, "parentFolders"); - this.parentFolders = parentFolders; - return this; - } /** - * Whether the list of parent folder is complete. Some connectors only return the direct parent of a folder + * The parent folders of the file, starting from the root */ - public Folder withParentFoldersComplete(boolean parentFoldersComplete) { - Utils.checkNotNull(parentFoldersComplete, "parentFoldersComplete"); - this.parentFoldersComplete = Optional.ofNullable(parentFoldersComplete); + public Folder withParentFolders(@Nonnull List parentFolders) { + this.parentFolders = Utils.checkNotNull(parentFolders, "parentFolders"); return this; } @@ -388,101 +316,56 @@ public Folder withParentFoldersComplete(boolean parentFoldersComplete) { /** * Whether the list of parent folder is complete. Some connectors only return the direct parent of a folder */ - public Folder withParentFoldersComplete(Optional parentFoldersComplete) { - Utils.checkNotNull(parentFoldersComplete, "parentFoldersComplete"); + public Folder withParentFoldersComplete(@Nullable Boolean parentFoldersComplete) { this.parentFoldersComplete = parentFoldersComplete; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public Folder withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Folder withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Folder withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public Folder withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Folder withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Folder withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Folder withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Folder withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Folder withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Folder withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Folder withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Folder withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Folder withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Folder withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Folder withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -540,261 +423,138 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private String name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable path = JsonNullable.undefined(); + private JsonNullable path; - private JsonNullable size = JsonNullable.undefined(); + private JsonNullable size; - private Optional owner = Optional.empty(); + private Owner owner; private List parentFolders; - private Optional parentFoldersComplete = Optional.empty(); + private Boolean parentFoldersComplete; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the folder */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** * Optional description of the folder */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Optional description of the folder - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The full path of the folder (includes the folder name) */ - public Builder path(String path) { - Utils.checkNotNull(path, "path"); + public Builder path(@Nullable String path) { this.path = JsonNullable.of(path); return this; } - /** - * The full path of the folder (includes the folder name) - */ - public Builder path(JsonNullable path) { - Utils.checkNotNull(path, "path"); - this.path = path; - return this; - } - - /** * The size of the folder in bytes */ - public Builder size(long size) { - Utils.checkNotNull(size, "size"); + public Builder size(@Nullable Long size) { this.size = JsonNullable.of(size); return this; } - /** - * The size of the folder in bytes - */ - public Builder size(JsonNullable size) { - Utils.checkNotNull(size, "size"); - this.size = size; - return this; - } - - - public Builder owner(Owner owner) { - Utils.checkNotNull(owner, "owner"); - this.owner = Optional.ofNullable(owner); - return this; - } - - public Builder owner(Optional owner) { - Utils.checkNotNull(owner, "owner"); + public Builder owner(@Nullable Owner owner) { this.owner = owner; return this; } - /** * The parent folders of the file, starting from the root */ - public Builder parentFolders(List parentFolders) { - Utils.checkNotNull(parentFolders, "parentFolders"); - this.parentFolders = parentFolders; + public Builder parentFolders(@Nonnull List parentFolders) { + this.parentFolders = Utils.checkNotNull(parentFolders, "parentFolders"); return this; } - /** * Whether the list of parent folder is complete. Some connectors only return the direct parent of a folder */ - public Builder parentFoldersComplete(boolean parentFoldersComplete) { - Utils.checkNotNull(parentFoldersComplete, "parentFoldersComplete"); - this.parentFoldersComplete = Optional.ofNullable(parentFoldersComplete); - return this; - } - - /** - * Whether the list of parent folder is complete. Some connectors only return the direct parent of a folder - */ - public Builder parentFoldersComplete(Optional parentFoldersComplete) { - Utils.checkNotNull(parentFoldersComplete, "parentFoldersComplete"); + public Builder parentFoldersComplete(@Nullable Boolean parentFoldersComplete) { this.parentFoldersComplete = parentFoldersComplete; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - public Folder build() { - return new Folder( id, name, description, path, size, owner, diff --git a/src/main/java/com/apideck/unify/models/components/FormField.java b/src/main/java/com/apideck/unify/models/components/FormField.java index 66f48442..8736a0d9 100644 --- a/src/main/java/com/apideck/unify/models/components/FormField.java +++ b/src/main/java/com/apideck/unify/models/components/FormField.java @@ -6,15 +6,14 @@ import com.apideck.unify.utils.LazySingletonValue; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,14 +25,14 @@ public class FormField { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The label of the field */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("label") - private Optional label; + private String label; /** * The placeholder for the form field @@ -52,26 +51,26 @@ public class FormField { @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private FormFieldType type; /** * Indicates if the form field is required, which means it must be filled in before the form can be submitted */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("required") - private Optional required; + private Boolean required; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_field") - private Optional customField; + private Boolean customField; /** * Only applicable to select fields. Allow the user to add a custom value though the option select if the desired value is not in the option select list. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("allow_custom_values") - private Optional allowCustomValues; + private Boolean allowCustomValues; /** * Indicates if the form field is displayed in a “read-only” mode. @@ -118,176 +117,153 @@ public class FormField { @JsonInclude(Include.NON_ABSENT) @JsonProperty("options") - private Optional> options; + private List options; @JsonCreator public FormField( - @JsonProperty("id") Optional id, - @JsonProperty("label") Optional label, - @JsonProperty("placeholder") JsonNullable placeholder, - @JsonProperty("description") JsonNullable description, - @JsonProperty("type") Optional type, - @JsonProperty("required") Optional required, - @JsonProperty("custom_field") Optional customField, - @JsonProperty("allow_custom_values") Optional allowCustomValues, - @JsonProperty("disabled") JsonNullable disabled, - @JsonProperty("hidden") JsonNullable hidden, - @JsonProperty("deprecated") JsonNullable deprecated, - @JsonProperty("sensitive") JsonNullable sensitive, - @JsonProperty("prefix") JsonNullable prefix, - @JsonProperty("suffix") JsonNullable suffix, - @JsonProperty("options") Optional> options) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(label, "label"); - Utils.checkNotNull(placeholder, "placeholder"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(required, "required"); - Utils.checkNotNull(customField, "customField"); - Utils.checkNotNull(allowCustomValues, "allowCustomValues"); - Utils.checkNotNull(disabled, "disabled"); - Utils.checkNotNull(hidden, "hidden"); - Utils.checkNotNull(deprecated, "deprecated"); - Utils.checkNotNull(sensitive, "sensitive"); - Utils.checkNotNull(prefix, "prefix"); - Utils.checkNotNull(suffix, "suffix"); - Utils.checkNotNull(options, "options"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("label") @Nullable String label, + @JsonProperty("placeholder") @Nullable JsonNullable placeholder, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("type") @Nullable FormFieldType type, + @JsonProperty("required") @Nullable Boolean required, + @JsonProperty("custom_field") @Nullable Boolean customField, + @JsonProperty("allow_custom_values") @Nullable Boolean allowCustomValues, + @JsonProperty("disabled") @Nullable JsonNullable disabled, + @JsonProperty("hidden") @Nullable JsonNullable hidden, + @JsonProperty("deprecated") @Nullable JsonNullable deprecated, + @JsonProperty("sensitive") @Nullable JsonNullable sensitive, + @JsonProperty("prefix") @Nullable JsonNullable prefix, + @JsonProperty("suffix") @Nullable JsonNullable suffix, + @JsonProperty("options") @Nullable List options) { this.id = id; this.label = label; - this.placeholder = placeholder; - this.description = description; + this.placeholder = Optional.ofNullable(placeholder) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.type = type; this.required = required; this.customField = customField; - this.allowCustomValues = allowCustomValues; - this.disabled = disabled; - this.hidden = hidden; - this.deprecated = deprecated; - this.sensitive = sensitive; - this.prefix = prefix; - this.suffix = suffix; + this.allowCustomValues = Optional.ofNullable(allowCustomValues) + .orElse(Builder._SINGLETON_VALUE_AllowCustomValues.value()); + this.disabled = Optional.ofNullable(disabled) + .orElse(JsonNullable.undefined()); + this.hidden = Optional.ofNullable(hidden) + .orElse(JsonNullable.undefined()); + this.deprecated = Optional.ofNullable(deprecated) + .orElse(JsonNullable.undefined()); + this.sensitive = Optional.ofNullable(sensitive) + .orElse(JsonNullable.undefined()); + this.prefix = Optional.ofNullable(prefix) + .orElse(JsonNullable.undefined()); + this.suffix = Optional.ofNullable(suffix) + .orElse(JsonNullable.undefined()); this.options = options; } public FormField() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * The unique identifier of the form field. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The label of the field */ - @JsonIgnore public Optional label() { - return label; + return Optional.ofNullable(this.label); } /** * The placeholder for the form field */ - @JsonIgnore public JsonNullable placeholder() { - return placeholder; + return this.placeholder; } /** * The description of the form field */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } /** * Indicates if the form field is required, which means it must be filled in before the form can be submitted */ - @JsonIgnore public Optional required() { - return required; + return Optional.ofNullable(this.required); } - @JsonIgnore public Optional customField() { - return customField; + return Optional.ofNullable(this.customField); } /** * Only applicable to select fields. Allow the user to add a custom value though the option select if the desired value is not in the option select list. */ - @JsonIgnore public Optional allowCustomValues() { - return allowCustomValues; + return Optional.ofNullable(this.allowCustomValues); } /** * Indicates if the form field is displayed in a “read-only” mode. */ - @JsonIgnore public JsonNullable disabled() { - return disabled; + return this.disabled; } /** * Indicates if the form field is not displayed but the value that is being stored on the connection. */ - @JsonIgnore public JsonNullable hidden() { - return hidden; + return this.hidden; } /** * When the setting is deprecated, it should be hidden from the user interface. The value will still be stored on the connection for the sake of backwards compatibility. */ - @JsonIgnore public JsonNullable deprecated() { - return deprecated; + return this.deprecated; } /** * Indicates if the form field contains sensitive data, which will display the value as a masked input. */ - @JsonIgnore public JsonNullable sensitive() { - return sensitive; + return this.sensitive; } /** * Prefix to display in front of the form field. */ - @JsonIgnore public JsonNullable prefix() { - return prefix; + return this.prefix; } /** * Suffix to display next to the form field. */ - @JsonIgnore public JsonNullable suffix() { - return suffix; + return this.suffix; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> options() { - return (Optional>) options; + return Optional.ofNullable(this.options); } public static Builder builder() { @@ -298,262 +274,129 @@ public static Builder builder() { /** * The unique identifier of the form field. */ - public FormField withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier of the form field. - */ - public FormField withId(Optional id) { - Utils.checkNotNull(id, "id"); + public FormField withId(@Nullable String id) { this.id = id; return this; } - /** - * The label of the field - */ - public FormField withLabel(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - /** * The label of the field */ - public FormField withLabel(Optional label) { - Utils.checkNotNull(label, "label"); + public FormField withLabel(@Nullable String label) { this.label = label; return this; } + /** * The placeholder for the form field */ - public FormField withPlaceholder(String placeholder) { - Utils.checkNotNull(placeholder, "placeholder"); + public FormField withPlaceholder(@Nullable String placeholder) { this.placeholder = JsonNullable.of(placeholder); return this; } - /** - * The placeholder for the form field - */ - public FormField withPlaceholder(JsonNullable placeholder) { - Utils.checkNotNull(placeholder, "placeholder"); - this.placeholder = placeholder; - return this; - } /** * The description of the form field */ - public FormField withDescription(String description) { - Utils.checkNotNull(description, "description"); + public FormField withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the form field - */ - public FormField withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - public FormField withType(FormFieldType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public FormField withType(Optional type) { - Utils.checkNotNull(type, "type"); + public FormField withType(@Nullable FormFieldType type) { this.type = type; return this; } - /** - * Indicates if the form field is required, which means it must be filled in before the form can be submitted - */ - public FormField withRequired(boolean required) { - Utils.checkNotNull(required, "required"); - this.required = Optional.ofNullable(required); - return this; - } - /** * Indicates if the form field is required, which means it must be filled in before the form can be submitted */ - public FormField withRequired(Optional required) { - Utils.checkNotNull(required, "required"); + public FormField withRequired(@Nullable Boolean required) { this.required = required; return this; } - public FormField withCustomField(boolean customField) { - Utils.checkNotNull(customField, "customField"); - this.customField = Optional.ofNullable(customField); - return this; - } - - public FormField withCustomField(Optional customField) { - Utils.checkNotNull(customField, "customField"); + public FormField withCustomField(@Nullable Boolean customField) { this.customField = customField; return this; } - /** - * Only applicable to select fields. Allow the user to add a custom value though the option select if the desired value is not in the option select list. - */ - public FormField withAllowCustomValues(boolean allowCustomValues) { - Utils.checkNotNull(allowCustomValues, "allowCustomValues"); - this.allowCustomValues = Optional.ofNullable(allowCustomValues); - return this; - } - /** * Only applicable to select fields. Allow the user to add a custom value though the option select if the desired value is not in the option select list. */ - public FormField withAllowCustomValues(Optional allowCustomValues) { - Utils.checkNotNull(allowCustomValues, "allowCustomValues"); + public FormField withAllowCustomValues(@Nullable Boolean allowCustomValues) { this.allowCustomValues = allowCustomValues; return this; } + /** * Indicates if the form field is displayed in a “read-only” mode. */ - public FormField withDisabled(boolean disabled) { - Utils.checkNotNull(disabled, "disabled"); + public FormField withDisabled(@Nullable Boolean disabled) { this.disabled = JsonNullable.of(disabled); return this; } - /** - * Indicates if the form field is displayed in a “read-only” mode. - */ - public FormField withDisabled(JsonNullable disabled) { - Utils.checkNotNull(disabled, "disabled"); - this.disabled = disabled; - return this; - } /** * Indicates if the form field is not displayed but the value that is being stored on the connection. */ - public FormField withHidden(boolean hidden) { - Utils.checkNotNull(hidden, "hidden"); + public FormField withHidden(@Nullable Boolean hidden) { this.hidden = JsonNullable.of(hidden); return this; } - /** - * Indicates if the form field is not displayed but the value that is being stored on the connection. - */ - public FormField withHidden(JsonNullable hidden) { - Utils.checkNotNull(hidden, "hidden"); - this.hidden = hidden; - return this; - } /** * When the setting is deprecated, it should be hidden from the user interface. The value will still be stored on the connection for the sake of backwards compatibility. */ - public FormField withDeprecated(boolean deprecated) { - Utils.checkNotNull(deprecated, "deprecated"); + public FormField withDeprecated(@Nullable Boolean deprecated) { this.deprecated = JsonNullable.of(deprecated); return this; } - /** - * When the setting is deprecated, it should be hidden from the user interface. The value will still be stored on the connection for the sake of backwards compatibility. - */ - public FormField withDeprecated(JsonNullable deprecated) { - Utils.checkNotNull(deprecated, "deprecated"); - this.deprecated = deprecated; - return this; - } /** * Indicates if the form field contains sensitive data, which will display the value as a masked input. */ - public FormField withSensitive(boolean sensitive) { - Utils.checkNotNull(sensitive, "sensitive"); + public FormField withSensitive(@Nullable Boolean sensitive) { this.sensitive = JsonNullable.of(sensitive); return this; } - /** - * Indicates if the form field contains sensitive data, which will display the value as a masked input. - */ - public FormField withSensitive(JsonNullable sensitive) { - Utils.checkNotNull(sensitive, "sensitive"); - this.sensitive = sensitive; - return this; - } /** * Prefix to display in front of the form field. */ - public FormField withPrefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public FormField withPrefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * Prefix to display in front of the form field. - */ - public FormField withPrefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } /** * Suffix to display next to the form field. */ - public FormField withSuffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public FormField withSuffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - /** - * Suffix to display next to the form field. - */ - public FormField withSuffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } - - public FormField withOptions(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - - public FormField withOptions(Optional> options) { - Utils.checkNotNull(options, "options"); + public FormField withOptions(@Nullable List options) { this.options = options; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -614,312 +457,152 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional label = Optional.empty(); + private String label; - private JsonNullable placeholder = JsonNullable.undefined(); + private JsonNullable placeholder; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional type = Optional.empty(); + private FormFieldType type; - private Optional required = Optional.empty(); + private Boolean required; - private Optional customField = Optional.empty(); + private Boolean customField; - private Optional allowCustomValues; + private Boolean allowCustomValues; - private JsonNullable disabled = JsonNullable.undefined(); + private JsonNullable disabled; - private JsonNullable hidden = JsonNullable.undefined(); + private JsonNullable hidden; - private JsonNullable deprecated = JsonNullable.undefined(); + private JsonNullable deprecated; - private JsonNullable sensitive = JsonNullable.undefined(); + private JsonNullable sensitive; - private JsonNullable prefix = JsonNullable.undefined(); + private JsonNullable prefix; - private JsonNullable suffix = JsonNullable.undefined(); + private JsonNullable suffix; - private Optional> options = Optional.empty(); + private List options; private Builder() { // force use of static builder() method } - /** * The unique identifier of the form field. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * The unique identifier of the form field. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The label of the field */ - public Builder label(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - - /** - * The label of the field - */ - public Builder label(Optional label) { - Utils.checkNotNull(label, "label"); + public Builder label(@Nullable String label) { this.label = label; return this; } - /** * The placeholder for the form field */ - public Builder placeholder(String placeholder) { - Utils.checkNotNull(placeholder, "placeholder"); + public Builder placeholder(@Nullable String placeholder) { this.placeholder = JsonNullable.of(placeholder); return this; } - /** - * The placeholder for the form field - */ - public Builder placeholder(JsonNullable placeholder) { - Utils.checkNotNull(placeholder, "placeholder"); - this.placeholder = placeholder; - return this; - } - - /** * The description of the form field */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the form field - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - public Builder type(FormFieldType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable FormFieldType type) { this.type = type; return this; } - /** * Indicates if the form field is required, which means it must be filled in before the form can be submitted */ - public Builder required(boolean required) { - Utils.checkNotNull(required, "required"); - this.required = Optional.ofNullable(required); - return this; - } - - /** - * Indicates if the form field is required, which means it must be filled in before the form can be submitted - */ - public Builder required(Optional required) { - Utils.checkNotNull(required, "required"); + public Builder required(@Nullable Boolean required) { this.required = required; return this; } - - public Builder customField(boolean customField) { - Utils.checkNotNull(customField, "customField"); - this.customField = Optional.ofNullable(customField); - return this; - } - - public Builder customField(Optional customField) { - Utils.checkNotNull(customField, "customField"); + public Builder customField(@Nullable Boolean customField) { this.customField = customField; return this; } - /** * Only applicable to select fields. Allow the user to add a custom value though the option select if the desired value is not in the option select list. */ - public Builder allowCustomValues(boolean allowCustomValues) { - Utils.checkNotNull(allowCustomValues, "allowCustomValues"); - this.allowCustomValues = Optional.ofNullable(allowCustomValues); - return this; - } - - /** - * Only applicable to select fields. Allow the user to add a custom value though the option select if the desired value is not in the option select list. - */ - public Builder allowCustomValues(Optional allowCustomValues) { - Utils.checkNotNull(allowCustomValues, "allowCustomValues"); + public Builder allowCustomValues(@Nullable Boolean allowCustomValues) { this.allowCustomValues = allowCustomValues; return this; } - /** * Indicates if the form field is displayed in a “read-only” mode. */ - public Builder disabled(boolean disabled) { - Utils.checkNotNull(disabled, "disabled"); + public Builder disabled(@Nullable Boolean disabled) { this.disabled = JsonNullable.of(disabled); return this; } - /** - * Indicates if the form field is displayed in a “read-only” mode. - */ - public Builder disabled(JsonNullable disabled) { - Utils.checkNotNull(disabled, "disabled"); - this.disabled = disabled; - return this; - } - - /** * Indicates if the form field is not displayed but the value that is being stored on the connection. */ - public Builder hidden(boolean hidden) { - Utils.checkNotNull(hidden, "hidden"); + public Builder hidden(@Nullable Boolean hidden) { this.hidden = JsonNullable.of(hidden); return this; } - /** - * Indicates if the form field is not displayed but the value that is being stored on the connection. - */ - public Builder hidden(JsonNullable hidden) { - Utils.checkNotNull(hidden, "hidden"); - this.hidden = hidden; - return this; - } - - /** * When the setting is deprecated, it should be hidden from the user interface. The value will still be stored on the connection for the sake of backwards compatibility. */ - public Builder deprecated(boolean deprecated) { - Utils.checkNotNull(deprecated, "deprecated"); + public Builder deprecated(@Nullable Boolean deprecated) { this.deprecated = JsonNullable.of(deprecated); return this; } - /** - * When the setting is deprecated, it should be hidden from the user interface. The value will still be stored on the connection for the sake of backwards compatibility. - */ - public Builder deprecated(JsonNullable deprecated) { - Utils.checkNotNull(deprecated, "deprecated"); - this.deprecated = deprecated; - return this; - } - - /** * Indicates if the form field contains sensitive data, which will display the value as a masked input. */ - public Builder sensitive(boolean sensitive) { - Utils.checkNotNull(sensitive, "sensitive"); + public Builder sensitive(@Nullable Boolean sensitive) { this.sensitive = JsonNullable.of(sensitive); return this; } - /** - * Indicates if the form field contains sensitive data, which will display the value as a masked input. - */ - public Builder sensitive(JsonNullable sensitive) { - Utils.checkNotNull(sensitive, "sensitive"); - this.sensitive = sensitive; - return this; - } - - /** * Prefix to display in front of the form field. */ - public Builder prefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public Builder prefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * Prefix to display in front of the form field. - */ - public Builder prefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } - - /** * Suffix to display next to the form field. */ - public Builder suffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Builder suffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - /** - * Suffix to display next to the form field. - */ - public Builder suffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } - - - public Builder options(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - - public Builder options(Optional> options) { - Utils.checkNotNull(options, "options"); + public Builder options(@Nullable List options) { this.options = options; return this; } public FormField build() { - if (allowCustomValues == null) { - allowCustomValues = _SINGLETON_VALUE_AllowCustomValues.value(); - } - return new FormField( id, label, placeholder, description, type, required, @@ -929,10 +612,10 @@ public FormField build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_AllowCustomValues = + private static final LazySingletonValue _SINGLETON_VALUE_AllowCustomValues = new LazySingletonValue<>( "allow_custom_values", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/FormFieldOptionGroup.java b/src/main/java/com/apideck/unify/models/components/FormFieldOptionGroup.java index b0221bec..a860c1e0 100644 --- a/src/main/java/com/apideck/unify/models/components/FormFieldOptionGroup.java +++ b/src/main/java/com/apideck/unify/models/components/FormFieldOptionGroup.java @@ -5,10 +5,11 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.List; @@ -19,7 +20,7 @@ public class FormFieldOptionGroup implements FormFieldOption { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonProperty("label") @@ -35,44 +36,39 @@ public class FormFieldOptionGroup implements FormFieldOption { @JsonCreator public FormFieldOptionGroup( - @JsonProperty("id") Optional id, - @JsonProperty("label") String label, - @JsonProperty("options") List options, - @JsonProperty("option_type") FormFieldOptionGroupOptionType optionType) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(label, "label"); - Utils.checkNotNull(options, "options"); - Utils.checkNotNull(optionType, "optionType"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("label") @Nonnull String label, + @JsonProperty("options") @Nonnull List options, + @JsonProperty("option_type") @Nonnull FormFieldOptionGroupOptionType optionType) { this.id = id; - this.label = label; - this.options = options; - this.optionType = optionType; + this.label = Optional.ofNullable(label) + .orElseThrow(() -> new IllegalArgumentException("label cannot be null")); + this.options = Optional.ofNullable(options) + .orElseThrow(() -> new IllegalArgumentException("options cannot be null")); + this.optionType = Optional.ofNullable(optionType) + .orElseThrow(() -> new IllegalArgumentException("optionType cannot be null")); } public FormFieldOptionGroup( - String label, - List options, - FormFieldOptionGroupOptionType optionType) { - this(Optional.empty(), label, options, + @Nonnull String label, + @Nonnull List options, + @Nonnull FormFieldOptionGroupOptionType optionType) { + this(null, label, options, optionType); } - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } - @JsonIgnore public String label() { - return label; + return this.label; } - @JsonIgnore public List options() { - return options; + return this.options; } - @JsonIgnore @Override public String optionType() { return Utils.discriminatorToString(optionType); @@ -83,37 +79,30 @@ public static Builder builder() { } - public FormFieldOptionGroup withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); + public FormFieldOptionGroup withId(@Nullable String id) { + this.id = id; return this; } - public FormFieldOptionGroup withId(Optional id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public FormFieldOptionGroup withLabel(@Nonnull String label) { + this.label = Utils.checkNotNull(label, "label"); return this; } - public FormFieldOptionGroup withLabel(String label) { - Utils.checkNotNull(label, "label"); - this.label = label; - return this; - } - public FormFieldOptionGroup withOptions(List options) { - Utils.checkNotNull(options, "options"); - this.options = options; + public FormFieldOptionGroup withOptions(@Nonnull List options) { + this.options = Utils.checkNotNull(options, "options"); return this; } - public FormFieldOptionGroup withOptionType(FormFieldOptionGroupOptionType optionType) { - Utils.checkNotNull(optionType, "optionType"); - this.optionType = optionType; + + public FormFieldOptionGroup withOptionType(@Nonnull FormFieldOptionGroupOptionType optionType) { + this.optionType = Utils.checkNotNull(optionType, "optionType"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -149,7 +138,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private String label; @@ -161,42 +150,27 @@ private Builder() { // force use of static builder() method } - - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - public Builder label(String label) { - Utils.checkNotNull(label, "label"); - this.label = label; + public Builder label(@Nonnull String label) { + this.label = Utils.checkNotNull(label, "label"); return this; } - - public Builder options(List options) { - Utils.checkNotNull(options, "options"); - this.options = options; + public Builder options(@Nonnull List options) { + this.options = Utils.checkNotNull(options, "options"); return this; } - - public Builder optionType(FormFieldOptionGroupOptionType optionType) { - Utils.checkNotNull(optionType, "optionType"); - this.optionType = optionType; + public Builder optionType(@Nonnull FormFieldOptionGroupOptionType optionType) { + this.optionType = Utils.checkNotNull(optionType, "optionType"); return this; } public FormFieldOptionGroup build() { - return new FormFieldOptionGroup( id, label, options, optionType); diff --git a/src/main/java/com/apideck/unify/models/components/Four.java b/src/main/java/com/apideck/unify/models/components/Four.java index 916bdb4a..eb509f33 100644 --- a/src/main/java/com/apideck/unify/models/components/Four.java +++ b/src/main/java/com/apideck/unify/models/components/Four.java @@ -49,7 +49,6 @@ private Builder() { } public Four build() { - return new Four( ); } diff --git a/src/main/java/com/apideck/unify/models/components/GetAccountingDepartmentResponse.java b/src/main/java/com/apideck/unify/models/components/GetAccountingDepartmentResponse.java index 8cf82482..ae29e38c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetAccountingDepartmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetAccountingDepartmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetAccountingDepartmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetAccountingDepartmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") AccountingDepartment data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull AccountingDepartment data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetAccountingDepartmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - AccountingDepartment data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull AccountingDepartment data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public AccountingDepartment data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetAccountingDepartmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetAccountingDepartmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetAccountingDepartmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetAccountingDepartmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetAccountingDepartmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetAccountingDepartmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetAccountingDepartmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetAccountingDepartmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetAccountingDepartmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetAccountingDepartmentResponse withData(AccountingDepartment data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetAccountingDepartmentResponse withData(@Nonnull AccountingDepartment data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetAccountingDepartmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetAccountingDepartmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetAccountingDepartmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private AccountingDepartment data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(AccountingDepartment data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull AccountingDepartment data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetAccountingDepartmentResponse build() { - return new GetAccountingDepartmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetAccountingDepartmentsResponse.java b/src/main/java/com/apideck/unify/models/components/GetAccountingDepartmentsResponse.java index f13fbbd4..f679d3cb 100644 --- a/src/main/java/com/apideck/unify/models/components/GetAccountingDepartmentsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetAccountingDepartmentsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetAccountingDepartmentsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetAccountingDepartmentsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetAccountingDepartmentsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetAccountingDepartmentsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetAccountingDepartmentsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetAccountingDepartmentsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetAccountingDepartmentsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetAccountingDepartmentsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetAccountingDepartmentsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetAccountingDepartmentsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetAccountingDepartmentsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetAccountingDepartmentsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetAccountingDepartmentsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetAccountingDepartmentsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetAccountingDepartmentsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetAccountingDepartmentsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetAccountingDepartmentsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetAccountingDepartmentsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetAccountingDepartmentsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetAccountingDepartmentsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetAccountingDepartmentsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetAccountingDepartmentsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetAccountingDepartmentsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetAccountingDepartmentsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetAccountingDepartmentsResponse build() { - return new GetAccountingDepartmentsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetAccountingLocationResponse.java b/src/main/java/com/apideck/unify/models/components/GetAccountingLocationResponse.java index e4af7604..68b669d0 100644 --- a/src/main/java/com/apideck/unify/models/components/GetAccountingLocationResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetAccountingLocationResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetAccountingLocationResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetAccountingLocationResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") AccountingLocation data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull AccountingLocation data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetAccountingLocationResponse( long statusCode, - String status, - String service, - String resource, - String operation, - AccountingLocation data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull AccountingLocation data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public AccountingLocation data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetAccountingLocationResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetAccountingLocationResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetAccountingLocationResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetAccountingLocationResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetAccountingLocationResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetAccountingLocationResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetAccountingLocationResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetAccountingLocationResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetAccountingLocationResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetAccountingLocationResponse withData(AccountingLocation data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetAccountingLocationResponse withData(@Nonnull AccountingLocation data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetAccountingLocationResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetAccountingLocationResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetAccountingLocationResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private AccountingLocation data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(AccountingLocation data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull AccountingLocation data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetAccountingLocationResponse build() { - return new GetAccountingLocationResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetAccountingLocationsResponse.java b/src/main/java/com/apideck/unify/models/components/GetAccountingLocationsResponse.java index 6b8e2fd5..9847355c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetAccountingLocationsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetAccountingLocationsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetAccountingLocationsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetAccountingLocationsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetAccountingLocationsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetAccountingLocationsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetAccountingLocationsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetAccountingLocationsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetAccountingLocationsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetAccountingLocationsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetAccountingLocationsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetAccountingLocationsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetAccountingLocationsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetAccountingLocationsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetAccountingLocationsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetAccountingLocationsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetAccountingLocationsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetAccountingLocationsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetAccountingLocationsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetAccountingLocationsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetAccountingLocationsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetAccountingLocationsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetAccountingLocationsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetAccountingLocationsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetAccountingLocationsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetAccountingLocationsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetAccountingLocationsResponse build() { - return new GetAccountingLocationsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetActivitiesResponse.java b/src/main/java/com/apideck/unify/models/components/GetActivitiesResponse.java index 1367966c..132410f0 100644 --- a/src/main/java/com/apideck/unify/models/components/GetActivitiesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetActivitiesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetActivitiesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetActivitiesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetActivitiesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetActivitiesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetActivitiesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetActivitiesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetActivitiesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetActivitiesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetActivitiesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetActivitiesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetActivitiesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetActivitiesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetActivitiesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetActivitiesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetActivitiesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetActivitiesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetActivitiesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetActivitiesResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetActivitiesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetActivitiesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetActivitiesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetActivitiesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetActivitiesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetActivitiesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetActivitiesResponse build() { - return new GetActivitiesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetActivityResponse.java b/src/main/java/com/apideck/unify/models/components/GetActivityResponse.java index 95e73e01..e0ddd69a 100644 --- a/src/main/java/com/apideck/unify/models/components/GetActivityResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetActivityResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetActivityResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetActivityResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Activity data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Activity data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetActivityResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Activity data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Activity data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Activity data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetActivityResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetActivityResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetActivityResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetActivityResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetActivityResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetActivityResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetActivityResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetActivityResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetActivityResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetActivityResponse withData(Activity data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetActivityResponse withData(@Nonnull Activity data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetActivityResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetActivityResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetActivityResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Activity data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Activity data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Activity data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetActivityResponse build() { - return new GetActivityResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetAgedCreditorsResponse.java b/src/main/java/com/apideck/unify/models/components/GetAgedCreditorsResponse.java index 553a0a9f..79d1f7f1 100644 --- a/src/main/java/com/apideck/unify/models/components/GetAgedCreditorsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetAgedCreditorsResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetAgedCreditorsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetAgedCreditorsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") AgedCreditors data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull AgedCreditors data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetAgedCreditorsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - AgedCreditors data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull AgedCreditors data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public AgedCreditors data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetAgedCreditorsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetAgedCreditorsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetAgedCreditorsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetAgedCreditorsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetAgedCreditorsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetAgedCreditorsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetAgedCreditorsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetAgedCreditorsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetAgedCreditorsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetAgedCreditorsResponse withData(AgedCreditors data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetAgedCreditorsResponse withData(@Nonnull AgedCreditors data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetAgedCreditorsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetAgedCreditorsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetAgedCreditorsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private AgedCreditors data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(AgedCreditors data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull AgedCreditors data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetAgedCreditorsResponse build() { - return new GetAgedCreditorsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetAgedDebtorsResponse.java b/src/main/java/com/apideck/unify/models/components/GetAgedDebtorsResponse.java index 2181b0d9..0d8534d3 100644 --- a/src/main/java/com/apideck/unify/models/components/GetAgedDebtorsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetAgedDebtorsResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetAgedDebtorsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetAgedDebtorsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") AgedDebtors data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull AgedDebtors data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetAgedDebtorsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - AgedDebtors data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull AgedDebtors data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public AgedDebtors data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetAgedDebtorsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetAgedDebtorsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetAgedDebtorsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetAgedDebtorsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetAgedDebtorsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetAgedDebtorsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetAgedDebtorsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetAgedDebtorsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetAgedDebtorsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetAgedDebtorsResponse withData(AgedDebtors data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetAgedDebtorsResponse withData(@Nonnull AgedDebtors data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetAgedDebtorsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetAgedDebtorsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetAgedDebtorsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private AgedDebtors data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(AgedDebtors data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull AgedDebtors data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetAgedDebtorsResponse build() { - return new GetAgedDebtorsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetApiResourceCoverageResponse.java b/src/main/java/com/apideck/unify/models/components/GetApiResourceCoverageResponse.java index 636ab95d..5342f1bf 100644 --- a/src/main/java/com/apideck/unify/models/components/GetApiResourceCoverageResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetApiResourceCoverageResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -45,98 +44,86 @@ public class GetApiResourceCoverageResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetApiResourceCoverageResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") ApiResourceCoverage data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull ApiResourceCoverage data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetApiResourceCoverageResponse( long statusCode, - String status, - ApiResourceCoverage data) { + @Nonnull String status, + @Nonnull ApiResourceCoverage data) { this(statusCode, status, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public ApiResourceCoverage data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -148,50 +135,31 @@ public static Builder builder() { * HTTP Response Status Code */ public GetApiResourceCoverageResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetApiResourceCoverageResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetApiResourceCoverageResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetApiResourceCoverageResponse withData(ApiResourceCoverage data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApiResourceCoverageResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetApiResourceCoverageResponse withData(@Nonnull ApiResourceCoverage data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApiResourceCoverageResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetApiResourceCoverageResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetApiResourceCoverageResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -199,31 +167,21 @@ public GetApiResourceCoverageResponse withMeta(Meta meta) { /** * Response metadata */ - public GetApiResourceCoverageResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetApiResourceCoverageResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetApiResourceCoverageResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetApiResourceCoverageResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetApiResourceCoverageResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -263,108 +221,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private ApiResourceCoverage data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(ApiResourceCoverage data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull ApiResourceCoverage data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - /** * Response metadata */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - - /** - * Response metadata - */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetApiResourceCoverageResponse build() { - return new GetApiResourceCoverageResponse( statusCode, status, data, raw, meta, links); diff --git a/src/main/java/com/apideck/unify/models/components/GetApiResourceResponse.java b/src/main/java/com/apideck/unify/models/components/GetApiResourceResponse.java index 601109a2..5b98fc62 100644 --- a/src/main/java/com/apideck/unify/models/components/GetApiResourceResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetApiResourceResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -45,98 +44,86 @@ public class GetApiResourceResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetApiResourceResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") ApiResource data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull ApiResource data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetApiResourceResponse( long statusCode, - String status, - ApiResource data) { + @Nonnull String status, + @Nonnull ApiResource data) { this(statusCode, status, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public ApiResource data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -148,50 +135,31 @@ public static Builder builder() { * HTTP Response Status Code */ public GetApiResourceResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetApiResourceResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetApiResourceResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetApiResourceResponse withData(ApiResource data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApiResourceResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetApiResourceResponse withData(@Nonnull ApiResource data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApiResourceResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetApiResourceResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetApiResourceResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -199,31 +167,21 @@ public GetApiResourceResponse withMeta(Meta meta) { /** * Response metadata */ - public GetApiResourceResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetApiResourceResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetApiResourceResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetApiResourceResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetApiResourceResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -263,108 +221,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private ApiResource data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(ApiResource data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull ApiResource data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - /** * Response metadata */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - - /** - * Response metadata - */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetApiResourceResponse build() { - return new GetApiResourceResponse( statusCode, status, data, raw, meta, links); diff --git a/src/main/java/com/apideck/unify/models/components/GetApiResponse.java b/src/main/java/com/apideck/unify/models/components/GetApiResponse.java index cab3f0ec..35436340 100644 --- a/src/main/java/com/apideck/unify/models/components/GetApiResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetApiResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -45,98 +44,86 @@ public class GetApiResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetApiResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Api data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Api data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetApiResponse( long statusCode, - String status, - Api data) { + @Nonnull String status, + @Nonnull Api data) { this(statusCode, status, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Api data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -148,50 +135,31 @@ public static Builder builder() { * HTTP Response Status Code */ public GetApiResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetApiResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetApiResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetApiResponse withData(Api data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApiResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetApiResponse withData(@Nonnull Api data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApiResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetApiResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetApiResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -199,31 +167,21 @@ public GetApiResponse withMeta(Meta meta) { /** * Response metadata */ - public GetApiResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetApiResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetApiResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetApiResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetApiResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -263,108 +221,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Api data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Api data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Api data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - /** * Response metadata */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - - /** - * Response metadata - */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetApiResponse build() { - return new GetApiResponse( statusCode, status, data, raw, meta, links); diff --git a/src/main/java/com/apideck/unify/models/components/GetApisResponse.java b/src/main/java/com/apideck/unify/models/components/GetApisResponse.java index 72121c5d..a3ff9b81 100644 --- a/src/main/java/com/apideck/unify/models/components/GetApisResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetApisResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -46,98 +45,86 @@ public class GetApisResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetApisResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetApisResponse( long statusCode, - String status, - List data) { + @Nonnull String status, + @Nonnull List data) { this(statusCode, status, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -149,50 +136,31 @@ public static Builder builder() { * HTTP Response Status Code */ public GetApisResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetApisResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetApisResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetApisResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApisResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetApisResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApisResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetApisResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetApisResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -200,31 +168,21 @@ public GetApisResponse withMeta(Meta meta) { /** * Response metadata */ - public GetApisResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetApisResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetApisResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetApisResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetApisResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -264,108 +222,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - /** * Response metadata */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - - /** - * Response metadata - */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetApisResponse build() { - return new GetApisResponse( statusCode, status, data, raw, meta, links); diff --git a/src/main/java/com/apideck/unify/models/components/GetApplicantResponse.java b/src/main/java/com/apideck/unify/models/components/GetApplicantResponse.java index d3b2eed5..1b6208e1 100644 --- a/src/main/java/com/apideck/unify/models/components/GetApplicantResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetApplicantResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetApplicantResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetApplicantResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Applicant data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Applicant data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetApplicantResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Applicant data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Applicant data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Applicant data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetApplicantResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetApplicantResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetApplicantResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetApplicantResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetApplicantResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetApplicantResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetApplicantResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetApplicantResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetApplicantResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetApplicantResponse withData(Applicant data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetApplicantResponse withData(@Nonnull Applicant data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetApplicantResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetApplicantResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApplicantResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Applicant data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Applicant data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Applicant data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetApplicantResponse build() { - return new GetApplicantResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetApplicantsResponse.java b/src/main/java/com/apideck/unify/models/components/GetApplicantsResponse.java index cc725dcf..9114ce87 100644 --- a/src/main/java/com/apideck/unify/models/components/GetApplicantsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetApplicantsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetApplicantsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetApplicantsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetApplicantsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetApplicantsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetApplicantsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetApplicantsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetApplicantsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetApplicantsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetApplicantsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetApplicantsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetApplicantsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetApplicantsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetApplicantsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApplicantsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetApplicantsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApplicantsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetApplicantsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetApplicantsResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetApplicantsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetApplicantsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetApplicantsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetApplicantsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetApplicantsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetApplicantsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetApplicantsResponse build() { - return new GetApplicantsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetApplicationResponse.java b/src/main/java/com/apideck/unify/models/components/GetApplicationResponse.java index f77f53de..6cc82799 100644 --- a/src/main/java/com/apideck/unify/models/components/GetApplicationResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetApplicationResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetApplicationResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetApplicationResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Application data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Application data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetApplicationResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Application data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Application data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Application data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetApplicationResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetApplicationResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetApplicationResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetApplicationResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetApplicationResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetApplicationResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetApplicationResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetApplicationResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetApplicationResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetApplicationResponse withData(Application data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetApplicationResponse withData(@Nonnull Application data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetApplicationResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetApplicationResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApplicationResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Application data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Application data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Application data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetApplicationResponse build() { - return new GetApplicationResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetApplicationsResponse.java b/src/main/java/com/apideck/unify/models/components/GetApplicationsResponse.java index dda98339..bafe1f78 100644 --- a/src/main/java/com/apideck/unify/models/components/GetApplicationsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetApplicationsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetApplicationsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetApplicationsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetApplicationsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetApplicationsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetApplicationsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetApplicationsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetApplicationsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetApplicationsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetApplicationsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetApplicationsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetApplicationsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetApplicationsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetApplicationsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApplicationsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetApplicationsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetApplicationsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetApplicationsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetApplicationsResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetApplicationsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetApplicationsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetApplicationsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetApplicationsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetApplicationsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetApplicationsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetApplicationsResponse build() { - return new GetApplicationsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetAttachmentResponse.java b/src/main/java/com/apideck/unify/models/components/GetAttachmentResponse.java index 76f13538..b021d312 100644 --- a/src/main/java/com/apideck/unify/models/components/GetAttachmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetAttachmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetAttachmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetAttachmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Attachment data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Attachment data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetAttachmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Attachment data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Attachment data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Attachment data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetAttachmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetAttachmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetAttachmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetAttachmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetAttachmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetAttachmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetAttachmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetAttachmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetAttachmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetAttachmentResponse withData(Attachment data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetAttachmentResponse withData(@Nonnull Attachment data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetAttachmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetAttachmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetAttachmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Attachment data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Attachment data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Attachment data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetAttachmentResponse build() { - return new GetAttachmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetAttachmentsResponse.java b/src/main/java/com/apideck/unify/models/components/GetAttachmentsResponse.java index 7a605506..902d0cfd 100644 --- a/src/main/java/com/apideck/unify/models/components/GetAttachmentsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetAttachmentsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetAttachmentsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetAttachmentsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetAttachmentsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetAttachmentsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetAttachmentsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetAttachmentsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetAttachmentsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetAttachmentsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetAttachmentsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetAttachmentsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetAttachmentsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetAttachmentsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetAttachmentsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetAttachmentsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetAttachmentsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetAttachmentsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetAttachmentsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetAttachmentsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetAttachmentsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetAttachmentsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetAttachmentsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetAttachmentsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetAttachmentsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetAttachmentsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetAttachmentsResponse build() { - return new GetAttachmentsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetBalanceSheetResponse.java b/src/main/java/com/apideck/unify/models/components/GetBalanceSheetResponse.java index 7c0cd692..747246c8 100644 --- a/src/main/java/com/apideck/unify/models/components/GetBalanceSheetResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetBalanceSheetResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetBalanceSheetResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetBalanceSheetResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") BalanceSheet data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull BalanceSheet data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetBalanceSheetResponse( long statusCode, - String status, - String service, - String resource, - String operation, - BalanceSheet data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull BalanceSheet data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public BalanceSheet data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetBalanceSheetResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetBalanceSheetResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetBalanceSheetResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetBalanceSheetResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetBalanceSheetResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetBalanceSheetResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetBalanceSheetResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetBalanceSheetResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetBalanceSheetResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetBalanceSheetResponse withData(BalanceSheet data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetBalanceSheetResponse withData(@Nonnull BalanceSheet data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetBalanceSheetResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetBalanceSheetResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetBalanceSheetResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private BalanceSheet data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(BalanceSheet data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull BalanceSheet data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetBalanceSheetResponse build() { - return new GetBalanceSheetResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetBankFeedAccountResponse.java b/src/main/java/com/apideck/unify/models/components/GetBankFeedAccountResponse.java index 5e18eca9..bfe2b422 100644 --- a/src/main/java/com/apideck/unify/models/components/GetBankFeedAccountResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetBankFeedAccountResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetBankFeedAccountResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetBankFeedAccountResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") BankFeedAccount data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull BankFeedAccount data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetBankFeedAccountResponse( long statusCode, - String status, - String service, - String resource, - String operation, - BankFeedAccount data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull BankFeedAccount data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public BankFeedAccount data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetBankFeedAccountResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetBankFeedAccountResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetBankFeedAccountResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetBankFeedAccountResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetBankFeedAccountResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetBankFeedAccountResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetBankFeedAccountResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetBankFeedAccountResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetBankFeedAccountResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetBankFeedAccountResponse withData(BankFeedAccount data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetBankFeedAccountResponse withData(@Nonnull BankFeedAccount data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetBankFeedAccountResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetBankFeedAccountResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetBankFeedAccountResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private BankFeedAccount data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(BankFeedAccount data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull BankFeedAccount data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetBankFeedAccountResponse build() { - return new GetBankFeedAccountResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetBankFeedAccountsResponse.java b/src/main/java/com/apideck/unify/models/components/GetBankFeedAccountsResponse.java index 7f95897e..f7f40a11 100644 --- a/src/main/java/com/apideck/unify/models/components/GetBankFeedAccountsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetBankFeedAccountsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetBankFeedAccountsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetBankFeedAccountsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetBankFeedAccountsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetBankFeedAccountsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetBankFeedAccountsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetBankFeedAccountsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetBankFeedAccountsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetBankFeedAccountsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetBankFeedAccountsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetBankFeedAccountsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetBankFeedAccountsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetBankFeedAccountsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetBankFeedAccountsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetBankFeedAccountsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetBankFeedAccountsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetBankFeedAccountsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetBankFeedAccountsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetBankFeedAccountsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetBankFeedAccountsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetBankFeedAccountsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetBankFeedAccountsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetBankFeedAccountsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetBankFeedAccountsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetBankFeedAccountsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetBankFeedAccountsResponse build() { - return new GetBankFeedAccountsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetBankFeedStatementResponse.java b/src/main/java/com/apideck/unify/models/components/GetBankFeedStatementResponse.java index e24e6c35..4c027b9f 100644 --- a/src/main/java/com/apideck/unify/models/components/GetBankFeedStatementResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetBankFeedStatementResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetBankFeedStatementResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetBankFeedStatementResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") BankFeedStatement data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull BankFeedStatement data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetBankFeedStatementResponse( long statusCode, - String status, - String service, - String resource, - String operation, - BankFeedStatement data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull BankFeedStatement data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public BankFeedStatement data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetBankFeedStatementResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetBankFeedStatementResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetBankFeedStatementResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetBankFeedStatementResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetBankFeedStatementResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetBankFeedStatementResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetBankFeedStatementResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetBankFeedStatementResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetBankFeedStatementResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetBankFeedStatementResponse withData(BankFeedStatement data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetBankFeedStatementResponse withData(@Nonnull BankFeedStatement data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetBankFeedStatementResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetBankFeedStatementResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetBankFeedStatementResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private BankFeedStatement data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(BankFeedStatement data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull BankFeedStatement data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetBankFeedStatementResponse build() { - return new GetBankFeedStatementResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetBankFeedStatementsResponse.java b/src/main/java/com/apideck/unify/models/components/GetBankFeedStatementsResponse.java index 9fe1ed59..efe0ee1c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetBankFeedStatementsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetBankFeedStatementsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetBankFeedStatementsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetBankFeedStatementsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetBankFeedStatementsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetBankFeedStatementsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetBankFeedStatementsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetBankFeedStatementsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetBankFeedStatementsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetBankFeedStatementsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetBankFeedStatementsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetBankFeedStatementsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetBankFeedStatementsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetBankFeedStatementsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetBankFeedStatementsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetBankFeedStatementsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetBankFeedStatementsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetBankFeedStatementsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetBankFeedStatementsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetBankFeedStatementsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetBankFeedStatementsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetBankFeedStatementsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetBankFeedStatementsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetBankFeedStatementsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetBankFeedStatementsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetBankFeedStatementsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetBankFeedStatementsResponse build() { - return new GetBankFeedStatementsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetBillPaymentResponse.java b/src/main/java/com/apideck/unify/models/components/GetBillPaymentResponse.java index 5e5847ad..fa641657 100644 --- a/src/main/java/com/apideck/unify/models/components/GetBillPaymentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetBillPaymentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetBillPaymentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetBillPaymentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") BillPayment data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull BillPayment data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetBillPaymentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - BillPayment data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull BillPayment data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public BillPayment data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetBillPaymentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetBillPaymentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetBillPaymentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetBillPaymentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetBillPaymentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetBillPaymentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetBillPaymentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetBillPaymentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetBillPaymentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetBillPaymentResponse withData(BillPayment data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetBillPaymentResponse withData(@Nonnull BillPayment data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetBillPaymentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetBillPaymentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetBillPaymentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private BillPayment data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(BillPayment data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull BillPayment data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetBillPaymentResponse build() { - return new GetBillPaymentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetBillPaymentsResponse.java b/src/main/java/com/apideck/unify/models/components/GetBillPaymentsResponse.java index 4404b41d..a2aa136d 100644 --- a/src/main/java/com/apideck/unify/models/components/GetBillPaymentsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetBillPaymentsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetBillPaymentsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetBillPaymentsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetBillPaymentsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetBillPaymentsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetBillPaymentsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetBillPaymentsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetBillPaymentsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetBillPaymentsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetBillPaymentsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetBillPaymentsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetBillPaymentsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetBillPaymentsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetBillPaymentsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetBillPaymentsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetBillPaymentsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetBillPaymentsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetBillPaymentsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetBillPaymentsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetBillPaymentsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetBillPaymentsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetBillPaymentsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetBillPaymentsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetBillPaymentsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetBillPaymentsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetBillPaymentsResponse build() { - return new GetBillPaymentsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetBillResponse.java b/src/main/java/com/apideck/unify/models/components/GetBillResponse.java index 99d96fb8..dee81fb9 100644 --- a/src/main/java/com/apideck/unify/models/components/GetBillResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetBillResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetBillResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetBillResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Bill data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Bill data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetBillResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Bill data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Bill data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Bill data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetBillResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetBillResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetBillResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetBillResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetBillResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetBillResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetBillResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetBillResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetBillResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetBillResponse withData(Bill data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetBillResponse withData(@Nonnull Bill data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetBillResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetBillResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetBillResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Bill data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Bill data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Bill data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetBillResponse build() { - return new GetBillResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetBillsResponse.java b/src/main/java/com/apideck/unify/models/components/GetBillsResponse.java index 32d78ed4..c6da3a12 100644 --- a/src/main/java/com/apideck/unify/models/components/GetBillsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetBillsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetBillsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetBillsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetBillsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetBillsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetBillsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetBillsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetBillsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetBillsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetBillsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetBillsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetBillsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetBillsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetBillsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetBillsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetBillsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetBillsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetBillsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetBillsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetBillsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetBillsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetBillsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetBillsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetBillsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetBillsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetBillsResponse build() { - return new GetBillsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCategoriesResponse.java b/src/main/java/com/apideck/unify/models/components/GetCategoriesResponse.java index a78d6c33..610f2493 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCategoriesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCategoriesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetCategoriesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCategoriesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCategoriesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCategoriesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCategoriesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCategoriesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCategoriesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCategoriesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCategoriesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCategoriesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCategoriesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCategoriesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCategoriesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetCategoriesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetCategoriesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetCategoriesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetCategoriesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetCategoriesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetCategoriesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetCategoriesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetCategoriesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCategoriesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCategoriesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCategoriesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCategoriesResponse build() { - return new GetCategoriesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCategoryResponse.java b/src/main/java/com/apideck/unify/models/components/GetCategoryResponse.java index a17d6ee9..7924ce72 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCategoryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCategoryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetCategoryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCategoryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Category data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Category data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCategoryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Category data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Category data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Category data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCategoryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCategoryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCategoryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCategoryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCategoryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCategoryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCategoryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCategoryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCategoryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCategoryResponse withData(Category data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCategoryResponse withData(@Nonnull Category data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCategoryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCategoryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCategoryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Category data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Category data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Category data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCategoryResponse build() { - return new GetCategoryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCollectionResponse.java b/src/main/java/com/apideck/unify/models/components/GetCollectionResponse.java index 3be78457..12496a41 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCollectionResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCollectionResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetCollectionResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCollectionResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Collection data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Collection data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCollectionResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Collection data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Collection data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Collection data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCollectionResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCollectionResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCollectionResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCollectionResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCollectionResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCollectionResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCollectionResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCollectionResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCollectionResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCollectionResponse withData(Collection data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCollectionResponse withData(@Nonnull Collection data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCollectionResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCollectionResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCollectionResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Collection data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Collection data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Collection data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCollectionResponse build() { - return new GetCollectionResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCollectionTagsResponse.java b/src/main/java/com/apideck/unify/models/components/GetCollectionTagsResponse.java index 18d0e3a7..b126591f 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCollectionTagsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCollectionTagsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetCollectionTagsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCollectionTagsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCollectionTagsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCollectionTagsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCollectionTagsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCollectionTagsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCollectionTagsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCollectionTagsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCollectionTagsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCollectionTagsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCollectionTagsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCollectionTagsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCollectionTagsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetCollectionTagsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetCollectionTagsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetCollectionTagsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetCollectionTagsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetCollectionTagsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetCollectionTagsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetCollectionTagsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetCollectionTagsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCollectionTagsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCollectionTagsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCollectionTagsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCollectionTagsResponse build() { - return new GetCollectionTagsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCollectionUserResponse.java b/src/main/java/com/apideck/unify/models/components/GetCollectionUserResponse.java index 9bb7d7b5..ca878754 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCollectionUserResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCollectionUserResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetCollectionUserResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCollectionUserResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") CollectionUser data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull CollectionUser data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCollectionUserResponse( long statusCode, - String status, - String service, - String resource, - String operation, - CollectionUser data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull CollectionUser data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public CollectionUser data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCollectionUserResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCollectionUserResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCollectionUserResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCollectionUserResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCollectionUserResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCollectionUserResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCollectionUserResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCollectionUserResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCollectionUserResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCollectionUserResponse withData(CollectionUser data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCollectionUserResponse withData(@Nonnull CollectionUser data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCollectionUserResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCollectionUserResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCollectionUserResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private CollectionUser data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(CollectionUser data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull CollectionUser data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCollectionUserResponse build() { - return new GetCollectionUserResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCollectionUsersResponse.java b/src/main/java/com/apideck/unify/models/components/GetCollectionUsersResponse.java index 7fe28356..27f436af 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCollectionUsersResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCollectionUsersResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetCollectionUsersResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCollectionUsersResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCollectionUsersResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCollectionUsersResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCollectionUsersResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCollectionUsersResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCollectionUsersResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCollectionUsersResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCollectionUsersResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCollectionUsersResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCollectionUsersResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCollectionUsersResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCollectionUsersResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetCollectionUsersResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetCollectionUsersResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetCollectionUsersResponse withMeta(Meta meta) { /** * Response metadata */ - public GetCollectionUsersResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetCollectionUsersResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetCollectionUsersResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetCollectionUsersResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetCollectionUsersResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCollectionUsersResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCollectionUsersResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCollectionUsersResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCollectionUsersResponse build() { - return new GetCollectionUsersResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCollectionsResponse.java b/src/main/java/com/apideck/unify/models/components/GetCollectionsResponse.java index 6c85d3ea..14420144 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCollectionsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCollectionsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetCollectionsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCollectionsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCollectionsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCollectionsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCollectionsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCollectionsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCollectionsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCollectionsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCollectionsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCollectionsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCollectionsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCollectionsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCollectionsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetCollectionsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetCollectionsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetCollectionsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetCollectionsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetCollectionsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetCollectionsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetCollectionsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetCollectionsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCollectionsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCollectionsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCollectionsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCollectionsResponse build() { - return new GetCollectionsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCommentResponse.java b/src/main/java/com/apideck/unify/models/components/GetCommentResponse.java index 5c61c24b..0eba5749 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCommentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCommentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetCommentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCommentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") CollectionTicketComment data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull CollectionTicketComment data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCommentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - CollectionTicketComment data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull CollectionTicketComment data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public CollectionTicketComment data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCommentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCommentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCommentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCommentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCommentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCommentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCommentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCommentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCommentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCommentResponse withData(CollectionTicketComment data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCommentResponse withData(@Nonnull CollectionTicketComment data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCommentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCommentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCommentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private CollectionTicketComment data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(CollectionTicketComment data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull CollectionTicketComment data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCommentResponse build() { - return new GetCommentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCommentsResponse.java b/src/main/java/com/apideck/unify/models/components/GetCommentsResponse.java index 8f40918f..9a268f8c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCommentsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCommentsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetCommentsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCommentsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCommentsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCommentsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCommentsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCommentsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCommentsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCommentsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCommentsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCommentsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCommentsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCommentsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCommentsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetCommentsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetCommentsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetCommentsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetCommentsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetCommentsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetCommentsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetCommentsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetCommentsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCommentsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCommentsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCommentsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCommentsResponse build() { - return new GetCommentsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCompaniesResponse.java b/src/main/java/com/apideck/unify/models/components/GetCompaniesResponse.java index 77a74867..1317ed13 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCompaniesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCompaniesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetCompaniesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCompaniesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCompaniesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCompaniesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCompaniesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCompaniesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCompaniesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCompaniesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCompaniesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCompaniesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCompaniesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCompaniesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCompaniesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetCompaniesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetCompaniesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetCompaniesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetCompaniesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetCompaniesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetCompaniesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetCompaniesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetCompaniesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCompaniesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCompaniesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCompaniesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCompaniesResponse build() { - return new GetCompaniesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCompanyInfoResponse.java b/src/main/java/com/apideck/unify/models/components/GetCompanyInfoResponse.java index b34685b1..2be3ae7a 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCompanyInfoResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCompanyInfoResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetCompanyInfoResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCompanyInfoResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") CompanyInfo data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull CompanyInfo data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCompanyInfoResponse( long statusCode, - String status, - String service, - String resource, - String operation, - CompanyInfo data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull CompanyInfo data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public CompanyInfo data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCompanyInfoResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCompanyInfoResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCompanyInfoResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCompanyInfoResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCompanyInfoResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCompanyInfoResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCompanyInfoResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCompanyInfoResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCompanyInfoResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCompanyInfoResponse withData(CompanyInfo data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCompanyInfoResponse withData(@Nonnull CompanyInfo data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCompanyInfoResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCompanyInfoResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCompanyInfoResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private CompanyInfo data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(CompanyInfo data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull CompanyInfo data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCompanyInfoResponse build() { - return new GetCompanyInfoResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCompanyResponse.java b/src/main/java/com/apideck/unify/models/components/GetCompanyResponse.java index 078aa24c..0d090624 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCompanyResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCompanyResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetCompanyResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCompanyResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Company1 data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Company1 data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCompanyResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Company1 data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Company1 data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Company1 data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCompanyResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCompanyResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCompanyResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCompanyResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCompanyResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCompanyResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCompanyResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCompanyResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCompanyResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCompanyResponse withData(Company1 data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCompanyResponse withData(@Nonnull Company1 data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCompanyResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCompanyResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCompanyResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Company1 data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Company1 data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Company1 data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCompanyResponse build() { - return new GetCompanyResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetConnectionResponse.java b/src/main/java/com/apideck/unify/models/components/GetConnectionResponse.java index 908e3cfb..8407158b 100644 --- a/src/main/java/com/apideck/unify/models/components/GetConnectionResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetConnectionResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class GetConnectionResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetConnectionResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Connection data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Connection data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetConnectionResponse( long statusCode, - String status, - Connection data) { + @Nonnull String status, + @Nonnull Connection data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Connection data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public GetConnectionResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetConnectionResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetConnectionResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetConnectionResponse withData(Connection data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetConnectionResponse withData(@Nonnull Connection data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetConnectionResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetConnectionResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetConnectionResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Connection data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Connection data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Connection data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetConnectionResponse build() { - return new GetConnectionResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/GetConnectionsResponse.java b/src/main/java/com/apideck/unify/models/components/GetConnectionsResponse.java index de0b8887..25edc30c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetConnectionsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetConnectionsResponse.java @@ -5,17 +5,17 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -45,60 +45,54 @@ public class GetConnectionsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetConnectionsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetConnectionsResponse( long statusCode, - String status, - List data) { + @Nonnull String status, + @Nonnull List data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -110,43 +104,34 @@ public static Builder builder() { * HTTP Response Status Code */ public GetConnectionsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetConnectionsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetConnectionsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetConnectionsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetConnectionsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetConnectionsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetConnectionsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetConnectionsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -183,66 +168,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetConnectionsResponse build() { - return new GetConnectionsResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/GetConnectorResourceResponse.java b/src/main/java/com/apideck/unify/models/components/GetConnectorResourceResponse.java index 3fb911e1..6ad1a30c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetConnectorResourceResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetConnectorResourceResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -45,98 +44,86 @@ public class GetConnectorResourceResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetConnectorResourceResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") ConnectorResource data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull ConnectorResource data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetConnectorResourceResponse( long statusCode, - String status, - ConnectorResource data) { + @Nonnull String status, + @Nonnull ConnectorResource data) { this(statusCode, status, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public ConnectorResource data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -148,50 +135,31 @@ public static Builder builder() { * HTTP Response Status Code */ public GetConnectorResourceResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetConnectorResourceResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetConnectorResourceResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetConnectorResourceResponse withData(ConnectorResource data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetConnectorResourceResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetConnectorResourceResponse withData(@Nonnull ConnectorResource data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetConnectorResourceResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetConnectorResourceResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetConnectorResourceResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -199,31 +167,21 @@ public GetConnectorResourceResponse withMeta(Meta meta) { /** * Response metadata */ - public GetConnectorResourceResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetConnectorResourceResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetConnectorResourceResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetConnectorResourceResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetConnectorResourceResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -263,108 +221,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private ConnectorResource data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(ConnectorResource data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull ConnectorResource data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - /** * Response metadata */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - - /** - * Response metadata - */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetConnectorResourceResponse build() { - return new GetConnectorResourceResponse( statusCode, status, data, raw, meta, links); diff --git a/src/main/java/com/apideck/unify/models/components/GetConnectorResponse.java b/src/main/java/com/apideck/unify/models/components/GetConnectorResponse.java index 397a9e9d..cbadfe2a 100644 --- a/src/main/java/com/apideck/unify/models/components/GetConnectorResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetConnectorResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -45,98 +44,86 @@ public class GetConnectorResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetConnectorResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Connector data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Connector data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetConnectorResponse( long statusCode, - String status, - Connector data) { + @Nonnull String status, + @Nonnull Connector data) { this(statusCode, status, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Connector data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -148,50 +135,31 @@ public static Builder builder() { * HTTP Response Status Code */ public GetConnectorResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetConnectorResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetConnectorResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetConnectorResponse withData(Connector data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetConnectorResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetConnectorResponse withData(@Nonnull Connector data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetConnectorResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetConnectorResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetConnectorResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -199,31 +167,21 @@ public GetConnectorResponse withMeta(Meta meta) { /** * Response metadata */ - public GetConnectorResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetConnectorResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetConnectorResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetConnectorResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetConnectorResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -263,108 +221,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Connector data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Connector data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Connector data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - /** * Response metadata */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - - /** - * Response metadata - */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetConnectorResponse build() { - return new GetConnectorResponse( statusCode, status, data, raw, meta, links); diff --git a/src/main/java/com/apideck/unify/models/components/GetConnectorsResponse.java b/src/main/java/com/apideck/unify/models/components/GetConnectorsResponse.java index 5bf13929..b16ba325 100644 --- a/src/main/java/com/apideck/unify/models/components/GetConnectorsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetConnectorsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -46,98 +45,86 @@ public class GetConnectorsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetConnectorsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetConnectorsResponse( long statusCode, - String status, - List data) { + @Nonnull String status, + @Nonnull List data) { this(statusCode, status, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -149,50 +136,31 @@ public static Builder builder() { * HTTP Response Status Code */ public GetConnectorsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetConnectorsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetConnectorsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetConnectorsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetConnectorsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetConnectorsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetConnectorsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetConnectorsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetConnectorsResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -200,31 +168,21 @@ public GetConnectorsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetConnectorsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetConnectorsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetConnectorsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetConnectorsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetConnectorsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -264,108 +222,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - /** * Response metadata */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - - /** - * Response metadata - */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetConnectorsResponse build() { - return new GetConnectorsResponse( statusCode, status, data, raw, meta, links); diff --git a/src/main/java/com/apideck/unify/models/components/GetConsumerResponse.java b/src/main/java/com/apideck/unify/models/components/GetConsumerResponse.java index d264552d..1e1e614f 100644 --- a/src/main/java/com/apideck/unify/models/components/GetConsumerResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetConsumerResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class GetConsumerResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetConsumerResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Consumer data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Consumer data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetConsumerResponse( long statusCode, - String status, - Consumer data) { + @Nonnull String status, + @Nonnull Consumer data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Consumer data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public GetConsumerResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetConsumerResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetConsumerResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetConsumerResponse withData(Consumer data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetConsumerResponse withData(@Nonnull Consumer data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetConsumerResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetConsumerResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetConsumerResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Consumer data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Consumer data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Consumer data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetConsumerResponse build() { - return new GetConsumerResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/GetConsumersResponse.java b/src/main/java/com/apideck/unify/models/components/GetConsumersResponse.java index e6f9c53f..8435cb4c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetConsumersResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetConsumersResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -46,98 +45,86 @@ public class GetConsumersResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetConsumersResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetConsumersResponse( long statusCode, - String status, - List data) { + @Nonnull String status, + @Nonnull List data) { this(statusCode, status, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -149,32 +136,22 @@ public static Builder builder() { * HTTP Response Status Code */ public GetConsumersResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetConsumersResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetConsumersResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetConsumersResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetConsumersResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetConsumersResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -182,48 +159,29 @@ public GetConsumersResponse withMeta(Meta meta) { /** * Response metadata */ - public GetConsumersResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetConsumersResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetConsumersResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetConsumersResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetConsumersResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetConsumersResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetConsumersResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetConsumersResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -264,108 +222,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Response metadata */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - - /** - * Response metadata - */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetConsumersResponse build() { - return new GetConsumersResponse( statusCode, status, data, meta, links, raw); diff --git a/src/main/java/com/apideck/unify/models/components/GetContactResponse.java b/src/main/java/com/apideck/unify/models/components/GetContactResponse.java index 031cbb77..35dd2ec1 100644 --- a/src/main/java/com/apideck/unify/models/components/GetContactResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetContactResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetContactResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetContactResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Contact data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Contact data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetContactResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Contact data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Contact data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Contact data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetContactResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetContactResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetContactResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetContactResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetContactResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetContactResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetContactResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetContactResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetContactResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetContactResponse withData(Contact data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetContactResponse withData(@Nonnull Contact data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetContactResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetContactResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetContactResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Contact data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Contact data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Contact data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetContactResponse build() { - return new GetContactResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetContactsResponse.java b/src/main/java/com/apideck/unify/models/components/GetContactsResponse.java index a55902c9..404f7fad 100644 --- a/src/main/java/com/apideck/unify/models/components/GetContactsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetContactsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetContactsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetContactsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetContactsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetContactsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetContactsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetContactsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetContactsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetContactsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetContactsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetContactsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetContactsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetContactsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetContactsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetContactsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetContactsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetContactsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetContactsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetContactsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetContactsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetContactsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetContactsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetContactsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetContactsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetContactsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetContactsResponse build() { - return new GetContactsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCreditNoteResponse.java b/src/main/java/com/apideck/unify/models/components/GetCreditNoteResponse.java index d10080d1..1bead892 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCreditNoteResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCreditNoteResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetCreditNoteResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCreditNoteResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") CreditNote data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull CreditNote data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCreditNoteResponse( long statusCode, - String status, - String service, - String resource, - String operation, - CreditNote data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull CreditNote data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public CreditNote data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCreditNoteResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCreditNoteResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCreditNoteResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCreditNoteResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCreditNoteResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCreditNoteResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCreditNoteResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCreditNoteResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCreditNoteResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCreditNoteResponse withData(CreditNote data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCreditNoteResponse withData(@Nonnull CreditNote data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCreditNoteResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCreditNoteResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCreditNoteResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private CreditNote data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(CreditNote data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull CreditNote data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCreditNoteResponse build() { - return new GetCreditNoteResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCreditNotesResponse.java b/src/main/java/com/apideck/unify/models/components/GetCreditNotesResponse.java index ce94a9b3..bc0b5e9c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCreditNotesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCreditNotesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetCreditNotesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCreditNotesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCreditNotesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCreditNotesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCreditNotesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCreditNotesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCreditNotesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCreditNotesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCreditNotesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCreditNotesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCreditNotesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCreditNotesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCreditNotesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetCreditNotesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetCreditNotesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetCreditNotesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetCreditNotesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetCreditNotesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetCreditNotesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetCreditNotesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetCreditNotesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCreditNotesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCreditNotesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCreditNotesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCreditNotesResponse build() { - return new GetCreditNotesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCustomFieldsResponse.java b/src/main/java/com/apideck/unify/models/components/GetCustomFieldsResponse.java index 7c2e4639..8fe2bef9 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCustomFieldsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCustomFieldsResponse.java @@ -5,17 +5,17 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -45,60 +45,54 @@ public class GetCustomFieldsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCustomFieldsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCustomFieldsResponse( long statusCode, - String status, - List data) { + @Nonnull String status, + @Nonnull List data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -110,43 +104,34 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCustomFieldsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCustomFieldsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCustomFieldsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetCustomFieldsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCustomFieldsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCustomFieldsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCustomFieldsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCustomFieldsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -183,66 +168,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCustomFieldsResponse build() { - return new GetCustomFieldsResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/GetCustomMappingsResponse.java b/src/main/java/com/apideck/unify/models/components/GetCustomMappingsResponse.java index 21ace14c..ff82cbe5 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCustomMappingsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCustomMappingsResponse.java @@ -5,17 +5,17 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -45,60 +45,54 @@ public class GetCustomMappingsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCustomMappingsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCustomMappingsResponse( long statusCode, - String status, - List data) { + @Nonnull String status, + @Nonnull List data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -110,43 +104,34 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCustomMappingsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCustomMappingsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCustomMappingsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetCustomMappingsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCustomMappingsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCustomMappingsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCustomMappingsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCustomMappingsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -183,66 +168,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCustomMappingsResponse build() { - return new GetCustomMappingsResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/GetCustomObjectResponse.java b/src/main/java/com/apideck/unify/models/components/GetCustomObjectResponse.java index fc6745f2..cc5a82d5 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCustomObjectResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCustomObjectResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetCustomObjectResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCustomObjectResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") CustomObject data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull CustomObject data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCustomObjectResponse( long statusCode, - String status, - String service, - String resource, - String operation, - CustomObject data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull CustomObject data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public CustomObject data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCustomObjectResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCustomObjectResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCustomObjectResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCustomObjectResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCustomObjectResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCustomObjectResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCustomObjectResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCustomObjectResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCustomObjectResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCustomObjectResponse withData(CustomObject data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCustomObjectResponse withData(@Nonnull CustomObject data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCustomObjectResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCustomObjectResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCustomObjectResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private CustomObject data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(CustomObject data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull CustomObject data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCustomObjectResponse build() { - return new GetCustomObjectResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCustomObjectSchemaResponse.java b/src/main/java/com/apideck/unify/models/components/GetCustomObjectSchemaResponse.java index 77090956..80cc17ac 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCustomObjectSchemaResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCustomObjectSchemaResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetCustomObjectSchemaResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCustomObjectSchemaResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") CustomObjectSchema data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull CustomObjectSchema data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCustomObjectSchemaResponse( long statusCode, - String status, - String service, - String resource, - String operation, - CustomObjectSchema data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull CustomObjectSchema data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public CustomObjectSchema data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCustomObjectSchemaResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCustomObjectSchemaResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCustomObjectSchemaResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCustomObjectSchemaResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCustomObjectSchemaResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCustomObjectSchemaResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCustomObjectSchemaResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCustomObjectSchemaResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCustomObjectSchemaResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCustomObjectSchemaResponse withData(CustomObjectSchema data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCustomObjectSchemaResponse withData(@Nonnull CustomObjectSchema data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCustomObjectSchemaResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCustomObjectSchemaResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCustomObjectSchemaResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private CustomObjectSchema data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(CustomObjectSchema data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull CustomObjectSchema data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCustomObjectSchemaResponse build() { - return new GetCustomObjectSchemaResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCustomObjectSchemasResponse.java b/src/main/java/com/apideck/unify/models/components/GetCustomObjectSchemasResponse.java index 4f099e13..8e49adf2 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCustomObjectSchemasResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCustomObjectSchemasResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetCustomObjectSchemasResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetCustomObjectSchemasResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetCustomObjectSchemasResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCustomObjectSchemasResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCustomObjectSchemasResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCustomObjectSchemasResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCustomObjectSchemasResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCustomObjectSchemasResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCustomObjectSchemasResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCustomObjectSchemasResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCustomObjectSchemasResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCustomObjectSchemasResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCustomObjectSchemasResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCustomObjectSchemasResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetCustomObjectSchemasResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCustomObjectSchemasResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetCustomObjectSchemasResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetCustomObjectSchemasResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetCustomObjectSchemasResponse withMeta(Meta meta) { /** * Response metadata */ - public GetCustomObjectSchemasResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetCustomObjectSchemasResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetCustomObjectSchemasResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetCustomObjectSchemasResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetCustomObjectSchemasResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetCustomObjectSchemasResponse build() { - return new GetCustomObjectSchemasResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCustomObjectsResponse.java b/src/main/java/com/apideck/unify/models/components/GetCustomObjectsResponse.java index 4c610854..9bad9ccc 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCustomObjectsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCustomObjectsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetCustomObjectsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetCustomObjectsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetCustomObjectsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCustomObjectsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCustomObjectsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCustomObjectsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCustomObjectsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCustomObjectsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCustomObjectsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCustomObjectsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCustomObjectsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCustomObjectsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCustomObjectsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCustomObjectsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetCustomObjectsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCustomObjectsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetCustomObjectsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetCustomObjectsResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetCustomObjectsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetCustomObjectsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetCustomObjectsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetCustomObjectsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetCustomObjectsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetCustomObjectsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetCustomObjectsResponse build() { - return new GetCustomObjectsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCustomerResponse.java b/src/main/java/com/apideck/unify/models/components/GetCustomerResponse.java index d516120b..bde366e6 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCustomerResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCustomerResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetCustomerResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCustomerResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Customer data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Customer data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCustomerResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Customer data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Customer data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Customer data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCustomerResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCustomerResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCustomerResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCustomerResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCustomerResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCustomerResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCustomerResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCustomerResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCustomerResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCustomerResponse withData(Customer data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetCustomerResponse withData(@Nonnull Customer data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCustomerResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCustomerResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCustomerResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Customer data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Customer data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Customer data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCustomerResponse build() { - return new GetCustomerResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetCustomersResponse.java b/src/main/java/com/apideck/unify/models/components/GetCustomersResponse.java index 86ff489f..47a9ea48 100644 --- a/src/main/java/com/apideck/unify/models/components/GetCustomersResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetCustomersResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetCustomersResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetCustomersResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetCustomersResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetCustomersResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetCustomersResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetCustomersResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetCustomersResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetCustomersResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetCustomersResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetCustomersResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetCustomersResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetCustomersResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetCustomersResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetCustomersResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetCustomersResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetCustomersResponse withMeta(Meta meta) { /** * Response metadata */ - public GetCustomersResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetCustomersResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetCustomersResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetCustomersResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetCustomersResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetCustomersResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetCustomersResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetCustomersResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetCustomersResponse build() { - return new GetCustomersResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetDepartmentResponse.java b/src/main/java/com/apideck/unify/models/components/GetDepartmentResponse.java index b7ab9ab2..948e8a35 100644 --- a/src/main/java/com/apideck/unify/models/components/GetDepartmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetDepartmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetDepartmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetDepartmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Department data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Department data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetDepartmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Department data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Department data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Department data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetDepartmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetDepartmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetDepartmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetDepartmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetDepartmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetDepartmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetDepartmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetDepartmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetDepartmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetDepartmentResponse withData(Department data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetDepartmentResponse withData(@Nonnull Department data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetDepartmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetDepartmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetDepartmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Department data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Department data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Department data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetDepartmentResponse build() { - return new GetDepartmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetDepartmentsResponse.java b/src/main/java/com/apideck/unify/models/components/GetDepartmentsResponse.java index daaa9eb3..4690c2ec 100644 --- a/src/main/java/com/apideck/unify/models/components/GetDepartmentsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetDepartmentsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetDepartmentsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetDepartmentsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetDepartmentsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetDepartmentsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetDepartmentsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetDepartmentsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetDepartmentsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetDepartmentsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetDepartmentsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetDepartmentsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetDepartmentsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetDepartmentsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetDepartmentsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetDepartmentsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetDepartmentsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetDepartmentsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetDepartmentsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetDepartmentsResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetDepartmentsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetDepartmentsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetDepartmentsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetDepartmentsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetDepartmentsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetDepartmentsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetDepartmentsResponse build() { - return new GetDepartmentsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetDriveGroupResponse.java b/src/main/java/com/apideck/unify/models/components/GetDriveGroupResponse.java index 5aa2462d..e8b21505 100644 --- a/src/main/java/com/apideck/unify/models/components/GetDriveGroupResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetDriveGroupResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetDriveGroupResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetDriveGroupResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") DriveGroup data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull DriveGroup data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetDriveGroupResponse( long statusCode, - String status, - String service, - String resource, - String operation, - DriveGroup data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull DriveGroup data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public DriveGroup data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetDriveGroupResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetDriveGroupResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetDriveGroupResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetDriveGroupResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetDriveGroupResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetDriveGroupResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetDriveGroupResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetDriveGroupResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetDriveGroupResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetDriveGroupResponse withData(DriveGroup data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetDriveGroupResponse withData(@Nonnull DriveGroup data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetDriveGroupResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetDriveGroupResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetDriveGroupResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private DriveGroup data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(DriveGroup data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull DriveGroup data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetDriveGroupResponse build() { - return new GetDriveGroupResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetDriveGroupsResponse.java b/src/main/java/com/apideck/unify/models/components/GetDriveGroupsResponse.java index 8716f104..313cc44d 100644 --- a/src/main/java/com/apideck/unify/models/components/GetDriveGroupsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetDriveGroupsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetDriveGroupsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetDriveGroupsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetDriveGroupsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetDriveGroupsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetDriveGroupsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetDriveGroupsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetDriveGroupsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetDriveGroupsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetDriveGroupsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetDriveGroupsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetDriveGroupsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetDriveGroupsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetDriveGroupsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetDriveGroupsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetDriveGroupsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetDriveGroupsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetDriveGroupsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetDriveGroupsResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetDriveGroupsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetDriveGroupsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetDriveGroupsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetDriveGroupsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetDriveGroupsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetDriveGroupsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetDriveGroupsResponse build() { - return new GetDriveGroupsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetDriveResponse.java b/src/main/java/com/apideck/unify/models/components/GetDriveResponse.java index b4f563a1..1385c438 100644 --- a/src/main/java/com/apideck/unify/models/components/GetDriveResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetDriveResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetDriveResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetDriveResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Drive data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Drive data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetDriveResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Drive data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Drive data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Drive data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetDriveResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetDriveResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetDriveResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetDriveResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetDriveResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetDriveResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetDriveResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetDriveResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetDriveResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetDriveResponse withData(Drive data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetDriveResponse withData(@Nonnull Drive data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetDriveResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetDriveResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetDriveResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Drive data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Drive data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Drive data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetDriveResponse build() { - return new GetDriveResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetDrivesResponse.java b/src/main/java/com/apideck/unify/models/components/GetDrivesResponse.java index 883ca40c..529848c5 100644 --- a/src/main/java/com/apideck/unify/models/components/GetDrivesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetDrivesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetDrivesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetDrivesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetDrivesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetDrivesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetDrivesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetDrivesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetDrivesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetDrivesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetDrivesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetDrivesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetDrivesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetDrivesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetDrivesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetDrivesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetDrivesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetDrivesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetDrivesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetDrivesResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetDrivesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetDrivesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetDrivesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetDrivesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetDrivesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetDrivesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetDrivesResponse build() { - return new GetDrivesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetEcommerceCustomerResponse.java b/src/main/java/com/apideck/unify/models/components/GetEcommerceCustomerResponse.java index 23fcc2b8..a467e315 100644 --- a/src/main/java/com/apideck/unify/models/components/GetEcommerceCustomerResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetEcommerceCustomerResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetEcommerceCustomerResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetEcommerceCustomerResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") EcommerceCustomer data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull EcommerceCustomer data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetEcommerceCustomerResponse( long statusCode, - String status, - String service, - String resource, - String operation, - EcommerceCustomer data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull EcommerceCustomer data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public EcommerceCustomer data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetEcommerceCustomerResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetEcommerceCustomerResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetEcommerceCustomerResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetEcommerceCustomerResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetEcommerceCustomerResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetEcommerceCustomerResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetEcommerceCustomerResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetEcommerceCustomerResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetEcommerceCustomerResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetEcommerceCustomerResponse withData(EcommerceCustomer data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetEcommerceCustomerResponse withData(@Nonnull EcommerceCustomer data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetEcommerceCustomerResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetEcommerceCustomerResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEcommerceCustomerResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private EcommerceCustomer data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(EcommerceCustomer data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull EcommerceCustomer data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetEcommerceCustomerResponse build() { - return new GetEcommerceCustomerResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetEcommerceCustomersResponse.java b/src/main/java/com/apideck/unify/models/components/GetEcommerceCustomersResponse.java index ba29ea31..010eaf38 100644 --- a/src/main/java/com/apideck/unify/models/components/GetEcommerceCustomersResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetEcommerceCustomersResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetEcommerceCustomersResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetEcommerceCustomersResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetEcommerceCustomersResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetEcommerceCustomersResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetEcommerceCustomersResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetEcommerceCustomersResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetEcommerceCustomersResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetEcommerceCustomersResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetEcommerceCustomersResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetEcommerceCustomersResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetEcommerceCustomersResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetEcommerceCustomersResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetEcommerceCustomersResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEcommerceCustomersResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetEcommerceCustomersResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEcommerceCustomersResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetEcommerceCustomersResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetEcommerceCustomersResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetEcommerceCustomersResponse withMeta(Meta meta) { /** * Response metadata */ - public GetEcommerceCustomersResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetEcommerceCustomersResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetEcommerceCustomersResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetEcommerceCustomersResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetEcommerceCustomersResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetEcommerceCustomersResponse build() { - return new GetEcommerceCustomersResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetEcommerceOrderResponse.java b/src/main/java/com/apideck/unify/models/components/GetEcommerceOrderResponse.java index 5f9d7bb8..28868717 100644 --- a/src/main/java/com/apideck/unify/models/components/GetEcommerceOrderResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetEcommerceOrderResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetEcommerceOrderResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetEcommerceOrderResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") EcommerceOrder data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull EcommerceOrder data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetEcommerceOrderResponse( long statusCode, - String status, - String service, - String resource, - String operation, - EcommerceOrder data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull EcommerceOrder data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public EcommerceOrder data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetEcommerceOrderResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetEcommerceOrderResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetEcommerceOrderResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetEcommerceOrderResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetEcommerceOrderResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetEcommerceOrderResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetEcommerceOrderResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetEcommerceOrderResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetEcommerceOrderResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetEcommerceOrderResponse withData(EcommerceOrder data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetEcommerceOrderResponse withData(@Nonnull EcommerceOrder data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetEcommerceOrderResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetEcommerceOrderResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEcommerceOrderResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private EcommerceOrder data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(EcommerceOrder data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull EcommerceOrder data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetEcommerceOrderResponse build() { - return new GetEcommerceOrderResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetEcommerceOrdersResponse.java b/src/main/java/com/apideck/unify/models/components/GetEcommerceOrdersResponse.java index 58e71ab5..4bfbfcff 100644 --- a/src/main/java/com/apideck/unify/models/components/GetEcommerceOrdersResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetEcommerceOrdersResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetEcommerceOrdersResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetEcommerceOrdersResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetEcommerceOrdersResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetEcommerceOrdersResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetEcommerceOrdersResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetEcommerceOrdersResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetEcommerceOrdersResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetEcommerceOrdersResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetEcommerceOrdersResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetEcommerceOrdersResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetEcommerceOrdersResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetEcommerceOrdersResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetEcommerceOrdersResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEcommerceOrdersResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetEcommerceOrdersResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEcommerceOrdersResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetEcommerceOrdersResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetEcommerceOrdersResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetEcommerceOrdersResponse withMeta(Meta meta) { /** * Response metadata */ - public GetEcommerceOrdersResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetEcommerceOrdersResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetEcommerceOrdersResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetEcommerceOrdersResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetEcommerceOrdersResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetEcommerceOrdersResponse build() { - return new GetEcommerceOrdersResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetEmployeePayrollResponse.java b/src/main/java/com/apideck/unify/models/components/GetEmployeePayrollResponse.java index 9d040bf5..e8efa236 100644 --- a/src/main/java/com/apideck/unify/models/components/GetEmployeePayrollResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetEmployeePayrollResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetEmployeePayrollResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetEmployeePayrollResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") EmployeePayroll data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull EmployeePayroll data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetEmployeePayrollResponse( long statusCode, - String status, - String service, - String resource, - String operation, - EmployeePayroll data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull EmployeePayroll data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public EmployeePayroll data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetEmployeePayrollResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetEmployeePayrollResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetEmployeePayrollResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetEmployeePayrollResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetEmployeePayrollResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetEmployeePayrollResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetEmployeePayrollResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetEmployeePayrollResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetEmployeePayrollResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetEmployeePayrollResponse withData(EmployeePayroll data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetEmployeePayrollResponse withData(@Nonnull EmployeePayroll data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetEmployeePayrollResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetEmployeePayrollResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEmployeePayrollResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private EmployeePayroll data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(EmployeePayroll data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull EmployeePayroll data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetEmployeePayrollResponse build() { - return new GetEmployeePayrollResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetEmployeePayrollsResponse.java b/src/main/java/com/apideck/unify/models/components/GetEmployeePayrollsResponse.java index ca75a9ce..54f6763a 100644 --- a/src/main/java/com/apideck/unify/models/components/GetEmployeePayrollsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetEmployeePayrollsResponse.java @@ -5,17 +5,17 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -63,97 +63,88 @@ public class GetEmployeePayrollsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetEmployeePayrollsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetEmployeePayrollsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -165,70 +156,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetEmployeePayrollsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetEmployeePayrollsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetEmployeePayrollsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetEmployeePayrollsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetEmployeePayrollsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetEmployeePayrollsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetEmployeePayrollsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetEmployeePayrollsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetEmployeePayrollsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetEmployeePayrollsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetEmployeePayrollsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetEmployeePayrollsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetEmployeePayrollsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEmployeePayrollsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -272,7 +254,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -284,90 +266,66 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetEmployeePayrollsResponse build() { - return new GetEmployeePayrollsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetEmployeeResponse.java b/src/main/java/com/apideck/unify/models/components/GetEmployeeResponse.java index 7cd121f3..8801d8d1 100644 --- a/src/main/java/com/apideck/unify/models/components/GetEmployeeResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetEmployeeResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetEmployeeResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetEmployeeResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Employee data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Employee data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetEmployeeResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Employee data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Employee data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Employee data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetEmployeeResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetEmployeeResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetEmployeeResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetEmployeeResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetEmployeeResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetEmployeeResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetEmployeeResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetEmployeeResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetEmployeeResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetEmployeeResponse withData(Employee data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetEmployeeResponse withData(@Nonnull Employee data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetEmployeeResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetEmployeeResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEmployeeResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Employee data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Employee data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Employee data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetEmployeeResponse build() { - return new GetEmployeeResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetEmployeeSchedulesResponse.java b/src/main/java/com/apideck/unify/models/components/GetEmployeeSchedulesResponse.java index c897e95c..6e7ef5ee 100644 --- a/src/main/java/com/apideck/unify/models/components/GetEmployeeSchedulesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetEmployeeSchedulesResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetEmployeeSchedulesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetEmployeeSchedulesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") EmployeeSchedules data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull EmployeeSchedules data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetEmployeeSchedulesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - EmployeeSchedules data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull EmployeeSchedules data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public EmployeeSchedules data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetEmployeeSchedulesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetEmployeeSchedulesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetEmployeeSchedulesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetEmployeeSchedulesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetEmployeeSchedulesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetEmployeeSchedulesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetEmployeeSchedulesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetEmployeeSchedulesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetEmployeeSchedulesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetEmployeeSchedulesResponse withData(EmployeeSchedules data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetEmployeeSchedulesResponse withData(@Nonnull EmployeeSchedules data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetEmployeeSchedulesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetEmployeeSchedulesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEmployeeSchedulesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private EmployeeSchedules data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(EmployeeSchedules data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull EmployeeSchedules data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetEmployeeSchedulesResponse build() { - return new GetEmployeeSchedulesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetEmployeesResponse.java b/src/main/java/com/apideck/unify/models/components/GetEmployeesResponse.java index 203d8837..4b171c3b 100644 --- a/src/main/java/com/apideck/unify/models/components/GetEmployeesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetEmployeesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetEmployeesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetEmployeesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetEmployeesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetEmployeesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetEmployeesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetEmployeesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetEmployeesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetEmployeesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetEmployeesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetEmployeesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetEmployeesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetEmployeesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetEmployeesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEmployeesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetEmployeesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetEmployeesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetEmployeesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetEmployeesResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetEmployeesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetEmployeesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetEmployeesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetEmployeesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetEmployeesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetEmployeesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetEmployeesResponse build() { - return new GetEmployeesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetExpenseResponse.java b/src/main/java/com/apideck/unify/models/components/GetExpenseResponse.java index df99495d..32f9040d 100644 --- a/src/main/java/com/apideck/unify/models/components/GetExpenseResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetExpenseResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetExpenseResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetExpenseResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Expense data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Expense data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetExpenseResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Expense data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Expense data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Expense data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetExpenseResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetExpenseResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetExpenseResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetExpenseResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetExpenseResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetExpenseResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetExpenseResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetExpenseResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetExpenseResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetExpenseResponse withData(Expense data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetExpenseResponse withData(@Nonnull Expense data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetExpenseResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetExpenseResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetExpenseResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Expense data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Expense data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Expense data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetExpenseResponse build() { - return new GetExpenseResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetExpensesResponse.java b/src/main/java/com/apideck/unify/models/components/GetExpensesResponse.java index 56668a00..b44b4ce4 100644 --- a/src/main/java/com/apideck/unify/models/components/GetExpensesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetExpensesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetExpensesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetExpensesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetExpensesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetExpensesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetExpensesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetExpensesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetExpensesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetExpensesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetExpensesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetExpensesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetExpensesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetExpensesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetExpensesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetExpensesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetExpensesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetExpensesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetExpensesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetExpensesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetExpensesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetExpensesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetExpensesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetExpensesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetExpensesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetExpensesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetExpensesResponse build() { - return new GetExpensesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetFileResponse.java b/src/main/java/com/apideck/unify/models/components/GetFileResponse.java index b48ee7f5..08236c2f 100644 --- a/src/main/java/com/apideck/unify/models/components/GetFileResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetFileResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetFileResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetFileResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedFile data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedFile data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetFileResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedFile data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedFile data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public UnifiedFile data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetFileResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetFileResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetFileResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetFileResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetFileResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetFileResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetFileResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetFileResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetFileResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetFileResponse withData(UnifiedFile data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetFileResponse withData(@Nonnull UnifiedFile data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetFileResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetFileResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetFileResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private UnifiedFile data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(UnifiedFile data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedFile data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetFileResponse build() { - return new GetFileResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetFilesResponse.java b/src/main/java/com/apideck/unify/models/components/GetFilesResponse.java index 623c3520..cfefd641 100644 --- a/src/main/java/com/apideck/unify/models/components/GetFilesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetFilesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetFilesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetFilesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetFilesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetFilesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetFilesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetFilesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetFilesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetFilesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetFilesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetFilesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetFilesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetFilesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetFilesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetFilesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetFilesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetFilesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetFilesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetFilesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetFilesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetFilesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetFilesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetFilesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetFilesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetFilesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetFilesResponse build() { - return new GetFilesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetFolderResponse.java b/src/main/java/com/apideck/unify/models/components/GetFolderResponse.java index bbdccd8b..62d2f769 100644 --- a/src/main/java/com/apideck/unify/models/components/GetFolderResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetFolderResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetFolderResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetFolderResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Folder data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Folder data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetFolderResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Folder data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Folder data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Folder data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetFolderResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetFolderResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetFolderResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetFolderResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetFolderResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetFolderResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetFolderResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetFolderResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetFolderResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetFolderResponse withData(Folder data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetFolderResponse withData(@Nonnull Folder data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetFolderResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetFolderResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetFolderResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Folder data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Folder data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Folder data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetFolderResponse build() { - return new GetFolderResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetHrisCompaniesResponse.java b/src/main/java/com/apideck/unify/models/components/GetHrisCompaniesResponse.java index 4b7c56ef..ef932b8c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetHrisCompaniesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetHrisCompaniesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetHrisCompaniesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetHrisCompaniesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetHrisCompaniesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetHrisCompaniesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetHrisCompaniesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetHrisCompaniesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetHrisCompaniesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetHrisCompaniesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetHrisCompaniesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetHrisCompaniesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetHrisCompaniesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetHrisCompaniesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetHrisCompaniesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetHrisCompaniesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetHrisCompaniesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetHrisCompaniesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetHrisCompaniesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetHrisCompaniesResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetHrisCompaniesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetHrisCompaniesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetHrisCompaniesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetHrisCompaniesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetHrisCompaniesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetHrisCompaniesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetHrisCompaniesResponse build() { - return new GetHrisCompaniesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetHrisCompanyResponse.java b/src/main/java/com/apideck/unify/models/components/GetHrisCompanyResponse.java index 701ba52d..90e6bc69 100644 --- a/src/main/java/com/apideck/unify/models/components/GetHrisCompanyResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetHrisCompanyResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetHrisCompanyResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetHrisCompanyResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") HrisCompany data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull HrisCompany data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetHrisCompanyResponse( long statusCode, - String status, - String service, - String resource, - String operation, - HrisCompany data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull HrisCompany data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public HrisCompany data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetHrisCompanyResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetHrisCompanyResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetHrisCompanyResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetHrisCompanyResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetHrisCompanyResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetHrisCompanyResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetHrisCompanyResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetHrisCompanyResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetHrisCompanyResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetHrisCompanyResponse withData(HrisCompany data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetHrisCompanyResponse withData(@Nonnull HrisCompany data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetHrisCompanyResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetHrisCompanyResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetHrisCompanyResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private HrisCompany data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(HrisCompany data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull HrisCompany data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetHrisCompanyResponse build() { - return new GetHrisCompanyResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetInvoiceItemResponse.java b/src/main/java/com/apideck/unify/models/components/GetInvoiceItemResponse.java index c015a7f5..1f530462 100644 --- a/src/main/java/com/apideck/unify/models/components/GetInvoiceItemResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetInvoiceItemResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetInvoiceItemResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetInvoiceItemResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") InvoiceItem data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull InvoiceItem data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetInvoiceItemResponse( long statusCode, - String status, - String service, - String resource, - String operation, - InvoiceItem data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull InvoiceItem data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public InvoiceItem data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetInvoiceItemResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetInvoiceItemResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetInvoiceItemResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetInvoiceItemResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetInvoiceItemResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetInvoiceItemResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetInvoiceItemResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetInvoiceItemResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetInvoiceItemResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetInvoiceItemResponse withData(InvoiceItem data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetInvoiceItemResponse withData(@Nonnull InvoiceItem data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetInvoiceItemResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetInvoiceItemResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetInvoiceItemResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private InvoiceItem data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(InvoiceItem data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull InvoiceItem data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetInvoiceItemResponse build() { - return new GetInvoiceItemResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetInvoiceItemsResponse.java b/src/main/java/com/apideck/unify/models/components/GetInvoiceItemsResponse.java index 76285ccf..9f833014 100644 --- a/src/main/java/com/apideck/unify/models/components/GetInvoiceItemsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetInvoiceItemsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetInvoiceItemsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetInvoiceItemsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetInvoiceItemsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetInvoiceItemsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetInvoiceItemsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetInvoiceItemsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetInvoiceItemsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetInvoiceItemsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetInvoiceItemsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetInvoiceItemsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetInvoiceItemsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetInvoiceItemsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetInvoiceItemsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetInvoiceItemsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetInvoiceItemsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetInvoiceItemsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetInvoiceItemsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetInvoiceItemsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetInvoiceItemsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetInvoiceItemsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetInvoiceItemsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetInvoiceItemsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetInvoiceItemsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetInvoiceItemsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetInvoiceItemsResponse build() { - return new GetInvoiceItemsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetInvoiceResponse.java b/src/main/java/com/apideck/unify/models/components/GetInvoiceResponse.java index 566023f4..574ea749 100644 --- a/src/main/java/com/apideck/unify/models/components/GetInvoiceResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetInvoiceResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetInvoiceResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetInvoiceResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Invoice data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Invoice data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetInvoiceResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Invoice data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Invoice data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Invoice data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetInvoiceResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetInvoiceResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetInvoiceResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetInvoiceResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetInvoiceResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetInvoiceResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetInvoiceResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetInvoiceResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetInvoiceResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetInvoiceResponse withData(Invoice data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetInvoiceResponse withData(@Nonnull Invoice data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetInvoiceResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetInvoiceResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetInvoiceResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Invoice data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Invoice data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Invoice data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetInvoiceResponse build() { - return new GetInvoiceResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetInvoicesResponse.java b/src/main/java/com/apideck/unify/models/components/GetInvoicesResponse.java index 9f1fdacb..8590de23 100644 --- a/src/main/java/com/apideck/unify/models/components/GetInvoicesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetInvoicesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetInvoicesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetInvoicesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetInvoicesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetInvoicesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetInvoicesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetInvoicesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetInvoicesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetInvoicesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetInvoicesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetInvoicesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetInvoicesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetInvoicesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetInvoicesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetInvoicesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetInvoicesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetInvoicesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetInvoicesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetInvoicesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetInvoicesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetInvoicesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetInvoicesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetInvoicesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetInvoicesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetInvoicesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetInvoicesResponse build() { - return new GetInvoicesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetJobResponse.java b/src/main/java/com/apideck/unify/models/components/GetJobResponse.java index ac79b51d..b72f538e 100644 --- a/src/main/java/com/apideck/unify/models/components/GetJobResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetJobResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetJobResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetJobResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Job data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Job data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetJobResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Job data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Job data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Job data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetJobResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetJobResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetJobResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetJobResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetJobResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetJobResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetJobResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetJobResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetJobResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetJobResponse withData(Job data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetJobResponse withData(@Nonnull Job data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetJobResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetJobResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetJobResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Job data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Job data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Job data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetJobResponse build() { - return new GetJobResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetJobsResponse.java b/src/main/java/com/apideck/unify/models/components/GetJobsResponse.java index d4703fb2..8bb9fea3 100644 --- a/src/main/java/com/apideck/unify/models/components/GetJobsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetJobsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetJobsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetJobsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetJobsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetJobsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetJobsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetJobsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetJobsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetJobsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetJobsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetJobsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetJobsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetJobsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetJobsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetJobsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetJobsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetJobsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetJobsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetJobsResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetJobsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetJobsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetJobsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetJobsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetJobsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetJobsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetJobsResponse build() { - return new GetJobsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetJournalEntriesResponse.java b/src/main/java/com/apideck/unify/models/components/GetJournalEntriesResponse.java index ee7c373a..08b42660 100644 --- a/src/main/java/com/apideck/unify/models/components/GetJournalEntriesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetJournalEntriesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetJournalEntriesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetJournalEntriesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetJournalEntriesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetJournalEntriesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetJournalEntriesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetJournalEntriesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetJournalEntriesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetJournalEntriesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetJournalEntriesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetJournalEntriesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetJournalEntriesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetJournalEntriesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetJournalEntriesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetJournalEntriesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetJournalEntriesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetJournalEntriesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetJournalEntriesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetJournalEntriesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetJournalEntriesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetJournalEntriesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetJournalEntriesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetJournalEntriesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetJournalEntriesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetJournalEntriesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetJournalEntriesResponse build() { - return new GetJournalEntriesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetJournalEntryResponse.java b/src/main/java/com/apideck/unify/models/components/GetJournalEntryResponse.java index a3a807ab..7697afbe 100644 --- a/src/main/java/com/apideck/unify/models/components/GetJournalEntryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetJournalEntryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetJournalEntryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetJournalEntryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") JournalEntry data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull JournalEntry data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetJournalEntryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - JournalEntry data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull JournalEntry data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public JournalEntry data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetJournalEntryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetJournalEntryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetJournalEntryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetJournalEntryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetJournalEntryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetJournalEntryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetJournalEntryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetJournalEntryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetJournalEntryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetJournalEntryResponse withData(JournalEntry data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetJournalEntryResponse withData(@Nonnull JournalEntry data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetJournalEntryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetJournalEntryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetJournalEntryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private JournalEntry data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(JournalEntry data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull JournalEntry data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetJournalEntryResponse build() { - return new GetJournalEntryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetLeadResponse.java b/src/main/java/com/apideck/unify/models/components/GetLeadResponse.java index 1ca31b4e..8f7c7d66 100644 --- a/src/main/java/com/apideck/unify/models/components/GetLeadResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetLeadResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetLeadResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetLeadResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Lead data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Lead data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetLeadResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Lead data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Lead data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Lead data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetLeadResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetLeadResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetLeadResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetLeadResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetLeadResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetLeadResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetLeadResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetLeadResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetLeadResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetLeadResponse withData(Lead data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetLeadResponse withData(@Nonnull Lead data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetLeadResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetLeadResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetLeadResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Lead data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Lead data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Lead data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetLeadResponse build() { - return new GetLeadResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetLeadsResponse.java b/src/main/java/com/apideck/unify/models/components/GetLeadsResponse.java index 402e5f02..4126cd38 100644 --- a/src/main/java/com/apideck/unify/models/components/GetLeadsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetLeadsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetLeadsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetLeadsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetLeadsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetLeadsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetLeadsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetLeadsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetLeadsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetLeadsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetLeadsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetLeadsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetLeadsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetLeadsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetLeadsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetLeadsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetLeadsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetLeadsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetLeadsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetLeadsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetLeadsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetLeadsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetLeadsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetLeadsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetLeadsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetLeadsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetLeadsResponse build() { - return new GetLeadsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetLedgerAccountResponse.java b/src/main/java/com/apideck/unify/models/components/GetLedgerAccountResponse.java index c1b084d1..6d5549a9 100644 --- a/src/main/java/com/apideck/unify/models/components/GetLedgerAccountResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetLedgerAccountResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetLedgerAccountResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetLedgerAccountResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") LedgerAccount data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull LedgerAccount data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetLedgerAccountResponse( long statusCode, - String status, - String service, - String resource, - String operation, - LedgerAccount data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull LedgerAccount data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public LedgerAccount data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetLedgerAccountResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetLedgerAccountResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetLedgerAccountResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetLedgerAccountResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetLedgerAccountResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetLedgerAccountResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetLedgerAccountResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetLedgerAccountResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetLedgerAccountResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetLedgerAccountResponse withData(LedgerAccount data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetLedgerAccountResponse withData(@Nonnull LedgerAccount data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetLedgerAccountResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetLedgerAccountResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetLedgerAccountResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private LedgerAccount data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(LedgerAccount data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull LedgerAccount data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetLedgerAccountResponse build() { - return new GetLedgerAccountResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetLedgerAccountsResponse.java b/src/main/java/com/apideck/unify/models/components/GetLedgerAccountsResponse.java index d43b242f..ce267551 100644 --- a/src/main/java/com/apideck/unify/models/components/GetLedgerAccountsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetLedgerAccountsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetLedgerAccountsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetLedgerAccountsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetLedgerAccountsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetLedgerAccountsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetLedgerAccountsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetLedgerAccountsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetLedgerAccountsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetLedgerAccountsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetLedgerAccountsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetLedgerAccountsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetLedgerAccountsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetLedgerAccountsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetLedgerAccountsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetLedgerAccountsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetLedgerAccountsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetLedgerAccountsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetLedgerAccountsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetLedgerAccountsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetLedgerAccountsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetLedgerAccountsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetLedgerAccountsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetLedgerAccountsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetLedgerAccountsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetLedgerAccountsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetLedgerAccountsResponse build() { - return new GetLedgerAccountsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetLogsResponse.java b/src/main/java/com/apideck/unify/models/components/GetLogsResponse.java index 65cefe93..be83a8ed 100644 --- a/src/main/java/com/apideck/unify/models/components/GetLogsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetLogsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -46,98 +45,86 @@ public class GetLogsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetLogsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetLogsResponse( long statusCode, - String status, - List data) { + @Nonnull String status, + @Nonnull List data) { this(statusCode, status, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -149,32 +136,22 @@ public static Builder builder() { * HTTP Response Status Code */ public GetLogsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetLogsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetLogsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetLogsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetLogsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetLogsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -182,48 +159,29 @@ public GetLogsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetLogsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetLogsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetLogsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetLogsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetLogsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetLogsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetLogsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetLogsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -264,108 +222,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Response metadata */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - - /** - * Response metadata - */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetLogsResponse build() { - return new GetLogsResponse( statusCode, status, data, meta, links, raw); diff --git a/src/main/java/com/apideck/unify/models/components/GetMessageResponse.java b/src/main/java/com/apideck/unify/models/components/GetMessageResponse.java index dc52fa28..3b796868 100644 --- a/src/main/java/com/apideck/unify/models/components/GetMessageResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetMessageResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetMessageResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetMessageResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Message data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Message data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetMessageResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Message data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Message data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Message data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetMessageResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetMessageResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetMessageResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetMessageResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetMessageResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetMessageResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetMessageResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetMessageResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetMessageResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetMessageResponse withData(Message data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetMessageResponse withData(@Nonnull Message data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetMessageResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetMessageResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetMessageResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Message data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Message data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Message data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetMessageResponse build() { - return new GetMessageResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetMessagesResponse.java b/src/main/java/com/apideck/unify/models/components/GetMessagesResponse.java index 0fd6f4f1..5bdd4150 100644 --- a/src/main/java/com/apideck/unify/models/components/GetMessagesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetMessagesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetMessagesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetMessagesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetMessagesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetMessagesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetMessagesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetMessagesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetMessagesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetMessagesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetMessagesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetMessagesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetMessagesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetMessagesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetMessagesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetMessagesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetMessagesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetMessagesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetMessagesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetMessagesResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetMessagesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetMessagesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetMessagesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetMessagesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetMessagesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetMessagesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetMessagesResponse build() { - return new GetMessagesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetNoteResponse.java b/src/main/java/com/apideck/unify/models/components/GetNoteResponse.java index 6590413f..0e42d7f7 100644 --- a/src/main/java/com/apideck/unify/models/components/GetNoteResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetNoteResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetNoteResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetNoteResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Note data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Note data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetNoteResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Note data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Note data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Note data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetNoteResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetNoteResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetNoteResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetNoteResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetNoteResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetNoteResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetNoteResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetNoteResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetNoteResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetNoteResponse withData(Note data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetNoteResponse withData(@Nonnull Note data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetNoteResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetNoteResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetNoteResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Note data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Note data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Note data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetNoteResponse build() { - return new GetNoteResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetNotesResponse.java b/src/main/java/com/apideck/unify/models/components/GetNotesResponse.java index f8e9cec6..d6e39b9d 100644 --- a/src/main/java/com/apideck/unify/models/components/GetNotesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetNotesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetNotesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetNotesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetNotesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetNotesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetNotesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetNotesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetNotesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetNotesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetNotesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetNotesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetNotesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetNotesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetNotesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetNotesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetNotesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetNotesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetNotesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetNotesResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetNotesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetNotesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetNotesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetNotesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetNotesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetNotesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetNotesResponse build() { - return new GetNotesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetOpportunitiesResponse.java b/src/main/java/com/apideck/unify/models/components/GetOpportunitiesResponse.java index 2a6df6c9..2dc0643d 100644 --- a/src/main/java/com/apideck/unify/models/components/GetOpportunitiesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetOpportunitiesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetOpportunitiesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetOpportunitiesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetOpportunitiesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetOpportunitiesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetOpportunitiesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetOpportunitiesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetOpportunitiesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetOpportunitiesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetOpportunitiesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetOpportunitiesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetOpportunitiesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetOpportunitiesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetOpportunitiesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetOpportunitiesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetOpportunitiesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetOpportunitiesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetOpportunitiesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetOpportunitiesResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetOpportunitiesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetOpportunitiesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetOpportunitiesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetOpportunitiesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetOpportunitiesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetOpportunitiesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetOpportunitiesResponse build() { - return new GetOpportunitiesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetOpportunityResponse.java b/src/main/java/com/apideck/unify/models/components/GetOpportunityResponse.java index 67035140..5f9d3aae 100644 --- a/src/main/java/com/apideck/unify/models/components/GetOpportunityResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetOpportunityResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetOpportunityResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetOpportunityResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Opportunity data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Opportunity data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetOpportunityResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Opportunity data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Opportunity data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Opportunity data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetOpportunityResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetOpportunityResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetOpportunityResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetOpportunityResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetOpportunityResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetOpportunityResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetOpportunityResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetOpportunityResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetOpportunityResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetOpportunityResponse withData(Opportunity data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetOpportunityResponse withData(@Nonnull Opportunity data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetOpportunityResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetOpportunityResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetOpportunityResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Opportunity data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Opportunity data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Opportunity data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetOpportunityResponse build() { - return new GetOpportunityResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetPaymentResponse.java b/src/main/java/com/apideck/unify/models/components/GetPaymentResponse.java index 1b0332a6..a704b109 100644 --- a/src/main/java/com/apideck/unify/models/components/GetPaymentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetPaymentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetPaymentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetPaymentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Payment data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Payment data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetPaymentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Payment data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Payment data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Payment data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetPaymentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetPaymentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetPaymentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetPaymentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetPaymentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetPaymentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetPaymentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetPaymentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetPaymentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetPaymentResponse withData(Payment data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetPaymentResponse withData(@Nonnull Payment data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetPaymentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetPaymentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetPaymentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Payment data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Payment data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Payment data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetPaymentResponse build() { - return new GetPaymentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetPaymentsResponse.java b/src/main/java/com/apideck/unify/models/components/GetPaymentsResponse.java index 26cffc8b..7b8cf491 100644 --- a/src/main/java/com/apideck/unify/models/components/GetPaymentsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetPaymentsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetPaymentsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetPaymentsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetPaymentsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetPaymentsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetPaymentsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetPaymentsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetPaymentsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetPaymentsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetPaymentsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetPaymentsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetPaymentsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetPaymentsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetPaymentsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetPaymentsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetPaymentsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetPaymentsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetPaymentsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetPaymentsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetPaymentsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetPaymentsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetPaymentsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetPaymentsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetPaymentsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetPaymentsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetPaymentsResponse build() { - return new GetPaymentsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetPayrollResponse.java b/src/main/java/com/apideck/unify/models/components/GetPayrollResponse.java index 74e2e5d0..cd4080e8 100644 --- a/src/main/java/com/apideck/unify/models/components/GetPayrollResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetPayrollResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetPayrollResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetPayrollResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Payroll data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Payroll data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetPayrollResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Payroll data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Payroll data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Payroll data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetPayrollResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetPayrollResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetPayrollResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetPayrollResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetPayrollResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetPayrollResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetPayrollResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetPayrollResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetPayrollResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetPayrollResponse withData(Payroll data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetPayrollResponse withData(@Nonnull Payroll data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetPayrollResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetPayrollResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetPayrollResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Payroll data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Payroll data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Payroll data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetPayrollResponse build() { - return new GetPayrollResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetPayrollsResponse.java b/src/main/java/com/apideck/unify/models/components/GetPayrollsResponse.java index 2689f135..b875176c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetPayrollsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetPayrollsResponse.java @@ -5,17 +5,17 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -63,97 +63,88 @@ public class GetPayrollsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetPayrollsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetPayrollsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -165,70 +156,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetPayrollsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetPayrollsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetPayrollsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetPayrollsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetPayrollsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetPayrollsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetPayrollsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetPayrollsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetPayrollsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetPayrollsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetPayrollsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetPayrollsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetPayrollsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetPayrollsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -272,7 +254,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -284,90 +266,66 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetPayrollsResponse build() { - return new GetPayrollsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetPipelineResponse.java b/src/main/java/com/apideck/unify/models/components/GetPipelineResponse.java index edc6cd91..499b3ea0 100644 --- a/src/main/java/com/apideck/unify/models/components/GetPipelineResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetPipelineResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetPipelineResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetPipelineResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Pipeline data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Pipeline data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetPipelineResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Pipeline data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Pipeline data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Pipeline data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetPipelineResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetPipelineResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetPipelineResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetPipelineResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetPipelineResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetPipelineResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetPipelineResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetPipelineResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetPipelineResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetPipelineResponse withData(Pipeline data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetPipelineResponse withData(@Nonnull Pipeline data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetPipelineResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetPipelineResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetPipelineResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Pipeline data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Pipeline data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Pipeline data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetPipelineResponse build() { - return new GetPipelineResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetPipelinesResponse.java b/src/main/java/com/apideck/unify/models/components/GetPipelinesResponse.java index 3826e34f..52e244de 100644 --- a/src/main/java/com/apideck/unify/models/components/GetPipelinesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetPipelinesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetPipelinesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetPipelinesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetPipelinesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetPipelinesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetPipelinesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetPipelinesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetPipelinesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetPipelinesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetPipelinesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetPipelinesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetPipelinesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetPipelinesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetPipelinesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetPipelinesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetPipelinesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetPipelinesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetPipelinesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetPipelinesResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetPipelinesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetPipelinesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetPipelinesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetPipelinesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetPipelinesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetPipelinesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetPipelinesResponse build() { - return new GetPipelinesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetProductResponse.java b/src/main/java/com/apideck/unify/models/components/GetProductResponse.java index 88d349a4..4efc72f3 100644 --- a/src/main/java/com/apideck/unify/models/components/GetProductResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetProductResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetProductResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetProductResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") EcommerceProduct data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull EcommerceProduct data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetProductResponse( long statusCode, - String status, - String service, - String resource, - String operation, - EcommerceProduct data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull EcommerceProduct data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public EcommerceProduct data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetProductResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetProductResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetProductResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetProductResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetProductResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetProductResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetProductResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetProductResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetProductResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetProductResponse withData(EcommerceProduct data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetProductResponse withData(@Nonnull EcommerceProduct data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetProductResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetProductResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetProductResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private EcommerceProduct data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(EcommerceProduct data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull EcommerceProduct data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetProductResponse build() { - return new GetProductResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetProductsResponse.java b/src/main/java/com/apideck/unify/models/components/GetProductsResponse.java index 055a326c..f84bc79f 100644 --- a/src/main/java/com/apideck/unify/models/components/GetProductsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetProductsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetProductsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetProductsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetProductsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetProductsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetProductsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetProductsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetProductsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetProductsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetProductsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetProductsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetProductsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetProductsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetProductsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetProductsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetProductsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetProductsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetProductsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetProductsResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetProductsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetProductsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetProductsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetProductsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetProductsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetProductsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetProductsResponse build() { - return new GetProductsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetProfitAndLossResponse.java b/src/main/java/com/apideck/unify/models/components/GetProfitAndLossResponse.java index d1ba88dd..252981c0 100644 --- a/src/main/java/com/apideck/unify/models/components/GetProfitAndLossResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetProfitAndLossResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetProfitAndLossResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetProfitAndLossResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") ProfitAndLoss data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull ProfitAndLoss data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetProfitAndLossResponse( long statusCode, - String status, - String service, - String resource, - String operation, - ProfitAndLoss data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull ProfitAndLoss data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public ProfitAndLoss data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetProfitAndLossResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetProfitAndLossResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetProfitAndLossResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetProfitAndLossResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetProfitAndLossResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetProfitAndLossResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetProfitAndLossResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetProfitAndLossResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetProfitAndLossResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetProfitAndLossResponse withData(ProfitAndLoss data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetProfitAndLossResponse withData(@Nonnull ProfitAndLoss data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetProfitAndLossResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetProfitAndLossResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetProfitAndLossResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private ProfitAndLoss data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(ProfitAndLoss data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull ProfitAndLoss data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetProfitAndLossResponse build() { - return new GetProfitAndLossResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetPurchaseOrderResponse.java b/src/main/java/com/apideck/unify/models/components/GetPurchaseOrderResponse.java index 934ad175..732bdd7c 100644 --- a/src/main/java/com/apideck/unify/models/components/GetPurchaseOrderResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetPurchaseOrderResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetPurchaseOrderResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetPurchaseOrderResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") PurchaseOrder data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull PurchaseOrder data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetPurchaseOrderResponse( long statusCode, - String status, - String service, - String resource, - String operation, - PurchaseOrder data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull PurchaseOrder data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public PurchaseOrder data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetPurchaseOrderResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetPurchaseOrderResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetPurchaseOrderResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetPurchaseOrderResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetPurchaseOrderResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetPurchaseOrderResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetPurchaseOrderResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetPurchaseOrderResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetPurchaseOrderResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetPurchaseOrderResponse withData(PurchaseOrder data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetPurchaseOrderResponse withData(@Nonnull PurchaseOrder data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetPurchaseOrderResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetPurchaseOrderResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetPurchaseOrderResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private PurchaseOrder data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(PurchaseOrder data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull PurchaseOrder data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetPurchaseOrderResponse build() { - return new GetPurchaseOrderResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetPurchaseOrdersResponse.java b/src/main/java/com/apideck/unify/models/components/GetPurchaseOrdersResponse.java index eb55a837..36d9f74d 100644 --- a/src/main/java/com/apideck/unify/models/components/GetPurchaseOrdersResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetPurchaseOrdersResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetPurchaseOrdersResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetPurchaseOrdersResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetPurchaseOrdersResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetPurchaseOrdersResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetPurchaseOrdersResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetPurchaseOrdersResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetPurchaseOrdersResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetPurchaseOrdersResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetPurchaseOrdersResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetPurchaseOrdersResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetPurchaseOrdersResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetPurchaseOrdersResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetPurchaseOrdersResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetPurchaseOrdersResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetPurchaseOrdersResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetPurchaseOrdersResponse withMeta(Meta meta) { /** * Response metadata */ - public GetPurchaseOrdersResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetPurchaseOrdersResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetPurchaseOrdersResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetPurchaseOrdersResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetPurchaseOrdersResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetPurchaseOrdersResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetPurchaseOrdersResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetPurchaseOrdersResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetPurchaseOrdersResponse build() { - return new GetPurchaseOrdersResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetSharedLinkResponse.java b/src/main/java/com/apideck/unify/models/components/GetSharedLinkResponse.java index f39a30fb..79f38e6a 100644 --- a/src/main/java/com/apideck/unify/models/components/GetSharedLinkResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetSharedLinkResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetSharedLinkResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetSharedLinkResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") SharedLink data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull SharedLink data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetSharedLinkResponse( long statusCode, - String status, - String service, - String resource, - String operation, - SharedLink data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull SharedLink data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public SharedLink data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetSharedLinkResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetSharedLinkResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetSharedLinkResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetSharedLinkResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetSharedLinkResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetSharedLinkResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetSharedLinkResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetSharedLinkResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetSharedLinkResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetSharedLinkResponse withData(SharedLink data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetSharedLinkResponse withData(@Nonnull SharedLink data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetSharedLinkResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetSharedLinkResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetSharedLinkResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private SharedLink data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(SharedLink data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull SharedLink data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetSharedLinkResponse build() { - return new GetSharedLinkResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetSharedLinksResponse.java b/src/main/java/com/apideck/unify/models/components/GetSharedLinksResponse.java index 9b507af7..ed4d5b43 100644 --- a/src/main/java/com/apideck/unify/models/components/GetSharedLinksResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetSharedLinksResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetSharedLinksResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetSharedLinksResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetSharedLinksResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetSharedLinksResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetSharedLinksResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetSharedLinksResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetSharedLinksResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetSharedLinksResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetSharedLinksResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetSharedLinksResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetSharedLinksResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetSharedLinksResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetSharedLinksResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetSharedLinksResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetSharedLinksResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetSharedLinksResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetSharedLinksResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetSharedLinksResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetSharedLinksResponse withMeta(Meta meta) { /** * Response metadata */ - public GetSharedLinksResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetSharedLinksResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetSharedLinksResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetSharedLinksResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetSharedLinksResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetSharedLinksResponse build() { - return new GetSharedLinksResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetStoreResponse.java b/src/main/java/com/apideck/unify/models/components/GetStoreResponse.java index 6c1847c6..889831a1 100644 --- a/src/main/java/com/apideck/unify/models/components/GetStoreResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetStoreResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetStoreResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetStoreResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") EcommerceStore data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull EcommerceStore data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetStoreResponse( long statusCode, - String status, - String service, - String resource, - String operation, - EcommerceStore data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull EcommerceStore data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public EcommerceStore data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetStoreResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetStoreResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetStoreResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetStoreResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetStoreResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetStoreResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetStoreResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetStoreResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetStoreResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetStoreResponse withData(EcommerceStore data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetStoreResponse withData(@Nonnull EcommerceStore data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetStoreResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetStoreResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetStoreResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private EcommerceStore data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(EcommerceStore data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull EcommerceStore data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetStoreResponse build() { - return new GetStoreResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetSubsidiariesResponse.java b/src/main/java/com/apideck/unify/models/components/GetSubsidiariesResponse.java index 7de3a06e..5d5e54a6 100644 --- a/src/main/java/com/apideck/unify/models/components/GetSubsidiariesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetSubsidiariesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetSubsidiariesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetSubsidiariesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetSubsidiariesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetSubsidiariesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetSubsidiariesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetSubsidiariesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetSubsidiariesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetSubsidiariesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetSubsidiariesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetSubsidiariesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetSubsidiariesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetSubsidiariesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetSubsidiariesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetSubsidiariesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetSubsidiariesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetSubsidiariesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetSubsidiariesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetSubsidiariesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetSubsidiariesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetSubsidiariesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetSubsidiariesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetSubsidiariesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetSubsidiariesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetSubsidiariesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetSubsidiariesResponse build() { - return new GetSubsidiariesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetSubsidiaryResponse.java b/src/main/java/com/apideck/unify/models/components/GetSubsidiaryResponse.java index 6ae1cb9f..aa264c3f 100644 --- a/src/main/java/com/apideck/unify/models/components/GetSubsidiaryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetSubsidiaryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetSubsidiaryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetSubsidiaryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Subsidiary data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Subsidiary data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetSubsidiaryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Subsidiary data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Subsidiary data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Subsidiary data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetSubsidiaryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetSubsidiaryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetSubsidiaryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetSubsidiaryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetSubsidiaryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetSubsidiaryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetSubsidiaryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetSubsidiaryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetSubsidiaryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetSubsidiaryResponse withData(Subsidiary data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetSubsidiaryResponse withData(@Nonnull Subsidiary data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetSubsidiaryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetSubsidiaryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetSubsidiaryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Subsidiary data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Subsidiary data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Subsidiary data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetSubsidiaryResponse build() { - return new GetSubsidiaryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetSupplierResponse.java b/src/main/java/com/apideck/unify/models/components/GetSupplierResponse.java index cdfdc56b..104d947b 100644 --- a/src/main/java/com/apideck/unify/models/components/GetSupplierResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetSupplierResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetSupplierResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetSupplierResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Supplier data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Supplier data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetSupplierResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Supplier data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Supplier data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Supplier data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetSupplierResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetSupplierResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetSupplierResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetSupplierResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetSupplierResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetSupplierResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetSupplierResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetSupplierResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetSupplierResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetSupplierResponse withData(Supplier data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetSupplierResponse withData(@Nonnull Supplier data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetSupplierResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetSupplierResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetSupplierResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Supplier data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Supplier data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Supplier data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetSupplierResponse build() { - return new GetSupplierResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetSuppliersResponse.java b/src/main/java/com/apideck/unify/models/components/GetSuppliersResponse.java index 5fdb33d1..da4ce487 100644 --- a/src/main/java/com/apideck/unify/models/components/GetSuppliersResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetSuppliersResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetSuppliersResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetSuppliersResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetSuppliersResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetSuppliersResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetSuppliersResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetSuppliersResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetSuppliersResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetSuppliersResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetSuppliersResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetSuppliersResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetSuppliersResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetSuppliersResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetSuppliersResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetSuppliersResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetSuppliersResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetSuppliersResponse withMeta(Meta meta) { /** * Response metadata */ - public GetSuppliersResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetSuppliersResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetSuppliersResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetSuppliersResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetSuppliersResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetSuppliersResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetSuppliersResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetSuppliersResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetSuppliersResponse build() { - return new GetSuppliersResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetTaxRateResponse.java b/src/main/java/com/apideck/unify/models/components/GetTaxRateResponse.java index 250ee2f9..b01d6fd8 100644 --- a/src/main/java/com/apideck/unify/models/components/GetTaxRateResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetTaxRateResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetTaxRateResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetTaxRateResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") TaxRate data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull TaxRate data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetTaxRateResponse( long statusCode, - String status, - String service, - String resource, - String operation, - TaxRate data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull TaxRate data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public TaxRate data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetTaxRateResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetTaxRateResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetTaxRateResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetTaxRateResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetTaxRateResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetTaxRateResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetTaxRateResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetTaxRateResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetTaxRateResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetTaxRateResponse withData(TaxRate data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetTaxRateResponse withData(@Nonnull TaxRate data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetTaxRateResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetTaxRateResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetTaxRateResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private TaxRate data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(TaxRate data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull TaxRate data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetTaxRateResponse build() { - return new GetTaxRateResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetTaxRatesResponse.java b/src/main/java/com/apideck/unify/models/components/GetTaxRatesResponse.java index 464ecc52..3a027bba 100644 --- a/src/main/java/com/apideck/unify/models/components/GetTaxRatesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetTaxRatesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetTaxRatesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetTaxRatesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetTaxRatesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetTaxRatesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetTaxRatesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetTaxRatesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetTaxRatesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetTaxRatesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetTaxRatesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetTaxRatesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetTaxRatesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetTaxRatesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetTaxRatesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetTaxRatesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetTaxRatesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetTaxRatesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetTaxRatesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetTaxRatesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetTaxRatesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetTaxRatesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetTaxRatesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetTaxRatesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetTaxRatesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetTaxRatesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetTaxRatesResponse build() { - return new GetTaxRatesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetTicketResponse.java b/src/main/java/com/apideck/unify/models/components/GetTicketResponse.java index 7e408505..a787e86f 100644 --- a/src/main/java/com/apideck/unify/models/components/GetTicketResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetTicketResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetTicketResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetTicketResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") Ticket data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull Ticket data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetTicketResponse( long statusCode, - String status, - String service, - String resource, - String operation, - Ticket data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull Ticket data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public Ticket data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetTicketResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetTicketResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetTicketResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetTicketResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetTicketResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetTicketResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetTicketResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetTicketResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetTicketResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetTicketResponse withData(Ticket data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetTicketResponse withData(@Nonnull Ticket data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetTicketResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetTicketResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetTicketResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private Ticket data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(Ticket data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Ticket data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetTicketResponse build() { - return new GetTicketResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetTicketsResponse.java b/src/main/java/com/apideck/unify/models/components/GetTicketsResponse.java index aabb520d..c09ae89a 100644 --- a/src/main/java/com/apideck/unify/models/components/GetTicketsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetTicketsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetTicketsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetTicketsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetTicketsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetTicketsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetTicketsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetTicketsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetTicketsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetTicketsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetTicketsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetTicketsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetTicketsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetTicketsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetTicketsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetTicketsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetTicketsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetTicketsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetTicketsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetTicketsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetTicketsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetTicketsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetTicketsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetTicketsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetTicketsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetTicketsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetTicketsResponse build() { - return new GetTicketsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetTimeOffRequestResponse.java b/src/main/java/com/apideck/unify/models/components/GetTimeOffRequestResponse.java index 85bb6673..fbf18032 100644 --- a/src/main/java/com/apideck/unify/models/components/GetTimeOffRequestResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetTimeOffRequestResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetTimeOffRequestResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetTimeOffRequestResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") TimeOffRequest data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull TimeOffRequest data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetTimeOffRequestResponse( long statusCode, - String status, - String service, - String resource, - String operation, - TimeOffRequest data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull TimeOffRequest data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public TimeOffRequest data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetTimeOffRequestResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetTimeOffRequestResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetTimeOffRequestResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetTimeOffRequestResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetTimeOffRequestResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetTimeOffRequestResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetTimeOffRequestResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetTimeOffRequestResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetTimeOffRequestResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetTimeOffRequestResponse withData(TimeOffRequest data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetTimeOffRequestResponse withData(@Nonnull TimeOffRequest data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetTimeOffRequestResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetTimeOffRequestResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetTimeOffRequestResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private TimeOffRequest data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(TimeOffRequest data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull TimeOffRequest data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetTimeOffRequestResponse build() { - return new GetTimeOffRequestResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetTimeOffRequestsResponse.java b/src/main/java/com/apideck/unify/models/components/GetTimeOffRequestsResponse.java index 22f7b24c..664ace03 100644 --- a/src/main/java/com/apideck/unify/models/components/GetTimeOffRequestsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetTimeOffRequestsResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetTimeOffRequestsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetTimeOffRequestsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetTimeOffRequestsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetTimeOffRequestsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetTimeOffRequestsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetTimeOffRequestsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetTimeOffRequestsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetTimeOffRequestsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetTimeOffRequestsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetTimeOffRequestsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetTimeOffRequestsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetTimeOffRequestsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetTimeOffRequestsResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetTimeOffRequestsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetTimeOffRequestsResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetTimeOffRequestsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetTimeOffRequestsResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetTimeOffRequestsResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetTimeOffRequestsResponse withMeta(Meta meta) { /** * Response metadata */ - public GetTimeOffRequestsResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetTimeOffRequestsResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetTimeOffRequestsResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetTimeOffRequestsResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetTimeOffRequestsResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetTimeOffRequestsResponse build() { - return new GetTimeOffRequestsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetTrackingCategoriesResponse.java b/src/main/java/com/apideck/unify/models/components/GetTrackingCategoriesResponse.java index 76231ab9..d547d843 100644 --- a/src/main/java/com/apideck/unify/models/components/GetTrackingCategoriesResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetTrackingCategoriesResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetTrackingCategoriesResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetTrackingCategoriesResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetTrackingCategoriesResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -204,59 +188,49 @@ public static Builder builder() { * HTTP Response Status Code */ public GetTrackingCategoriesResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetTrackingCategoriesResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetTrackingCategoriesResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetTrackingCategoriesResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetTrackingCategoriesResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetTrackingCategoriesResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetTrackingCategoriesResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetTrackingCategoriesResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetTrackingCategoriesResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetTrackingCategoriesResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetTrackingCategoriesResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetTrackingCategoriesResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -264,48 +238,29 @@ public GetTrackingCategoriesResponse withMeta(Meta meta) { /** * Response metadata */ - public GetTrackingCategoriesResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetTrackingCategoriesResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetTrackingCategoriesResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetTrackingCategoriesResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetTrackingCategoriesResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetTrackingCategoriesResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetTrackingCategoriesResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetTrackingCategoriesResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } - - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetTrackingCategoriesResponse build() { - return new GetTrackingCategoriesResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetTrackingCategoryResponse.java b/src/main/java/com/apideck/unify/models/components/GetTrackingCategoryResponse.java index d4a73e15..2f6a3b65 100644 --- a/src/main/java/com/apideck/unify/models/components/GetTrackingCategoryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetTrackingCategoryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetTrackingCategoryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetTrackingCategoryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") TrackingCategory data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull TrackingCategory data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetTrackingCategoryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - TrackingCategory data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull TrackingCategory data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public TrackingCategory data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetTrackingCategoryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetTrackingCategoryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetTrackingCategoryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetTrackingCategoryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetTrackingCategoryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetTrackingCategoryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetTrackingCategoryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetTrackingCategoryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetTrackingCategoryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetTrackingCategoryResponse withData(TrackingCategory data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetTrackingCategoryResponse withData(@Nonnull TrackingCategory data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetTrackingCategoryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetTrackingCategoryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetTrackingCategoryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private TrackingCategory data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(TrackingCategory data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull TrackingCategory data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetTrackingCategoryResponse build() { - return new GetTrackingCategoryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetUploadSessionResponse.java b/src/main/java/com/apideck/unify/models/components/GetUploadSessionResponse.java index a706c604..8a5553bd 100644 --- a/src/main/java/com/apideck/unify/models/components/GetUploadSessionResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetUploadSessionResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetUploadSessionResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetUploadSessionResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UploadSession data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UploadSession data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetUploadSessionResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UploadSession data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UploadSession data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public UploadSession data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetUploadSessionResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetUploadSessionResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetUploadSessionResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetUploadSessionResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetUploadSessionResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetUploadSessionResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetUploadSessionResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetUploadSessionResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetUploadSessionResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetUploadSessionResponse withData(UploadSession data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetUploadSessionResponse withData(@Nonnull UploadSession data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetUploadSessionResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetUploadSessionResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetUploadSessionResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private UploadSession data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(UploadSession data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UploadSession data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetUploadSessionResponse build() { - return new GetUploadSessionResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetUserResponse.java b/src/main/java/com/apideck/unify/models/components/GetUserResponse.java index 00fcc275..a25ec62f 100644 --- a/src/main/java/com/apideck/unify/models/components/GetUserResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetUserResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class GetUserResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetUserResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") User data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull User data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetUserResponse( long statusCode, - String status, - String service, - String resource, - String operation, - User data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull User data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public User data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public GetUserResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetUserResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetUserResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetUserResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetUserResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetUserResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetUserResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetUserResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetUserResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetUserResponse withData(User data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetUserResponse withData(@Nonnull User data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetUserResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetUserResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetUserResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private User data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(User data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull User data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetUserResponse build() { - return new GetUserResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetUsersResponse.java b/src/main/java/com/apideck/unify/models/components/GetUsersResponse.java index aea9cb9d..563e446f 100644 --- a/src/main/java/com/apideck/unify/models/components/GetUsersResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetUsersResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -64,135 +63,120 @@ public class GetUsersResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; /** * Response metadata */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; @JsonCreator public GetUsersResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") List data, - @JsonProperty("_raw") JsonNullable> raw, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("_raw") @Nullable JsonNullable> raw, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); this.meta = meta; this.links = links; } public GetUsersResponse( long statusCode, - String status, - String service, - String resource, - String operation, - List data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull List data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } public static Builder builder() { @@ -204,77 +188,58 @@ public static Builder builder() { * HTTP Response Status Code */ public GetUsersResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetUsersResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetUsersResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public GetUsersResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public GetUsersResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public GetUsersResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public GetUsersResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public GetUsersResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public GetUsersResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public GetUsersResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetUsersResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = JsonNullable.of(raw); + public GetUsersResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetUsersResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } /** - * Response metadata + * Raw response from the integration when raw=true query param is provided */ - public GetUsersResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetUsersResponse withRaw(@Nullable Map raw) { + this.raw = JsonNullable.of(raw); return this; } @@ -282,31 +247,21 @@ public GetUsersResponse withMeta(Meta meta) { /** * Response metadata */ - public GetUsersResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetUsersResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetUsersResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetUsersResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetUsersResponse withLinks(@Nullable Links links) { this.links = links; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -353,7 +308,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -365,132 +320,86 @@ public final static class Builder { private List data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - - - /** - * Response metadata - */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - /** * Response metadata */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } public GetUsersResponse build() { - return new GetUsersResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/GetWebhookResponse.java b/src/main/java/com/apideck/unify/models/components/GetWebhookResponse.java index 57e514f1..0e57fec1 100644 --- a/src/main/java/com/apideck/unify/models/components/GetWebhookResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetWebhookResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class GetWebhookResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetWebhookResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Webhook data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Webhook data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetWebhookResponse( long statusCode, - String status, - Webhook data) { + @Nonnull String status, + @Nonnull Webhook data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Webhook data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public GetWebhookResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetWebhookResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetWebhookResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetWebhookResponse withData(Webhook data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public GetWebhookResponse withData(@Nonnull Webhook data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetWebhookResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetWebhookResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetWebhookResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Webhook data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Webhook data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Webhook data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetWebhookResponse build() { - return new GetWebhookResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/GetWebhooksResponse.java b/src/main/java/com/apideck/unify/models/components/GetWebhooksResponse.java index 2c98acc9..1e372e9b 100644 --- a/src/main/java/com/apideck/unify/models/components/GetWebhooksResponse.java +++ b/src/main/java/com/apideck/unify/models/components/GetWebhooksResponse.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -46,98 +45,86 @@ public class GetWebhooksResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("meta") - private Optional meta; + private Meta meta; /** * Links to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional links; + private Links links; /** * Raw response from the integration when raw=true query param is provided */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public GetWebhooksResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") List data, - @JsonProperty("meta") Optional meta, - @JsonProperty("links") Optional links, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(meta, "meta"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull List data, + @JsonProperty("meta") @Nullable Meta meta, + @JsonProperty("links") @Nullable Links links, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); this.meta = meta; this.links = links; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public GetWebhooksResponse( long statusCode, - String status, - List data) { + @Nonnull String status, + @Nonnull List data) { this(statusCode, status, data, - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + null, null, null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public List data() { - return data; + return this.data; } /** * Response metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional meta() { - return (Optional) meta; + return Optional.ofNullable(this.meta); } /** * Links to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional links() { - return (Optional) links; + return Optional.ofNullable(this.links); } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -149,32 +136,22 @@ public static Builder builder() { * HTTP Response Status Code */ public GetWebhooksResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public GetWebhooksResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public GetWebhooksResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public GetWebhooksResponse withData(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; - return this; - } - /** - * Response metadata - */ - public GetWebhooksResponse withMeta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); + public GetWebhooksResponse withData(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } @@ -182,48 +159,29 @@ public GetWebhooksResponse withMeta(Meta meta) { /** * Response metadata */ - public GetWebhooksResponse withMeta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public GetWebhooksResponse withMeta(@Nullable Meta meta) { this.meta = meta; return this; } - /** - * Links to navigate to previous or next pages through the API - */ - public GetWebhooksResponse withLinks(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - /** * Links to navigate to previous or next pages through the API */ - public GetWebhooksResponse withLinks(Optional links) { - Utils.checkNotNull(links, "links"); + public GetWebhooksResponse withLinks(@Nullable Links links) { this.links = links; return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public GetWebhooksResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public GetWebhooksResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public GetWebhooksResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -264,108 +222,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private List data; - private Optional meta = Optional.empty(); + private Meta meta; - private Optional links = Optional.empty(); + private Links links; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(List data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull List data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Response metadata */ - public Builder meta(Meta meta) { - Utils.checkNotNull(meta, "meta"); - this.meta = Optional.ofNullable(meta); - return this; - } - - /** - * Response metadata - */ - public Builder meta(Optional meta) { - Utils.checkNotNull(meta, "meta"); + public Builder meta(@Nullable Meta meta) { this.meta = meta; return this; } - /** * Links to navigate to previous or next pages through the API */ - public Builder links(Links links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - /** - * Links to navigate to previous or next pages through the API - */ - public Builder links(Optional links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable Links links) { this.links = links; return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public GetWebhooksResponse build() { - return new GetWebhooksResponse( statusCode, status, data, meta, links, raw); diff --git a/src/main/java/com/apideck/unify/models/components/HrisCompany.java b/src/main/java/com/apideck/unify/models/components/HrisCompany.java index d72e6239..1037aa54 100644 --- a/src/main/java/com/apideck/unify/models/components/HrisCompany.java +++ b/src/main/java/com/apideck/unify/models/components/HrisCompany.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -27,12 +26,12 @@ public class HrisCompany { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonInclude(Include.ALWAYS) @JsonProperty("legal_name") - private Optional legalName; + private JsonNullable legalName; @JsonInclude(Include.NON_ABSENT) @@ -47,7 +46,7 @@ public class HrisCompany { @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private HrisCompanyStatus status; /** * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. @@ -61,27 +60,27 @@ public class HrisCompany { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @@ -93,12 +92,12 @@ public class HrisCompany { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; @JsonInclude(Include.NON_ABSENT) @JsonProperty("deleted") - private Optional deleted; + private Boolean deleted; /** * The user who last updated the object. @@ -133,207 +132,171 @@ public class HrisCompany { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public HrisCompany( - @JsonProperty("id") Optional id, - @JsonProperty("legal_name") Optional legalName, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("subdomain") JsonNullable subdomain, - @JsonProperty("status") Optional status, - @JsonProperty("company_number") JsonNullable companyNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("websites") Optional> websites, - @JsonProperty("debtor_id") JsonNullable debtorId, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("deleted") Optional deleted, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(legalName, "legalName"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(subdomain, "subdomain"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(companyNumber, "companyNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(debtorId, "debtorId"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(deleted, "deleted"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("legal_name") @Nullable String legalName, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("subdomain") @Nullable JsonNullable subdomain, + @JsonProperty("status") @Nullable HrisCompanyStatus status, + @JsonProperty("company_number") @Nullable JsonNullable companyNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("debtor_id") @Nullable JsonNullable debtorId, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("deleted") @Nullable Boolean deleted, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.legalName = legalName; - this.displayName = displayName; - this.subdomain = subdomain; + this.legalName = JsonNullable.of(legalName); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.subdomain = Optional.ofNullable(subdomain) + .orElse(JsonNullable.undefined()); this.status = status; - this.companyNumber = companyNumber; - this.currency = currency; + this.companyNumber = Optional.ofNullable(companyNumber) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.phoneNumbers = phoneNumbers; this.emails = emails; this.websites = websites; - this.debtorId = debtorId; - this.customMappings = customMappings; + this.debtorId = Optional.ofNullable(debtorId) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); this.deleted = deleted; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public HrisCompany() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } - @JsonIgnore - public Optional legalName() { - return legalName; + public JsonNullable legalName() { + return this.legalName; } - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } - @JsonIgnore public JsonNullable subdomain() { - return subdomain; + return this.subdomain; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. */ - @JsonIgnore public JsonNullable companyNumber() { - return companyNumber; + return this.companyNumber; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @JsonIgnore public JsonNullable debtorId() { - return debtorId; + return this.debtorId; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } - @JsonIgnore public Optional deleted() { - return deleted; + return Optional.ofNullable(this.deleted); } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -344,294 +307,144 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public HrisCompany withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public HrisCompany withId(Optional id) { - Utils.checkNotNull(id, "id"); + public HrisCompany withId(@Nullable String id) { this.id = id; return this; } - public HrisCompany withLegalName(String legalName) { - Utils.checkNotNull(legalName, "legalName"); - this.legalName = Optional.ofNullable(legalName); - return this; - } - - public HrisCompany withLegalName(Optional legalName) { - Utils.checkNotNull(legalName, "legalName"); - this.legalName = legalName; + public HrisCompany withLegalName(@Nullable String legalName) { + this.legalName = JsonNullable.of(legalName); return this; } - public HrisCompany withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + + public HrisCompany withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - public HrisCompany withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - public HrisCompany withSubdomain(String subdomain) { - Utils.checkNotNull(subdomain, "subdomain"); + public HrisCompany withSubdomain(@Nullable String subdomain) { this.subdomain = JsonNullable.of(subdomain); return this; } - public HrisCompany withSubdomain(JsonNullable subdomain) { - Utils.checkNotNull(subdomain, "subdomain"); - this.subdomain = subdomain; - return this; - } - - public HrisCompany withStatus(HrisCompanyStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - public HrisCompany withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public HrisCompany withStatus(@Nullable HrisCompanyStatus status) { this.status = status; return this; } + /** * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. */ - public HrisCompany withCompanyNumber(String companyNumber) { - Utils.checkNotNull(companyNumber, "companyNumber"); + public HrisCompany withCompanyNumber(@Nullable String companyNumber) { this.companyNumber = JsonNullable.of(companyNumber); return this; } - /** - * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. - */ - public HrisCompany withCompanyNumber(JsonNullable companyNumber) { - Utils.checkNotNull(companyNumber, "companyNumber"); - this.companyNumber = companyNumber; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public HrisCompany withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public HrisCompany withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public HrisCompany withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - public HrisCompany withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public HrisCompany withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public HrisCompany withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public HrisCompany withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public HrisCompany withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public HrisCompany withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public HrisCompany withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public HrisCompany withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public HrisCompany withEmails(@Nullable List emails) { this.emails = emails; return this; } - public HrisCompany withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public HrisCompany withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public HrisCompany withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public HrisCompany withDebtorId(String debtorId) { - Utils.checkNotNull(debtorId, "debtorId"); + + public HrisCompany withDebtorId(@Nullable String debtorId) { this.debtorId = JsonNullable.of(debtorId); return this; } - public HrisCompany withDebtorId(JsonNullable debtorId) { - Utils.checkNotNull(debtorId, "debtorId"); - this.debtorId = debtorId; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public HrisCompany withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public HrisCompany withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public HrisCompany withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - public HrisCompany withDeleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = Optional.ofNullable(deleted); - return this; - } - - public HrisCompany withDeleted(Optional deleted) { - Utils.checkNotNull(deleted, "deleted"); + public HrisCompany withDeleted(@Nullable Boolean deleted) { this.deleted = deleted; return this; } + /** * The user who last updated the object. */ - public HrisCompany withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public HrisCompany withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public HrisCompany withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public HrisCompany withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public HrisCompany withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public HrisCompany withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public HrisCompany withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public HrisCompany withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public HrisCompany withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public HrisCompany withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public HrisCompany withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public HrisCompany withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public HrisCompany withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public HrisCompany withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public HrisCompany withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -702,351 +515,171 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional legalName = Optional.empty(); + private String legalName; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable subdomain = JsonNullable.undefined(); + private JsonNullable subdomain; - private Optional status = Optional.empty(); + private HrisCompanyStatus status; - private JsonNullable companyNumber = JsonNullable.undefined(); + private JsonNullable companyNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private Optional> websites = Optional.empty(); + private List websites; - private JsonNullable debtorId = JsonNullable.undefined(); + private JsonNullable debtorId; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private Optional deleted = Optional.empty(); + private Boolean deleted; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - public Builder legalName(String legalName) { - Utils.checkNotNull(legalName, "legalName"); - this.legalName = Optional.ofNullable(legalName); - return this; - } - - public Builder legalName(Optional legalName) { - Utils.checkNotNull(legalName, "legalName"); + public Builder legalName(@Nullable String legalName) { this.legalName = legalName; return this; } - - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - - public Builder subdomain(String subdomain) { - Utils.checkNotNull(subdomain, "subdomain"); + public Builder subdomain(@Nullable String subdomain) { this.subdomain = JsonNullable.of(subdomain); return this; } - public Builder subdomain(JsonNullable subdomain) { - Utils.checkNotNull(subdomain, "subdomain"); - this.subdomain = subdomain; - return this; - } - - - public Builder status(HrisCompanyStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable HrisCompanyStatus status) { this.status = status; return this; } - /** * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. */ - public Builder companyNumber(String companyNumber) { - Utils.checkNotNull(companyNumber, "companyNumber"); + public Builder companyNumber(@Nullable String companyNumber) { this.companyNumber = JsonNullable.of(companyNumber); return this; } - /** - * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. - */ - public Builder companyNumber(JsonNullable companyNumber) { - Utils.checkNotNull(companyNumber, "companyNumber"); - this.companyNumber = companyNumber; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder debtorId(String debtorId) { - Utils.checkNotNull(debtorId, "debtorId"); + public Builder debtorId(@Nullable String debtorId) { this.debtorId = JsonNullable.of(debtorId); return this; } - public Builder debtorId(JsonNullable debtorId) { - Utils.checkNotNull(debtorId, "debtorId"); - this.debtorId = debtorId; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - - public Builder deleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = Optional.ofNullable(deleted); - return this; - } - - public Builder deleted(Optional deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Builder deleted(@Nullable Boolean deleted) { this.deleted = deleted; return this; } - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public HrisCompany build() { - return new HrisCompany( id, legalName, displayName, subdomain, status, companyNumber, diff --git a/src/main/java/com/apideck/unify/models/components/HrisCompanyInput.java b/src/main/java/com/apideck/unify/models/components/HrisCompanyInput.java index 1fbd304b..31ee295b 100644 --- a/src/main/java/com/apideck/unify/models/components/HrisCompanyInput.java +++ b/src/main/java/com/apideck/unify/models/components/HrisCompanyInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -21,7 +20,7 @@ public class HrisCompanyInput { @JsonInclude(Include.ALWAYS) @JsonProperty("legal_name") - private Optional legalName; + private JsonNullable legalName; @JsonInclude(Include.NON_ABSENT) @@ -36,7 +35,7 @@ public class HrisCompanyInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private HrisCompanyStatus status; /** * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. @@ -50,27 +49,27 @@ public class HrisCompanyInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @@ -82,129 +81,103 @@ public class HrisCompanyInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public HrisCompanyInput( - @JsonProperty("legal_name") Optional legalName, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("subdomain") JsonNullable subdomain, - @JsonProperty("status") Optional status, - @JsonProperty("company_number") JsonNullable companyNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("websites") Optional> websites, - @JsonProperty("debtor_id") JsonNullable debtorId, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(legalName, "legalName"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(subdomain, "subdomain"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(companyNumber, "companyNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(debtorId, "debtorId"); - Utils.checkNotNull(passThrough, "passThrough"); - this.legalName = legalName; - this.displayName = displayName; - this.subdomain = subdomain; + @JsonProperty("legal_name") @Nullable String legalName, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("subdomain") @Nullable JsonNullable subdomain, + @JsonProperty("status") @Nullable HrisCompanyStatus status, + @JsonProperty("company_number") @Nullable JsonNullable companyNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("debtor_id") @Nullable JsonNullable debtorId, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.legalName = JsonNullable.of(legalName); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.subdomain = Optional.ofNullable(subdomain) + .orElse(JsonNullable.undefined()); this.status = status; - this.companyNumber = companyNumber; - this.currency = currency; + this.companyNumber = Optional.ofNullable(companyNumber) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.phoneNumbers = phoneNumbers; this.emails = emails; this.websites = websites; - this.debtorId = debtorId; + this.debtorId = Optional.ofNullable(debtorId) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public HrisCompanyInput() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null); } - @JsonIgnore - public Optional legalName() { - return legalName; + public JsonNullable legalName() { + return this.legalName; } - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } - @JsonIgnore public JsonNullable subdomain() { - return subdomain; + return this.subdomain; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. */ - @JsonIgnore public JsonNullable companyNumber() { - return companyNumber; + return this.companyNumber; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @JsonIgnore public JsonNullable debtorId() { - return debtorId; + return this.debtorId; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -212,162 +185,74 @@ public static Builder builder() { } - public HrisCompanyInput withLegalName(String legalName) { - Utils.checkNotNull(legalName, "legalName"); - this.legalName = Optional.ofNullable(legalName); + public HrisCompanyInput withLegalName(@Nullable String legalName) { + this.legalName = JsonNullable.of(legalName); return this; } - public HrisCompanyInput withLegalName(Optional legalName) { - Utils.checkNotNull(legalName, "legalName"); - this.legalName = legalName; - return this; - } - - public HrisCompanyInput withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public HrisCompanyInput withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - public HrisCompanyInput withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - public HrisCompanyInput withSubdomain(String subdomain) { - Utils.checkNotNull(subdomain, "subdomain"); + public HrisCompanyInput withSubdomain(@Nullable String subdomain) { this.subdomain = JsonNullable.of(subdomain); return this; } - public HrisCompanyInput withSubdomain(JsonNullable subdomain) { - Utils.checkNotNull(subdomain, "subdomain"); - this.subdomain = subdomain; - return this; - } - public HrisCompanyInput withStatus(HrisCompanyStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - - public HrisCompanyInput withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public HrisCompanyInput withStatus(@Nullable HrisCompanyStatus status) { this.status = status; return this; } + /** * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. */ - public HrisCompanyInput withCompanyNumber(String companyNumber) { - Utils.checkNotNull(companyNumber, "companyNumber"); + public HrisCompanyInput withCompanyNumber(@Nullable String companyNumber) { this.companyNumber = JsonNullable.of(companyNumber); return this; } - /** - * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. - */ - public HrisCompanyInput withCompanyNumber(JsonNullable companyNumber) { - Utils.checkNotNull(companyNumber, "companyNumber"); - this.companyNumber = companyNumber; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public HrisCompanyInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public HrisCompanyInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public HrisCompanyInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - public HrisCompanyInput withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public HrisCompanyInput withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public HrisCompanyInput withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public HrisCompanyInput withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public HrisCompanyInput withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public HrisCompanyInput withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public HrisCompanyInput withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public HrisCompanyInput withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public HrisCompanyInput withEmails(@Nullable List emails) { this.emails = emails; return this; } - public HrisCompanyInput withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public HrisCompanyInput withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public HrisCompanyInput withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public HrisCompanyInput withDebtorId(String debtorId) { - Utils.checkNotNull(debtorId, "debtorId"); - this.debtorId = JsonNullable.of(debtorId); - return this; - } - - public HrisCompanyInput withDebtorId(JsonNullable debtorId) { - Utils.checkNotNull(debtorId, "debtorId"); - this.debtorId = debtorId; - return this; - } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public HrisCompanyInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public HrisCompanyInput withDebtorId(@Nullable String debtorId) { + this.debtorId = JsonNullable.of(debtorId); return this; } @@ -375,12 +260,12 @@ public HrisCompanyInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public HrisCompanyInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public HrisCompanyInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -434,210 +319,104 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional legalName = Optional.empty(); + private String legalName; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable subdomain = JsonNullable.undefined(); + private JsonNullable subdomain; - private Optional status = Optional.empty(); + private HrisCompanyStatus status; - private JsonNullable companyNumber = JsonNullable.undefined(); + private JsonNullable companyNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private Optional> websites = Optional.empty(); + private List websites; - private JsonNullable debtorId = JsonNullable.undefined(); + private JsonNullable debtorId; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - public Builder legalName(String legalName) { - Utils.checkNotNull(legalName, "legalName"); - this.legalName = Optional.ofNullable(legalName); - return this; - } - - public Builder legalName(Optional legalName) { - Utils.checkNotNull(legalName, "legalName"); + public Builder legalName(@Nullable String legalName) { this.legalName = legalName; return this; } - - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - - public Builder subdomain(String subdomain) { - Utils.checkNotNull(subdomain, "subdomain"); + public Builder subdomain(@Nullable String subdomain) { this.subdomain = JsonNullable.of(subdomain); return this; } - public Builder subdomain(JsonNullable subdomain) { - Utils.checkNotNull(subdomain, "subdomain"); - this.subdomain = subdomain; - return this; - } - - - public Builder status(HrisCompanyStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable HrisCompanyStatus status) { this.status = status; return this; } - /** * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. */ - public Builder companyNumber(String companyNumber) { - Utils.checkNotNull(companyNumber, "companyNumber"); + public Builder companyNumber(@Nullable String companyNumber) { this.companyNumber = JsonNullable.of(companyNumber); return this; } - /** - * An Company Number, Company ID or Company Code, is a unique number that has been assigned to each company. - */ - public Builder companyNumber(JsonNullable companyNumber) { - Utils.checkNotNull(companyNumber, "companyNumber"); - this.companyNumber = companyNumber; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder debtorId(String debtorId) { - Utils.checkNotNull(debtorId, "debtorId"); + public Builder debtorId(@Nullable String debtorId) { this.debtorId = JsonNullable.of(debtorId); return this; } - public Builder debtorId(JsonNullable debtorId) { - Utils.checkNotNull(debtorId, "debtorId"); - this.debtorId = debtorId; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public HrisCompanyInput build() { - return new HrisCompanyInput( legalName, displayName, subdomain, status, companyNumber, currency, diff --git a/src/main/java/com/apideck/unify/models/components/Images.java b/src/main/java/com/apideck/unify/models/components/Images.java index 84b37c30..a16eefa6 100644 --- a/src/main/java/com/apideck/unify/models/components/Images.java +++ b/src/main/java/com/apideck/unify/models/components/Images.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -31,32 +32,30 @@ public class Images { @JsonCreator public Images( - @JsonProperty("id") JsonNullable id, - @JsonProperty("url") JsonNullable url) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(url, "url"); - this.id = id; - this.url = url; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("url") @Nullable JsonNullable url) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.url = Optional.ofNullable(url) + .orElse(JsonNullable.undefined()); } public Images() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The URL of an image of the product. */ - @JsonIgnore public JsonNullable url() { - return url; + return this.url; } public static Builder builder() { @@ -67,38 +66,20 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Images withId(String id) { - Utils.checkNotNull(id, "id"); + public Images withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Images withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The URL of an image of the product. */ - public Images withUrl(String url) { - Utils.checkNotNull(url, "url"); + public Images withUrl(@Nullable String url) { this.url = JsonNullable.of(url); return this; } - /** - * The URL of an image of the product. - */ - public Images withUrl(JsonNullable url) { - Utils.checkNotNull(url, "url"); - this.url = url; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -130,54 +111,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable url = JsonNullable.undefined(); + private JsonNullable url; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The URL of an image of the product. */ - public Builder url(String url) { - Utils.checkNotNull(url, "url"); + public Builder url(@Nullable String url) { this.url = JsonNullable.of(url); return this; } - /** - * The URL of an image of the product. - */ - public Builder url(JsonNullable url) { - Utils.checkNotNull(url, "url"); - this.url = url; - return this; - } - public Images build() { - return new Images( id, url); } diff --git a/src/main/java/com/apideck/unify/models/components/Income.java b/src/main/java/com/apideck/unify/models/components/Income.java index afc0338c..075542da 100644 --- a/src/main/java/com/apideck/unify/models/components/Income.java +++ b/src/main/java/com/apideck/unify/models/components/Income.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -28,35 +28,35 @@ public class Income { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The account code of the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * The name of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") - private Optional title; + private String title; /** * The type of profit and loss */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The aggregated total of all accounts within this category. */ @JsonInclude(Include.ALWAYS) @JsonProperty("total") - private Optional total; + private JsonNullable total; @JsonProperty("records") @@ -64,76 +64,65 @@ public class Income { @JsonCreator public Income( - @JsonProperty("id") Optional id, - @JsonProperty("code") Optional code, - @JsonProperty("title") Optional title, - @JsonProperty("type") JsonNullable type, - @JsonProperty("total") Optional total, - @JsonProperty("records") Object records) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(records, "records"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("code") @Nullable String code, + @JsonProperty("title") @Nullable String title, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("total") @Nullable Double total, + @JsonProperty("records") @Nonnull Object records) { this.id = id; this.code = code; this.title = title; - this.type = type; - this.total = total; - this.records = records; + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.total = JsonNullable.of(total); + this.records = Optional.ofNullable(records) + .orElseThrow(() -> new IllegalArgumentException("records cannot be null")); } public Income( - Object records) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), records); + @Nonnull Object records) { + this(null, null, null, + null, null, records); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The account code of the account */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * The name of the account. */ - @JsonIgnore public Optional title() { - return title; + return Optional.ofNullable(this.title); } /** * The type of profit and loss */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The aggregated total of all accounts within this category. */ - @JsonIgnore - public Optional total() { - return total; + public JsonNullable total() { + return this.total; } - @JsonIgnore public Object records() { - return records; + return this.records; } public static Builder builder() { @@ -144,102 +133,53 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Income withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Income withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Income withId(@Nullable String id) { this.id = id; return this; } - /** - * The account code of the account - */ - public Income withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The account code of the account */ - public Income withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public Income withCode(@Nullable String code) { this.code = code; return this; } - /** - * The name of the account. - */ - public Income withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public Income withTitle(Optional title) { - Utils.checkNotNull(title, "title"); + public Income withTitle(@Nullable String title) { this.title = title; return this; } + /** * The type of profit and loss */ - public Income withType(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public Income withType(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public Income withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The aggregated total of all accounts within this category. */ - public Income withTotal(double total) { - Utils.checkNotNull(total, "total"); - this.total = Optional.ofNullable(total); + public Income withTotal(@Nullable Double total) { + this.total = JsonNullable.of(total); return this; } - /** - * The aggregated total of all accounts within this category. - */ - public Income withTotal(Optional total) { - Utils.checkNotNull(total, "total"); - this.total = total; + public Income withRecords(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } - public Income withRecords(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -280,15 +220,15 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional code = Optional.empty(); + private String code; - private Optional title = Optional.empty(); + private String title; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private Optional total = Optional.empty(); + private Double total; private Object records; @@ -296,110 +236,52 @@ private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The account code of the account */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The account code of the account - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - /** - * The name of the account. - */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = title; return this; } - /** * The type of profit and loss */ - public Builder type(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - - /** - * The aggregated total of all accounts within this category. - */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); - this.total = Optional.ofNullable(total); - return this; - } - /** * The aggregated total of all accounts within this category. */ - public Builder total(Optional total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = total; return this; } - - public Builder records(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; + public Builder records(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } public Income build() { - return new Income( id, code, title, type, total, records); diff --git a/src/main/java/com/apideck/unify/models/components/Invoice.java b/src/main/java/com/apideck/unify/models/components/Invoice.java index cd693f5b..404452e3 100644 --- a/src/main/java/com/apideck/unify/models/components/Invoice.java +++ b/src/main/java/com/apideck/unify/models/components/Invoice.java @@ -5,17 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -30,7 +29,7 @@ public class Invoice { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The third-party API ID of original entity @@ -44,7 +43,7 @@ public class Invoice { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * Invoice number. @@ -58,7 +57,7 @@ public class Invoice { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer") - private JsonNullable customer; + private JsonNullable customer; /** * The company or subsidiary id the transaction belongs to @@ -107,21 +106,21 @@ public class Invoice { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Invoice sent to contact/customer. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("invoice_sent") - private Optional invoiceSent; + private Boolean invoiceSent; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -207,29 +206,29 @@ public class Invoice { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_category") @Deprecated - private JsonNullable trackingCategory; + private JsonNullable trackingCategory; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; @JsonInclude(Include.NON_ABSENT) @JsonProperty("billing_address") - private Optional billingAddress; + private Address billingAddress; @JsonInclude(Include.NON_ABSENT) @JsonProperty("shipping_address") - private Optional shippingAddress; + private Address shippingAddress; /** * Optional invoice template @@ -250,7 +249,7 @@ public class Invoice { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_allocations") - private JsonNullable> paymentAllocations; + private JsonNullable> paymentAllocations; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check @@ -283,24 +282,24 @@ public class Invoice { @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_account") - private Optional bankAccount; + private BankAccount bankAccount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("ledger_account") - private JsonNullable ledgerAccount; + private JsonNullable ledgerAccount; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -342,374 +341,337 @@ public class Invoice { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Invoice( - @JsonProperty("id") Optional id, - @JsonProperty("downstream_id") JsonNullable downstreamId, - @JsonProperty("type") JsonNullable type, - @JsonProperty("number") JsonNullable number, - @JsonProperty("customer") JsonNullable customer, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("invoice_date") JsonNullable invoiceDate, - @JsonProperty("due_date") JsonNullable dueDate, - @JsonProperty("terms") JsonNullable terms, - @JsonProperty("po_number") JsonNullable poNumber, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("status") JsonNullable status, - @JsonProperty("invoice_sent") Optional invoiceSent, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("sub_total") JsonNullable subTotal, - @JsonProperty("total_tax") JsonNullable totalTax, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("discount_percentage") JsonNullable discountPercentage, - @JsonProperty("discount_amount") JsonNullable discountAmount, - @JsonProperty("total") JsonNullable total, - @JsonProperty("balance") JsonNullable balance, - @JsonProperty("deposit") JsonNullable deposit, - @JsonProperty("customer_memo") JsonNullable customerMemo, - @JsonProperty("tracking_category") JsonNullable trackingCategory, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("billing_address") Optional billingAddress, - @JsonProperty("shipping_address") Optional shippingAddress, - @JsonProperty("template_id") JsonNullable templateId, - @JsonProperty("source_document_url") JsonNullable sourceDocumentUrl, - @JsonProperty("payment_allocations") JsonNullable> paymentAllocations, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("channel") JsonNullable channel, - @JsonProperty("language") JsonNullable language, - @JsonProperty("accounting_by_row") JsonNullable accountingByRow, - @JsonProperty("bank_account") Optional bankAccount, - @JsonProperty("ledger_account") JsonNullable ledgerAccount, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(customer, "customer"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(invoiceDate, "invoiceDate"); - Utils.checkNotNull(dueDate, "dueDate"); - Utils.checkNotNull(terms, "terms"); - Utils.checkNotNull(poNumber, "poNumber"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(invoiceSent, "invoiceSent"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalTax, "totalTax"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(discountPercentage, "discountPercentage"); - Utils.checkNotNull(discountAmount, "discountAmount"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(balance, "balance"); - Utils.checkNotNull(deposit, "deposit"); - Utils.checkNotNull(customerMemo, "customerMemo"); - Utils.checkNotNull(trackingCategory, "trackingCategory"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(billingAddress, "billingAddress"); - Utils.checkNotNull(shippingAddress, "shippingAddress"); - Utils.checkNotNull(templateId, "templateId"); - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - Utils.checkNotNull(paymentAllocations, "paymentAllocations"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(channel, "channel"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(accountingByRow, "accountingByRow"); - Utils.checkNotNull(bankAccount, "bankAccount"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("customer") @Nullable JsonNullable customer, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("invoice_date") @Nullable JsonNullable invoiceDate, + @JsonProperty("due_date") @Nullable JsonNullable dueDate, + @JsonProperty("terms") @Nullable JsonNullable terms, + @JsonProperty("po_number") @Nullable JsonNullable poNumber, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("invoice_sent") @Nullable Boolean invoiceSent, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, + @JsonProperty("total_tax") @Nullable JsonNullable totalTax, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("discount_percentage") @Nullable JsonNullable discountPercentage, + @JsonProperty("discount_amount") @Nullable JsonNullable discountAmount, + @JsonProperty("total") @Nullable JsonNullable total, + @JsonProperty("balance") @Nullable JsonNullable balance, + @JsonProperty("deposit") @Nullable JsonNullable deposit, + @JsonProperty("customer_memo") @Nullable JsonNullable customerMemo, + @JsonProperty("tracking_category") @Nullable JsonNullable trackingCategory, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("billing_address") @Nullable Address billingAddress, + @JsonProperty("shipping_address") @Nullable Address shippingAddress, + @JsonProperty("template_id") @Nullable JsonNullable templateId, + @JsonProperty("source_document_url") @Nullable JsonNullable sourceDocumentUrl, + @JsonProperty("payment_allocations") @Nullable JsonNullable> paymentAllocations, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("channel") @Nullable JsonNullable channel, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("accounting_by_row") @Nullable JsonNullable accountingByRow, + @JsonProperty("bank_account") @Nullable BankAccount bankAccount, + @JsonProperty("ledger_account") @Nullable JsonNullable ledgerAccount, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.downstreamId = downstreamId; - this.type = type; - this.number = number; - this.customer = customer; - this.companyId = companyId; - this.invoiceDate = invoiceDate; - this.dueDate = dueDate; - this.terms = terms; - this.poNumber = poNumber; - this.reference = reference; - this.status = status; + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.customer = Optional.ofNullable(customer) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.invoiceDate = Optional.ofNullable(invoiceDate) + .orElse(JsonNullable.undefined()); + this.dueDate = Optional.ofNullable(dueDate) + .orElse(JsonNullable.undefined()); + this.terms = Optional.ofNullable(terms) + .orElse(JsonNullable.undefined()); + this.poNumber = Optional.ofNullable(poNumber) + .orElse(JsonNullable.undefined()); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); this.invoiceSent = invoiceSent; - this.currency = currency; - this.currencyRate = currencyRate; - this.taxInclusive = taxInclusive; - this.subTotal = subTotal; - this.totalTax = totalTax; - this.taxCode = taxCode; - this.discountPercentage = discountPercentage; - this.discountAmount = discountAmount; - this.total = total; - this.balance = balance; - this.deposit = deposit; - this.customerMemo = customerMemo; - this.trackingCategory = trackingCategory; - this.trackingCategories = trackingCategories; + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); + this.totalTax = Optional.ofNullable(totalTax) + .orElse(JsonNullable.undefined()); + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.discountPercentage = Optional.ofNullable(discountPercentage) + .orElse(JsonNullable.undefined()); + this.discountAmount = Optional.ofNullable(discountAmount) + .orElse(JsonNullable.undefined()); + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); + this.balance = Optional.ofNullable(balance) + .orElse(JsonNullable.undefined()); + this.deposit = Optional.ofNullable(deposit) + .orElse(JsonNullable.undefined()); + this.customerMemo = Optional.ofNullable(customerMemo) + .orElse(JsonNullable.undefined()); + this.trackingCategory = Optional.ofNullable(trackingCategory) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); this.lineItems = lineItems; this.billingAddress = billingAddress; this.shippingAddress = shippingAddress; - this.templateId = templateId; - this.sourceDocumentUrl = sourceDocumentUrl; - this.paymentAllocations = paymentAllocations; - this.paymentMethod = paymentMethod; - this.channel = channel; - this.language = language; - this.accountingByRow = accountingByRow; + this.templateId = Optional.ofNullable(templateId) + .orElse(JsonNullable.undefined()); + this.sourceDocumentUrl = Optional.ofNullable(sourceDocumentUrl) + .orElse(JsonNullable.undefined()); + this.paymentAllocations = Optional.ofNullable(paymentAllocations) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.channel = Optional.ofNullable(channel) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.accountingByRow = Optional.ofNullable(accountingByRow) + .orElse(JsonNullable.undefined()); this.bankAccount = bankAccount; - this.ledgerAccount = ledgerAccount; - this.customMappings = customMappings; + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Invoice() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } /** * Invoice type */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * Invoice number. */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * The customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable customer() { - return (JsonNullable) customer; + return this.customer; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Date invoice was issued - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable invoiceDate() { - return invoiceDate; + return this.invoiceDate; } /** * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable dueDate() { - return dueDate; + return this.dueDate; } /** * Terms of payment. */ - @JsonIgnore public JsonNullable terms() { - return terms; + return this.terms; } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - @JsonIgnore public JsonNullable poNumber() { - return poNumber; + return this.poNumber; } /** * Optional reference identifier for the transaction. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } /** * Invoice status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Invoice sent to contact/customer. */ - @JsonIgnore public Optional invoiceSent() { - return invoiceSent; + return Optional.ofNullable(this.invoiceSent); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Total tax amount applied to this invoice. */ - @JsonIgnore public JsonNullable totalTax() { - return totalTax; + return this.totalTax; } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } /** * Discount percentage applied to this invoice. */ - @JsonIgnore public JsonNullable discountPercentage() { - return discountPercentage; + return this.discountPercentage; } /** * Discount amount applied to this invoice. */ - @JsonIgnore public JsonNullable discountAmount() { - return discountAmount; + return this.discountAmount; } /** * Total amount of invoice, including tax. */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } /** * Balance of invoice due. */ - @JsonIgnore public JsonNullable balance() { - return balance; + return this.balance; } /** * Amount of deposit made to this invoice. */ - @JsonIgnore public JsonNullable deposit() { - return deposit; + return this.deposit; } /** * Customer memo */ - @JsonIgnore public JsonNullable customerMemo() { - return customerMemo; + return this.customerMemo; } /** @@ -717,170 +679,137 @@ public JsonNullable customerMemo() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable trackingCategory() { - return (JsonNullable) trackingCategory; + return this.trackingCategory; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
billingAddress() { - return (Optional
) billingAddress; + return Optional.ofNullable(this.billingAddress); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
shippingAddress() { - return (Optional
) shippingAddress; + return Optional.ofNullable(this.shippingAddress); } /** * Optional invoice template */ - @JsonIgnore public JsonNullable templateId() { - return templateId; + return this.templateId; } /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - @JsonIgnore public JsonNullable sourceDocumentUrl() { - return sourceDocumentUrl; + return this.sourceDocumentUrl; } /** * IDs of payments made on the invoice */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> paymentAllocations() { - return (JsonNullable>) paymentAllocations; + return this.paymentAllocations; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * The channel through which the transaction is processed. */ - @JsonIgnore public JsonNullable channel() { - return channel; + return this.channel; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - @JsonIgnore public JsonNullable accountingByRow() { - return accountingByRow; + return this.accountingByRow; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional bankAccount() { - return (Optional) bankAccount; + return Optional.ofNullable(this.bankAccount); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable ledgerAccount() { - return (JsonNullable) ledgerAccount; + return this.ledgerAccount; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -891,825 +820,410 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Invoice withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Invoice withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Invoice withId(@Nullable String id) { this.id = id; return this; } + /** * The third-party API ID of original entity */ - public Invoice withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Invoice withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Invoice withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } /** * Invoice type */ - public Invoice withType(InvoiceType type) { - Utils.checkNotNull(type, "type"); + public Invoice withType(@Nullable InvoiceType type) { this.type = JsonNullable.of(type); return this; } - /** - * Invoice type - */ - public Invoice withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Invoice number. */ - public Invoice withNumber(String number) { - Utils.checkNotNull(number, "number"); + public Invoice withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Invoice number. - */ - public Invoice withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * The customer this entity is linked to. */ - public Invoice withCustomer(LinkedCustomer customer) { - Utils.checkNotNull(customer, "customer"); + public Invoice withCustomer(@Nullable LinkedCustomer customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public Invoice withCustomer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public Invoice withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Invoice withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Invoice withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Date invoice was issued - YYYY-MM-DD. */ - public Invoice withInvoiceDate(LocalDate invoiceDate) { - Utils.checkNotNull(invoiceDate, "invoiceDate"); + public Invoice withInvoiceDate(@Nullable LocalDate invoiceDate) { this.invoiceDate = JsonNullable.of(invoiceDate); return this; } - /** - * Date invoice was issued - YYYY-MM-DD. - */ - public Invoice withInvoiceDate(JsonNullable invoiceDate) { - Utils.checkNotNull(invoiceDate, "invoiceDate"); - this.invoiceDate = invoiceDate; - return this; - } /** * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. */ - public Invoice withDueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Invoice withDueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. - */ - public Invoice withDueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } /** * Terms of payment. */ - public Invoice withTerms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Invoice withTerms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public Invoice withTerms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - public Invoice withPoNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public Invoice withPoNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - */ - public Invoice withPoNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } /** * Optional reference identifier for the transaction. */ - public Invoice withReference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Invoice withReference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference identifier for the transaction. - */ - public Invoice withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } /** * Invoice status */ - public Invoice withStatus(InvoiceStatus status) { - Utils.checkNotNull(status, "status"); + public Invoice withStatus(@Nullable InvoiceStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Invoice status - */ - public Invoice withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** - * Invoice sent to contact/customer. - */ - public Invoice withInvoiceSent(boolean invoiceSent) { - Utils.checkNotNull(invoiceSent, "invoiceSent"); - this.invoiceSent = Optional.ofNullable(invoiceSent); - return this; - } - /** * Invoice sent to contact/customer. */ - public Invoice withInvoiceSent(Optional invoiceSent) { - Utils.checkNotNull(invoiceSent, "invoiceSent"); + public Invoice withInvoiceSent(@Nullable Boolean invoiceSent) { this.invoiceSent = invoiceSent; return this; } + /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Invoice withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Invoice withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Invoice withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Invoice withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Invoice withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Invoice withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * Amounts are including tax */ - public Invoice withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Invoice withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Invoice withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } /** * Sub-total amount, normally before tax. */ - public Invoice withSubTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Invoice withSubTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Invoice withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Total tax amount applied to this invoice. */ - public Invoice withTotalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Invoice withTotalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public Invoice withTotalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Invoice withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Invoice withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Invoice withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } /** * Discount percentage applied to this invoice. */ - public Invoice withDiscountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Invoice withDiscountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this invoice. - */ - public Invoice withDiscountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } /** * Discount amount applied to this invoice. */ - public Invoice withDiscountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public Invoice withDiscountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } - /** - * Discount amount applied to this invoice. - */ - public Invoice withDiscountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; - return this; - } /** * Total amount of invoice, including tax. */ - public Invoice withTotal(double total) { - Utils.checkNotNull(total, "total"); + public Invoice withTotal(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of invoice, including tax. - */ - public Invoice withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } /** * Balance of invoice due. */ - public Invoice withBalance(double balance) { - Utils.checkNotNull(balance, "balance"); + public Invoice withBalance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * Balance of invoice due. - */ - public Invoice withBalance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } /** * Amount of deposit made to this invoice. */ - public Invoice withDeposit(double deposit) { - Utils.checkNotNull(deposit, "deposit"); + public Invoice withDeposit(@Nullable Double deposit) { this.deposit = JsonNullable.of(deposit); return this; } - /** - * Amount of deposit made to this invoice. - */ - public Invoice withDeposit(JsonNullable deposit) { - Utils.checkNotNull(deposit, "deposit"); - this.deposit = deposit; - return this; - } /** * Customer memo */ - public Invoice withCustomerMemo(String customerMemo) { - Utils.checkNotNull(customerMemo, "customerMemo"); + public Invoice withCustomerMemo(@Nullable String customerMemo) { this.customerMemo = JsonNullable.of(customerMemo); return this; } - /** - * Customer memo - */ - public Invoice withCustomerMemo(JsonNullable customerMemo) { - Utils.checkNotNull(customerMemo, "customerMemo"); - this.customerMemo = customerMemo; - return this; - } /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Invoice withTrackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public Invoice withTrackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Invoice withTrackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } /** * A list of linked tracking categories. */ - public Invoice withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Invoice withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Invoice withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - public Invoice withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public Invoice withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Invoice withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - public Invoice withBillingAddress(Address billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); - this.billingAddress = Optional.ofNullable(billingAddress); - return this; - } - - public Invoice withBillingAddress(Optional billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); + public Invoice withBillingAddress(@Nullable Address billingAddress) { this.billingAddress = billingAddress; return this; } - public Invoice withShippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public Invoice withShippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public Invoice withShippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } + /** * Optional invoice template */ - public Invoice withTemplateId(String templateId) { - Utils.checkNotNull(templateId, "templateId"); + public Invoice withTemplateId(@Nullable String templateId) { this.templateId = JsonNullable.of(templateId); return this; } - /** - * Optional invoice template - */ - public Invoice withTemplateId(JsonNullable templateId) { - Utils.checkNotNull(templateId, "templateId"); - this.templateId = templateId; - return this; - } /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - public Invoice withSourceDocumentUrl(String sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); + public Invoice withSourceDocumentUrl(@Nullable String sourceDocumentUrl) { this.sourceDocumentUrl = JsonNullable.of(sourceDocumentUrl); return this; } - /** - * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - */ - public Invoice withSourceDocumentUrl(JsonNullable sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - this.sourceDocumentUrl = sourceDocumentUrl; - return this; - } /** * IDs of payments made on the invoice */ - public Invoice withPaymentAllocations(List paymentAllocations) { - Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + public Invoice withPaymentAllocations(@Nullable List paymentAllocations) { this.paymentAllocations = JsonNullable.of(paymentAllocations); return this; } - /** - * IDs of payments made on the invoice - */ - public Invoice withPaymentAllocations(JsonNullable> paymentAllocations) { - Utils.checkNotNull(paymentAllocations, "paymentAllocations"); - this.paymentAllocations = paymentAllocations; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Invoice withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Invoice withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Invoice withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * The channel through which the transaction is processed. */ - public Invoice withChannel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Invoice withChannel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Invoice withChannel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public Invoice withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public Invoice withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Invoice withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public Invoice withAccountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public Invoice withAccountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public Invoice withAccountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } - - public Invoice withBankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public Invoice withBankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public Invoice withBankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - public Invoice withLedgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + + public Invoice withLedgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Invoice withLedgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Invoice withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Invoice withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Invoice withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - public Invoice withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Invoice withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Invoice withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Invoice withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Invoice withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Invoice withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public Invoice withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Invoice withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Invoice withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Invoice withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Invoice withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Invoice withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Invoice withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Invoice withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Invoice withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Invoice withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Invoice withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Invoice withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Invoice withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Invoice withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Invoice withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1845,968 +1359,466 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private JsonNullable customer = JsonNullable.undefined(); + private JsonNullable customer; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable invoiceDate = JsonNullable.undefined(); + private JsonNullable invoiceDate; - private JsonNullable dueDate = JsonNullable.undefined(); + private JsonNullable dueDate; - private JsonNullable terms = JsonNullable.undefined(); + private JsonNullable terms; - private JsonNullable poNumber = JsonNullable.undefined(); + private JsonNullable poNumber; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private Optional invoiceSent = Optional.empty(); + private Boolean invoiceSent; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private JsonNullable totalTax = JsonNullable.undefined(); + private JsonNullable totalTax; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable discountPercentage = JsonNullable.undefined(); + private JsonNullable discountPercentage; - private JsonNullable discountAmount = JsonNullable.undefined(); + private JsonNullable discountAmount; - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; - private JsonNullable balance = JsonNullable.undefined(); + private JsonNullable balance; - private JsonNullable deposit = JsonNullable.undefined(); + private JsonNullable deposit; - private JsonNullable customerMemo = JsonNullable.undefined(); + private JsonNullable customerMemo; @Deprecated - private JsonNullable trackingCategory = JsonNullable.undefined(); + private JsonNullable trackingCategory; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private Optional billingAddress = Optional.empty(); + private Address billingAddress; - private Optional shippingAddress = Optional.empty(); + private Address shippingAddress; - private JsonNullable templateId = JsonNullable.undefined(); + private JsonNullable templateId; - private JsonNullable sourceDocumentUrl = JsonNullable.undefined(); + private JsonNullable sourceDocumentUrl; - private JsonNullable> paymentAllocations = JsonNullable.undefined(); + private JsonNullable> paymentAllocations; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable channel = JsonNullable.undefined(); + private JsonNullable channel; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable accountingByRow = JsonNullable.undefined(); + private JsonNullable accountingByRow; - private Optional bankAccount = Optional.empty(); + private BankAccount bankAccount; - private JsonNullable ledgerAccount = JsonNullable.undefined(); + private JsonNullable ledgerAccount; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } /** - * The third-party API ID of original entity + * Invoice type */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; + public Builder type(@Nullable InvoiceType type) { + this.type = JsonNullable.of(type); return this; } - /** - * Invoice type + * Invoice number. */ - public Builder type(InvoiceType type) { - Utils.checkNotNull(type, "type"); - this.type = JsonNullable.of(type); + public Builder number(@Nullable String number) { + this.number = JsonNullable.of(number); return this; } - /** - * Invoice type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - - /** - * Invoice number. - */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); - this.number = JsonNullable.of(number); - return this; - } - - /** - * Invoice number. - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * The customer this entity is linked to. */ - public Builder customer(LinkedCustomer customer) { - Utils.checkNotNull(customer, "customer"); + public Builder customer(@Nullable LinkedCustomer customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public Builder customer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Date invoice was issued - YYYY-MM-DD. */ - public Builder invoiceDate(LocalDate invoiceDate) { - Utils.checkNotNull(invoiceDate, "invoiceDate"); + public Builder invoiceDate(@Nullable LocalDate invoiceDate) { this.invoiceDate = JsonNullable.of(invoiceDate); return this; } - /** - * Date invoice was issued - YYYY-MM-DD. - */ - public Builder invoiceDate(JsonNullable invoiceDate) { - Utils.checkNotNull(invoiceDate, "invoiceDate"); - this.invoiceDate = invoiceDate; - return this; - } - - /** * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. */ - public Builder dueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Builder dueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. - */ - public Builder dueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } - - /** * Terms of payment. */ - public Builder terms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Builder terms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public Builder terms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } - - /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - public Builder poNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public Builder poNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - */ - public Builder poNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } - - /** * Optional reference identifier for the transaction. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference identifier for the transaction. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** * Invoice status */ - public Builder status(InvoiceStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable InvoiceStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Invoice status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Invoice sent to contact/customer. */ - public Builder invoiceSent(boolean invoiceSent) { - Utils.checkNotNull(invoiceSent, "invoiceSent"); - this.invoiceSent = Optional.ofNullable(invoiceSent); - return this; - } - - /** - * Invoice sent to contact/customer. - */ - public Builder invoiceSent(Optional invoiceSent) { - Utils.checkNotNull(invoiceSent, "invoiceSent"); + public Builder invoiceSent(@Nullable Boolean invoiceSent) { this.invoiceSent = invoiceSent; return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Total tax amount applied to this invoice. */ - public Builder totalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Builder totalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public Builder totalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } - - /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - /** * Discount percentage applied to this invoice. */ - public Builder discountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Builder discountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this invoice. - */ - public Builder discountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - /** * Discount amount applied to this invoice. */ - public Builder discountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public Builder discountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } - /** - * Discount amount applied to this invoice. - */ - public Builder discountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; - return this; - } - - /** * Total amount of invoice, including tax. */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of invoice, including tax. - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - - /** * Balance of invoice due. */ - public Builder balance(double balance) { - Utils.checkNotNull(balance, "balance"); + public Builder balance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * Balance of invoice due. - */ - public Builder balance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } - - /** * Amount of deposit made to this invoice. */ - public Builder deposit(double deposit) { - Utils.checkNotNull(deposit, "deposit"); + public Builder deposit(@Nullable Double deposit) { this.deposit = JsonNullable.of(deposit); return this; } - /** - * Amount of deposit made to this invoice. - */ - public Builder deposit(JsonNullable deposit) { - Utils.checkNotNull(deposit, "deposit"); - this.deposit = deposit; - return this; - } - - /** * Customer memo */ - public Builder customerMemo(String customerMemo) { - Utils.checkNotNull(customerMemo, "customerMemo"); + public Builder customerMemo(@Nullable String customerMemo) { this.customerMemo = JsonNullable.of(customerMemo); return this; } - /** - * Customer memo - */ - public Builder customerMemo(JsonNullable customerMemo) { - Utils.checkNotNull(customerMemo, "customerMemo"); - this.customerMemo = customerMemo; - return this; - } - - /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder trackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public Builder trackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder trackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - - public Builder billingAddress(Address billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); - this.billingAddress = Optional.ofNullable(billingAddress); - return this; - } - - public Builder billingAddress(Optional billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); + public Builder billingAddress(@Nullable Address billingAddress) { this.billingAddress = billingAddress; return this; } - - public Builder shippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public Builder shippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public Builder shippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } - /** * Optional invoice template */ - public Builder templateId(String templateId) { - Utils.checkNotNull(templateId, "templateId"); + public Builder templateId(@Nullable String templateId) { this.templateId = JsonNullable.of(templateId); return this; } - /** - * Optional invoice template - */ - public Builder templateId(JsonNullable templateId) { - Utils.checkNotNull(templateId, "templateId"); - this.templateId = templateId; - return this; - } - - /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - public Builder sourceDocumentUrl(String sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); + public Builder sourceDocumentUrl(@Nullable String sourceDocumentUrl) { this.sourceDocumentUrl = JsonNullable.of(sourceDocumentUrl); return this; } - /** - * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - */ - public Builder sourceDocumentUrl(JsonNullable sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - this.sourceDocumentUrl = sourceDocumentUrl; - return this; - } - - /** * IDs of payments made on the invoice */ - public Builder paymentAllocations(List paymentAllocations) { - Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + public Builder paymentAllocations(@Nullable List paymentAllocations) { this.paymentAllocations = JsonNullable.of(paymentAllocations); return this; } - /** - * IDs of payments made on the invoice - */ - public Builder paymentAllocations(JsonNullable> paymentAllocations) { - Utils.checkNotNull(paymentAllocations, "paymentAllocations"); - this.paymentAllocations = paymentAllocations; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * The channel through which the transaction is processed. */ - public Builder channel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Builder channel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Builder channel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public Builder accountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public Builder accountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public Builder accountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } - - - public Builder bankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public Builder bankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public Builder bankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - - public Builder ledgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Builder ledgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Invoice build() { - return new Invoice( id, downstreamId, type, number, customer, companyId, diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceInput.java b/src/main/java/com/apideck/unify/models/components/InvoiceInput.java index 6f11e615..3304af01 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceInput.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceInput.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -27,7 +26,7 @@ public class InvoiceInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * Invoice number. @@ -41,7 +40,7 @@ public class InvoiceInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer") - private JsonNullable customer; + private JsonNullable customer; /** * The company or subsidiary id the transaction belongs to @@ -90,21 +89,21 @@ public class InvoiceInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Invoice sent to contact/customer. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("invoice_sent") - private Optional invoiceSent; + private Boolean invoiceSent; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -190,29 +189,29 @@ public class InvoiceInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_category") @Deprecated - private JsonNullable trackingCategory; + private JsonNullable trackingCategory; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; @JsonInclude(Include.NON_ABSENT) @JsonProperty("billing_address") - private Optional billingAddress; + private Address billingAddress; @JsonInclude(Include.NON_ABSENT) @JsonProperty("shipping_address") - private Optional shippingAddress; + private Address shippingAddress; /** * Optional invoice template @@ -233,7 +232,7 @@ public class InvoiceInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("payment_allocations") - private JsonNullable> paymentAllocations; + private JsonNullable> paymentAllocations; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check @@ -266,17 +265,17 @@ public class InvoiceInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_account") - private Optional bankAccount; + private BankAccount bankAccount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("ledger_account") - private JsonNullable ledgerAccount; + private JsonNullable ledgerAccount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -290,335 +289,301 @@ public class InvoiceInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public InvoiceInput( - @JsonProperty("type") JsonNullable type, - @JsonProperty("number") JsonNullable number, - @JsonProperty("customer") JsonNullable customer, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("invoice_date") JsonNullable invoiceDate, - @JsonProperty("due_date") JsonNullable dueDate, - @JsonProperty("terms") JsonNullable terms, - @JsonProperty("po_number") JsonNullable poNumber, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("status") JsonNullable status, - @JsonProperty("invoice_sent") Optional invoiceSent, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("sub_total") JsonNullable subTotal, - @JsonProperty("total_tax") JsonNullable totalTax, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("discount_percentage") JsonNullable discountPercentage, - @JsonProperty("discount_amount") JsonNullable discountAmount, - @JsonProperty("total") JsonNullable total, - @JsonProperty("balance") JsonNullable balance, - @JsonProperty("deposit") JsonNullable deposit, - @JsonProperty("customer_memo") JsonNullable customerMemo, - @JsonProperty("tracking_category") JsonNullable trackingCategory, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("billing_address") Optional billingAddress, - @JsonProperty("shipping_address") Optional shippingAddress, - @JsonProperty("template_id") JsonNullable templateId, - @JsonProperty("source_document_url") JsonNullable sourceDocumentUrl, - @JsonProperty("payment_allocations") JsonNullable> paymentAllocations, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("channel") JsonNullable channel, - @JsonProperty("language") JsonNullable language, - @JsonProperty("accounting_by_row") JsonNullable accountingByRow, - @JsonProperty("bank_account") Optional bankAccount, - @JsonProperty("ledger_account") JsonNullable ledgerAccount, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(customer, "customer"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(invoiceDate, "invoiceDate"); - Utils.checkNotNull(dueDate, "dueDate"); - Utils.checkNotNull(terms, "terms"); - Utils.checkNotNull(poNumber, "poNumber"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(invoiceSent, "invoiceSent"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalTax, "totalTax"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(discountPercentage, "discountPercentage"); - Utils.checkNotNull(discountAmount, "discountAmount"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(balance, "balance"); - Utils.checkNotNull(deposit, "deposit"); - Utils.checkNotNull(customerMemo, "customerMemo"); - Utils.checkNotNull(trackingCategory, "trackingCategory"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(billingAddress, "billingAddress"); - Utils.checkNotNull(shippingAddress, "shippingAddress"); - Utils.checkNotNull(templateId, "templateId"); - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - Utils.checkNotNull(paymentAllocations, "paymentAllocations"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(channel, "channel"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(accountingByRow, "accountingByRow"); - Utils.checkNotNull(bankAccount, "bankAccount"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - this.type = type; - this.number = number; - this.customer = customer; - this.companyId = companyId; - this.invoiceDate = invoiceDate; - this.dueDate = dueDate; - this.terms = terms; - this.poNumber = poNumber; - this.reference = reference; - this.status = status; + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("customer") @Nullable JsonNullable customer, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("invoice_date") @Nullable JsonNullable invoiceDate, + @JsonProperty("due_date") @Nullable JsonNullable dueDate, + @JsonProperty("terms") @Nullable JsonNullable terms, + @JsonProperty("po_number") @Nullable JsonNullable poNumber, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("invoice_sent") @Nullable Boolean invoiceSent, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, + @JsonProperty("total_tax") @Nullable JsonNullable totalTax, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("discount_percentage") @Nullable JsonNullable discountPercentage, + @JsonProperty("discount_amount") @Nullable JsonNullable discountAmount, + @JsonProperty("total") @Nullable JsonNullable total, + @JsonProperty("balance") @Nullable JsonNullable balance, + @JsonProperty("deposit") @Nullable JsonNullable deposit, + @JsonProperty("customer_memo") @Nullable JsonNullable customerMemo, + @JsonProperty("tracking_category") @Nullable JsonNullable trackingCategory, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("billing_address") @Nullable Address billingAddress, + @JsonProperty("shipping_address") @Nullable Address shippingAddress, + @JsonProperty("template_id") @Nullable JsonNullable templateId, + @JsonProperty("source_document_url") @Nullable JsonNullable sourceDocumentUrl, + @JsonProperty("payment_allocations") @Nullable JsonNullable> paymentAllocations, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("channel") @Nullable JsonNullable channel, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("accounting_by_row") @Nullable JsonNullable accountingByRow, + @JsonProperty("bank_account") @Nullable BankAccount bankAccount, + @JsonProperty("ledger_account") @Nullable JsonNullable ledgerAccount, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.customer = Optional.ofNullable(customer) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.invoiceDate = Optional.ofNullable(invoiceDate) + .orElse(JsonNullable.undefined()); + this.dueDate = Optional.ofNullable(dueDate) + .orElse(JsonNullable.undefined()); + this.terms = Optional.ofNullable(terms) + .orElse(JsonNullable.undefined()); + this.poNumber = Optional.ofNullable(poNumber) + .orElse(JsonNullable.undefined()); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); this.invoiceSent = invoiceSent; - this.currency = currency; - this.currencyRate = currencyRate; - this.taxInclusive = taxInclusive; - this.subTotal = subTotal; - this.totalTax = totalTax; - this.taxCode = taxCode; - this.discountPercentage = discountPercentage; - this.discountAmount = discountAmount; - this.total = total; - this.balance = balance; - this.deposit = deposit; - this.customerMemo = customerMemo; - this.trackingCategory = trackingCategory; - this.trackingCategories = trackingCategories; + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); + this.totalTax = Optional.ofNullable(totalTax) + .orElse(JsonNullable.undefined()); + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.discountPercentage = Optional.ofNullable(discountPercentage) + .orElse(JsonNullable.undefined()); + this.discountAmount = Optional.ofNullable(discountAmount) + .orElse(JsonNullable.undefined()); + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); + this.balance = Optional.ofNullable(balance) + .orElse(JsonNullable.undefined()); + this.deposit = Optional.ofNullable(deposit) + .orElse(JsonNullable.undefined()); + this.customerMemo = Optional.ofNullable(customerMemo) + .orElse(JsonNullable.undefined()); + this.trackingCategory = Optional.ofNullable(trackingCategory) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); this.lineItems = lineItems; this.billingAddress = billingAddress; this.shippingAddress = shippingAddress; - this.templateId = templateId; - this.sourceDocumentUrl = sourceDocumentUrl; - this.paymentAllocations = paymentAllocations; - this.paymentMethod = paymentMethod; - this.channel = channel; - this.language = language; - this.accountingByRow = accountingByRow; + this.templateId = Optional.ofNullable(templateId) + .orElse(JsonNullable.undefined()); + this.sourceDocumentUrl = Optional.ofNullable(sourceDocumentUrl) + .orElse(JsonNullable.undefined()); + this.paymentAllocations = Optional.ofNullable(paymentAllocations) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.channel = Optional.ofNullable(channel) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.accountingByRow = Optional.ofNullable(accountingByRow) + .orElse(JsonNullable.undefined()); this.bankAccount = bankAccount; - this.ledgerAccount = ledgerAccount; + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public InvoiceInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Invoice type */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * Invoice number. */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * The customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable customer() { - return (JsonNullable) customer; + return this.customer; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Date invoice was issued - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable invoiceDate() { - return invoiceDate; + return this.invoiceDate; } /** * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable dueDate() { - return dueDate; + return this.dueDate; } /** * Terms of payment. */ - @JsonIgnore public JsonNullable terms() { - return terms; + return this.terms; } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - @JsonIgnore public JsonNullable poNumber() { - return poNumber; + return this.poNumber; } /** * Optional reference identifier for the transaction. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } /** * Invoice status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Invoice sent to contact/customer. */ - @JsonIgnore public Optional invoiceSent() { - return invoiceSent; + return Optional.ofNullable(this.invoiceSent); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Total tax amount applied to this invoice. */ - @JsonIgnore public JsonNullable totalTax() { - return totalTax; + return this.totalTax; } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } /** * Discount percentage applied to this invoice. */ - @JsonIgnore public JsonNullable discountPercentage() { - return discountPercentage; + return this.discountPercentage; } /** * Discount amount applied to this invoice. */ - @JsonIgnore public JsonNullable discountAmount() { - return discountAmount; + return this.discountAmount; } /** * Total amount of invoice, including tax. */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } /** * Balance of invoice due. */ - @JsonIgnore public JsonNullable balance() { - return balance; + return this.balance; } /** * Amount of deposit made to this invoice. */ - @JsonIgnore public JsonNullable deposit() { - return deposit; + return this.deposit; } /** * Customer memo */ - @JsonIgnore public JsonNullable customerMemo() { - return customerMemo; + return this.customerMemo; } /** @@ -626,129 +591,102 @@ public JsonNullable customerMemo() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable trackingCategory() { - return (JsonNullable) trackingCategory; + return this.trackingCategory; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
billingAddress() { - return (Optional
) billingAddress; + return Optional.ofNullable(this.billingAddress); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
shippingAddress() { - return (Optional
) shippingAddress; + return Optional.ofNullable(this.shippingAddress); } /** * Optional invoice template */ - @JsonIgnore public JsonNullable templateId() { - return templateId; + return this.templateId; } /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - @JsonIgnore public JsonNullable sourceDocumentUrl() { - return sourceDocumentUrl; + return this.sourceDocumentUrl; } /** * IDs of payments made on the invoice */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> paymentAllocations() { - return (JsonNullable>) paymentAllocations; + return this.paymentAllocations; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * The channel through which the transaction is processed. */ - @JsonIgnore public JsonNullable channel() { - return channel; + return this.channel; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - @JsonIgnore public JsonNullable accountingByRow() { - return accountingByRow; + return this.accountingByRow; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional bankAccount() { - return (Optional) bankAccount; + return Optional.ofNullable(this.bankAccount); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable ledgerAccount() { - return (JsonNullable) ledgerAccount; + return this.ledgerAccount; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -759,685 +697,334 @@ public static Builder builder() { /** * Invoice type */ - public InvoiceInput withType(InvoiceType type) { - Utils.checkNotNull(type, "type"); + public InvoiceInput withType(@Nullable InvoiceType type) { this.type = JsonNullable.of(type); return this; } - /** - * Invoice type - */ - public InvoiceInput withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Invoice number. */ - public InvoiceInput withNumber(String number) { - Utils.checkNotNull(number, "number"); + public InvoiceInput withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Invoice number. - */ - public InvoiceInput withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * The customer this entity is linked to. */ - public InvoiceInput withCustomer(LinkedCustomerInput customer) { - Utils.checkNotNull(customer, "customer"); + public InvoiceInput withCustomer(@Nullable LinkedCustomerInput customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public InvoiceInput withCustomer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public InvoiceInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public InvoiceInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public InvoiceInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Date invoice was issued - YYYY-MM-DD. */ - public InvoiceInput withInvoiceDate(LocalDate invoiceDate) { - Utils.checkNotNull(invoiceDate, "invoiceDate"); + public InvoiceInput withInvoiceDate(@Nullable LocalDate invoiceDate) { this.invoiceDate = JsonNullable.of(invoiceDate); return this; } - /** - * Date invoice was issued - YYYY-MM-DD. - */ - public InvoiceInput withInvoiceDate(JsonNullable invoiceDate) { - Utils.checkNotNull(invoiceDate, "invoiceDate"); - this.invoiceDate = invoiceDate; - return this; - } /** * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. */ - public InvoiceInput withDueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public InvoiceInput withDueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. - */ - public InvoiceInput withDueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } /** * Terms of payment. */ - public InvoiceInput withTerms(String terms) { - Utils.checkNotNull(terms, "terms"); + public InvoiceInput withTerms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public InvoiceInput withTerms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - public InvoiceInput withPoNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public InvoiceInput withPoNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - */ - public InvoiceInput withPoNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } /** * Optional reference identifier for the transaction. */ - public InvoiceInput withReference(String reference) { - Utils.checkNotNull(reference, "reference"); + public InvoiceInput withReference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference identifier for the transaction. - */ - public InvoiceInput withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } /** * Invoice status */ - public InvoiceInput withStatus(InvoiceStatus status) { - Utils.checkNotNull(status, "status"); + public InvoiceInput withStatus(@Nullable InvoiceStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Invoice status - */ - public InvoiceInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** - * Invoice sent to contact/customer. - */ - public InvoiceInput withInvoiceSent(boolean invoiceSent) { - Utils.checkNotNull(invoiceSent, "invoiceSent"); - this.invoiceSent = Optional.ofNullable(invoiceSent); - return this; - } - /** * Invoice sent to contact/customer. */ - public InvoiceInput withInvoiceSent(Optional invoiceSent) { - Utils.checkNotNull(invoiceSent, "invoiceSent"); + public InvoiceInput withInvoiceSent(@Nullable Boolean invoiceSent) { this.invoiceSent = invoiceSent; return this; } + /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public InvoiceInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public InvoiceInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public InvoiceInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public InvoiceInput withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public InvoiceInput withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public InvoiceInput withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * Amounts are including tax */ - public InvoiceInput withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public InvoiceInput withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public InvoiceInput withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } /** * Sub-total amount, normally before tax. */ - public InvoiceInput withSubTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public InvoiceInput withSubTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public InvoiceInput withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Total tax amount applied to this invoice. */ - public InvoiceInput withTotalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public InvoiceInput withTotalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public InvoiceInput withTotalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public InvoiceInput withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public InvoiceInput withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public InvoiceInput withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } /** * Discount percentage applied to this invoice. */ - public InvoiceInput withDiscountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public InvoiceInput withDiscountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this invoice. - */ - public InvoiceInput withDiscountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } /** * Discount amount applied to this invoice. */ - public InvoiceInput withDiscountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public InvoiceInput withDiscountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } - /** - * Discount amount applied to this invoice. - */ - public InvoiceInput withDiscountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; - return this; - } /** * Total amount of invoice, including tax. */ - public InvoiceInput withTotal(double total) { - Utils.checkNotNull(total, "total"); + public InvoiceInput withTotal(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of invoice, including tax. - */ - public InvoiceInput withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } /** * Balance of invoice due. */ - public InvoiceInput withBalance(double balance) { - Utils.checkNotNull(balance, "balance"); + public InvoiceInput withBalance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * Balance of invoice due. - */ - public InvoiceInput withBalance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } /** * Amount of deposit made to this invoice. */ - public InvoiceInput withDeposit(double deposit) { - Utils.checkNotNull(deposit, "deposit"); + public InvoiceInput withDeposit(@Nullable Double deposit) { this.deposit = JsonNullable.of(deposit); return this; } - /** - * Amount of deposit made to this invoice. - */ - public InvoiceInput withDeposit(JsonNullable deposit) { - Utils.checkNotNull(deposit, "deposit"); - this.deposit = deposit; - return this; - } /** * Customer memo */ - public InvoiceInput withCustomerMemo(String customerMemo) { - Utils.checkNotNull(customerMemo, "customerMemo"); + public InvoiceInput withCustomerMemo(@Nullable String customerMemo) { this.customerMemo = JsonNullable.of(customerMemo); return this; } - /** - * Customer memo - */ - public InvoiceInput withCustomerMemo(JsonNullable customerMemo) { - Utils.checkNotNull(customerMemo, "customerMemo"); - this.customerMemo = customerMemo; - return this; - } /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public InvoiceInput withTrackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public InvoiceInput withTrackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public InvoiceInput withTrackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } /** * A list of linked tracking categories. */ - public InvoiceInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public InvoiceInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public InvoiceInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - public InvoiceInput withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - - public InvoiceInput withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public InvoiceInput withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - public InvoiceInput withBillingAddress(Address billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); - this.billingAddress = Optional.ofNullable(billingAddress); - return this; - } - - public InvoiceInput withBillingAddress(Optional billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); + public InvoiceInput withBillingAddress(@Nullable Address billingAddress) { this.billingAddress = billingAddress; return this; } - public InvoiceInput withShippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public InvoiceInput withShippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public InvoiceInput withShippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } + /** * Optional invoice template */ - public InvoiceInput withTemplateId(String templateId) { - Utils.checkNotNull(templateId, "templateId"); + public InvoiceInput withTemplateId(@Nullable String templateId) { this.templateId = JsonNullable.of(templateId); return this; } - /** - * Optional invoice template - */ - public InvoiceInput withTemplateId(JsonNullable templateId) { - Utils.checkNotNull(templateId, "templateId"); - this.templateId = templateId; - return this; - } /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - public InvoiceInput withSourceDocumentUrl(String sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); + public InvoiceInput withSourceDocumentUrl(@Nullable String sourceDocumentUrl) { this.sourceDocumentUrl = JsonNullable.of(sourceDocumentUrl); return this; } - /** - * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - */ - public InvoiceInput withSourceDocumentUrl(JsonNullable sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - this.sourceDocumentUrl = sourceDocumentUrl; - return this; - } /** * IDs of payments made on the invoice */ - public InvoiceInput withPaymentAllocations(List paymentAllocations) { - Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + public InvoiceInput withPaymentAllocations(@Nullable List paymentAllocations) { this.paymentAllocations = JsonNullable.of(paymentAllocations); return this; } - /** - * IDs of payments made on the invoice - */ - public InvoiceInput withPaymentAllocations(JsonNullable> paymentAllocations) { - Utils.checkNotNull(paymentAllocations, "paymentAllocations"); - this.paymentAllocations = paymentAllocations; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public InvoiceInput withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public InvoiceInput withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public InvoiceInput withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * The channel through which the transaction is processed. */ - public InvoiceInput withChannel(String channel) { - Utils.checkNotNull(channel, "channel"); + public InvoiceInput withChannel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public InvoiceInput withChannel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public InvoiceInput withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public InvoiceInput withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public InvoiceInput withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public InvoiceInput withAccountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public InvoiceInput withAccountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public InvoiceInput withAccountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } - - public InvoiceInput withBankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public InvoiceInput withBankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public InvoiceInput withBankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - public InvoiceInput withLedgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = JsonNullable.of(ledgerAccount); - return this; - } - public InvoiceInput withLedgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - public InvoiceInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); + public InvoiceInput withLedgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { + this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public InvoiceInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public InvoiceInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public InvoiceInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public InvoiceInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public InvoiceInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public InvoiceInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -1445,12 +1032,12 @@ public InvoiceInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public InvoiceInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public InvoiceInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1570,821 +1157,396 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private JsonNullable customer = JsonNullable.undefined(); + private JsonNullable customer; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable invoiceDate = JsonNullable.undefined(); + private JsonNullable invoiceDate; - private JsonNullable dueDate = JsonNullable.undefined(); + private JsonNullable dueDate; - private JsonNullable terms = JsonNullable.undefined(); + private JsonNullable terms; - private JsonNullable poNumber = JsonNullable.undefined(); + private JsonNullable poNumber; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private Optional invoiceSent = Optional.empty(); + private Boolean invoiceSent; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private JsonNullable totalTax = JsonNullable.undefined(); + private JsonNullable totalTax; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable discountPercentage = JsonNullable.undefined(); + private JsonNullable discountPercentage; - private JsonNullable discountAmount = JsonNullable.undefined(); + private JsonNullable discountAmount; - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; - private JsonNullable balance = JsonNullable.undefined(); + private JsonNullable balance; - private JsonNullable deposit = JsonNullable.undefined(); + private JsonNullable deposit; - private JsonNullable customerMemo = JsonNullable.undefined(); + private JsonNullable customerMemo; @Deprecated - private JsonNullable trackingCategory = JsonNullable.undefined(); + private JsonNullable trackingCategory; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private Optional billingAddress = Optional.empty(); + private Address billingAddress; - private Optional shippingAddress = Optional.empty(); + private Address shippingAddress; - private JsonNullable templateId = JsonNullable.undefined(); + private JsonNullable templateId; - private JsonNullable sourceDocumentUrl = JsonNullable.undefined(); + private JsonNullable sourceDocumentUrl; - private JsonNullable> paymentAllocations = JsonNullable.undefined(); + private JsonNullable> paymentAllocations; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable channel = JsonNullable.undefined(); + private JsonNullable channel; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable accountingByRow = JsonNullable.undefined(); + private JsonNullable accountingByRow; - private Optional bankAccount = Optional.empty(); + private BankAccount bankAccount; - private JsonNullable ledgerAccount = JsonNullable.undefined(); + private JsonNullable ledgerAccount; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Invoice type */ - public Builder type(InvoiceType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable InvoiceType type) { this.type = JsonNullable.of(type); return this; } - /** - * Invoice type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * Invoice number. */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Invoice number. - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * The customer this entity is linked to. */ - public Builder customer(LinkedCustomerInput customer) { - Utils.checkNotNull(customer, "customer"); + public Builder customer(@Nullable LinkedCustomerInput customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public Builder customer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Date invoice was issued - YYYY-MM-DD. */ - public Builder invoiceDate(LocalDate invoiceDate) { - Utils.checkNotNull(invoiceDate, "invoiceDate"); + public Builder invoiceDate(@Nullable LocalDate invoiceDate) { this.invoiceDate = JsonNullable.of(invoiceDate); return this; } - /** - * Date invoice was issued - YYYY-MM-DD. - */ - public Builder invoiceDate(JsonNullable invoiceDate) { - Utils.checkNotNull(invoiceDate, "invoiceDate"); - this.invoiceDate = invoiceDate; - return this; - } - - /** * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. */ - public Builder dueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Builder dueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The invoice due date is the date on which a payment or invoice is scheduled to be received by the seller - YYYY-MM-DD. - */ - public Builder dueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } - - /** * Terms of payment. */ - public Builder terms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Builder terms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public Builder terms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } - - /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. */ - public Builder poNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public Builder poNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. The buyer will match the PO number in the invoice to the Purchase Order. - */ - public Builder poNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } - - /** * Optional reference identifier for the transaction. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional reference identifier for the transaction. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** * Invoice status */ - public Builder status(InvoiceStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable InvoiceStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Invoice status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - - /** - * Invoice sent to contact/customer. - */ - public Builder invoiceSent(boolean invoiceSent) { - Utils.checkNotNull(invoiceSent, "invoiceSent"); - this.invoiceSent = Optional.ofNullable(invoiceSent); - return this; - } - /** * Invoice sent to contact/customer. */ - public Builder invoiceSent(Optional invoiceSent) { - Utils.checkNotNull(invoiceSent, "invoiceSent"); + public Builder invoiceSent(@Nullable Boolean invoiceSent) { this.invoiceSent = invoiceSent; return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Total tax amount applied to this invoice. */ - public Builder totalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Builder totalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public Builder totalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } - - /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - /** * Discount percentage applied to this invoice. */ - public Builder discountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Builder discountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this invoice. - */ - public Builder discountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - /** * Discount amount applied to this invoice. */ - public Builder discountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public Builder discountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } - /** - * Discount amount applied to this invoice. - */ - public Builder discountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; - return this; - } - - /** * Total amount of invoice, including tax. */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of invoice, including tax. - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - - /** * Balance of invoice due. */ - public Builder balance(double balance) { - Utils.checkNotNull(balance, "balance"); + public Builder balance(@Nullable Double balance) { this.balance = JsonNullable.of(balance); return this; } - /** - * Balance of invoice due. - */ - public Builder balance(JsonNullable balance) { - Utils.checkNotNull(balance, "balance"); - this.balance = balance; - return this; - } - - /** * Amount of deposit made to this invoice. */ - public Builder deposit(double deposit) { - Utils.checkNotNull(deposit, "deposit"); + public Builder deposit(@Nullable Double deposit) { this.deposit = JsonNullable.of(deposit); return this; } - /** - * Amount of deposit made to this invoice. - */ - public Builder deposit(JsonNullable deposit) { - Utils.checkNotNull(deposit, "deposit"); - this.deposit = deposit; - return this; - } - - /** * Customer memo */ - public Builder customerMemo(String customerMemo) { - Utils.checkNotNull(customerMemo, "customerMemo"); + public Builder customerMemo(@Nullable String customerMemo) { this.customerMemo = JsonNullable.of(customerMemo); return this; } - /** - * Customer memo - */ - public Builder customerMemo(JsonNullable customerMemo) { - Utils.checkNotNull(customerMemo, "customerMemo"); - this.customerMemo = customerMemo; - return this; - } - - /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder trackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public Builder trackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder trackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - - public Builder billingAddress(Address billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); - this.billingAddress = Optional.ofNullable(billingAddress); - return this; - } - - public Builder billingAddress(Optional billingAddress) { - Utils.checkNotNull(billingAddress, "billingAddress"); + public Builder billingAddress(@Nullable Address billingAddress) { this.billingAddress = billingAddress; return this; } - - public Builder shippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public Builder shippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public Builder shippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } - /** * Optional invoice template */ - public Builder templateId(String templateId) { - Utils.checkNotNull(templateId, "templateId"); + public Builder templateId(@Nullable String templateId) { this.templateId = JsonNullable.of(templateId); return this; } - /** - * Optional invoice template - */ - public Builder templateId(JsonNullable templateId) { - Utils.checkNotNull(templateId, "templateId"); - this.templateId = templateId; - return this; - } - - /** * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. */ - public Builder sourceDocumentUrl(String sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); + public Builder sourceDocumentUrl(@Nullable String sourceDocumentUrl) { this.sourceDocumentUrl = JsonNullable.of(sourceDocumentUrl); return this; } - /** - * URL link to a source document - shown as 'Go to [appName]' in the downstream app. Currently only supported for Xero. - */ - public Builder sourceDocumentUrl(JsonNullable sourceDocumentUrl) { - Utils.checkNotNull(sourceDocumentUrl, "sourceDocumentUrl"); - this.sourceDocumentUrl = sourceDocumentUrl; - return this; - } - - /** * IDs of payments made on the invoice */ - public Builder paymentAllocations(List paymentAllocations) { - Utils.checkNotNull(paymentAllocations, "paymentAllocations"); + public Builder paymentAllocations(@Nullable List paymentAllocations) { this.paymentAllocations = JsonNullable.of(paymentAllocations); return this; } - /** - * IDs of payments made on the invoice - */ - public Builder paymentAllocations(JsonNullable> paymentAllocations) { - Utils.checkNotNull(paymentAllocations, "paymentAllocations"); - this.paymentAllocations = paymentAllocations; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * The channel through which the transaction is processed. */ - public Builder channel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Builder channel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Builder channel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public Builder accountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public Builder accountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public Builder accountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } - - - public Builder bankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public Builder bankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public Builder bankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - - public Builder ledgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Builder ledgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public InvoiceInput build() { - return new InvoiceInput( type, number, customer, companyId, invoiceDate, dueDate, diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceItem.java b/src/main/java/com/apideck/unify/models/components/InvoiceItem.java index 2c041ed3..2813f8fa 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceItem.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceItem.java @@ -5,17 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -30,7 +29,7 @@ public class InvoiceItem { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Item name @@ -93,17 +92,17 @@ public class InvoiceItem { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("sales_details") - private Optional salesDetails; + private SalesDetails salesDetails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("purchase_details") - private Optional purchaseDetails; + private PurchaseDetails purchaseDetails; @JsonInclude(Include.NON_ABSENT) @@ -118,17 +117,17 @@ public class InvoiceItem { @JsonInclude(Include.NON_ABSENT) @JsonProperty("asset_account") - private JsonNullable assetAccount; + private JsonNullable assetAccount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("income_account") - private JsonNullable incomeAccount; + private JsonNullable incomeAccount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("expense_account") - private JsonNullable expenseAccount; + private JsonNullable expenseAccount; /** * @@ -137,14 +136,14 @@ public class InvoiceItem { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_category") @Deprecated - private JsonNullable trackingCategory; + private JsonNullable trackingCategory; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @@ -184,7 +183,7 @@ public class InvoiceItem { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -226,238 +225,211 @@ public class InvoiceItem { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public InvoiceItem( - @JsonProperty("id") Optional id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("code") JsonNullable code, - @JsonProperty("sold") JsonNullable sold, - @JsonProperty("purchased") JsonNullable purchased, - @JsonProperty("tracked") JsonNullable tracked, - @JsonProperty("taxable") JsonNullable taxable, - @JsonProperty("inventory_date") JsonNullable inventoryDate, - @JsonProperty("type") JsonNullable type, - @JsonProperty("sales_details") Optional salesDetails, - @JsonProperty("purchase_details") Optional purchaseDetails, - @JsonProperty("quantity") JsonNullable quantity, - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("asset_account") JsonNullable assetAccount, - @JsonProperty("income_account") JsonNullable incomeAccount, - @JsonProperty("expense_account") JsonNullable expenseAccount, - @JsonProperty("tracking_category") JsonNullable trackingCategory, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("active") JsonNullable active, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("location_id") JsonNullable locationId, - @JsonProperty("subsidiary_id") JsonNullable subsidiaryId, - @JsonProperty("tax_schedule_id") JsonNullable taxScheduleId, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(sold, "sold"); - Utils.checkNotNull(purchased, "purchased"); - Utils.checkNotNull(tracked, "tracked"); - Utils.checkNotNull(taxable, "taxable"); - Utils.checkNotNull(inventoryDate, "inventoryDate"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(salesDetails, "salesDetails"); - Utils.checkNotNull(purchaseDetails, "purchaseDetails"); - Utils.checkNotNull(quantity, "quantity"); - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(assetAccount, "assetAccount"); - Utils.checkNotNull(incomeAccount, "incomeAccount"); - Utils.checkNotNull(expenseAccount, "expenseAccount"); - Utils.checkNotNull(trackingCategory, "trackingCategory"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(locationId, "locationId"); - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - Utils.checkNotNull(taxScheduleId, "taxScheduleId"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("sold") @Nullable JsonNullable sold, + @JsonProperty("purchased") @Nullable JsonNullable purchased, + @JsonProperty("tracked") @Nullable JsonNullable tracked, + @JsonProperty("taxable") @Nullable JsonNullable taxable, + @JsonProperty("inventory_date") @Nullable JsonNullable inventoryDate, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("sales_details") @Nullable SalesDetails salesDetails, + @JsonProperty("purchase_details") @Nullable PurchaseDetails purchaseDetails, + @JsonProperty("quantity") @Nullable JsonNullable quantity, + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("asset_account") @Nullable JsonNullable assetAccount, + @JsonProperty("income_account") @Nullable JsonNullable incomeAccount, + @JsonProperty("expense_account") @Nullable JsonNullable expenseAccount, + @JsonProperty("tracking_category") @Nullable JsonNullable trackingCategory, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("active") @Nullable JsonNullable active, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("location_id") @Nullable JsonNullable locationId, + @JsonProperty("subsidiary_id") @Nullable JsonNullable subsidiaryId, + @JsonProperty("tax_schedule_id") @Nullable JsonNullable taxScheduleId, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.name = name; - this.description = description; - this.code = code; - this.sold = sold; - this.purchased = purchased; - this.tracked = tracked; - this.taxable = taxable; - this.inventoryDate = inventoryDate; - this.type = type; + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.sold = Optional.ofNullable(sold) + .orElse(JsonNullable.undefined()); + this.purchased = Optional.ofNullable(purchased) + .orElse(JsonNullable.undefined()); + this.tracked = Optional.ofNullable(tracked) + .orElse(JsonNullable.undefined()); + this.taxable = Optional.ofNullable(taxable) + .orElse(JsonNullable.undefined()); + this.inventoryDate = Optional.ofNullable(inventoryDate) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); this.salesDetails = salesDetails; this.purchaseDetails = purchaseDetails; - this.quantity = quantity; - this.unitPrice = unitPrice; - this.assetAccount = assetAccount; - this.incomeAccount = incomeAccount; - this.expenseAccount = expenseAccount; - this.trackingCategory = trackingCategory; - this.trackingCategories = trackingCategories; - this.active = active; - this.departmentId = departmentId; - this.locationId = locationId; - this.subsidiaryId = subsidiaryId; - this.taxScheduleId = taxScheduleId; - this.customMappings = customMappings; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.quantity = Optional.ofNullable(quantity) + .orElse(JsonNullable.undefined()); + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.assetAccount = Optional.ofNullable(assetAccount) + .orElse(JsonNullable.undefined()); + this.incomeAccount = Optional.ofNullable(incomeAccount) + .orElse(JsonNullable.undefined()); + this.expenseAccount = Optional.ofNullable(expenseAccount) + .orElse(JsonNullable.undefined()); + this.trackingCategory = Optional.ofNullable(trackingCategory) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.active = Optional.ofNullable(active) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); + this.locationId = Optional.ofNullable(locationId) + .orElse(JsonNullable.undefined()); + this.subsidiaryId = Optional.ofNullable(subsidiaryId) + .orElse(JsonNullable.undefined()); + this.taxScheduleId = Optional.ofNullable(taxScheduleId) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public InvoiceItem() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * The ID of the item. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Item name */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * A short description of the item */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * User defined item code */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Item will be available on sales transactions */ - @JsonIgnore public JsonNullable sold() { - return sold; + return this.sold; } /** * Item is available for purchase transactions */ - @JsonIgnore public JsonNullable purchased() { - return purchased; + return this.purchased; } /** * Item is inventoried */ - @JsonIgnore public JsonNullable tracked() { - return tracked; + return this.tracked; } /** * If true, transactions for this item are taxable */ - @JsonIgnore public JsonNullable taxable() { - return taxable; + return this.taxable; } /** * The date of opening balance if inventory item is tracked - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable inventoryDate() { - return inventoryDate; + return this.inventoryDate; } /** * Item type */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional salesDetails() { - return (Optional) salesDetails; + return Optional.ofNullable(this.salesDetails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional purchaseDetails() { - return (Optional) purchaseDetails; + return Optional.ofNullable(this.purchaseDetails); } - @JsonIgnore public JsonNullable quantity() { - return quantity; + return this.quantity; } - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable assetAccount() { - return (JsonNullable) assetAccount; + return this.assetAccount; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable incomeAccount() { - return (JsonNullable) incomeAccount; + return this.incomeAccount; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable expenseAccount() { - return (JsonNullable) expenseAccount; + return this.expenseAccount; } /** @@ -465,114 +437,96 @@ public JsonNullable expenseAccount() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable trackingCategory() { - return (JsonNullable) trackingCategory; + return this.trackingCategory; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @JsonIgnore public JsonNullable active() { - return active; + return this.active; } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } /** * The ID of the location */ - @JsonIgnore public JsonNullable locationId() { - return locationId; + return this.locationId; } /** * The ID of the subsidiary */ - @JsonIgnore public JsonNullable subsidiaryId() { - return subsidiaryId; + return this.subsidiaryId; } /** * The ID of the tax schedule */ - @JsonIgnore public JsonNullable taxScheduleId() { - return taxScheduleId; + return this.taxScheduleId; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -583,521 +537,260 @@ public static Builder builder() { /** * The ID of the item. */ - public InvoiceItem withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The ID of the item. - */ - public InvoiceItem withId(Optional id) { - Utils.checkNotNull(id, "id"); + public InvoiceItem withId(@Nullable String id) { this.id = id; return this; } + /** * Item name */ - public InvoiceItem withName(String name) { - Utils.checkNotNull(name, "name"); + public InvoiceItem withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Item name - */ - public InvoiceItem withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * A short description of the item */ - public InvoiceItem withDescription(String description) { - Utils.checkNotNull(description, "description"); + public InvoiceItem withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A short description of the item - */ - public InvoiceItem withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * User defined item code */ - public InvoiceItem withCode(String code) { - Utils.checkNotNull(code, "code"); + public InvoiceItem withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public InvoiceItem withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * Item will be available on sales transactions */ - public InvoiceItem withSold(boolean sold) { - Utils.checkNotNull(sold, "sold"); + public InvoiceItem withSold(@Nullable Boolean sold) { this.sold = JsonNullable.of(sold); return this; } - /** - * Item will be available on sales transactions - */ - public InvoiceItem withSold(JsonNullable sold) { - Utils.checkNotNull(sold, "sold"); - this.sold = sold; - return this; - } /** * Item is available for purchase transactions */ - public InvoiceItem withPurchased(boolean purchased) { - Utils.checkNotNull(purchased, "purchased"); + public InvoiceItem withPurchased(@Nullable Boolean purchased) { this.purchased = JsonNullable.of(purchased); return this; } - /** - * Item is available for purchase transactions - */ - public InvoiceItem withPurchased(JsonNullable purchased) { - Utils.checkNotNull(purchased, "purchased"); - this.purchased = purchased; - return this; - } /** * Item is inventoried */ - public InvoiceItem withTracked(boolean tracked) { - Utils.checkNotNull(tracked, "tracked"); + public InvoiceItem withTracked(@Nullable Boolean tracked) { this.tracked = JsonNullable.of(tracked); return this; } - /** - * Item is inventoried - */ - public InvoiceItem withTracked(JsonNullable tracked) { - Utils.checkNotNull(tracked, "tracked"); - this.tracked = tracked; - return this; - } /** * If true, transactions for this item are taxable */ - public InvoiceItem withTaxable(boolean taxable) { - Utils.checkNotNull(taxable, "taxable"); + public InvoiceItem withTaxable(@Nullable Boolean taxable) { this.taxable = JsonNullable.of(taxable); return this; } - /** - * If true, transactions for this item are taxable - */ - public InvoiceItem withTaxable(JsonNullable taxable) { - Utils.checkNotNull(taxable, "taxable"); - this.taxable = taxable; - return this; - } /** * The date of opening balance if inventory item is tracked - YYYY-MM-DD. */ - public InvoiceItem withInventoryDate(LocalDate inventoryDate) { - Utils.checkNotNull(inventoryDate, "inventoryDate"); + public InvoiceItem withInventoryDate(@Nullable LocalDate inventoryDate) { this.inventoryDate = JsonNullable.of(inventoryDate); return this; } - /** - * The date of opening balance if inventory item is tracked - YYYY-MM-DD. - */ - public InvoiceItem withInventoryDate(JsonNullable inventoryDate) { - Utils.checkNotNull(inventoryDate, "inventoryDate"); - this.inventoryDate = inventoryDate; - return this; - } /** * Item type */ - public InvoiceItem withType(InvoiceItemTypeType type) { - Utils.checkNotNull(type, "type"); + public InvoiceItem withType(@Nullable InvoiceItemTypeType type) { this.type = JsonNullable.of(type); return this; } - /** - * Item type - */ - public InvoiceItem withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - public InvoiceItem withSalesDetails(SalesDetails salesDetails) { - Utils.checkNotNull(salesDetails, "salesDetails"); - this.salesDetails = Optional.ofNullable(salesDetails); - return this; - } - - - public InvoiceItem withSalesDetails(Optional salesDetails) { - Utils.checkNotNull(salesDetails, "salesDetails"); + public InvoiceItem withSalesDetails(@Nullable SalesDetails salesDetails) { this.salesDetails = salesDetails; return this; } - public InvoiceItem withPurchaseDetails(PurchaseDetails purchaseDetails) { - Utils.checkNotNull(purchaseDetails, "purchaseDetails"); - this.purchaseDetails = Optional.ofNullable(purchaseDetails); - return this; - } - - public InvoiceItem withPurchaseDetails(Optional purchaseDetails) { - Utils.checkNotNull(purchaseDetails, "purchaseDetails"); + public InvoiceItem withPurchaseDetails(@Nullable PurchaseDetails purchaseDetails) { this.purchaseDetails = purchaseDetails; return this; } - public InvoiceItem withQuantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + + public InvoiceItem withQuantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public InvoiceItem withQuantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - public InvoiceItem withUnitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public InvoiceItem withUnitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public InvoiceItem withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - public InvoiceItem withAssetAccount(LinkedLedgerAccount assetAccount) { - Utils.checkNotNull(assetAccount, "assetAccount"); + public InvoiceItem withAssetAccount(@Nullable LinkedLedgerAccount assetAccount) { this.assetAccount = JsonNullable.of(assetAccount); return this; } - public InvoiceItem withAssetAccount(JsonNullable assetAccount) { - Utils.checkNotNull(assetAccount, "assetAccount"); - this.assetAccount = assetAccount; - return this; - } - public InvoiceItem withIncomeAccount(LinkedLedgerAccount incomeAccount) { - Utils.checkNotNull(incomeAccount, "incomeAccount"); + public InvoiceItem withIncomeAccount(@Nullable LinkedLedgerAccount incomeAccount) { this.incomeAccount = JsonNullable.of(incomeAccount); return this; } - public InvoiceItem withIncomeAccount(JsonNullable incomeAccount) { - Utils.checkNotNull(incomeAccount, "incomeAccount"); - this.incomeAccount = incomeAccount; - return this; - } - public InvoiceItem withExpenseAccount(LinkedLedgerAccount expenseAccount) { - Utils.checkNotNull(expenseAccount, "expenseAccount"); + public InvoiceItem withExpenseAccount(@Nullable LinkedLedgerAccount expenseAccount) { this.expenseAccount = JsonNullable.of(expenseAccount); return this; } - public InvoiceItem withExpenseAccount(JsonNullable expenseAccount) { - Utils.checkNotNull(expenseAccount, "expenseAccount"); - this.expenseAccount = expenseAccount; - return this; - } /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public InvoiceItem withTrackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public InvoiceItem withTrackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public InvoiceItem withTrackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } /** * A list of linked tracking categories. */ - public InvoiceItem withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public InvoiceItem withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public InvoiceItem withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - public InvoiceItem withActive(boolean active) { - Utils.checkNotNull(active, "active"); + public InvoiceItem withActive(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - public InvoiceItem withActive(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } /** * The ID of the department */ - public InvoiceItem withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public InvoiceItem withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public InvoiceItem withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } /** * The ID of the location */ - public InvoiceItem withLocationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public InvoiceItem withLocationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public InvoiceItem withLocationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } /** * The ID of the subsidiary */ - public InvoiceItem withSubsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public InvoiceItem withSubsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public InvoiceItem withSubsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } /** * The ID of the tax schedule */ - public InvoiceItem withTaxScheduleId(String taxScheduleId) { - Utils.checkNotNull(taxScheduleId, "taxScheduleId"); + public InvoiceItem withTaxScheduleId(@Nullable String taxScheduleId) { this.taxScheduleId = JsonNullable.of(taxScheduleId); return this; } - /** - * The ID of the tax schedule - */ - public InvoiceItem withTaxScheduleId(JsonNullable taxScheduleId) { - Utils.checkNotNull(taxScheduleId, "taxScheduleId"); - this.taxScheduleId = taxScheduleId; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public InvoiceItem withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public InvoiceItem withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public InvoiceItem withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public InvoiceItem withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public InvoiceItem withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public InvoiceItem withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public InvoiceItem withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public InvoiceItem withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public InvoiceItem withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public InvoiceItem withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public InvoiceItem withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public InvoiceItem withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public InvoiceItem withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public InvoiceItem withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public InvoiceItem withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public InvoiceItem withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public InvoiceItem withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public InvoiceItem withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public InvoiceItem withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public InvoiceItem withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public InvoiceItem withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1196,620 +889,300 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable sold = JsonNullable.undefined(); + private JsonNullable sold; - private JsonNullable purchased = JsonNullable.undefined(); + private JsonNullable purchased; - private JsonNullable tracked = JsonNullable.undefined(); + private JsonNullable tracked; - private JsonNullable taxable = JsonNullable.undefined(); + private JsonNullable taxable; - private JsonNullable inventoryDate = JsonNullable.undefined(); + private JsonNullable inventoryDate; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private Optional salesDetails = Optional.empty(); + private SalesDetails salesDetails; - private Optional purchaseDetails = Optional.empty(); + private PurchaseDetails purchaseDetails; - private JsonNullable quantity = JsonNullable.undefined(); + private JsonNullable quantity; - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable assetAccount = JsonNullable.undefined(); + private JsonNullable assetAccount; - private JsonNullable incomeAccount = JsonNullable.undefined(); + private JsonNullable incomeAccount; - private JsonNullable expenseAccount = JsonNullable.undefined(); + private JsonNullable expenseAccount; @Deprecated - private JsonNullable trackingCategory = JsonNullable.undefined(); + private JsonNullable trackingCategory; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable active = JsonNullable.undefined(); + private JsonNullable active; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private JsonNullable locationId = JsonNullable.undefined(); + private JsonNullable locationId; - private JsonNullable subsidiaryId = JsonNullable.undefined(); + private JsonNullable subsidiaryId; - private JsonNullable taxScheduleId = JsonNullable.undefined(); + private JsonNullable taxScheduleId; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * The ID of the item. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The ID of the item. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Item name */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Item name - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * A short description of the item */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A short description of the item - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * User defined item code */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Item will be available on sales transactions */ - public Builder sold(boolean sold) { - Utils.checkNotNull(sold, "sold"); + public Builder sold(@Nullable Boolean sold) { this.sold = JsonNullable.of(sold); return this; } - /** - * Item will be available on sales transactions - */ - public Builder sold(JsonNullable sold) { - Utils.checkNotNull(sold, "sold"); - this.sold = sold; - return this; - } - - /** * Item is available for purchase transactions */ - public Builder purchased(boolean purchased) { - Utils.checkNotNull(purchased, "purchased"); + public Builder purchased(@Nullable Boolean purchased) { this.purchased = JsonNullable.of(purchased); return this; } - /** - * Item is available for purchase transactions - */ - public Builder purchased(JsonNullable purchased) { - Utils.checkNotNull(purchased, "purchased"); - this.purchased = purchased; - return this; - } - - /** * Item is inventoried */ - public Builder tracked(boolean tracked) { - Utils.checkNotNull(tracked, "tracked"); + public Builder tracked(@Nullable Boolean tracked) { this.tracked = JsonNullable.of(tracked); return this; } - /** - * Item is inventoried - */ - public Builder tracked(JsonNullable tracked) { - Utils.checkNotNull(tracked, "tracked"); - this.tracked = tracked; - return this; - } - - /** * If true, transactions for this item are taxable */ - public Builder taxable(boolean taxable) { - Utils.checkNotNull(taxable, "taxable"); + public Builder taxable(@Nullable Boolean taxable) { this.taxable = JsonNullable.of(taxable); return this; } - /** - * If true, transactions for this item are taxable - */ - public Builder taxable(JsonNullable taxable) { - Utils.checkNotNull(taxable, "taxable"); - this.taxable = taxable; - return this; - } - - /** * The date of opening balance if inventory item is tracked - YYYY-MM-DD. */ - public Builder inventoryDate(LocalDate inventoryDate) { - Utils.checkNotNull(inventoryDate, "inventoryDate"); + public Builder inventoryDate(@Nullable LocalDate inventoryDate) { this.inventoryDate = JsonNullable.of(inventoryDate); return this; } - /** - * The date of opening balance if inventory item is tracked - YYYY-MM-DD. - */ - public Builder inventoryDate(JsonNullable inventoryDate) { - Utils.checkNotNull(inventoryDate, "inventoryDate"); - this.inventoryDate = inventoryDate; - return this; - } - - /** * Item type */ - public Builder type(InvoiceItemTypeType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable InvoiceItemTypeType type) { this.type = JsonNullable.of(type); return this; } - /** - * Item type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - - public Builder salesDetails(SalesDetails salesDetails) { - Utils.checkNotNull(salesDetails, "salesDetails"); - this.salesDetails = Optional.ofNullable(salesDetails); - return this; - } - - public Builder salesDetails(Optional salesDetails) { - Utils.checkNotNull(salesDetails, "salesDetails"); + public Builder salesDetails(@Nullable SalesDetails salesDetails) { this.salesDetails = salesDetails; return this; } - - public Builder purchaseDetails(PurchaseDetails purchaseDetails) { - Utils.checkNotNull(purchaseDetails, "purchaseDetails"); - this.purchaseDetails = Optional.ofNullable(purchaseDetails); - return this; - } - - public Builder purchaseDetails(Optional purchaseDetails) { - Utils.checkNotNull(purchaseDetails, "purchaseDetails"); + public Builder purchaseDetails(@Nullable PurchaseDetails purchaseDetails) { this.purchaseDetails = purchaseDetails; return this; } - - public Builder quantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + public Builder quantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public Builder quantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - - - public Builder unitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - - public Builder assetAccount(LinkedLedgerAccount assetAccount) { - Utils.checkNotNull(assetAccount, "assetAccount"); + public Builder assetAccount(@Nullable LinkedLedgerAccount assetAccount) { this.assetAccount = JsonNullable.of(assetAccount); return this; } - public Builder assetAccount(JsonNullable assetAccount) { - Utils.checkNotNull(assetAccount, "assetAccount"); - this.assetAccount = assetAccount; - return this; - } - - - public Builder incomeAccount(LinkedLedgerAccount incomeAccount) { - Utils.checkNotNull(incomeAccount, "incomeAccount"); + public Builder incomeAccount(@Nullable LinkedLedgerAccount incomeAccount) { this.incomeAccount = JsonNullable.of(incomeAccount); return this; } - public Builder incomeAccount(JsonNullable incomeAccount) { - Utils.checkNotNull(incomeAccount, "incomeAccount"); - this.incomeAccount = incomeAccount; - return this; - } - - - public Builder expenseAccount(LinkedLedgerAccount expenseAccount) { - Utils.checkNotNull(expenseAccount, "expenseAccount"); + public Builder expenseAccount(@Nullable LinkedLedgerAccount expenseAccount) { this.expenseAccount = JsonNullable.of(expenseAccount); return this; } - public Builder expenseAccount(JsonNullable expenseAccount) { - Utils.checkNotNull(expenseAccount, "expenseAccount"); - this.expenseAccount = expenseAccount; - return this; - } - - /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder trackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public Builder trackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder trackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - public Builder active(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - /** * The ID of the location */ - public Builder locationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public Builder locationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public Builder locationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } - - /** * The ID of the subsidiary */ - public Builder subsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public Builder subsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public Builder subsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } - - /** * The ID of the tax schedule */ - public Builder taxScheduleId(String taxScheduleId) { - Utils.checkNotNull(taxScheduleId, "taxScheduleId"); + public Builder taxScheduleId(@Nullable String taxScheduleId) { this.taxScheduleId = JsonNullable.of(taxScheduleId); return this; } - /** - * The ID of the tax schedule - */ - public Builder taxScheduleId(JsonNullable taxScheduleId) { - Utils.checkNotNull(taxScheduleId, "taxScheduleId"); - this.taxScheduleId = taxScheduleId; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public InvoiceItem build() { - return new InvoiceItem( id, name, description, code, sold, purchased, diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceItemFilter.java b/src/main/java/com/apideck/unify/models/components/InvoiceItemFilter.java index 60fe9ea1..3af180fe 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceItemFilter.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceItemFilter.java @@ -6,10 +6,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -18,26 +18,24 @@ public class InvoiceItemFilter { * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ @SpeakeasyMetadata("queryParam:name=type") - private JsonNullable type; + private JsonNullable type; @JsonCreator public InvoiceItemFilter( - JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; + @Nullable JsonNullable type) { + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); } public InvoiceItemFilter() { - this(JsonNullable.undefined()); + this(null); } /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } public static Builder builder() { @@ -48,20 +46,11 @@ public static Builder builder() { /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ - public InvoiceItemFilter withType(InvoiceItemFilterInvoiceItemType type) { - Utils.checkNotNull(type, "type"); + public InvoiceItemFilter withType(@Nullable InvoiceItemFilterInvoiceItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of invoice item, indicating whether it is an inventory item, a service, or another type. - */ - public InvoiceItemFilter withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -91,33 +80,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; private Builder() { // force use of static builder() method } - /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ - public Builder type(InvoiceItemFilterInvoiceItemType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable InvoiceItemFilterInvoiceItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of invoice item, indicating whether it is an inventory item, a service, or another type. - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - public InvoiceItemFilter build() { - return new InvoiceItemFilter( type); } diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceItemInput.java b/src/main/java/com/apideck/unify/models/components/InvoiceItemInput.java index 2c27a7f1..e9818609 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceItemInput.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceItemInput.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -83,17 +82,17 @@ public class InvoiceItemInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("sales_details") - private Optional salesDetails; + private InvoiceItemSalesDetails salesDetails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("purchase_details") - private Optional purchaseDetails; + private InvoiceItemPurchaseDetails purchaseDetails; @JsonInclude(Include.NON_ABSENT) @@ -108,17 +107,17 @@ public class InvoiceItemInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("asset_account") - private JsonNullable assetAccount; + private JsonNullable assetAccount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("income_account") - private JsonNullable incomeAccount; + private JsonNullable incomeAccount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("expense_account") - private JsonNullable expenseAccount; + private JsonNullable expenseAccount; /** * @@ -127,14 +126,14 @@ public class InvoiceItemInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_category") @Deprecated - private JsonNullable trackingCategory; + private JsonNullable trackingCategory; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @@ -181,210 +180,185 @@ public class InvoiceItemInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public InvoiceItemInput( - @JsonProperty("name") JsonNullable name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("code") JsonNullable code, - @JsonProperty("sold") JsonNullable sold, - @JsonProperty("purchased") JsonNullable purchased, - @JsonProperty("tracked") JsonNullable tracked, - @JsonProperty("taxable") JsonNullable taxable, - @JsonProperty("inventory_date") JsonNullable inventoryDate, - @JsonProperty("type") JsonNullable type, - @JsonProperty("sales_details") Optional salesDetails, - @JsonProperty("purchase_details") Optional purchaseDetails, - @JsonProperty("quantity") JsonNullable quantity, - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("asset_account") JsonNullable assetAccount, - @JsonProperty("income_account") JsonNullable incomeAccount, - @JsonProperty("expense_account") JsonNullable expenseAccount, - @JsonProperty("tracking_category") JsonNullable trackingCategory, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("active") JsonNullable active, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("location_id") JsonNullable locationId, - @JsonProperty("subsidiary_id") JsonNullable subsidiaryId, - @JsonProperty("tax_schedule_id") JsonNullable taxScheduleId, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(sold, "sold"); - Utils.checkNotNull(purchased, "purchased"); - Utils.checkNotNull(tracked, "tracked"); - Utils.checkNotNull(taxable, "taxable"); - Utils.checkNotNull(inventoryDate, "inventoryDate"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(salesDetails, "salesDetails"); - Utils.checkNotNull(purchaseDetails, "purchaseDetails"); - Utils.checkNotNull(quantity, "quantity"); - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(assetAccount, "assetAccount"); - Utils.checkNotNull(incomeAccount, "incomeAccount"); - Utils.checkNotNull(expenseAccount, "expenseAccount"); - Utils.checkNotNull(trackingCategory, "trackingCategory"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(locationId, "locationId"); - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - Utils.checkNotNull(taxScheduleId, "taxScheduleId"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; - this.description = description; - this.code = code; - this.sold = sold; - this.purchased = purchased; - this.tracked = tracked; - this.taxable = taxable; - this.inventoryDate = inventoryDate; - this.type = type; + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("sold") @Nullable JsonNullable sold, + @JsonProperty("purchased") @Nullable JsonNullable purchased, + @JsonProperty("tracked") @Nullable JsonNullable tracked, + @JsonProperty("taxable") @Nullable JsonNullable taxable, + @JsonProperty("inventory_date") @Nullable JsonNullable inventoryDate, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("sales_details") @Nullable InvoiceItemSalesDetails salesDetails, + @JsonProperty("purchase_details") @Nullable InvoiceItemPurchaseDetails purchaseDetails, + @JsonProperty("quantity") @Nullable JsonNullable quantity, + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("asset_account") @Nullable JsonNullable assetAccount, + @JsonProperty("income_account") @Nullable JsonNullable incomeAccount, + @JsonProperty("expense_account") @Nullable JsonNullable expenseAccount, + @JsonProperty("tracking_category") @Nullable JsonNullable trackingCategory, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("active") @Nullable JsonNullable active, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("location_id") @Nullable JsonNullable locationId, + @JsonProperty("subsidiary_id") @Nullable JsonNullable subsidiaryId, + @JsonProperty("tax_schedule_id") @Nullable JsonNullable taxScheduleId, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.sold = Optional.ofNullable(sold) + .orElse(JsonNullable.undefined()); + this.purchased = Optional.ofNullable(purchased) + .orElse(JsonNullable.undefined()); + this.tracked = Optional.ofNullable(tracked) + .orElse(JsonNullable.undefined()); + this.taxable = Optional.ofNullable(taxable) + .orElse(JsonNullable.undefined()); + this.inventoryDate = Optional.ofNullable(inventoryDate) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); this.salesDetails = salesDetails; this.purchaseDetails = purchaseDetails; - this.quantity = quantity; - this.unitPrice = unitPrice; - this.assetAccount = assetAccount; - this.incomeAccount = incomeAccount; - this.expenseAccount = expenseAccount; - this.trackingCategory = trackingCategory; - this.trackingCategories = trackingCategories; - this.active = active; - this.departmentId = departmentId; - this.locationId = locationId; - this.subsidiaryId = subsidiaryId; - this.taxScheduleId = taxScheduleId; - this.rowVersion = rowVersion; + this.quantity = Optional.ofNullable(quantity) + .orElse(JsonNullable.undefined()); + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.assetAccount = Optional.ofNullable(assetAccount) + .orElse(JsonNullable.undefined()); + this.incomeAccount = Optional.ofNullable(incomeAccount) + .orElse(JsonNullable.undefined()); + this.expenseAccount = Optional.ofNullable(expenseAccount) + .orElse(JsonNullable.undefined()); + this.trackingCategory = Optional.ofNullable(trackingCategory) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.active = Optional.ofNullable(active) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); + this.locationId = Optional.ofNullable(locationId) + .orElse(JsonNullable.undefined()); + this.subsidiaryId = Optional.ofNullable(subsidiaryId) + .orElse(JsonNullable.undefined()); + this.taxScheduleId = Optional.ofNullable(taxScheduleId) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public InvoiceItemInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Item name */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * A short description of the item */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * User defined item code */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Item will be available on sales transactions */ - @JsonIgnore public JsonNullable sold() { - return sold; + return this.sold; } /** * Item is available for purchase transactions */ - @JsonIgnore public JsonNullable purchased() { - return purchased; + return this.purchased; } /** * Item is inventoried */ - @JsonIgnore public JsonNullable tracked() { - return tracked; + return this.tracked; } /** * If true, transactions for this item are taxable */ - @JsonIgnore public JsonNullable taxable() { - return taxable; + return this.taxable; } /** * The date of opening balance if inventory item is tracked - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable inventoryDate() { - return inventoryDate; + return this.inventoryDate; } /** * Item type */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional salesDetails() { - return (Optional) salesDetails; + return Optional.ofNullable(this.salesDetails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional purchaseDetails() { - return (Optional) purchaseDetails; + return Optional.ofNullable(this.purchaseDetails); } - @JsonIgnore public JsonNullable quantity() { - return quantity; + return this.quantity; } - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable assetAccount() { - return (JsonNullable) assetAccount; + return this.assetAccount; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable incomeAccount() { - return (JsonNullable) incomeAccount; + return this.incomeAccount; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable expenseAccount() { - return (JsonNullable) expenseAccount; + return this.expenseAccount; } /** @@ -392,73 +366,61 @@ public JsonNullable expenseAccount() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable trackingCategory() { - return (JsonNullable) trackingCategory; + return this.trackingCategory; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @JsonIgnore public JsonNullable active() { - return active; + return this.active; } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } /** * The ID of the location */ - @JsonIgnore public JsonNullable locationId() { - return locationId; + return this.locationId; } /** * The ID of the subsidiary */ - @JsonIgnore public JsonNullable subsidiaryId() { - return subsidiaryId; + return this.subsidiaryId; } /** * The ID of the tax schedule */ - @JsonIgnore public JsonNullable taxScheduleId() { - return taxScheduleId; + return this.taxScheduleId; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -469,412 +431,206 @@ public static Builder builder() { /** * Item name */ - public InvoiceItemInput withName(String name) { - Utils.checkNotNull(name, "name"); + public InvoiceItemInput withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Item name - */ - public InvoiceItemInput withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * A short description of the item */ - public InvoiceItemInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public InvoiceItemInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A short description of the item - */ - public InvoiceItemInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * User defined item code */ - public InvoiceItemInput withCode(String code) { - Utils.checkNotNull(code, "code"); + public InvoiceItemInput withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public InvoiceItemInput withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * Item will be available on sales transactions */ - public InvoiceItemInput withSold(boolean sold) { - Utils.checkNotNull(sold, "sold"); + public InvoiceItemInput withSold(@Nullable Boolean sold) { this.sold = JsonNullable.of(sold); return this; } - /** - * Item will be available on sales transactions - */ - public InvoiceItemInput withSold(JsonNullable sold) { - Utils.checkNotNull(sold, "sold"); - this.sold = sold; - return this; - } /** * Item is available for purchase transactions */ - public InvoiceItemInput withPurchased(boolean purchased) { - Utils.checkNotNull(purchased, "purchased"); + public InvoiceItemInput withPurchased(@Nullable Boolean purchased) { this.purchased = JsonNullable.of(purchased); return this; } - /** - * Item is available for purchase transactions - */ - public InvoiceItemInput withPurchased(JsonNullable purchased) { - Utils.checkNotNull(purchased, "purchased"); - this.purchased = purchased; - return this; - } /** * Item is inventoried */ - public InvoiceItemInput withTracked(boolean tracked) { - Utils.checkNotNull(tracked, "tracked"); + public InvoiceItemInput withTracked(@Nullable Boolean tracked) { this.tracked = JsonNullable.of(tracked); return this; } - /** - * Item is inventoried - */ - public InvoiceItemInput withTracked(JsonNullable tracked) { - Utils.checkNotNull(tracked, "tracked"); - this.tracked = tracked; - return this; - } /** * If true, transactions for this item are taxable */ - public InvoiceItemInput withTaxable(boolean taxable) { - Utils.checkNotNull(taxable, "taxable"); + public InvoiceItemInput withTaxable(@Nullable Boolean taxable) { this.taxable = JsonNullable.of(taxable); return this; } - /** - * If true, transactions for this item are taxable - */ - public InvoiceItemInput withTaxable(JsonNullable taxable) { - Utils.checkNotNull(taxable, "taxable"); - this.taxable = taxable; - return this; - } /** * The date of opening balance if inventory item is tracked - YYYY-MM-DD. */ - public InvoiceItemInput withInventoryDate(LocalDate inventoryDate) { - Utils.checkNotNull(inventoryDate, "inventoryDate"); + public InvoiceItemInput withInventoryDate(@Nullable LocalDate inventoryDate) { this.inventoryDate = JsonNullable.of(inventoryDate); return this; } - /** - * The date of opening balance if inventory item is tracked - YYYY-MM-DD. - */ - public InvoiceItemInput withInventoryDate(JsonNullable inventoryDate) { - Utils.checkNotNull(inventoryDate, "inventoryDate"); - this.inventoryDate = inventoryDate; - return this; - } /** * Item type */ - public InvoiceItemInput withType(InvoiceItemTypeType type) { - Utils.checkNotNull(type, "type"); + public InvoiceItemInput withType(@Nullable InvoiceItemTypeType type) { this.type = JsonNullable.of(type); return this; } - /** - * Item type - */ - public InvoiceItemInput withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - public InvoiceItemInput withSalesDetails(InvoiceItemSalesDetails salesDetails) { - Utils.checkNotNull(salesDetails, "salesDetails"); - this.salesDetails = Optional.ofNullable(salesDetails); - return this; - } - - public InvoiceItemInput withSalesDetails(Optional salesDetails) { - Utils.checkNotNull(salesDetails, "salesDetails"); + public InvoiceItemInput withSalesDetails(@Nullable InvoiceItemSalesDetails salesDetails) { this.salesDetails = salesDetails; return this; } - public InvoiceItemInput withPurchaseDetails(InvoiceItemPurchaseDetails purchaseDetails) { - Utils.checkNotNull(purchaseDetails, "purchaseDetails"); - this.purchaseDetails = Optional.ofNullable(purchaseDetails); - return this; - } - - public InvoiceItemInput withPurchaseDetails(Optional purchaseDetails) { - Utils.checkNotNull(purchaseDetails, "purchaseDetails"); + public InvoiceItemInput withPurchaseDetails(@Nullable InvoiceItemPurchaseDetails purchaseDetails) { this.purchaseDetails = purchaseDetails; return this; } - public InvoiceItemInput withQuantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + + public InvoiceItemInput withQuantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public InvoiceItemInput withQuantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - public InvoiceItemInput withUnitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public InvoiceItemInput withUnitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public InvoiceItemInput withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - public InvoiceItemInput withAssetAccount(LinkedLedgerAccountInput assetAccount) { - Utils.checkNotNull(assetAccount, "assetAccount"); + public InvoiceItemInput withAssetAccount(@Nullable LinkedLedgerAccountInput assetAccount) { this.assetAccount = JsonNullable.of(assetAccount); return this; } - public InvoiceItemInput withAssetAccount(JsonNullable assetAccount) { - Utils.checkNotNull(assetAccount, "assetAccount"); - this.assetAccount = assetAccount; - return this; - } - public InvoiceItemInput withIncomeAccount(LinkedLedgerAccountInput incomeAccount) { - Utils.checkNotNull(incomeAccount, "incomeAccount"); + public InvoiceItemInput withIncomeAccount(@Nullable LinkedLedgerAccountInput incomeAccount) { this.incomeAccount = JsonNullable.of(incomeAccount); return this; } - public InvoiceItemInput withIncomeAccount(JsonNullable incomeAccount) { - Utils.checkNotNull(incomeAccount, "incomeAccount"); - this.incomeAccount = incomeAccount; - return this; - } - public InvoiceItemInput withExpenseAccount(LinkedLedgerAccountInput expenseAccount) { - Utils.checkNotNull(expenseAccount, "expenseAccount"); + public InvoiceItemInput withExpenseAccount(@Nullable LinkedLedgerAccountInput expenseAccount) { this.expenseAccount = JsonNullable.of(expenseAccount); return this; } - public InvoiceItemInput withExpenseAccount(JsonNullable expenseAccount) { - Utils.checkNotNull(expenseAccount, "expenseAccount"); - this.expenseAccount = expenseAccount; - return this; - } /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public InvoiceItemInput withTrackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public InvoiceItemInput withTrackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public InvoiceItemInput withTrackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } /** * A list of linked tracking categories. */ - public InvoiceItemInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public InvoiceItemInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public InvoiceItemInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - public InvoiceItemInput withActive(boolean active) { - Utils.checkNotNull(active, "active"); + public InvoiceItemInput withActive(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - public InvoiceItemInput withActive(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } /** * The ID of the department */ - public InvoiceItemInput withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public InvoiceItemInput withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public InvoiceItemInput withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } /** * The ID of the location */ - public InvoiceItemInput withLocationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public InvoiceItemInput withLocationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public InvoiceItemInput withLocationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } /** * The ID of the subsidiary */ - public InvoiceItemInput withSubsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public InvoiceItemInput withSubsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public InvoiceItemInput withSubsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } /** * The ID of the tax schedule */ - public InvoiceItemInput withTaxScheduleId(String taxScheduleId) { - Utils.checkNotNull(taxScheduleId, "taxScheduleId"); + public InvoiceItemInput withTaxScheduleId(@Nullable String taxScheduleId) { this.taxScheduleId = JsonNullable.of(taxScheduleId); return this; } - /** - * The ID of the tax schedule - */ - public InvoiceItemInput withTaxScheduleId(JsonNullable taxScheduleId) { - Utils.checkNotNull(taxScheduleId, "taxScheduleId"); - this.taxScheduleId = taxScheduleId; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public InvoiceItemInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public InvoiceItemInput withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public InvoiceItemInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public InvoiceItemInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public InvoiceItemInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public InvoiceItemInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -959,494 +715,240 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable sold = JsonNullable.undefined(); + private JsonNullable sold; - private JsonNullable purchased = JsonNullable.undefined(); + private JsonNullable purchased; - private JsonNullable tracked = JsonNullable.undefined(); + private JsonNullable tracked; - private JsonNullable taxable = JsonNullable.undefined(); + private JsonNullable taxable; - private JsonNullable inventoryDate = JsonNullable.undefined(); + private JsonNullable inventoryDate; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private Optional salesDetails = Optional.empty(); + private InvoiceItemSalesDetails salesDetails; - private Optional purchaseDetails = Optional.empty(); + private InvoiceItemPurchaseDetails purchaseDetails; - private JsonNullable quantity = JsonNullable.undefined(); + private JsonNullable quantity; - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable assetAccount = JsonNullable.undefined(); + private JsonNullable assetAccount; - private JsonNullable incomeAccount = JsonNullable.undefined(); + private JsonNullable incomeAccount; - private JsonNullable expenseAccount = JsonNullable.undefined(); + private JsonNullable expenseAccount; @Deprecated - private JsonNullable trackingCategory = JsonNullable.undefined(); + private JsonNullable trackingCategory; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable active = JsonNullable.undefined(); + private JsonNullable active; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private JsonNullable locationId = JsonNullable.undefined(); + private JsonNullable locationId; - private JsonNullable subsidiaryId = JsonNullable.undefined(); + private JsonNullable subsidiaryId; - private JsonNullable taxScheduleId = JsonNullable.undefined(); + private JsonNullable taxScheduleId; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Item name */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Item name - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * A short description of the item */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A short description of the item - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * User defined item code */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Item will be available on sales transactions */ - public Builder sold(boolean sold) { - Utils.checkNotNull(sold, "sold"); + public Builder sold(@Nullable Boolean sold) { this.sold = JsonNullable.of(sold); return this; } - /** - * Item will be available on sales transactions - */ - public Builder sold(JsonNullable sold) { - Utils.checkNotNull(sold, "sold"); - this.sold = sold; - return this; - } - - /** * Item is available for purchase transactions */ - public Builder purchased(boolean purchased) { - Utils.checkNotNull(purchased, "purchased"); + public Builder purchased(@Nullable Boolean purchased) { this.purchased = JsonNullable.of(purchased); return this; } - /** - * Item is available for purchase transactions - */ - public Builder purchased(JsonNullable purchased) { - Utils.checkNotNull(purchased, "purchased"); - this.purchased = purchased; - return this; - } - - /** * Item is inventoried */ - public Builder tracked(boolean tracked) { - Utils.checkNotNull(tracked, "tracked"); + public Builder tracked(@Nullable Boolean tracked) { this.tracked = JsonNullable.of(tracked); return this; } - /** - * Item is inventoried - */ - public Builder tracked(JsonNullable tracked) { - Utils.checkNotNull(tracked, "tracked"); - this.tracked = tracked; - return this; - } - - /** * If true, transactions for this item are taxable */ - public Builder taxable(boolean taxable) { - Utils.checkNotNull(taxable, "taxable"); + public Builder taxable(@Nullable Boolean taxable) { this.taxable = JsonNullable.of(taxable); return this; } - /** - * If true, transactions for this item are taxable - */ - public Builder taxable(JsonNullable taxable) { - Utils.checkNotNull(taxable, "taxable"); - this.taxable = taxable; - return this; - } - - /** * The date of opening balance if inventory item is tracked - YYYY-MM-DD. */ - public Builder inventoryDate(LocalDate inventoryDate) { - Utils.checkNotNull(inventoryDate, "inventoryDate"); + public Builder inventoryDate(@Nullable LocalDate inventoryDate) { this.inventoryDate = JsonNullable.of(inventoryDate); return this; } - /** - * The date of opening balance if inventory item is tracked - YYYY-MM-DD. - */ - public Builder inventoryDate(JsonNullable inventoryDate) { - Utils.checkNotNull(inventoryDate, "inventoryDate"); - this.inventoryDate = inventoryDate; - return this; - } - - /** * Item type */ - public Builder type(InvoiceItemTypeType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable InvoiceItemTypeType type) { this.type = JsonNullable.of(type); return this; } - /** - * Item type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - - public Builder salesDetails(InvoiceItemSalesDetails salesDetails) { - Utils.checkNotNull(salesDetails, "salesDetails"); - this.salesDetails = Optional.ofNullable(salesDetails); - return this; - } - - public Builder salesDetails(Optional salesDetails) { - Utils.checkNotNull(salesDetails, "salesDetails"); + public Builder salesDetails(@Nullable InvoiceItemSalesDetails salesDetails) { this.salesDetails = salesDetails; return this; } - - public Builder purchaseDetails(InvoiceItemPurchaseDetails purchaseDetails) { - Utils.checkNotNull(purchaseDetails, "purchaseDetails"); - this.purchaseDetails = Optional.ofNullable(purchaseDetails); - return this; - } - - public Builder purchaseDetails(Optional purchaseDetails) { - Utils.checkNotNull(purchaseDetails, "purchaseDetails"); + public Builder purchaseDetails(@Nullable InvoiceItemPurchaseDetails purchaseDetails) { this.purchaseDetails = purchaseDetails; return this; } - - public Builder quantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + public Builder quantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public Builder quantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - - - public Builder unitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - - public Builder assetAccount(LinkedLedgerAccountInput assetAccount) { - Utils.checkNotNull(assetAccount, "assetAccount"); + public Builder assetAccount(@Nullable LinkedLedgerAccountInput assetAccount) { this.assetAccount = JsonNullable.of(assetAccount); return this; } - public Builder assetAccount(JsonNullable assetAccount) { - Utils.checkNotNull(assetAccount, "assetAccount"); - this.assetAccount = assetAccount; - return this; - } - - - public Builder incomeAccount(LinkedLedgerAccountInput incomeAccount) { - Utils.checkNotNull(incomeAccount, "incomeAccount"); + public Builder incomeAccount(@Nullable LinkedLedgerAccountInput incomeAccount) { this.incomeAccount = JsonNullable.of(incomeAccount); return this; } - public Builder incomeAccount(JsonNullable incomeAccount) { - Utils.checkNotNull(incomeAccount, "incomeAccount"); - this.incomeAccount = incomeAccount; - return this; - } - - - public Builder expenseAccount(LinkedLedgerAccountInput expenseAccount) { - Utils.checkNotNull(expenseAccount, "expenseAccount"); + public Builder expenseAccount(@Nullable LinkedLedgerAccountInput expenseAccount) { this.expenseAccount = JsonNullable.of(expenseAccount); return this; } - public Builder expenseAccount(JsonNullable expenseAccount) { - Utils.checkNotNull(expenseAccount, "expenseAccount"); - this.expenseAccount = expenseAccount; - return this; - } - - /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder trackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public Builder trackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder trackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - public Builder active(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - /** * The ID of the location */ - public Builder locationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public Builder locationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public Builder locationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } - - /** * The ID of the subsidiary */ - public Builder subsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public Builder subsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public Builder subsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } - - /** * The ID of the tax schedule */ - public Builder taxScheduleId(String taxScheduleId) { - Utils.checkNotNull(taxScheduleId, "taxScheduleId"); + public Builder taxScheduleId(@Nullable String taxScheduleId) { this.taxScheduleId = JsonNullable.of(taxScheduleId); return this; } - /** - * The ID of the tax schedule - */ - public Builder taxScheduleId(JsonNullable taxScheduleId) { - Utils.checkNotNull(taxScheduleId, "taxScheduleId"); - this.taxScheduleId = taxScheduleId; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public InvoiceItemInput build() { - return new InvoiceItemInput( name, description, code, sold, purchased, tracked, diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceItemPurchaseDetails.java b/src/main/java/com/apideck/unify/models/components/InvoiceItemPurchaseDetails.java index ffda4f43..b1cdb28c 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceItemPurchaseDetails.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceItemPurchaseDetails.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -41,54 +40,48 @@ public class InvoiceItemPurchaseDetails { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRateInput taxRate; @JsonCreator public InvoiceItemPurchaseDetails( - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("unit_of_measure") JsonNullable unitOfMeasure, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("tax_rate") Optional taxRate) { - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(taxRate, "taxRate"); - this.unitPrice = unitPrice; - this.unitOfMeasure = unitOfMeasure; - this.taxInclusive = taxInclusive; + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("unit_of_measure") @Nullable JsonNullable unitOfMeasure, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("tax_rate") @Nullable LinkedTaxRateInput taxRate) { + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.unitOfMeasure = Optional.ofNullable(unitOfMeasure) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; } public InvoiceItemPurchaseDetails() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null); } - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - @JsonIgnore public JsonNullable unitOfMeasure() { - return unitOfMeasure; + return this.unitOfMeasure; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } public static Builder builder() { @@ -96,67 +89,36 @@ public static Builder builder() { } - public InvoiceItemPurchaseDetails withUnitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public InvoiceItemPurchaseDetails withUnitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public InvoiceItemPurchaseDetails withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public InvoiceItemPurchaseDetails withUnitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public InvoiceItemPurchaseDetails withUnitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public InvoiceItemPurchaseDetails withUnitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } /** * Amounts are including tax */ - public InvoiceItemPurchaseDetails withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public InvoiceItemPurchaseDetails withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public InvoiceItemPurchaseDetails withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - public InvoiceItemPurchaseDetails withTaxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public InvoiceItemPurchaseDetails withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public InvoiceItemPurchaseDetails withTaxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -192,84 +154,45 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable unitOfMeasure = JsonNullable.undefined(); + private JsonNullable unitOfMeasure; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private Optional taxRate = Optional.empty(); + private LinkedTaxRateInput taxRate; private Builder() { // force use of static builder() method } - - public Builder unitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public Builder unitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public Builder unitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public Builder unitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - - public Builder taxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } public InvoiceItemPurchaseDetails build() { - return new InvoiceItemPurchaseDetails( unitPrice, unitOfMeasure, taxInclusive, taxRate); diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceItemSalesDetails.java b/src/main/java/com/apideck/unify/models/components/InvoiceItemSalesDetails.java index 3c388e6a..34b63e19 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceItemSalesDetails.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceItemSalesDetails.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -41,54 +40,48 @@ public class InvoiceItemSalesDetails { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRateInput taxRate; @JsonCreator public InvoiceItemSalesDetails( - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("unit_of_measure") JsonNullable unitOfMeasure, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("tax_rate") Optional taxRate) { - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(taxRate, "taxRate"); - this.unitPrice = unitPrice; - this.unitOfMeasure = unitOfMeasure; - this.taxInclusive = taxInclusive; + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("unit_of_measure") @Nullable JsonNullable unitOfMeasure, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("tax_rate") @Nullable LinkedTaxRateInput taxRate) { + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.unitOfMeasure = Optional.ofNullable(unitOfMeasure) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; } public InvoiceItemSalesDetails() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null); } - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - @JsonIgnore public JsonNullable unitOfMeasure() { - return unitOfMeasure; + return this.unitOfMeasure; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } public static Builder builder() { @@ -96,67 +89,36 @@ public static Builder builder() { } - public InvoiceItemSalesDetails withUnitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public InvoiceItemSalesDetails withUnitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public InvoiceItemSalesDetails withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public InvoiceItemSalesDetails withUnitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public InvoiceItemSalesDetails withUnitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public InvoiceItemSalesDetails withUnitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } /** * Amounts are including tax */ - public InvoiceItemSalesDetails withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public InvoiceItemSalesDetails withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public InvoiceItemSalesDetails withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - public InvoiceItemSalesDetails withTaxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public InvoiceItemSalesDetails withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public InvoiceItemSalesDetails withTaxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -192,84 +154,45 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable unitOfMeasure = JsonNullable.undefined(); + private JsonNullable unitOfMeasure; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private Optional taxRate = Optional.empty(); + private LinkedTaxRateInput taxRate; private Builder() { // force use of static builder() method } - - public Builder unitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public Builder unitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public Builder unitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public Builder unitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - - public Builder taxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } public InvoiceItemSalesDetails build() { - return new InvoiceItemSalesDetails( unitPrice, unitOfMeasure, taxInclusive, taxRate); diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceItemsFilter.java b/src/main/java/com/apideck/unify/models/components/InvoiceItemsFilter.java index 6d9b5662..47e304cb 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceItemsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceItemsFilter.java @@ -6,10 +6,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -19,43 +18,39 @@ public class InvoiceItemsFilter { * Name of Invoice Items to search for */ @SpeakeasyMetadata("queryParam:name=name") - private Optional name; + private String name; /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ @SpeakeasyMetadata("queryParam:name=type") - private JsonNullable type; + private JsonNullable type; @JsonCreator public InvoiceItemsFilter( - Optional name, - JsonNullable type) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(type, "type"); + @Nullable String name, + @Nullable JsonNullable type) { this.name = name; - this.type = type; + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); } public InvoiceItemsFilter() { - this(Optional.empty(), JsonNullable.undefined()); + this(null, null); } /** * Name of Invoice Items to search for */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } public static Builder builder() { @@ -66,39 +61,20 @@ public static Builder builder() { /** * Name of Invoice Items to search for */ - public InvoiceItemsFilter withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - /** - * Name of Invoice Items to search for - */ - public InvoiceItemsFilter withName(Optional name) { - Utils.checkNotNull(name, "name"); + public InvoiceItemsFilter withName(@Nullable String name) { this.name = name; return this; } + /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ - public InvoiceItemsFilter withType(InvoiceItemType type) { - Utils.checkNotNull(type, "type"); + public InvoiceItemsFilter withType(@Nullable InvoiceItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of invoice item, indicating whether it is an inventory item, a service, or another type. - */ - public InvoiceItemsFilter withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -130,54 +106,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional name = Optional.empty(); + private String name; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; private Builder() { // force use of static builder() method } - - /** - * Name of Invoice Items to search for - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of Invoice Items to search for */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * The type of invoice item, indicating whether it is an inventory item, a service, or another type. */ - public Builder type(InvoiceItemType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable InvoiceItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of invoice item, indicating whether it is an inventory item, a service, or another type. - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - public InvoiceItemsFilter build() { - return new InvoiceItemsFilter( name, type); } diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceItemsSort.java b/src/main/java/com/apideck/unify/models/components/InvoiceItemsSort.java index 1ad97769..7a1c5af9 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceItemsSort.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceItemsSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class InvoiceItemsSort { * The field on which to sort the Invoice Items */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private InvoiceItemsSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public InvoiceItemsSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable InvoiceItemsSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public InvoiceItemsSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Invoice Items */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Invoice Items */ - public InvoiceItemsSort withBy(InvoiceItemsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Invoice Items - */ - public InvoiceItemsSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public InvoiceItemsSort withBy(@Nullable InvoiceItemsSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public InvoiceItemsSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public InvoiceItemsSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public InvoiceItemsSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private InvoiceItemsSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Invoice Items - */ - public Builder by(InvoiceItemsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Invoice Items */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable InvoiceItemsSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public InvoiceItemsSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new InvoiceItemsSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceLineItem.java b/src/main/java/com/apideck/unify/models/components/InvoiceLineItem.java index baab3b3e..73985ad4 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceLineItem.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceLineItem.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -33,7 +32,7 @@ public class InvoiceLineItem { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("row_id") - private Optional rowId; + private String rowId; /** * User defined item code @@ -61,7 +60,7 @@ public class InvoiceLineItem { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * Tax amount @@ -108,6 +107,13 @@ public class InvoiceLineItem { @JsonProperty("discount_amount") private JsonNullable discountAmount; + /** + * ID of the category of the line item + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("category_id") + private JsonNullable categoryId; + /** * The ID of the location */ @@ -125,29 +131,29 @@ public class InvoiceLineItem { @JsonInclude(Include.NON_ABSENT) @JsonProperty("item") - private Optional item; + private LinkedInvoiceItem item; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRate taxRate; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("ledger_account") - private JsonNullable ledgerAccount; + private JsonNullable ledgerAccount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -186,281 +192,256 @@ public class InvoiceLineItem { @JsonCreator public InvoiceLineItem( - @JsonProperty("id") JsonNullable id, - @JsonProperty("row_id") Optional rowId, - @JsonProperty("code") JsonNullable code, - @JsonProperty("line_number") JsonNullable lineNumber, - @JsonProperty("description") JsonNullable description, - @JsonProperty("type") JsonNullable type, - @JsonProperty("tax_amount") JsonNullable taxAmount, - @JsonProperty("total_amount") JsonNullable totalAmount, - @JsonProperty("quantity") JsonNullable quantity, - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("unit_of_measure") JsonNullable unitOfMeasure, - @JsonProperty("discount_percentage") JsonNullable discountPercentage, - @JsonProperty("discount_amount") JsonNullable discountAmount, - @JsonProperty("location_id") JsonNullable locationId, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("item") Optional item, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("ledger_account") JsonNullable ledgerAccount, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("updated_at") JsonNullable updatedAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(rowId, "rowId"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(lineNumber, "lineNumber"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(taxAmount, "taxAmount"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(quantity, "quantity"); - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - Utils.checkNotNull(discountPercentage, "discountPercentage"); - Utils.checkNotNull(discountAmount, "discountAmount"); - Utils.checkNotNull(locationId, "locationId"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(item, "item"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); - this.id = id; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("row_id") @Nullable String rowId, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("line_number") @Nullable JsonNullable lineNumber, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("tax_amount") @Nullable JsonNullable taxAmount, + @JsonProperty("total_amount") @Nullable JsonNullable totalAmount, + @JsonProperty("quantity") @Nullable JsonNullable quantity, + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("unit_of_measure") @Nullable JsonNullable unitOfMeasure, + @JsonProperty("discount_percentage") @Nullable JsonNullable discountPercentage, + @JsonProperty("discount_amount") @Nullable JsonNullable discountAmount, + @JsonProperty("category_id") @Nullable JsonNullable categoryId, + @JsonProperty("location_id") @Nullable JsonNullable locationId, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("item") @Nullable LinkedInvoiceItem item, + @JsonProperty("tax_rate") @Nullable LinkedTaxRate taxRate, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("ledger_account") @Nullable JsonNullable ledgerAccount, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); this.rowId = rowId; - this.code = code; - this.lineNumber = lineNumber; - this.description = description; - this.type = type; - this.taxAmount = taxAmount; - this.totalAmount = totalAmount; - this.quantity = quantity; - this.unitPrice = unitPrice; - this.unitOfMeasure = unitOfMeasure; - this.discountPercentage = discountPercentage; - this.discountAmount = discountAmount; - this.locationId = locationId; - this.departmentId = departmentId; + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.lineNumber = Optional.ofNullable(lineNumber) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.taxAmount = Optional.ofNullable(taxAmount) + .orElse(JsonNullable.undefined()); + this.totalAmount = Optional.ofNullable(totalAmount) + .orElse(JsonNullable.undefined()); + this.quantity = Optional.ofNullable(quantity) + .orElse(JsonNullable.undefined()); + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.unitOfMeasure = Optional.ofNullable(unitOfMeasure) + .orElse(JsonNullable.undefined()); + this.discountPercentage = Optional.ofNullable(discountPercentage) + .orElse(JsonNullable.undefined()); + this.discountAmount = Optional.ofNullable(discountAmount) + .orElse(JsonNullable.undefined()); + this.categoryId = Optional.ofNullable(categoryId) + .orElse(JsonNullable.undefined()); + this.locationId = Optional.ofNullable(locationId) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); this.item = item; this.taxRate = taxRate; - this.trackingCategories = trackingCategories; - this.ledgerAccount = ledgerAccount; + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.createdAt = createdAt; - this.updatedAt = updatedAt; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); } public InvoiceLineItem() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Row ID */ - @JsonIgnore public Optional rowId() { - return rowId; + return Optional.ofNullable(this.rowId); } /** * User defined item code */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Line number of the resource */ - @JsonIgnore public JsonNullable lineNumber() { - return lineNumber; + return this.lineNumber; } /** * User defined description */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Item type */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * Tax amount */ - @JsonIgnore public JsonNullable taxAmount() { - return taxAmount; + return this.taxAmount; } /** * Total amount of the line item */ - @JsonIgnore public JsonNullable totalAmount() { - return totalAmount; + return this.totalAmount; } - @JsonIgnore public JsonNullable quantity() { - return quantity; + return this.quantity; } - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - @JsonIgnore public JsonNullable unitOfMeasure() { - return unitOfMeasure; + return this.unitOfMeasure; } /** * Discount percentage applied to the line item when supported downstream. */ - @JsonIgnore public JsonNullable discountPercentage() { - return discountPercentage; + return this.discountPercentage; } /** * Discount amount applied to the line item when supported downstream. */ - @JsonIgnore public JsonNullable discountAmount() { - return discountAmount; + return this.discountAmount; + } + + /** + * ID of the category of the line item + */ + public JsonNullable categoryId() { + return this.categoryId; } /** * The ID of the location */ - @JsonIgnore public JsonNullable locationId() { - return locationId; + return this.locationId; } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional item() { - return (Optional) item; + return Optional.ofNullable(this.item); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable ledgerAccount() { - return (JsonNullable) ledgerAccount; + return this.ledgerAccount; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } public static Builder builder() { @@ -471,420 +452,218 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public InvoiceLineItem withId(String id) { - Utils.checkNotNull(id, "id"); + public InvoiceLineItem withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public InvoiceLineItem withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * Row ID */ - public InvoiceLineItem withRowId(String rowId) { - Utils.checkNotNull(rowId, "rowId"); - this.rowId = Optional.ofNullable(rowId); - return this; - } - - - /** - * Row ID - */ - public InvoiceLineItem withRowId(Optional rowId) { - Utils.checkNotNull(rowId, "rowId"); + public InvoiceLineItem withRowId(@Nullable String rowId) { this.rowId = rowId; return this; } + /** * User defined item code */ - public InvoiceLineItem withCode(String code) { - Utils.checkNotNull(code, "code"); + public InvoiceLineItem withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public InvoiceLineItem withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * Line number of the resource */ - public InvoiceLineItem withLineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public InvoiceLineItem withLineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public InvoiceLineItem withLineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } /** * User defined description */ - public InvoiceLineItem withDescription(String description) { - Utils.checkNotNull(description, "description"); + public InvoiceLineItem withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public InvoiceLineItem withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * Item type */ - public InvoiceLineItem withType(InvoiceLineItemType type) { - Utils.checkNotNull(type, "type"); + public InvoiceLineItem withType(@Nullable InvoiceLineItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * Item type - */ - public InvoiceLineItem withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Tax amount */ - public InvoiceLineItem withTaxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public InvoiceLineItem withTaxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public InvoiceLineItem withTaxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } /** * Total amount of the line item */ - public InvoiceLineItem withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public InvoiceLineItem withTotalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Total amount of the line item - */ - public InvoiceLineItem withTotalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - public InvoiceLineItem withQuantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + public InvoiceLineItem withQuantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public InvoiceLineItem withQuantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - public InvoiceLineItem withUnitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public InvoiceLineItem withUnitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public InvoiceLineItem withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public InvoiceLineItem withUnitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public InvoiceLineItem withUnitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public InvoiceLineItem withUnitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } /** * Discount percentage applied to the line item when supported downstream. */ - public InvoiceLineItem withDiscountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public InvoiceLineItem withDiscountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to the line item when supported downstream. - */ - public InvoiceLineItem withDiscountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } /** * Discount amount applied to the line item when supported downstream. */ - public InvoiceLineItem withDiscountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public InvoiceLineItem withDiscountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } + /** - * Discount amount applied to the line item when supported downstream. + * ID of the category of the line item */ - public InvoiceLineItem withDiscountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; + public InvoiceLineItem withCategoryId(@Nullable String categoryId) { + this.categoryId = JsonNullable.of(categoryId); return this; } + /** * The ID of the location */ - public InvoiceLineItem withLocationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public InvoiceLineItem withLocationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public InvoiceLineItem withLocationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } /** * The ID of the department */ - public InvoiceLineItem withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public InvoiceLineItem withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public InvoiceLineItem withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - public InvoiceLineItem withItem(LinkedInvoiceItem item) { - Utils.checkNotNull(item, "item"); - this.item = Optional.ofNullable(item); - return this; - } - - public InvoiceLineItem withItem(Optional item) { - Utils.checkNotNull(item, "item"); + public InvoiceLineItem withItem(@Nullable LinkedInvoiceItem item) { this.item = item; return this; } - public InvoiceLineItem withTaxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public InvoiceLineItem withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public InvoiceLineItem withTaxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } + /** * A list of linked tracking categories. */ - public InvoiceLineItem withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public InvoiceLineItem withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public InvoiceLineItem withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - public InvoiceLineItem withLedgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public InvoiceLineItem withLedgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public InvoiceLineItem withLedgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - public InvoiceLineItem withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public InvoiceLineItem withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public InvoiceLineItem withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public InvoiceLineItem withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public InvoiceLineItem withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public InvoiceLineItem withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public InvoiceLineItem withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public InvoiceLineItem withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public InvoiceLineItem withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public InvoiceLineItem withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public InvoiceLineItem withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public InvoiceLineItem withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was created. */ - public InvoiceLineItem withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public InvoiceLineItem withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public InvoiceLineItem withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The date and time when the object was last updated. */ - public InvoiceLineItem withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public InvoiceLineItem withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public InvoiceLineItem withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -909,6 +688,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.unitOfMeasure, other.unitOfMeasure) && Utils.enhancedDeepEquals(this.discountPercentage, other.discountPercentage) && Utils.enhancedDeepEquals(this.discountAmount, other.discountAmount) && + Utils.enhancedDeepEquals(this.categoryId, other.categoryId) && Utils.enhancedDeepEquals(this.locationId, other.locationId) && Utils.enhancedDeepEquals(this.departmentId, other.departmentId) && Utils.enhancedDeepEquals(this.item, other.item) && @@ -930,11 +710,11 @@ public int hashCode() { lineNumber, description, type, taxAmount, totalAmount, quantity, unitPrice, unitOfMeasure, discountPercentage, - discountAmount, locationId, departmentId, - item, taxRate, trackingCategories, - ledgerAccount, customFields, rowVersion, - updatedBy, createdBy, createdAt, - updatedAt); + discountAmount, categoryId, locationId, + departmentId, item, taxRate, + trackingCategories, ledgerAccount, customFields, + rowVersion, updatedBy, createdBy, + createdAt, updatedAt); } @Override @@ -953,6 +733,7 @@ public String toString() { "unitOfMeasure", unitOfMeasure, "discountPercentage", discountPercentage, "discountAmount", discountAmount, + "categoryId", categoryId, "locationId", locationId, "departmentId", departmentId, "item", item, @@ -970,511 +751,263 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; + + private String rowId; - private Optional rowId = Optional.empty(); + private JsonNullable code; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable lineNumber; - private JsonNullable lineNumber = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable taxAmount; - private JsonNullable taxAmount = JsonNullable.undefined(); + private JsonNullable totalAmount; - private JsonNullable totalAmount = JsonNullable.undefined(); + private JsonNullable quantity; - private JsonNullable quantity = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitOfMeasure; - private JsonNullable unitOfMeasure = JsonNullable.undefined(); + private JsonNullable discountPercentage; - private JsonNullable discountPercentage = JsonNullable.undefined(); + private JsonNullable discountAmount; - private JsonNullable discountAmount = JsonNullable.undefined(); + private JsonNullable categoryId; - private JsonNullable locationId = JsonNullable.undefined(); + private JsonNullable locationId; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private Optional item = Optional.empty(); + private LinkedInvoiceItem item; - private Optional taxRate = Optional.empty(); + private LinkedTaxRate taxRate; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable ledgerAccount = JsonNullable.undefined(); + private JsonNullable ledgerAccount; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * Row ID - */ - public Builder rowId(String rowId) { - Utils.checkNotNull(rowId, "rowId"); - this.rowId = Optional.ofNullable(rowId); - return this; - } - /** * Row ID */ - public Builder rowId(Optional rowId) { - Utils.checkNotNull(rowId, "rowId"); + public Builder rowId(@Nullable String rowId) { this.rowId = rowId; return this; } - /** * User defined item code */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Line number of the resource */ - public Builder lineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public Builder lineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public Builder lineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } - - /** * User defined description */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * Item type */ - public Builder type(InvoiceLineItemType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable InvoiceLineItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * Item type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * Tax amount */ - public Builder taxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public Builder taxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public Builder taxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } - - /** * Total amount of the line item */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Total amount of the line item - */ - public Builder totalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - - public Builder quantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + public Builder quantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public Builder quantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - - - public Builder unitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public Builder unitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public Builder unitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public Builder unitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } - - /** * Discount percentage applied to the line item when supported downstream. */ - public Builder discountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Builder discountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to the line item when supported downstream. - */ - public Builder discountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - /** * Discount amount applied to the line item when supported downstream. */ - public Builder discountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public Builder discountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } /** - * Discount amount applied to the line item when supported downstream. + * ID of the category of the line item */ - public Builder discountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; + public Builder categoryId(@Nullable String categoryId) { + this.categoryId = JsonNullable.of(categoryId); return this; } - /** * The ID of the location */ - public Builder locationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public Builder locationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public Builder locationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } - - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - - public Builder item(LinkedInvoiceItem item) { - Utils.checkNotNull(item, "item"); - this.item = Optional.ofNullable(item); - return this; - } - - public Builder item(Optional item) { - Utils.checkNotNull(item, "item"); + public Builder item(@Nullable LinkedInvoiceItem item) { this.item = item; return this; } - - public Builder taxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder ledgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Builder ledgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - public InvoiceLineItem build() { - return new InvoiceLineItem( id, rowId, code, lineNumber, description, type, taxAmount, totalAmount, quantity, unitPrice, unitOfMeasure, discountPercentage, - discountAmount, locationId, departmentId, - item, taxRate, trackingCategories, - ledgerAccount, customFields, rowVersion, - updatedBy, createdBy, createdAt, - updatedAt); + discountAmount, categoryId, locationId, + departmentId, item, taxRate, + trackingCategories, ledgerAccount, customFields, + rowVersion, updatedBy, createdBy, + createdAt, updatedAt); } } diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceLineItemInput.java b/src/main/java/com/apideck/unify/models/components/InvoiceLineItemInput.java index a294ecae..1bdca978 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceLineItemInput.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceLineItemInput.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -32,7 +31,7 @@ public class InvoiceLineItemInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("row_id") - private Optional rowId; + private String rowId; /** * User defined item code @@ -60,7 +59,7 @@ public class InvoiceLineItemInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * Tax amount @@ -107,6 +106,13 @@ public class InvoiceLineItemInput { @JsonProperty("discount_amount") private JsonNullable discountAmount; + /** + * ID of the category of the line item + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("category_id") + private JsonNullable categoryId; + /** * The ID of the location */ @@ -124,29 +130,29 @@ public class InvoiceLineItemInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("item") - private Optional item; + private LinkedInvoiceItem item; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRateInput taxRate; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("ledger_account") - private JsonNullable ledgerAccount; + private JsonNullable ledgerAccount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -157,235 +163,215 @@ public class InvoiceLineItemInput { @JsonCreator public InvoiceLineItemInput( - @JsonProperty("id") JsonNullable id, - @JsonProperty("row_id") Optional rowId, - @JsonProperty("code") JsonNullable code, - @JsonProperty("line_number") JsonNullable lineNumber, - @JsonProperty("description") JsonNullable description, - @JsonProperty("type") JsonNullable type, - @JsonProperty("tax_amount") JsonNullable taxAmount, - @JsonProperty("total_amount") JsonNullable totalAmount, - @JsonProperty("quantity") JsonNullable quantity, - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("unit_of_measure") JsonNullable unitOfMeasure, - @JsonProperty("discount_percentage") JsonNullable discountPercentage, - @JsonProperty("discount_amount") JsonNullable discountAmount, - @JsonProperty("location_id") JsonNullable locationId, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("item") Optional item, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("ledger_account") JsonNullable ledgerAccount, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(rowId, "rowId"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(lineNumber, "lineNumber"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(taxAmount, "taxAmount"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(quantity, "quantity"); - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - Utils.checkNotNull(discountPercentage, "discountPercentage"); - Utils.checkNotNull(discountAmount, "discountAmount"); - Utils.checkNotNull(locationId, "locationId"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(item, "item"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - this.id = id; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("row_id") @Nullable String rowId, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("line_number") @Nullable JsonNullable lineNumber, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("tax_amount") @Nullable JsonNullable taxAmount, + @JsonProperty("total_amount") @Nullable JsonNullable totalAmount, + @JsonProperty("quantity") @Nullable JsonNullable quantity, + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("unit_of_measure") @Nullable JsonNullable unitOfMeasure, + @JsonProperty("discount_percentage") @Nullable JsonNullable discountPercentage, + @JsonProperty("discount_amount") @Nullable JsonNullable discountAmount, + @JsonProperty("category_id") @Nullable JsonNullable categoryId, + @JsonProperty("location_id") @Nullable JsonNullable locationId, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("item") @Nullable LinkedInvoiceItem item, + @JsonProperty("tax_rate") @Nullable LinkedTaxRateInput taxRate, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("ledger_account") @Nullable JsonNullable ledgerAccount, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); this.rowId = rowId; - this.code = code; - this.lineNumber = lineNumber; - this.description = description; - this.type = type; - this.taxAmount = taxAmount; - this.totalAmount = totalAmount; - this.quantity = quantity; - this.unitPrice = unitPrice; - this.unitOfMeasure = unitOfMeasure; - this.discountPercentage = discountPercentage; - this.discountAmount = discountAmount; - this.locationId = locationId; - this.departmentId = departmentId; + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.lineNumber = Optional.ofNullable(lineNumber) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.taxAmount = Optional.ofNullable(taxAmount) + .orElse(JsonNullable.undefined()); + this.totalAmount = Optional.ofNullable(totalAmount) + .orElse(JsonNullable.undefined()); + this.quantity = Optional.ofNullable(quantity) + .orElse(JsonNullable.undefined()); + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.unitOfMeasure = Optional.ofNullable(unitOfMeasure) + .orElse(JsonNullable.undefined()); + this.discountPercentage = Optional.ofNullable(discountPercentage) + .orElse(JsonNullable.undefined()); + this.discountAmount = Optional.ofNullable(discountAmount) + .orElse(JsonNullable.undefined()); + this.categoryId = Optional.ofNullable(categoryId) + .orElse(JsonNullable.undefined()); + this.locationId = Optional.ofNullable(locationId) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); this.item = item; this.taxRate = taxRate; - this.trackingCategories = trackingCategories; - this.ledgerAccount = ledgerAccount; + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); } public InvoiceLineItemInput() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Row ID */ - @JsonIgnore public Optional rowId() { - return rowId; + return Optional.ofNullable(this.rowId); } /** * User defined item code */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Line number of the resource */ - @JsonIgnore public JsonNullable lineNumber() { - return lineNumber; + return this.lineNumber; } /** * User defined description */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Item type */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * Tax amount */ - @JsonIgnore public JsonNullable taxAmount() { - return taxAmount; + return this.taxAmount; } /** * Total amount of the line item */ - @JsonIgnore public JsonNullable totalAmount() { - return totalAmount; + return this.totalAmount; } - @JsonIgnore public JsonNullable quantity() { - return quantity; + return this.quantity; } - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - @JsonIgnore public JsonNullable unitOfMeasure() { - return unitOfMeasure; + return this.unitOfMeasure; } /** * Discount percentage applied to the line item when supported downstream. */ - @JsonIgnore public JsonNullable discountPercentage() { - return discountPercentage; + return this.discountPercentage; } /** * Discount amount applied to the line item when supported downstream. */ - @JsonIgnore public JsonNullable discountAmount() { - return discountAmount; + return this.discountAmount; + } + + /** + * ID of the category of the line item + */ + public JsonNullable categoryId() { + return this.categoryId; } /** * The ID of the location */ - @JsonIgnore public JsonNullable locationId() { - return locationId; + return this.locationId; } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional item() { - return (Optional) item; + return Optional.ofNullable(this.item); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable ledgerAccount() { - return (JsonNullable) ledgerAccount; + return this.ledgerAccount; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } public static Builder builder() { @@ -396,348 +382,182 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public InvoiceLineItemInput withId(String id) { - Utils.checkNotNull(id, "id"); + public InvoiceLineItemInput withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public InvoiceLineItemInput withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * Row ID */ - public InvoiceLineItemInput withRowId(String rowId) { - Utils.checkNotNull(rowId, "rowId"); - this.rowId = Optional.ofNullable(rowId); - return this; - } - - - /** - * Row ID - */ - public InvoiceLineItemInput withRowId(Optional rowId) { - Utils.checkNotNull(rowId, "rowId"); + public InvoiceLineItemInput withRowId(@Nullable String rowId) { this.rowId = rowId; return this; } + /** * User defined item code */ - public InvoiceLineItemInput withCode(String code) { - Utils.checkNotNull(code, "code"); + public InvoiceLineItemInput withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public InvoiceLineItemInput withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * Line number of the resource */ - public InvoiceLineItemInput withLineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public InvoiceLineItemInput withLineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public InvoiceLineItemInput withLineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } /** * User defined description */ - public InvoiceLineItemInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public InvoiceLineItemInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public InvoiceLineItemInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * Item type */ - public InvoiceLineItemInput withType(InvoiceLineItemType type) { - Utils.checkNotNull(type, "type"); + public InvoiceLineItemInput withType(@Nullable InvoiceLineItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * Item type - */ - public InvoiceLineItemInput withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Tax amount */ - public InvoiceLineItemInput withTaxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public InvoiceLineItemInput withTaxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public InvoiceLineItemInput withTaxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } /** * Total amount of the line item */ - public InvoiceLineItemInput withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public InvoiceLineItemInput withTotalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Total amount of the line item - */ - public InvoiceLineItemInput withTotalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - public InvoiceLineItemInput withQuantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + public InvoiceLineItemInput withQuantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public InvoiceLineItemInput withQuantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - public InvoiceLineItemInput withUnitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public InvoiceLineItemInput withUnitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public InvoiceLineItemInput withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public InvoiceLineItemInput withUnitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public InvoiceLineItemInput withUnitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public InvoiceLineItemInput withUnitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } /** * Discount percentage applied to the line item when supported downstream. */ - public InvoiceLineItemInput withDiscountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public InvoiceLineItemInput withDiscountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to the line item when supported downstream. - */ - public InvoiceLineItemInput withDiscountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } /** * Discount amount applied to the line item when supported downstream. */ - public InvoiceLineItemInput withDiscountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public InvoiceLineItemInput withDiscountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } + /** - * Discount amount applied to the line item when supported downstream. + * ID of the category of the line item */ - public InvoiceLineItemInput withDiscountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; + public InvoiceLineItemInput withCategoryId(@Nullable String categoryId) { + this.categoryId = JsonNullable.of(categoryId); return this; } + /** * The ID of the location */ - public InvoiceLineItemInput withLocationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public InvoiceLineItemInput withLocationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public InvoiceLineItemInput withLocationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } /** * The ID of the department */ - public InvoiceLineItemInput withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public InvoiceLineItemInput withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public InvoiceLineItemInput withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - public InvoiceLineItemInput withItem(LinkedInvoiceItem item) { - Utils.checkNotNull(item, "item"); - this.item = Optional.ofNullable(item); - return this; - } - - public InvoiceLineItemInput withItem(Optional item) { - Utils.checkNotNull(item, "item"); + public InvoiceLineItemInput withItem(@Nullable LinkedInvoiceItem item) { this.item = item; return this; } - public InvoiceLineItemInput withTaxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public InvoiceLineItemInput withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public InvoiceLineItemInput withTaxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } + /** * A list of linked tracking categories. */ - public InvoiceLineItemInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public InvoiceLineItemInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public InvoiceLineItemInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - public InvoiceLineItemInput withLedgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public InvoiceLineItemInput withLedgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public InvoiceLineItemInput withLedgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - public InvoiceLineItemInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public InvoiceLineItemInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public InvoiceLineItemInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public InvoiceLineItemInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public InvoiceLineItemInput withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public InvoiceLineItemInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -762,6 +582,7 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.unitOfMeasure, other.unitOfMeasure) && Utils.enhancedDeepEquals(this.discountPercentage, other.discountPercentage) && Utils.enhancedDeepEquals(this.discountAmount, other.discountAmount) && + Utils.enhancedDeepEquals(this.categoryId, other.categoryId) && Utils.enhancedDeepEquals(this.locationId, other.locationId) && Utils.enhancedDeepEquals(this.departmentId, other.departmentId) && Utils.enhancedDeepEquals(this.item, other.item) && @@ -779,9 +600,10 @@ public int hashCode() { lineNumber, description, type, taxAmount, totalAmount, quantity, unitPrice, unitOfMeasure, discountPercentage, - discountAmount, locationId, departmentId, - item, taxRate, trackingCategories, - ledgerAccount, customFields, rowVersion); + discountAmount, categoryId, locationId, + departmentId, item, taxRate, + trackingCategories, ledgerAccount, customFields, + rowVersion); } @Override @@ -800,6 +622,7 @@ public String toString() { "unitOfMeasure", unitOfMeasure, "discountPercentage", discountPercentage, "discountAmount", discountAmount, + "categoryId", categoryId, "locationId", locationId, "departmentId", departmentId, "item", item, @@ -813,425 +636,222 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private Optional rowId = Optional.empty(); + private String rowId; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable lineNumber = JsonNullable.undefined(); + private JsonNullable lineNumber; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable taxAmount = JsonNullable.undefined(); + private JsonNullable taxAmount; - private JsonNullable totalAmount = JsonNullable.undefined(); + private JsonNullable totalAmount; - private JsonNullable quantity = JsonNullable.undefined(); + private JsonNullable quantity; - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable unitOfMeasure = JsonNullable.undefined(); + private JsonNullable unitOfMeasure; - private JsonNullable discountPercentage = JsonNullable.undefined(); + private JsonNullable discountPercentage; - private JsonNullable discountAmount = JsonNullable.undefined(); + private JsonNullable discountAmount; - private JsonNullable locationId = JsonNullable.undefined(); + private JsonNullable categoryId; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable locationId; - private Optional item = Optional.empty(); + private JsonNullable departmentId; - private Optional taxRate = Optional.empty(); + private LinkedInvoiceItem item; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private LinkedTaxRateInput taxRate; - private JsonNullable ledgerAccount = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional> customFields = Optional.empty(); + private JsonNullable ledgerAccount; - private JsonNullable rowVersion = JsonNullable.undefined(); + private List customFields; + + private JsonNullable rowVersion; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * Row ID */ - public Builder rowId(String rowId) { - Utils.checkNotNull(rowId, "rowId"); - this.rowId = Optional.ofNullable(rowId); - return this; - } - - /** - * Row ID - */ - public Builder rowId(Optional rowId) { - Utils.checkNotNull(rowId, "rowId"); + public Builder rowId(@Nullable String rowId) { this.rowId = rowId; return this; } - /** * User defined item code */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Line number of the resource */ - public Builder lineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public Builder lineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public Builder lineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } - - /** * User defined description */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * Item type */ - public Builder type(InvoiceLineItemType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable InvoiceLineItemType type) { this.type = JsonNullable.of(type); return this; } - /** - * Item type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * Tax amount */ - public Builder taxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public Builder taxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public Builder taxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } - - /** * Total amount of the line item */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Total amount of the line item - */ - public Builder totalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - - public Builder quantity(double quantity) { - Utils.checkNotNull(quantity, "quantity"); + public Builder quantity(@Nullable Double quantity) { this.quantity = JsonNullable.of(quantity); return this; } - public Builder quantity(JsonNullable quantity) { - Utils.checkNotNull(quantity, "quantity"); - this.quantity = quantity; - return this; - } - - - public Builder unitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public Builder unitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public Builder unitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public Builder unitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } - - /** * Discount percentage applied to the line item when supported downstream. */ - public Builder discountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Builder discountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to the line item when supported downstream. - */ - public Builder discountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - /** * Discount amount applied to the line item when supported downstream. */ - public Builder discountAmount(double discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); + public Builder discountAmount(@Nullable Double discountAmount) { this.discountAmount = JsonNullable.of(discountAmount); return this; } /** - * Discount amount applied to the line item when supported downstream. + * ID of the category of the line item */ - public Builder discountAmount(JsonNullable discountAmount) { - Utils.checkNotNull(discountAmount, "discountAmount"); - this.discountAmount = discountAmount; + public Builder categoryId(@Nullable String categoryId) { + this.categoryId = JsonNullable.of(categoryId); return this; } - /** * The ID of the location */ - public Builder locationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public Builder locationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public Builder locationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } - - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - - public Builder item(LinkedInvoiceItem item) { - Utils.checkNotNull(item, "item"); - this.item = Optional.ofNullable(item); - return this; - } - - public Builder item(Optional item) { - Utils.checkNotNull(item, "item"); + public Builder item(@Nullable LinkedInvoiceItem item) { this.item = item; return this; } - - public Builder taxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder ledgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Builder ledgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - public InvoiceLineItemInput build() { - return new InvoiceLineItemInput( id, rowId, code, lineNumber, description, type, taxAmount, totalAmount, quantity, unitPrice, unitOfMeasure, discountPercentage, - discountAmount, locationId, departmentId, - item, taxRate, trackingCategories, - ledgerAccount, customFields, rowVersion); + discountAmount, categoryId, locationId, + departmentId, item, taxRate, + trackingCategories, ledgerAccount, customFields, + rowVersion); } } diff --git a/src/main/java/com/apideck/unify/models/components/InvoiceResponse.java b/src/main/java/com/apideck/unify/models/components/InvoiceResponse.java index b6ff419e..d457a713 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoiceResponse.java +++ b/src/main/java/com/apideck/unify/models/components/InvoiceResponse.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -21,7 +21,7 @@ public class InvoiceResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The third-party API ID of original entity @@ -32,32 +32,29 @@ public class InvoiceResponse { @JsonCreator public InvoiceResponse( - @JsonProperty("id") Optional id, - @JsonProperty("downstream_id") JsonNullable downstreamId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId) { this.id = id; - this.downstreamId = downstreamId; + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); } public InvoiceResponse() { - this(Optional.empty(), JsonNullable.undefined()); + this(null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } public static Builder builder() { @@ -68,39 +65,20 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public InvoiceResponse withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public InvoiceResponse withId(Optional id) { - Utils.checkNotNull(id, "id"); + public InvoiceResponse withId(@Nullable String id) { this.id = id; return this; } + /** * The third-party API ID of original entity */ - public InvoiceResponse withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public InvoiceResponse withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public InvoiceResponse withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -132,54 +110,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } - public InvoiceResponse build() { - return new InvoiceResponse( id, downstreamId); } diff --git a/src/main/java/com/apideck/unify/models/components/InvoicesFilter.java b/src/main/java/com/apideck/unify/models/components/InvoicesFilter.java index a512586a..32652786 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoicesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/InvoicesFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; @@ -16,51 +16,45 @@ public class InvoicesFilter { @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private OffsetDateTime updatedSince; @SpeakeasyMetadata("queryParam:name=created_since") - private Optional createdSince; + private OffsetDateTime createdSince; /** * Invoice number to search for */ @SpeakeasyMetadata("queryParam:name=number") - private Optional number; + private String number; @JsonCreator public InvoicesFilter( - Optional updatedSince, - Optional createdSince, - Optional number) { - Utils.checkNotNull(updatedSince, "updatedSince"); - Utils.checkNotNull(createdSince, "createdSince"); - Utils.checkNotNull(number, "number"); + @Nullable OffsetDateTime updatedSince, + @Nullable OffsetDateTime createdSince, + @Nullable String number) { this.updatedSince = updatedSince; this.createdSince = createdSince; this.number = number; } public InvoicesFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } - @JsonIgnore public Optional createdSince() { - return createdSince; + return Optional.ofNullable(this.createdSince); } /** * Invoice number to search for */ - @JsonIgnore public Optional number() { - return number; + return Optional.ofNullable(this.number); } public static Builder builder() { @@ -68,51 +62,27 @@ public static Builder builder() { } - public InvoicesFilter withUpdatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - - public InvoicesFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public InvoicesFilter withUpdatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - public InvoicesFilter withCreatedSince(OffsetDateTime createdSince) { - Utils.checkNotNull(createdSince, "createdSince"); - this.createdSince = Optional.ofNullable(createdSince); - return this; - } - - public InvoicesFilter withCreatedSince(Optional createdSince) { - Utils.checkNotNull(createdSince, "createdSince"); + public InvoicesFilter withCreatedSince(@Nullable OffsetDateTime createdSince) { this.createdSince = createdSince; return this; } - /** - * Invoice number to search for - */ - public InvoicesFilter withNumber(String number) { - Utils.checkNotNull(number, "number"); - this.number = Optional.ofNullable(number); - return this; - } - /** * Invoice number to search for */ - public InvoicesFilter withNumber(Optional number) { - Utils.checkNotNull(number, "number"); + public InvoicesFilter withNumber(@Nullable String number) { this.number = number; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -145,63 +115,35 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional updatedSince = Optional.empty(); + private OffsetDateTime updatedSince; - private Optional createdSince = Optional.empty(); + private OffsetDateTime createdSince; - private Optional number = Optional.empty(); + private String number; private Builder() { // force use of static builder() method } - - public Builder updatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - - public Builder createdSince(OffsetDateTime createdSince) { - Utils.checkNotNull(createdSince, "createdSince"); - this.createdSince = Optional.ofNullable(createdSince); - return this; - } - - public Builder createdSince(Optional createdSince) { - Utils.checkNotNull(createdSince, "createdSince"); + public Builder createdSince(@Nullable OffsetDateTime createdSince) { this.createdSince = createdSince; return this; } - /** * Invoice number to search for */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); - this.number = Optional.ofNullable(number); - return this; - } - - /** - * Invoice number to search for - */ - public Builder number(Optional number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = number; return this; } public InvoicesFilter build() { - return new InvoicesFilter( updatedSince, createdSince, number); } diff --git a/src/main/java/com/apideck/unify/models/components/InvoicesSort.java b/src/main/java/com/apideck/unify/models/components/InvoicesSort.java index c67f5d72..afd97d64 100644 --- a/src/main/java/com/apideck/unify/models/components/InvoicesSort.java +++ b/src/main/java/com/apideck/unify/models/components/InvoicesSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class InvoicesSort { * The field on which to sort the Invoices */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private InvoicesSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public InvoicesSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable InvoicesSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public InvoicesSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Invoices */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Invoices */ - public InvoicesSort withBy(InvoicesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Invoices - */ - public InvoicesSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public InvoicesSort withBy(@Nullable InvoicesSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public InvoicesSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public InvoicesSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public InvoicesSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private InvoicesSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Invoices - */ - public Builder by(InvoicesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Invoices */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable InvoicesSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public InvoicesSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new InvoicesSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/IssuesFilter.java b/src/main/java/com/apideck/unify/models/components/IssuesFilter.java index 4224a388..d4ea3019 100644 --- a/src/main/java/com/apideck/unify/models/components/IssuesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/IssuesFilter.java @@ -6,10 +6,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -20,60 +19,53 @@ public class IssuesFilter { * Filter by ticket status, can be `open`, `closed` or `all`. Will passthrough if none of the above match */ @SpeakeasyMetadata("queryParam:name=status") - private Optional> status; + private List status; /** * Only return tickets since a specific date */ @SpeakeasyMetadata("queryParam:name=since") - private Optional since; + private OffsetDateTime since; /** * Only return tickets assigned to a specific user */ @SpeakeasyMetadata("queryParam:name=assignee_id") - private Optional assigneeId; + private String assigneeId; @JsonCreator public IssuesFilter( - Optional> status, - Optional since, - Optional assigneeId) { - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(since, "since"); - Utils.checkNotNull(assigneeId, "assigneeId"); + @Nullable List status, + @Nullable OffsetDateTime since, + @Nullable String assigneeId) { this.status = status; this.since = since; this.assigneeId = assigneeId; } public IssuesFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } /** * Filter by ticket status, can be `open`, `closed` or `all`. Will passthrough if none of the above match */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> status() { - return (Optional>) status; + return Optional.ofNullable(this.status); } /** * Only return tickets since a specific date */ - @JsonIgnore public Optional since() { - return since; + return Optional.ofNullable(this.since); } /** * Only return tickets assigned to a specific user */ - @JsonIgnore public Optional assigneeId() { - return assigneeId; + return Optional.ofNullable(this.assigneeId); } public static Builder builder() { @@ -84,60 +76,30 @@ public static Builder builder() { /** * Filter by ticket status, can be `open`, `closed` or `all`. Will passthrough if none of the above match */ - public IssuesFilter withStatus(List status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - - /** - * Filter by ticket status, can be `open`, `closed` or `all`. Will passthrough if none of the above match - */ - public IssuesFilter withStatus(Optional> status) { - Utils.checkNotNull(status, "status"); + public IssuesFilter withStatus(@Nullable List status) { this.status = status; return this; } - /** - * Only return tickets since a specific date - */ - public IssuesFilter withSince(OffsetDateTime since) { - Utils.checkNotNull(since, "since"); - this.since = Optional.ofNullable(since); - return this; - } - /** * Only return tickets since a specific date */ - public IssuesFilter withSince(Optional since) { - Utils.checkNotNull(since, "since"); + public IssuesFilter withSince(@Nullable OffsetDateTime since) { this.since = since; return this; } - /** - * Only return tickets assigned to a specific user - */ - public IssuesFilter withAssigneeId(String assigneeId) { - Utils.checkNotNull(assigneeId, "assigneeId"); - this.assigneeId = Optional.ofNullable(assigneeId); - return this; - } - /** * Only return tickets assigned to a specific user */ - public IssuesFilter withAssigneeId(Optional assigneeId) { - Utils.checkNotNull(assigneeId, "assigneeId"); + public IssuesFilter withAssigneeId(@Nullable String assigneeId) { this.assigneeId = assigneeId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -170,75 +132,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional> status = Optional.empty(); + private List status; - private Optional since = Optional.empty(); + private OffsetDateTime since; - private Optional assigneeId = Optional.empty(); + private String assigneeId; private Builder() { // force use of static builder() method } - - /** - * Filter by ticket status, can be `open`, `closed` or `all`. Will passthrough if none of the above match - */ - public Builder status(List status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Filter by ticket status, can be `open`, `closed` or `all`. Will passthrough if none of the above match */ - public Builder status(Optional> status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable List status) { this.status = status; return this; } - /** * Only return tickets since a specific date */ - public Builder since(OffsetDateTime since) { - Utils.checkNotNull(since, "since"); - this.since = Optional.ofNullable(since); - return this; - } - - /** - * Only return tickets since a specific date - */ - public Builder since(Optional since) { - Utils.checkNotNull(since, "since"); + public Builder since(@Nullable OffsetDateTime since) { this.since = since; return this; } - - /** - * Only return tickets assigned to a specific user - */ - public Builder assigneeId(String assigneeId) { - Utils.checkNotNull(assigneeId, "assigneeId"); - this.assigneeId = Optional.ofNullable(assigneeId); - return this; - } - /** * Only return tickets assigned to a specific user */ - public Builder assigneeId(Optional assigneeId) { - Utils.checkNotNull(assigneeId, "assigneeId"); + public Builder assigneeId(@Nullable String assigneeId) { this.assigneeId = assigneeId; return this; } public IssuesFilter build() { - return new IssuesFilter( status, since, assigneeId); } diff --git a/src/main/java/com/apideck/unify/models/components/Job.java b/src/main/java/com/apideck/unify/models/components/Job.java index 258c94ac..69bf5b41 100644 --- a/src/main/java/com/apideck/unify/models/components/Job.java +++ b/src/main/java/com/apideck/unify/models/components/Job.java @@ -5,17 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -30,7 +29,7 @@ public class Job { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonInclude(Include.NON_ABSENT) @@ -49,28 +48,28 @@ public class Job { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("sequence") - private Optional sequence; + private Long sequence; /** * The visibility of the job */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("visibility") - private Optional visibility; + private Visibility visibility; /** * The status of the job. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private JobStatus status; /** * The code of the job. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * language code according to ISO 639-1. For the United States - EN @@ -82,14 +81,14 @@ public class Job { @JsonInclude(Include.NON_ABSENT) @JsonProperty("employment_terms") - private JsonNullable employmentTerms; + private JsonNullable employmentTerms; /** * Level of experience required for the job role. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("experience") - private Optional experience; + private String experience; /** * Specifies the location for the job posting. @@ -110,36 +109,36 @@ public class Job { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("requisition_id") - private Optional requisitionId; + private String requisitionId; @JsonInclude(Include.NON_ABSENT) @JsonProperty("department") - private Optional department; + private Department department; /** * Details of the branch for which the job is created. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("branch") - private Optional branch; + private Branch branch; /** * The recruiter is generally someone who is tasked to help the hiring manager find and screen qualified applicant */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("recruiters") - private JsonNullable> recruiters; + private JsonNullable> recruiters; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hiring_managers") - private Optional> hiringManagers; + private List hiringManagers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("followers") - private JsonNullable> followers; + private JsonNullable> followers; /** * A description of the object. @@ -158,7 +157,7 @@ public class Job { @JsonInclude(Include.NON_ABSENT) @JsonProperty("blocks") - private Optional> blocks; + private List blocks; @JsonInclude(Include.NON_ABSENT) @@ -180,7 +179,7 @@ public class Job { @JsonInclude(Include.NON_ABSENT) @JsonProperty("salary") - private Optional salary; + private Salary salary; /** * URL of the job description @@ -214,34 +213,34 @@ public class Job { @JsonInclude(Include.NON_ABSENT) @JsonProperty("links") - private Optional> links; + private List links; @JsonInclude(Include.NON_ABSENT) @JsonProperty("confidential") - private Optional confidential; + private Boolean confidential; /** * Specifies whether an employee of the organization can apply for the job. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("available_to_employees") - private Optional availableToEmployees; + private Boolean availableToEmployees; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * Flag to indicate if the object is deleted. @@ -265,7 +264,7 @@ public class Job { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -297,332 +296,280 @@ public class Job { @JsonCreator public Job( - @JsonProperty("id") Optional id, - @JsonProperty("slug") JsonNullable slug, - @JsonProperty("title") JsonNullable title, - @JsonProperty("sequence") Optional sequence, - @JsonProperty("visibility") Optional visibility, - @JsonProperty("status") Optional status, - @JsonProperty("code") Optional code, - @JsonProperty("language") JsonNullable language, - @JsonProperty("employment_terms") JsonNullable employmentTerms, - @JsonProperty("experience") Optional experience, - @JsonProperty("location") JsonNullable location, - @JsonProperty("remote") JsonNullable remote, - @JsonProperty("requisition_id") Optional requisitionId, - @JsonProperty("department") Optional department, - @JsonProperty("branch") Optional branch, - @JsonProperty("recruiters") JsonNullable> recruiters, - @JsonProperty("hiring_managers") Optional> hiringManagers, - @JsonProperty("followers") JsonNullable> followers, - @JsonProperty("description") JsonNullable description, - @JsonProperty("description_html") JsonNullable descriptionHtml, - @JsonProperty("blocks") Optional> blocks, - @JsonProperty("closing") JsonNullable closing, - @JsonProperty("closing_html") JsonNullable closingHtml, - @JsonProperty("closing_date") JsonNullable closingDate, - @JsonProperty("salary") Optional salary, - @JsonProperty("url") JsonNullable url, - @JsonProperty("job_portal_url") JsonNullable jobPortalUrl, - @JsonProperty("record_url") JsonNullable recordUrl, - @JsonProperty("links") Optional> links, - @JsonProperty("confidential") Optional confidential, - @JsonProperty("available_to_employees") Optional availableToEmployees, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("deleted") JsonNullable deleted, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("published_at") JsonNullable publishedAt, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(slug, "slug"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(sequence, "sequence"); - Utils.checkNotNull(visibility, "visibility"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(employmentTerms, "employmentTerms"); - Utils.checkNotNull(experience, "experience"); - Utils.checkNotNull(location, "location"); - Utils.checkNotNull(remote, "remote"); - Utils.checkNotNull(requisitionId, "requisitionId"); - Utils.checkNotNull(department, "department"); - Utils.checkNotNull(branch, "branch"); - Utils.checkNotNull(recruiters, "recruiters"); - Utils.checkNotNull(hiringManagers, "hiringManagers"); - Utils.checkNotNull(followers, "followers"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(descriptionHtml, "descriptionHtml"); - Utils.checkNotNull(blocks, "blocks"); - Utils.checkNotNull(closing, "closing"); - Utils.checkNotNull(closingHtml, "closingHtml"); - Utils.checkNotNull(closingDate, "closingDate"); - Utils.checkNotNull(salary, "salary"); - Utils.checkNotNull(url, "url"); - Utils.checkNotNull(jobPortalUrl, "jobPortalUrl"); - Utils.checkNotNull(recordUrl, "recordUrl"); - Utils.checkNotNull(links, "links"); - Utils.checkNotNull(confidential, "confidential"); - Utils.checkNotNull(availableToEmployees, "availableToEmployees"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(deleted, "deleted"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(publishedAt, "publishedAt"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("slug") @Nullable JsonNullable slug, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("sequence") @Nullable Long sequence, + @JsonProperty("visibility") @Nullable Visibility visibility, + @JsonProperty("status") @Nullable JobStatus status, + @JsonProperty("code") @Nullable String code, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("employment_terms") @Nullable JsonNullable employmentTerms, + @JsonProperty("experience") @Nullable String experience, + @JsonProperty("location") @Nullable JsonNullable location, + @JsonProperty("remote") @Nullable JsonNullable remote, + @JsonProperty("requisition_id") @Nullable String requisitionId, + @JsonProperty("department") @Nullable Department department, + @JsonProperty("branch") @Nullable Branch branch, + @JsonProperty("recruiters") @Nullable JsonNullable> recruiters, + @JsonProperty("hiring_managers") @Nullable List hiringManagers, + @JsonProperty("followers") @Nullable JsonNullable> followers, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("description_html") @Nullable JsonNullable descriptionHtml, + @JsonProperty("blocks") @Nullable List blocks, + @JsonProperty("closing") @Nullable JsonNullable closing, + @JsonProperty("closing_html") @Nullable JsonNullable closingHtml, + @JsonProperty("closing_date") @Nullable JsonNullable closingDate, + @JsonProperty("salary") @Nullable Salary salary, + @JsonProperty("url") @Nullable JsonNullable url, + @JsonProperty("job_portal_url") @Nullable JsonNullable jobPortalUrl, + @JsonProperty("record_url") @Nullable JsonNullable recordUrl, + @JsonProperty("links") @Nullable List links, + @JsonProperty("confidential") @Nullable Boolean confidential, + @JsonProperty("available_to_employees") @Nullable Boolean availableToEmployees, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("deleted") @Nullable JsonNullable deleted, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("published_at") @Nullable JsonNullable publishedAt, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt) { this.id = id; - this.slug = slug; - this.title = title; + this.slug = Optional.ofNullable(slug) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); this.sequence = sequence; this.visibility = visibility; this.status = status; this.code = code; - this.language = language; - this.employmentTerms = employmentTerms; + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.employmentTerms = Optional.ofNullable(employmentTerms) + .orElse(JsonNullable.undefined()); this.experience = experience; - this.location = location; - this.remote = remote; + this.location = Optional.ofNullable(location) + .orElse(JsonNullable.undefined()); + this.remote = Optional.ofNullable(remote) + .orElse(JsonNullable.undefined()); this.requisitionId = requisitionId; this.department = department; this.branch = branch; - this.recruiters = recruiters; + this.recruiters = Optional.ofNullable(recruiters) + .orElse(JsonNullable.undefined()); this.hiringManagers = hiringManagers; - this.followers = followers; - this.description = description; - this.descriptionHtml = descriptionHtml; + this.followers = Optional.ofNullable(followers) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.descriptionHtml = Optional.ofNullable(descriptionHtml) + .orElse(JsonNullable.undefined()); this.blocks = blocks; - this.closing = closing; - this.closingHtml = closingHtml; - this.closingDate = closingDate; + this.closing = Optional.ofNullable(closing) + .orElse(JsonNullable.undefined()); + this.closingHtml = Optional.ofNullable(closingHtml) + .orElse(JsonNullable.undefined()); + this.closingDate = Optional.ofNullable(closingDate) + .orElse(JsonNullable.undefined()); this.salary = salary; - this.url = url; - this.jobPortalUrl = jobPortalUrl; - this.recordUrl = recordUrl; + this.url = Optional.ofNullable(url) + .orElse(JsonNullable.undefined()); + this.jobPortalUrl = Optional.ofNullable(jobPortalUrl) + .orElse(JsonNullable.undefined()); + this.recordUrl = Optional.ofNullable(recordUrl) + .orElse(JsonNullable.undefined()); this.links = links; this.confidential = confidential; this.availableToEmployees = availableToEmployees; - this.tags = tags; + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.customFields = customFields; - this.deleted = deleted; - this.ownerId = ownerId; - this.publishedAt = publishedAt; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.deleted = Optional.ofNullable(deleted) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.publishedAt = Optional.ofNullable(publishedAt) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); } public Job() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } - @JsonIgnore public JsonNullable slug() { - return slug; + return this.slug; } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * Sequence in relation to other jobs. */ - @JsonIgnore public Optional sequence() { - return sequence; + return Optional.ofNullable(this.sequence); } /** * The visibility of the job */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional visibility() { - return (Optional) visibility; + return Optional.ofNullable(this.visibility); } /** * The status of the job. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * The code of the job. */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable employmentTerms() { - return (JsonNullable) employmentTerms; + return this.employmentTerms; } /** * Level of experience required for the job role. */ - @JsonIgnore public Optional experience() { - return experience; + return Optional.ofNullable(this.experience); } /** * Specifies the location for the job posting. */ - @JsonIgnore public JsonNullable location() { - return location; + return this.location; } /** * Specifies whether the posting is for a remote job. */ - @JsonIgnore public JsonNullable remote() { - return remote; + return this.remote; } /** * A job's Requisition ID (Req ID) allows your organization to identify and track a job based on alphanumeric naming conventions unique to your company's internal processes. */ - @JsonIgnore public Optional requisitionId() { - return requisitionId; + return Optional.ofNullable(this.requisitionId); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional department() { - return (Optional) department; + return Optional.ofNullable(this.department); } /** * Details of the branch for which the job is created. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional branch() { - return (Optional) branch; + return Optional.ofNullable(this.branch); } /** * The recruiter is generally someone who is tasked to help the hiring manager find and screen qualified applicant */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> recruiters() { - return (JsonNullable>) recruiters; + return this.recruiters; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> hiringManagers() { - return (Optional>) hiringManagers; + return Optional.ofNullable(this.hiringManagers); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> followers() { - return (JsonNullable>) followers; + return this.followers; } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The job description in HTML format */ - @JsonIgnore public JsonNullable descriptionHtml() { - return descriptionHtml; + return this.descriptionHtml; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> blocks() { - return (Optional>) blocks; + return Optional.ofNullable(this.blocks); } - @JsonIgnore public JsonNullable closing() { - return closing; + return this.closing; } /** * The closing section of the job description in HTML format */ - @JsonIgnore public JsonNullable closingHtml() { - return closingHtml; + return this.closingHtml; } - @JsonIgnore public JsonNullable closingDate() { - return closingDate; + return this.closingDate; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional salary() { - return (Optional) salary; + return Optional.ofNullable(this.salary); } /** @@ -631,9 +578,8 @@ public Optional salary() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable url() { - return url; + return this.url; } /** @@ -642,9 +588,8 @@ public JsonNullable url() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable jobPortalUrl() { - return jobPortalUrl; + return this.jobPortalUrl; } /** @@ -652,105 +597,85 @@ public JsonNullable jobPortalUrl() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable recordUrl() { - return recordUrl; + return this.recordUrl; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> links() { - return (Optional>) links; + return Optional.ofNullable(this.links); } - @JsonIgnore public Optional confidential() { - return confidential; + return Optional.ofNullable(this.confidential); } /** * Specifies whether an employee of the organization can apply for the job. */ - @JsonIgnore public Optional availableToEmployees() { - return availableToEmployees; + return Optional.ofNullable(this.availableToEmployees); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * Flag to indicate if the object is deleted. */ - @JsonIgnore public JsonNullable deleted() { - return deleted; + return this.deleted; } - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } - @JsonIgnore public JsonNullable publishedAt() { - return publishedAt; + return this.publishedAt; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } public static Builder builder() { @@ -761,434 +686,212 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Job withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Job withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Job withId(@Nullable String id) { this.id = id; return this; } - public Job withSlug(String slug) { - Utils.checkNotNull(slug, "slug"); + + public Job withSlug(@Nullable String slug) { this.slug = JsonNullable.of(slug); return this; } - public Job withSlug(JsonNullable slug) { - Utils.checkNotNull(slug, "slug"); - this.slug = slug; - return this; - } /** * The job title of the person. */ - public Job withTitle(String title) { - Utils.checkNotNull(title, "title"); + public Job withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Job withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * Sequence in relation to other jobs. */ - public Job withSequence(long sequence) { - Utils.checkNotNull(sequence, "sequence"); - this.sequence = Optional.ofNullable(sequence); - return this; - } - - - /** - * Sequence in relation to other jobs. - */ - public Job withSequence(Optional sequence) { - Utils.checkNotNull(sequence, "sequence"); + public Job withSequence(@Nullable Long sequence) { this.sequence = sequence; return this; } - /** - * The visibility of the job - */ - public Job withVisibility(Visibility visibility) { - Utils.checkNotNull(visibility, "visibility"); - this.visibility = Optional.ofNullable(visibility); - return this; - } - /** * The visibility of the job */ - public Job withVisibility(Optional visibility) { - Utils.checkNotNull(visibility, "visibility"); + public Job withVisibility(@Nullable Visibility visibility) { this.visibility = visibility; return this; } - /** - * The status of the job. - */ - public Job withStatus(JobStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * The status of the job. */ - public Job withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public Job withStatus(@Nullable JobStatus status) { this.status = status; return this; } - /** - * The code of the job. - */ - public Job withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The code of the job. */ - public Job withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public Job withCode(@Nullable String code) { this.code = code; return this; } + /** * language code according to ISO 639-1. For the United States - EN */ - public Job withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public Job withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Job withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - public Job withEmploymentTerms(EmploymentTerms employmentTerms) { - Utils.checkNotNull(employmentTerms, "employmentTerms"); + public Job withEmploymentTerms(@Nullable EmploymentTerms employmentTerms) { this.employmentTerms = JsonNullable.of(employmentTerms); return this; } - public Job withEmploymentTerms(JsonNullable employmentTerms) { - Utils.checkNotNull(employmentTerms, "employmentTerms"); - this.employmentTerms = employmentTerms; - return this; - } - - /** - * Level of experience required for the job role. - */ - public Job withExperience(String experience) { - Utils.checkNotNull(experience, "experience"); - this.experience = Optional.ofNullable(experience); - return this; - } - /** * Level of experience required for the job role. */ - public Job withExperience(Optional experience) { - Utils.checkNotNull(experience, "experience"); + public Job withExperience(@Nullable String experience) { this.experience = experience; return this; } + /** * Specifies the location for the job posting. */ - public Job withLocation(String location) { - Utils.checkNotNull(location, "location"); + public Job withLocation(@Nullable String location) { this.location = JsonNullable.of(location); return this; } - /** - * Specifies the location for the job posting. - */ - public Job withLocation(JsonNullable location) { - Utils.checkNotNull(location, "location"); - this.location = location; - return this; - } /** * Specifies whether the posting is for a remote job. */ - public Job withRemote(boolean remote) { - Utils.checkNotNull(remote, "remote"); + public Job withRemote(@Nullable Boolean remote) { this.remote = JsonNullable.of(remote); return this; } - /** - * Specifies whether the posting is for a remote job. - */ - public Job withRemote(JsonNullable remote) { - Utils.checkNotNull(remote, "remote"); - this.remote = remote; - return this; - } - - /** - * A job's Requisition ID (Req ID) allows your organization to identify and track a job based on alphanumeric naming conventions unique to your company's internal processes. - */ - public Job withRequisitionId(String requisitionId) { - Utils.checkNotNull(requisitionId, "requisitionId"); - this.requisitionId = Optional.ofNullable(requisitionId); - return this; - } - /** * A job's Requisition ID (Req ID) allows your organization to identify and track a job based on alphanumeric naming conventions unique to your company's internal processes. */ - public Job withRequisitionId(Optional requisitionId) { - Utils.checkNotNull(requisitionId, "requisitionId"); + public Job withRequisitionId(@Nullable String requisitionId) { this.requisitionId = requisitionId; return this; } - public Job withDepartment(Department department) { - Utils.checkNotNull(department, "department"); - this.department = Optional.ofNullable(department); - return this; - } - - public Job withDepartment(Optional department) { - Utils.checkNotNull(department, "department"); + public Job withDepartment(@Nullable Department department) { this.department = department; return this; } - /** - * Details of the branch for which the job is created. - */ - public Job withBranch(Branch branch) { - Utils.checkNotNull(branch, "branch"); - this.branch = Optional.ofNullable(branch); - return this; - } - /** * Details of the branch for which the job is created. */ - public Job withBranch(Optional branch) { - Utils.checkNotNull(branch, "branch"); + public Job withBranch(@Nullable Branch branch) { this.branch = branch; return this; } - /** - * The recruiter is generally someone who is tasked to help the hiring manager find and screen qualified applicant - */ - public Job withRecruiters(List recruiters) { - Utils.checkNotNull(recruiters, "recruiters"); - this.recruiters = JsonNullable.of(recruiters); - return this; - } /** * The recruiter is generally someone who is tasked to help the hiring manager find and screen qualified applicant */ - public Job withRecruiters(JsonNullable> recruiters) { - Utils.checkNotNull(recruiters, "recruiters"); - this.recruiters = recruiters; - return this; - } - - public Job withHiringManagers(List hiringManagers) { - Utils.checkNotNull(hiringManagers, "hiringManagers"); - this.hiringManagers = Optional.ofNullable(hiringManagers); + public Job withRecruiters(@Nullable List recruiters) { + this.recruiters = JsonNullable.of(recruiters); return this; } - public Job withHiringManagers(Optional> hiringManagers) { - Utils.checkNotNull(hiringManagers, "hiringManagers"); + public Job withHiringManagers(@Nullable List hiringManagers) { this.hiringManagers = hiringManagers; return this; } - public Job withFollowers(List followers) { - Utils.checkNotNull(followers, "followers"); + + public Job withFollowers(@Nullable List followers) { this.followers = JsonNullable.of(followers); return this; } - public Job withFollowers(JsonNullable> followers) { - Utils.checkNotNull(followers, "followers"); - this.followers = followers; - return this; - } /** * A description of the object. */ - public Job withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Job withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Job withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The job description in HTML format */ - public Job withDescriptionHtml(String descriptionHtml) { - Utils.checkNotNull(descriptionHtml, "descriptionHtml"); + public Job withDescriptionHtml(@Nullable String descriptionHtml) { this.descriptionHtml = JsonNullable.of(descriptionHtml); return this; } - /** - * The job description in HTML format - */ - public Job withDescriptionHtml(JsonNullable descriptionHtml) { - Utils.checkNotNull(descriptionHtml, "descriptionHtml"); - this.descriptionHtml = descriptionHtml; - return this; - } - - public Job withBlocks(List blocks) { - Utils.checkNotNull(blocks, "blocks"); - this.blocks = Optional.ofNullable(blocks); - return this; - } - - public Job withBlocks(Optional> blocks) { - Utils.checkNotNull(blocks, "blocks"); + public Job withBlocks(@Nullable List blocks) { this.blocks = blocks; return this; } - public Job withClosing(String closing) { - Utils.checkNotNull(closing, "closing"); + + public Job withClosing(@Nullable String closing) { this.closing = JsonNullable.of(closing); return this; } - public Job withClosing(JsonNullable closing) { - Utils.checkNotNull(closing, "closing"); - this.closing = closing; - return this; - } /** * The closing section of the job description in HTML format */ - public Job withClosingHtml(String closingHtml) { - Utils.checkNotNull(closingHtml, "closingHtml"); + public Job withClosingHtml(@Nullable String closingHtml) { this.closingHtml = JsonNullable.of(closingHtml); return this; } - /** - * The closing section of the job description in HTML format - */ - public Job withClosingHtml(JsonNullable closingHtml) { - Utils.checkNotNull(closingHtml, "closingHtml"); - this.closingHtml = closingHtml; - return this; - } - public Job withClosingDate(LocalDate closingDate) { - Utils.checkNotNull(closingDate, "closingDate"); + public Job withClosingDate(@Nullable LocalDate closingDate) { this.closingDate = JsonNullable.of(closingDate); return this; } - public Job withClosingDate(JsonNullable closingDate) { - Utils.checkNotNull(closingDate, "closingDate"); - this.closingDate = closingDate; - return this; - } - - public Job withSalary(Salary salary) { - Utils.checkNotNull(salary, "salary"); - this.salary = Optional.ofNullable(salary); - return this; - } - - public Job withSalary(Optional salary) { - Utils.checkNotNull(salary, "salary"); + public Job withSalary(@Nullable Salary salary) { this.salary = salary; return this; } + /** * URL of the job description * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Job withUrl(String url) { - Utils.checkNotNull(url, "url"); + public Job withUrl(@Nullable String url) { this.url = JsonNullable.of(url); return this; } - /** - * URL of the job description - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Job withUrl(JsonNullable url) { - Utils.checkNotNull(url, "url"); - this.url = url; - return this; - } /** * URL of the job portal @@ -1196,260 +899,127 @@ public Job withUrl(JsonNullable url) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Job withJobPortalUrl(String jobPortalUrl) { - Utils.checkNotNull(jobPortalUrl, "jobPortalUrl"); + public Job withJobPortalUrl(@Nullable String jobPortalUrl) { this.jobPortalUrl = JsonNullable.of(jobPortalUrl); return this; } - /** - * URL of the job portal - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Job withJobPortalUrl(JsonNullable jobPortalUrl) { - Utils.checkNotNull(jobPortalUrl, "jobPortalUrl"); - this.jobPortalUrl = jobPortalUrl; - return this; - } /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Job withRecordUrl(String recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); + public Job withRecordUrl(@Nullable String recordUrl) { this.recordUrl = JsonNullable.of(recordUrl); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Job withRecordUrl(JsonNullable recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); - this.recordUrl = recordUrl; - return this; - } - - public Job withLinks(List links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - public Job withLinks(Optional> links) { - Utils.checkNotNull(links, "links"); + public Job withLinks(@Nullable List links) { this.links = links; return this; } - public Job withConfidential(boolean confidential) { - Utils.checkNotNull(confidential, "confidential"); - this.confidential = Optional.ofNullable(confidential); - return this; - } - - public Job withConfidential(Optional confidential) { - Utils.checkNotNull(confidential, "confidential"); + public Job withConfidential(@Nullable Boolean confidential) { this.confidential = confidential; return this; } - /** - * Specifies whether an employee of the organization can apply for the job. - */ - public Job withAvailableToEmployees(boolean availableToEmployees) { - Utils.checkNotNull(availableToEmployees, "availableToEmployees"); - this.availableToEmployees = Optional.ofNullable(availableToEmployees); - return this; - } - /** * Specifies whether an employee of the organization can apply for the job. */ - public Job withAvailableToEmployees(Optional availableToEmployees) { - Utils.checkNotNull(availableToEmployees, "availableToEmployees"); + public Job withAvailableToEmployees(@Nullable Boolean availableToEmployees) { this.availableToEmployees = availableToEmployees; return this; } - public Job withTags(List tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = JsonNullable.of(tags); - return this; - } - - public Job withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - public Job withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); + public Job withTags(@Nullable List tags) { + this.tags = JsonNullable.of(tags); return this; } - public Job withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Job withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public Job withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Job withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Job withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * Flag to indicate if the object is deleted. */ - public Job withDeleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Job withDeleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Flag to indicate if the object is deleted. - */ - public Job withDeleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - public Job withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Job withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - public Job withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - public Job withPublishedAt(OffsetDateTime publishedAt) { - Utils.checkNotNull(publishedAt, "publishedAt"); + public Job withPublishedAt(@Nullable OffsetDateTime publishedAt) { this.publishedAt = JsonNullable.of(publishedAt); return this; } - public Job withPublishedAt(JsonNullable publishedAt) { - Utils.checkNotNull(publishedAt, "publishedAt"); - this.publishedAt = publishedAt; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Job withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Job withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Job withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public Job withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Job withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Job withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Job withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Job withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Job withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Job withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Job withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Job withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Job withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Job withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Job withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -1574,817 +1144,394 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable slug = JsonNullable.undefined(); + private JsonNullable slug; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private Optional sequence = Optional.empty(); + private Long sequence; - private Optional visibility = Optional.empty(); + private Visibility visibility; - private Optional status = Optional.empty(); + private JobStatus status; - private Optional code = Optional.empty(); + private String code; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable employmentTerms = JsonNullable.undefined(); + private JsonNullable employmentTerms; - private Optional experience = Optional.empty(); + private String experience; - private JsonNullable location = JsonNullable.undefined(); + private JsonNullable location; - private JsonNullable remote = JsonNullable.undefined(); + private JsonNullable remote; - private Optional requisitionId = Optional.empty(); + private String requisitionId; - private Optional department = Optional.empty(); + private Department department; - private Optional branch = Optional.empty(); + private Branch branch; - private JsonNullable> recruiters = JsonNullable.undefined(); + private JsonNullable> recruiters; - private Optional> hiringManagers = Optional.empty(); + private List hiringManagers; - private JsonNullable> followers = JsonNullable.undefined(); + private JsonNullable> followers; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable descriptionHtml = JsonNullable.undefined(); + private JsonNullable descriptionHtml; - private Optional> blocks = Optional.empty(); + private List blocks; - private JsonNullable closing = JsonNullable.undefined(); + private JsonNullable closing; - private JsonNullable closingHtml = JsonNullable.undefined(); + private JsonNullable closingHtml; - private JsonNullable closingDate = JsonNullable.undefined(); + private JsonNullable closingDate; - private Optional salary = Optional.empty(); + private Salary salary; @Deprecated - private JsonNullable url = JsonNullable.undefined(); + private JsonNullable url; @Deprecated - private JsonNullable jobPortalUrl = JsonNullable.undefined(); + private JsonNullable jobPortalUrl; @Deprecated - private JsonNullable recordUrl = JsonNullable.undefined(); + private JsonNullable recordUrl; - private Optional> links = Optional.empty(); + private List links; - private Optional confidential = Optional.empty(); + private Boolean confidential; - private Optional availableToEmployees = Optional.empty(); + private Boolean availableToEmployees; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable deleted = JsonNullable.undefined(); + private JsonNullable deleted; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable publishedAt = JsonNullable.undefined(); + private JsonNullable publishedAt; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - public Builder slug(String slug) { - Utils.checkNotNull(slug, "slug"); + public Builder slug(@Nullable String slug) { this.slug = JsonNullable.of(slug); return this; } - public Builder slug(JsonNullable slug) { - Utils.checkNotNull(slug, "slug"); - this.slug = slug; - return this; - } - - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - - /** - * Sequence in relation to other jobs. - */ - public Builder sequence(long sequence) { - Utils.checkNotNull(sequence, "sequence"); - this.sequence = Optional.ofNullable(sequence); - return this; - } - /** * Sequence in relation to other jobs. */ - public Builder sequence(Optional sequence) { - Utils.checkNotNull(sequence, "sequence"); + public Builder sequence(@Nullable Long sequence) { this.sequence = sequence; return this; } - - /** - * The visibility of the job - */ - public Builder visibility(Visibility visibility) { - Utils.checkNotNull(visibility, "visibility"); - this.visibility = Optional.ofNullable(visibility); - return this; - } - /** * The visibility of the job */ - public Builder visibility(Optional visibility) { - Utils.checkNotNull(visibility, "visibility"); + public Builder visibility(@Nullable Visibility visibility) { this.visibility = visibility; return this; } - /** * The status of the job. */ - public Builder status(JobStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * The status of the job. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable JobStatus status) { this.status = status; return this; } - /** * The code of the job. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The code of the job. - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - - public Builder employmentTerms(EmploymentTerms employmentTerms) { - Utils.checkNotNull(employmentTerms, "employmentTerms"); + public Builder employmentTerms(@Nullable EmploymentTerms employmentTerms) { this.employmentTerms = JsonNullable.of(employmentTerms); return this; } - public Builder employmentTerms(JsonNullable employmentTerms) { - Utils.checkNotNull(employmentTerms, "employmentTerms"); - this.employmentTerms = employmentTerms; - return this; - } - - /** * Level of experience required for the job role. */ - public Builder experience(String experience) { - Utils.checkNotNull(experience, "experience"); - this.experience = Optional.ofNullable(experience); - return this; - } - - /** - * Level of experience required for the job role. - */ - public Builder experience(Optional experience) { - Utils.checkNotNull(experience, "experience"); + public Builder experience(@Nullable String experience) { this.experience = experience; return this; } - /** * Specifies the location for the job posting. */ - public Builder location(String location) { - Utils.checkNotNull(location, "location"); + public Builder location(@Nullable String location) { this.location = JsonNullable.of(location); return this; } - /** - * Specifies the location for the job posting. - */ - public Builder location(JsonNullable location) { - Utils.checkNotNull(location, "location"); - this.location = location; - return this; - } - - /** * Specifies whether the posting is for a remote job. */ - public Builder remote(boolean remote) { - Utils.checkNotNull(remote, "remote"); + public Builder remote(@Nullable Boolean remote) { this.remote = JsonNullable.of(remote); return this; } - /** - * Specifies whether the posting is for a remote job. - */ - public Builder remote(JsonNullable remote) { - Utils.checkNotNull(remote, "remote"); - this.remote = remote; - return this; - } - - /** * A job's Requisition ID (Req ID) allows your organization to identify and track a job based on alphanumeric naming conventions unique to your company's internal processes. */ - public Builder requisitionId(String requisitionId) { - Utils.checkNotNull(requisitionId, "requisitionId"); - this.requisitionId = Optional.ofNullable(requisitionId); - return this; - } - - /** - * A job's Requisition ID (Req ID) allows your organization to identify and track a job based on alphanumeric naming conventions unique to your company's internal processes. - */ - public Builder requisitionId(Optional requisitionId) { - Utils.checkNotNull(requisitionId, "requisitionId"); + public Builder requisitionId(@Nullable String requisitionId) { this.requisitionId = requisitionId; return this; } - - public Builder department(Department department) { - Utils.checkNotNull(department, "department"); - this.department = Optional.ofNullable(department); - return this; - } - - public Builder department(Optional department) { - Utils.checkNotNull(department, "department"); + public Builder department(@Nullable Department department) { this.department = department; return this; } - /** * Details of the branch for which the job is created. */ - public Builder branch(Branch branch) { - Utils.checkNotNull(branch, "branch"); - this.branch = Optional.ofNullable(branch); - return this; - } - - /** - * Details of the branch for which the job is created. - */ - public Builder branch(Optional branch) { - Utils.checkNotNull(branch, "branch"); + public Builder branch(@Nullable Branch branch) { this.branch = branch; return this; } - /** * The recruiter is generally someone who is tasked to help the hiring manager find and screen qualified applicant */ - public Builder recruiters(List recruiters) { - Utils.checkNotNull(recruiters, "recruiters"); + public Builder recruiters(@Nullable List recruiters) { this.recruiters = JsonNullable.of(recruiters); return this; } - /** - * The recruiter is generally someone who is tasked to help the hiring manager find and screen qualified applicant - */ - public Builder recruiters(JsonNullable> recruiters) { - Utils.checkNotNull(recruiters, "recruiters"); - this.recruiters = recruiters; - return this; - } - - - public Builder hiringManagers(List hiringManagers) { - Utils.checkNotNull(hiringManagers, "hiringManagers"); - this.hiringManagers = Optional.ofNullable(hiringManagers); - return this; - } - - public Builder hiringManagers(Optional> hiringManagers) { - Utils.checkNotNull(hiringManagers, "hiringManagers"); + public Builder hiringManagers(@Nullable List hiringManagers) { this.hiringManagers = hiringManagers; return this; } - - public Builder followers(List followers) { - Utils.checkNotNull(followers, "followers"); + public Builder followers(@Nullable List followers) { this.followers = JsonNullable.of(followers); return this; } - public Builder followers(JsonNullable> followers) { - Utils.checkNotNull(followers, "followers"); - this.followers = followers; - return this; - } - - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The job description in HTML format */ - public Builder descriptionHtml(String descriptionHtml) { - Utils.checkNotNull(descriptionHtml, "descriptionHtml"); + public Builder descriptionHtml(@Nullable String descriptionHtml) { this.descriptionHtml = JsonNullable.of(descriptionHtml); return this; } - /** - * The job description in HTML format - */ - public Builder descriptionHtml(JsonNullable descriptionHtml) { - Utils.checkNotNull(descriptionHtml, "descriptionHtml"); - this.descriptionHtml = descriptionHtml; - return this; - } - - - public Builder blocks(List blocks) { - Utils.checkNotNull(blocks, "blocks"); - this.blocks = Optional.ofNullable(blocks); - return this; - } - - public Builder blocks(Optional> blocks) { - Utils.checkNotNull(blocks, "blocks"); + public Builder blocks(@Nullable List blocks) { this.blocks = blocks; return this; } - - public Builder closing(String closing) { - Utils.checkNotNull(closing, "closing"); + public Builder closing(@Nullable String closing) { this.closing = JsonNullable.of(closing); return this; } - public Builder closing(JsonNullable closing) { - Utils.checkNotNull(closing, "closing"); - this.closing = closing; - return this; - } - - /** * The closing section of the job description in HTML format */ - public Builder closingHtml(String closingHtml) { - Utils.checkNotNull(closingHtml, "closingHtml"); + public Builder closingHtml(@Nullable String closingHtml) { this.closingHtml = JsonNullable.of(closingHtml); return this; } - /** - * The closing section of the job description in HTML format - */ - public Builder closingHtml(JsonNullable closingHtml) { - Utils.checkNotNull(closingHtml, "closingHtml"); - this.closingHtml = closingHtml; - return this; - } - - - public Builder closingDate(LocalDate closingDate) { - Utils.checkNotNull(closingDate, "closingDate"); + public Builder closingDate(@Nullable LocalDate closingDate) { this.closingDate = JsonNullable.of(closingDate); return this; } - public Builder closingDate(JsonNullable closingDate) { - Utils.checkNotNull(closingDate, "closingDate"); - this.closingDate = closingDate; - return this; - } - - - public Builder salary(Salary salary) { - Utils.checkNotNull(salary, "salary"); - this.salary = Optional.ofNullable(salary); - return this; - } - - public Builder salary(Optional salary) { - Utils.checkNotNull(salary, "salary"); + public Builder salary(@Nullable Salary salary) { this.salary = salary; return this; } - /** * URL of the job description * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder url(String url) { - Utils.checkNotNull(url, "url"); + public Builder url(@Nullable String url) { this.url = JsonNullable.of(url); return this; } - /** - * URL of the job description - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder url(JsonNullable url) { - Utils.checkNotNull(url, "url"); - this.url = url; - return this; - } - - /** * URL of the job portal * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder jobPortalUrl(String jobPortalUrl) { - Utils.checkNotNull(jobPortalUrl, "jobPortalUrl"); + public Builder jobPortalUrl(@Nullable String jobPortalUrl) { this.jobPortalUrl = JsonNullable.of(jobPortalUrl); return this; } - /** - * URL of the job portal - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder jobPortalUrl(JsonNullable jobPortalUrl) { - Utils.checkNotNull(jobPortalUrl, "jobPortalUrl"); - this.jobPortalUrl = jobPortalUrl; - return this; - } - - /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder recordUrl(String recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); + public Builder recordUrl(@Nullable String recordUrl) { this.recordUrl = JsonNullable.of(recordUrl); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder recordUrl(JsonNullable recordUrl) { - Utils.checkNotNull(recordUrl, "recordUrl"); - this.recordUrl = recordUrl; - return this; - } - - - public Builder links(List links) { - Utils.checkNotNull(links, "links"); - this.links = Optional.ofNullable(links); - return this; - } - - public Builder links(Optional> links) { - Utils.checkNotNull(links, "links"); + public Builder links(@Nullable List links) { this.links = links; return this; } - - public Builder confidential(boolean confidential) { - Utils.checkNotNull(confidential, "confidential"); - this.confidential = Optional.ofNullable(confidential); - return this; - } - - public Builder confidential(Optional confidential) { - Utils.checkNotNull(confidential, "confidential"); + public Builder confidential(@Nullable Boolean confidential) { this.confidential = confidential; return this; } - - /** - * Specifies whether an employee of the organization can apply for the job. - */ - public Builder availableToEmployees(boolean availableToEmployees) { - Utils.checkNotNull(availableToEmployees, "availableToEmployees"); - this.availableToEmployees = Optional.ofNullable(availableToEmployees); - return this; - } - /** * Specifies whether an employee of the organization can apply for the job. */ - public Builder availableToEmployees(Optional availableToEmployees) { - Utils.checkNotNull(availableToEmployees, "availableToEmployees"); + public Builder availableToEmployees(@Nullable Boolean availableToEmployees) { this.availableToEmployees = availableToEmployees; return this; } - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * Flag to indicate if the object is deleted. */ - public Builder deleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Builder deleted(@Nullable Boolean deleted) { this.deleted = JsonNullable.of(deleted); return this; } - /** - * Flag to indicate if the object is deleted. - */ - public Builder deleted(JsonNullable deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = deleted; - return this; - } - - - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - - public Builder publishedAt(OffsetDateTime publishedAt) { - Utils.checkNotNull(publishedAt, "publishedAt"); + public Builder publishedAt(@Nullable OffsetDateTime publishedAt) { this.publishedAt = JsonNullable.of(publishedAt); return this; } - public Builder publishedAt(JsonNullable publishedAt) { - Utils.checkNotNull(publishedAt, "publishedAt"); - this.publishedAt = publishedAt; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - public Job build() { - return new Job( id, slug, title, sequence, visibility, status, diff --git a/src/main/java/com/apideck/unify/models/components/JobLinks.java b/src/main/java/com/apideck/unify/models/components/JobLinks.java index 928448e0..6353c41d 100644 --- a/src/main/java/com/apideck/unify/models/components/JobLinks.java +++ b/src/main/java/com/apideck/unify/models/components/JobLinks.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -19,36 +18,31 @@ public class JobLinks { @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private JobType type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("url") - private Optional url; + private String url; @JsonCreator public JobLinks( - @JsonProperty("type") Optional type, - @JsonProperty("url") Optional url) { - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(url, "url"); + @JsonProperty("type") @Nullable JobType type, + @JsonProperty("url") @Nullable String url) { this.type = type; this.url = url; } public JobLinks() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } - @JsonIgnore public Optional url() { - return url; + return Optional.ofNullable(this.url); } public static Builder builder() { @@ -56,32 +50,18 @@ public static Builder builder() { } - public JobLinks withType(JobType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - - public JobLinks withType(Optional type) { - Utils.checkNotNull(type, "type"); + public JobLinks withType(@Nullable JobType type) { this.type = type; return this; } - public JobLinks withUrl(String url) { - Utils.checkNotNull(url, "url"); - this.url = Optional.ofNullable(url); - return this; - } - - public JobLinks withUrl(Optional url) { - Utils.checkNotNull(url, "url"); + public JobLinks withUrl(@Nullable String url) { this.url = url; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,42 +92,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional type = Optional.empty(); + private JobType type; - private Optional url = Optional.empty(); + private String url; private Builder() { // force use of static builder() method } - - public Builder type(JobType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable JobType type) { this.type = type; return this; } - - public Builder url(String url) { - Utils.checkNotNull(url, "url"); - this.url = Optional.ofNullable(url); - return this; - } - - public Builder url(Optional url) { - Utils.checkNotNull(url, "url"); + public Builder url(@Nullable String url) { this.url = url; return this; } public JobLinks build() { - return new JobLinks( type, url); } diff --git a/src/main/java/com/apideck/unify/models/components/JournalEntriesFilter.java b/src/main/java/com/apideck/unify/models/components/JournalEntriesFilter.java index 5e21ff69..568ad39a 100644 --- a/src/main/java/com/apideck/unify/models/components/JournalEntriesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/JournalEntriesFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; @@ -16,22 +16,20 @@ public class JournalEntriesFilter { @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private OffsetDateTime updatedSince; @JsonCreator public JournalEntriesFilter( - Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + @Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; } public JournalEntriesFilter() { - this(Optional.empty()); + this(null); } - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } public static Builder builder() { @@ -39,19 +37,12 @@ public static Builder builder() { } - public JournalEntriesFilter withUpdatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - - public JournalEntriesFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public JournalEntriesFilter withUpdatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -80,27 +71,18 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional updatedSince = Optional.empty(); + private OffsetDateTime updatedSince; private Builder() { // force use of static builder() method } - - public Builder updatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } public JournalEntriesFilter build() { - return new JournalEntriesFilter( updatedSince); } diff --git a/src/main/java/com/apideck/unify/models/components/JournalEntriesSort.java b/src/main/java/com/apideck/unify/models/components/JournalEntriesSort.java index ead8290b..d12fa850 100644 --- a/src/main/java/com/apideck/unify/models/components/JournalEntriesSort.java +++ b/src/main/java/com/apideck/unify/models/components/JournalEntriesSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class JournalEntriesSort { * The field on which to sort the Journal Entries. */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private JournalEntriesSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public JournalEntriesSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable JournalEntriesSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public JournalEntriesSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Journal Entries. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Journal Entries. */ - public JournalEntriesSort withBy(JournalEntriesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Journal Entries. - */ - public JournalEntriesSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public JournalEntriesSort withBy(@Nullable JournalEntriesSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public JournalEntriesSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public JournalEntriesSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public JournalEntriesSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private JournalEntriesSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Journal Entries. - */ - public Builder by(JournalEntriesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Journal Entries. */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable JournalEntriesSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public JournalEntriesSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new JournalEntriesSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/JournalEntry.java b/src/main/java/com/apideck/unify/models/components/JournalEntry.java index d5f4fdc5..8b2016ca 100644 --- a/src/main/java/com/apideck/unify/models/components/JournalEntry.java +++ b/src/main/java/com/apideck/unify/models/components/JournalEntry.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -27,7 +26,7 @@ public class JournalEntry { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Journal entry title @@ -48,7 +47,7 @@ public class JournalEntry { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The company or subsidiary id the transaction belongs to @@ -62,14 +61,14 @@ public class JournalEntry { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; /** * Journal entry status */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Reference for the journal entry. @@ -83,7 +82,7 @@ public class JournalEntry { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("posted_at") - private Optional postedAt; + private OffsetDateTime postedAt; /** * Journal symbol of the entry. For example IND for indirect costs @@ -118,7 +117,7 @@ public class JournalEntry { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; /** * Accounting period @@ -132,7 +131,7 @@ public class JournalEntry { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -172,285 +171,250 @@ public class JournalEntry { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public JournalEntry( - @JsonProperty("id") Optional id, - @JsonProperty("title") JsonNullable title, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("status") JsonNullable status, - @JsonProperty("memo") JsonNullable memo, - @JsonProperty("posted_at") Optional postedAt, - @JsonProperty("journal_symbol") JsonNullable journalSymbol, - @JsonProperty("tax_type") JsonNullable taxType, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("number") JsonNullable number, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("accounting_period") JsonNullable accountingPeriod, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(memo, "memo"); - Utils.checkNotNull(postedAt, "postedAt"); - Utils.checkNotNull(journalSymbol, "journalSymbol"); - Utils.checkNotNull(taxType, "taxType"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("memo") @Nullable JsonNullable memo, + @JsonProperty("posted_at") @Nullable OffsetDateTime postedAt, + @JsonProperty("journal_symbol") @Nullable JsonNullable journalSymbol, + @JsonProperty("tax_type") @Nullable JsonNullable taxType, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("accounting_period") @Nullable JsonNullable accountingPeriod, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.title = title; - this.currencyRate = currencyRate; - this.currency = currency; - this.companyId = companyId; + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); this.lineItems = lineItems; - this.status = status; - this.memo = memo; + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.memo = Optional.ofNullable(memo) + .orElse(JsonNullable.undefined()); this.postedAt = postedAt; - this.journalSymbol = journalSymbol; - this.taxType = taxType; - this.taxCode = taxCode; - this.number = number; - this.trackingCategories = trackingCategories; - this.accountingPeriod = accountingPeriod; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; - this.rowVersion = rowVersion; + this.journalSymbol = Optional.ofNullable(journalSymbol) + .orElse(JsonNullable.undefined()); + this.taxType = Optional.ofNullable(taxType) + .orElse(JsonNullable.undefined()); + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.accountingPeriod = Optional.ofNullable(accountingPeriod) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.customFields = customFields; this.passThrough = passThrough; } public JournalEntry() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Journal entry title */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Requires a minimum of 2 line items that sum to 0 */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } /** * Journal entry status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Reference for the journal entry. */ - @JsonIgnore public JsonNullable memo() { - return memo; + return this.memo; } /** * This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. */ - @JsonIgnore public Optional postedAt() { - return postedAt; + return Optional.ofNullable(this.postedAt); } /** * Journal symbol of the entry. For example IND for indirect costs */ - @JsonIgnore public JsonNullable journalSymbol() { - return journalSymbol; + return this.journalSymbol; } /** * The specific category of tax associated with a transaction like sales or purchase */ - @JsonIgnore public JsonNullable taxType() { - return taxType; + return this.taxType; } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } /** * Journal entry number. */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } /** * Accounting period */ - @JsonIgnore public JsonNullable accountingPeriod() { - return accountingPeriod; + return this.accountingPeriod; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -461,416 +425,207 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public JournalEntry withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public JournalEntry withId(Optional id) { - Utils.checkNotNull(id, "id"); + public JournalEntry withId(@Nullable String id) { this.id = id; return this; } + /** * Journal entry title */ - public JournalEntry withTitle(String title) { - Utils.checkNotNull(title, "title"); + public JournalEntry withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * Journal entry title - */ - public JournalEntry withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public JournalEntry withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public JournalEntry withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public JournalEntry withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public JournalEntry withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public JournalEntry withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public JournalEntry withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public JournalEntry withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public JournalEntry withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public JournalEntry withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** - * Requires a minimum of 2 line items that sum to 0 - */ - public JournalEntry withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - /** * Requires a minimum of 2 line items that sum to 0 */ - public JournalEntry withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public JournalEntry withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } + /** * Journal entry status */ - public JournalEntry withStatus(JournalEntryStatus status) { - Utils.checkNotNull(status, "status"); + public JournalEntry withStatus(@Nullable JournalEntryStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Journal entry status - */ - public JournalEntry withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Reference for the journal entry. */ - public JournalEntry withMemo(String memo) { - Utils.checkNotNull(memo, "memo"); + public JournalEntry withMemo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * Reference for the journal entry. - */ - public JournalEntry withMemo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } - - /** - * This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. - */ - public JournalEntry withPostedAt(OffsetDateTime postedAt) { - Utils.checkNotNull(postedAt, "postedAt"); - this.postedAt = Optional.ofNullable(postedAt); - return this; - } - /** * This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. */ - public JournalEntry withPostedAt(Optional postedAt) { - Utils.checkNotNull(postedAt, "postedAt"); + public JournalEntry withPostedAt(@Nullable OffsetDateTime postedAt) { this.postedAt = postedAt; return this; } + /** * Journal symbol of the entry. For example IND for indirect costs */ - public JournalEntry withJournalSymbol(String journalSymbol) { - Utils.checkNotNull(journalSymbol, "journalSymbol"); + public JournalEntry withJournalSymbol(@Nullable String journalSymbol) { this.journalSymbol = JsonNullable.of(journalSymbol); return this; } - /** - * Journal symbol of the entry. For example IND for indirect costs - */ - public JournalEntry withJournalSymbol(JsonNullable journalSymbol) { - Utils.checkNotNull(journalSymbol, "journalSymbol"); - this.journalSymbol = journalSymbol; - return this; - } /** * The specific category of tax associated with a transaction like sales or purchase */ - public JournalEntry withTaxType(String taxType) { - Utils.checkNotNull(taxType, "taxType"); + public JournalEntry withTaxType(@Nullable String taxType) { this.taxType = JsonNullable.of(taxType); return this; } - /** - * The specific category of tax associated with a transaction like sales or purchase - */ - public JournalEntry withTaxType(JsonNullable taxType) { - Utils.checkNotNull(taxType, "taxType"); - this.taxType = taxType; - return this; - } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public JournalEntry withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public JournalEntry withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public JournalEntry withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } /** * Journal entry number. */ - public JournalEntry withNumber(String number) { - Utils.checkNotNull(number, "number"); + public JournalEntry withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Journal entry number. - */ - public JournalEntry withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * A list of linked tracking categories. */ - public JournalEntry withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public JournalEntry withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public JournalEntry withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } /** * Accounting period */ - public JournalEntry withAccountingPeriod(String accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + public JournalEntry withAccountingPeriod(@Nullable String accountingPeriod) { this.accountingPeriod = JsonNullable.of(accountingPeriod); return this; } - /** - * Accounting period - */ - public JournalEntry withAccountingPeriod(JsonNullable accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - this.accountingPeriod = accountingPeriod; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public JournalEntry withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public JournalEntry withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public JournalEntry withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public JournalEntry withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public JournalEntry withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public JournalEntry withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public JournalEntry withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public JournalEntry withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public JournalEntry withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public JournalEntry withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public JournalEntry withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public JournalEntry withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public JournalEntry withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public JournalEntry withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public JournalEntry withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public JournalEntry withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public JournalEntry withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public JournalEntry withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - public JournalEntry withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public JournalEntry withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public JournalEntry withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public JournalEntry withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public JournalEntry withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public JournalEntry withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -950,489 +705,238 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable memo = JsonNullable.undefined(); + private JsonNullable memo; - private Optional postedAt = Optional.empty(); + private OffsetDateTime postedAt; - private JsonNullable journalSymbol = JsonNullable.undefined(); + private JsonNullable journalSymbol; - private JsonNullable taxType = JsonNullable.undefined(); + private JsonNullable taxType; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable accountingPeriod = JsonNullable.undefined(); + private JsonNullable accountingPeriod; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> customFields = Optional.empty(); + private List customFields; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Journal entry title */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * Journal entry title - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Requires a minimum of 2 line items that sum to 0 */ - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - /** - * Requires a minimum of 2 line items that sum to 0 - */ - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - /** * Journal entry status */ - public Builder status(JournalEntryStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable JournalEntryStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Journal entry status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Reference for the journal entry. */ - public Builder memo(String memo) { - Utils.checkNotNull(memo, "memo"); + public Builder memo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * Reference for the journal entry. - */ - public Builder memo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } - - - /** - * This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. - */ - public Builder postedAt(OffsetDateTime postedAt) { - Utils.checkNotNull(postedAt, "postedAt"); - this.postedAt = Optional.ofNullable(postedAt); - return this; - } - /** * This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. */ - public Builder postedAt(Optional postedAt) { - Utils.checkNotNull(postedAt, "postedAt"); + public Builder postedAt(@Nullable OffsetDateTime postedAt) { this.postedAt = postedAt; return this; } - /** * Journal symbol of the entry. For example IND for indirect costs */ - public Builder journalSymbol(String journalSymbol) { - Utils.checkNotNull(journalSymbol, "journalSymbol"); + public Builder journalSymbol(@Nullable String journalSymbol) { this.journalSymbol = JsonNullable.of(journalSymbol); return this; } - /** - * Journal symbol of the entry. For example IND for indirect costs - */ - public Builder journalSymbol(JsonNullable journalSymbol) { - Utils.checkNotNull(journalSymbol, "journalSymbol"); - this.journalSymbol = journalSymbol; - return this; - } - - /** * The specific category of tax associated with a transaction like sales or purchase */ - public Builder taxType(String taxType) { - Utils.checkNotNull(taxType, "taxType"); + public Builder taxType(@Nullable String taxType) { this.taxType = JsonNullable.of(taxType); return this; } - /** - * The specific category of tax associated with a transaction like sales or purchase - */ - public Builder taxType(JsonNullable taxType) { - Utils.checkNotNull(taxType, "taxType"); - this.taxType = taxType; - return this; - } - - /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - /** * Journal entry number. */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Journal entry number. - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** * Accounting period */ - public Builder accountingPeriod(String accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + public Builder accountingPeriod(@Nullable String accountingPeriod) { this.accountingPeriod = JsonNullable.of(accountingPeriod); return this; } - /** - * Accounting period - */ - public Builder accountingPeriod(JsonNullable accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - this.accountingPeriod = accountingPeriod; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public JournalEntry build() { - return new JournalEntry( id, title, currencyRate, currency, companyId, lineItems, diff --git a/src/main/java/com/apideck/unify/models/components/JournalEntryInput.java b/src/main/java/com/apideck/unify/models/components/JournalEntryInput.java index d992b6c9..59702e8a 100644 --- a/src/main/java/com/apideck/unify/models/components/JournalEntryInput.java +++ b/src/main/java/com/apideck/unify/models/components/JournalEntryInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -39,7 +38,7 @@ public class JournalEntryInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The company or subsidiary id the transaction belongs to @@ -53,14 +52,14 @@ public class JournalEntryInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; /** * Journal entry status */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Reference for the journal entry. @@ -74,7 +73,7 @@ public class JournalEntryInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("posted_at") - private Optional postedAt; + private OffsetDateTime postedAt; /** * Journal symbol of the entry. For example IND for indirect costs @@ -109,7 +108,7 @@ public class JournalEntryInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; /** * Accounting period @@ -128,216 +127,189 @@ public class JournalEntryInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public JournalEntryInput( - @JsonProperty("title") JsonNullable title, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("status") JsonNullable status, - @JsonProperty("memo") JsonNullable memo, - @JsonProperty("posted_at") Optional postedAt, - @JsonProperty("journal_symbol") JsonNullable journalSymbol, - @JsonProperty("tax_type") JsonNullable taxType, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("number") JsonNullable number, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("accounting_period") JsonNullable accountingPeriod, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(memo, "memo"); - Utils.checkNotNull(postedAt, "postedAt"); - Utils.checkNotNull(journalSymbol, "journalSymbol"); - Utils.checkNotNull(taxType, "taxType"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(passThrough, "passThrough"); - this.title = title; - this.currencyRate = currencyRate; - this.currency = currency; - this.companyId = companyId; + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("memo") @Nullable JsonNullable memo, + @JsonProperty("posted_at") @Nullable OffsetDateTime postedAt, + @JsonProperty("journal_symbol") @Nullable JsonNullable journalSymbol, + @JsonProperty("tax_type") @Nullable JsonNullable taxType, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("accounting_period") @Nullable JsonNullable accountingPeriod, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); this.lineItems = lineItems; - this.status = status; - this.memo = memo; + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.memo = Optional.ofNullable(memo) + .orElse(JsonNullable.undefined()); this.postedAt = postedAt; - this.journalSymbol = journalSymbol; - this.taxType = taxType; - this.taxCode = taxCode; - this.number = number; - this.trackingCategories = trackingCategories; - this.accountingPeriod = accountingPeriod; - this.rowVersion = rowVersion; + this.journalSymbol = Optional.ofNullable(journalSymbol) + .orElse(JsonNullable.undefined()); + this.taxType = Optional.ofNullable(taxType) + .orElse(JsonNullable.undefined()); + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.accountingPeriod = Optional.ofNullable(accountingPeriod) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.customFields = customFields; this.passThrough = passThrough; } public JournalEntryInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * Journal entry title */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Requires a minimum of 2 line items that sum to 0 */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } /** * Journal entry status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Reference for the journal entry. */ - @JsonIgnore public JsonNullable memo() { - return memo; + return this.memo; } /** * This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. */ - @JsonIgnore public Optional postedAt() { - return postedAt; + return Optional.ofNullable(this.postedAt); } /** * Journal symbol of the entry. For example IND for indirect costs */ - @JsonIgnore public JsonNullable journalSymbol() { - return journalSymbol; + return this.journalSymbol; } /** * The specific category of tax associated with a transaction like sales or purchase */ - @JsonIgnore public JsonNullable taxType() { - return taxType; + return this.taxType; } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } /** * Journal entry number. */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } /** * Accounting period */ - @JsonIgnore public JsonNullable accountingPeriod() { - return accountingPeriod; + return this.accountingPeriod; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -348,307 +320,153 @@ public static Builder builder() { /** * Journal entry title */ - public JournalEntryInput withTitle(String title) { - Utils.checkNotNull(title, "title"); + public JournalEntryInput withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * Journal entry title - */ - public JournalEntryInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public JournalEntryInput withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public JournalEntryInput withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public JournalEntryInput withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public JournalEntryInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public JournalEntryInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public JournalEntryInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public JournalEntryInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public JournalEntryInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public JournalEntryInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** - * Requires a minimum of 2 line items that sum to 0 - */ - public JournalEntryInput withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - /** * Requires a minimum of 2 line items that sum to 0 */ - public JournalEntryInput withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public JournalEntryInput withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } + /** * Journal entry status */ - public JournalEntryInput withStatus(JournalEntryStatus status) { - Utils.checkNotNull(status, "status"); + public JournalEntryInput withStatus(@Nullable JournalEntryStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Journal entry status - */ - public JournalEntryInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Reference for the journal entry. */ - public JournalEntryInput withMemo(String memo) { - Utils.checkNotNull(memo, "memo"); + public JournalEntryInput withMemo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * Reference for the journal entry. - */ - public JournalEntryInput withMemo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } - - /** - * This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. - */ - public JournalEntryInput withPostedAt(OffsetDateTime postedAt) { - Utils.checkNotNull(postedAt, "postedAt"); - this.postedAt = Optional.ofNullable(postedAt); - return this; - } - /** * This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. */ - public JournalEntryInput withPostedAt(Optional postedAt) { - Utils.checkNotNull(postedAt, "postedAt"); + public JournalEntryInput withPostedAt(@Nullable OffsetDateTime postedAt) { this.postedAt = postedAt; return this; } + /** * Journal symbol of the entry. For example IND for indirect costs */ - public JournalEntryInput withJournalSymbol(String journalSymbol) { - Utils.checkNotNull(journalSymbol, "journalSymbol"); + public JournalEntryInput withJournalSymbol(@Nullable String journalSymbol) { this.journalSymbol = JsonNullable.of(journalSymbol); return this; } - /** - * Journal symbol of the entry. For example IND for indirect costs - */ - public JournalEntryInput withJournalSymbol(JsonNullable journalSymbol) { - Utils.checkNotNull(journalSymbol, "journalSymbol"); - this.journalSymbol = journalSymbol; - return this; - } /** * The specific category of tax associated with a transaction like sales or purchase */ - public JournalEntryInput withTaxType(String taxType) { - Utils.checkNotNull(taxType, "taxType"); + public JournalEntryInput withTaxType(@Nullable String taxType) { this.taxType = JsonNullable.of(taxType); return this; } - /** - * The specific category of tax associated with a transaction like sales or purchase - */ - public JournalEntryInput withTaxType(JsonNullable taxType) { - Utils.checkNotNull(taxType, "taxType"); - this.taxType = taxType; - return this; - } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public JournalEntryInput withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public JournalEntryInput withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public JournalEntryInput withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } /** * Journal entry number. */ - public JournalEntryInput withNumber(String number) { - Utils.checkNotNull(number, "number"); + public JournalEntryInput withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Journal entry number. - */ - public JournalEntryInput withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * A list of linked tracking categories. */ - public JournalEntryInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public JournalEntryInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public JournalEntryInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } /** * Accounting period */ - public JournalEntryInput withAccountingPeriod(String accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + public JournalEntryInput withAccountingPeriod(@Nullable String accountingPeriod) { this.accountingPeriod = JsonNullable.of(accountingPeriod); return this; } - /** - * Accounting period - */ - public JournalEntryInput withAccountingPeriod(JsonNullable accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - this.accountingPeriod = accountingPeriod; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public JournalEntryInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public JournalEntryInput withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public JournalEntryInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - public JournalEntryInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public JournalEntryInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public JournalEntryInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public JournalEntryInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public JournalEntryInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public JournalEntryInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -714,363 +532,178 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable memo = JsonNullable.undefined(); + private JsonNullable memo; - private Optional postedAt = Optional.empty(); + private OffsetDateTime postedAt; - private JsonNullable journalSymbol = JsonNullable.undefined(); + private JsonNullable journalSymbol; - private JsonNullable taxType = JsonNullable.undefined(); + private JsonNullable taxType; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable accountingPeriod = JsonNullable.undefined(); + private JsonNullable accountingPeriod; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> customFields = Optional.empty(); + private List customFields; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Journal entry title */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * Journal entry title - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Requires a minimum of 2 line items that sum to 0 */ - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - /** - * Requires a minimum of 2 line items that sum to 0 - */ - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - /** * Journal entry status */ - public Builder status(JournalEntryStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable JournalEntryStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Journal entry status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Reference for the journal entry. */ - public Builder memo(String memo) { - Utils.checkNotNull(memo, "memo"); + public Builder memo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * Reference for the journal entry. - */ - public Builder memo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } - - - /** - * This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. - */ - public Builder postedAt(OffsetDateTime postedAt) { - Utils.checkNotNull(postedAt, "postedAt"); - this.postedAt = Optional.ofNullable(postedAt); - return this; - } - /** * This is the date on which the journal entry was added. This can be different from the creation date and can also be backdated. */ - public Builder postedAt(Optional postedAt) { - Utils.checkNotNull(postedAt, "postedAt"); + public Builder postedAt(@Nullable OffsetDateTime postedAt) { this.postedAt = postedAt; return this; } - /** * Journal symbol of the entry. For example IND for indirect costs */ - public Builder journalSymbol(String journalSymbol) { - Utils.checkNotNull(journalSymbol, "journalSymbol"); + public Builder journalSymbol(@Nullable String journalSymbol) { this.journalSymbol = JsonNullable.of(journalSymbol); return this; } - /** - * Journal symbol of the entry. For example IND for indirect costs - */ - public Builder journalSymbol(JsonNullable journalSymbol) { - Utils.checkNotNull(journalSymbol, "journalSymbol"); - this.journalSymbol = journalSymbol; - return this; - } - - /** * The specific category of tax associated with a transaction like sales or purchase */ - public Builder taxType(String taxType) { - Utils.checkNotNull(taxType, "taxType"); + public Builder taxType(@Nullable String taxType) { this.taxType = JsonNullable.of(taxType); return this; } - /** - * The specific category of tax associated with a transaction like sales or purchase - */ - public Builder taxType(JsonNullable taxType) { - Utils.checkNotNull(taxType, "taxType"); - this.taxType = taxType; - return this; - } - - /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - /** * Journal entry number. */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Journal entry number. - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** * Accounting period */ - public Builder accountingPeriod(String accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); + public Builder accountingPeriod(@Nullable String accountingPeriod) { this.accountingPeriod = JsonNullable.of(accountingPeriod); return this; } - /** - * Accounting period - */ - public Builder accountingPeriod(JsonNullable accountingPeriod) { - Utils.checkNotNull(accountingPeriod, "accountingPeriod"); - this.accountingPeriod = accountingPeriod; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public JournalEntryInput build() { - return new JournalEntryInput( title, currencyRate, currency, companyId, lineItems, status, diff --git a/src/main/java/com/apideck/unify/models/components/JournalEntryLineItem.java b/src/main/java/com/apideck/unify/models/components/JournalEntryLineItem.java index 5010eb13..f7cc209a 100644 --- a/src/main/java/com/apideck/unify/models/components/JournalEntryLineItem.java +++ b/src/main/java/com/apideck/unify/models/components/JournalEntryLineItem.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Deprecated; import java.lang.Double; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,7 +26,7 @@ public class JournalEntryLineItem { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * User defined description @@ -65,7 +65,7 @@ public class JournalEntryLineItem { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRate taxRate; /** * @@ -74,33 +74,33 @@ public class JournalEntryLineItem { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_category") @Deprecated - private JsonNullable trackingCategory; + private JsonNullable trackingCategory; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.ALWAYS) @JsonProperty("ledger_account") - private Optional ledgerAccount; + private JsonNullable ledgerAccount; /** * The customer this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer") - private JsonNullable customer; + private JsonNullable customer; /** * The supplier this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier") - private JsonNullable supplier; + private JsonNullable supplier; /** * The ID of the department @@ -125,114 +125,103 @@ public class JournalEntryLineItem { @JsonCreator public JournalEntryLineItem( - @JsonProperty("id") Optional id, - @JsonProperty("description") JsonNullable description, - @JsonProperty("tax_amount") JsonNullable taxAmount, - @JsonProperty("sub_total") JsonNullable subTotal, - @JsonProperty("total_amount") JsonNullable totalAmount, - @JsonProperty("type") JournalEntryLineItemType type, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("tracking_category") JsonNullable trackingCategory, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("ledger_account") Optional ledgerAccount, - @JsonProperty("customer") JsonNullable customer, - @JsonProperty("supplier") JsonNullable supplier, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("location_id") JsonNullable locationId, - @JsonProperty("line_number") JsonNullable lineNumber) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(taxAmount, "taxAmount"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(trackingCategory, "trackingCategory"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(customer, "customer"); - Utils.checkNotNull(supplier, "supplier"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(locationId, "locationId"); - Utils.checkNotNull(lineNumber, "lineNumber"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("tax_amount") @Nullable JsonNullable taxAmount, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, + @JsonProperty("total_amount") @Nullable JsonNullable totalAmount, + @JsonProperty("type") @Nonnull JournalEntryLineItemType type, + @JsonProperty("tax_rate") @Nullable LinkedTaxRate taxRate, + @JsonProperty("tracking_category") @Nullable JsonNullable trackingCategory, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("ledger_account") @Nullable LinkedLedgerAccount ledgerAccount, + @JsonProperty("customer") @Nullable JsonNullable customer, + @JsonProperty("supplier") @Nullable JsonNullable supplier, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("location_id") @Nullable JsonNullable locationId, + @JsonProperty("line_number") @Nullable JsonNullable lineNumber) { this.id = id; - this.description = description; - this.taxAmount = taxAmount; - this.subTotal = subTotal; - this.totalAmount = totalAmount; - this.type = type; + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.taxAmount = Optional.ofNullable(taxAmount) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); + this.totalAmount = Optional.ofNullable(totalAmount) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElseThrow(() -> new IllegalArgumentException("type cannot be null")); this.taxRate = taxRate; - this.trackingCategory = trackingCategory; - this.trackingCategories = trackingCategories; - this.ledgerAccount = ledgerAccount; - this.customer = customer; - this.supplier = supplier; - this.departmentId = departmentId; - this.locationId = locationId; - this.lineNumber = lineNumber; + this.trackingCategory = Optional.ofNullable(trackingCategory) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.ledgerAccount = JsonNullable.of(ledgerAccount); + this.customer = Optional.ofNullable(customer) + .orElse(JsonNullable.undefined()); + this.supplier = Optional.ofNullable(supplier) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); + this.locationId = Optional.ofNullable(locationId) + .orElse(JsonNullable.undefined()); + this.lineNumber = Optional.ofNullable(lineNumber) + .orElse(JsonNullable.undefined()); } public JournalEntryLineItem( - JournalEntryLineItemType type) { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), type, - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + @Nonnull JournalEntryLineItemType type) { + this(null, null, null, + null, null, type, + null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * User defined description */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Tax amount */ - @JsonIgnore public JsonNullable taxAmount() { - return taxAmount; + return this.taxAmount; } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Debit entries are considered positive, and credit entries are considered negative. */ - @JsonIgnore public JsonNullable totalAmount() { - return totalAmount; + return this.totalAmount; } /** * Debit entries are considered positive, and credit entries are considered negative. */ - @JsonIgnore public JournalEntryLineItemType type() { - return type; + return this.type; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } /** @@ -240,67 +229,54 @@ public Optional taxRate() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable trackingCategory() { - return (JsonNullable) trackingCategory; + return this.trackingCategory; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore - public Optional ledgerAccount() { - return (Optional) ledgerAccount; + public JsonNullable ledgerAccount() { + return this.ledgerAccount; } /** * The customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable customer() { - return (JsonNullable) customer; + return this.customer; } /** * The supplier this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable supplier() { - return (JsonNullable) supplier; + return this.supplier; } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } /** * The ID of the location */ - @JsonIgnore public JsonNullable locationId() { - return locationId; + return this.locationId; } /** * Line number of the resource */ - @JsonIgnore public JsonNullable lineNumber() { - return lineNumber; + return this.lineNumber; } public static Builder builder() { @@ -311,258 +287,133 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public JournalEntryLineItem withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public JournalEntryLineItem withId(Optional id) { - Utils.checkNotNull(id, "id"); + public JournalEntryLineItem withId(@Nullable String id) { this.id = id; return this; } + /** * User defined description */ - public JournalEntryLineItem withDescription(String description) { - Utils.checkNotNull(description, "description"); + public JournalEntryLineItem withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public JournalEntryLineItem withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * Tax amount */ - public JournalEntryLineItem withTaxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public JournalEntryLineItem withTaxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public JournalEntryLineItem withTaxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } /** * Sub-total amount, normally before tax. */ - public JournalEntryLineItem withSubTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public JournalEntryLineItem withSubTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public JournalEntryLineItem withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Debit entries are considered positive, and credit entries are considered negative. */ - public JournalEntryLineItem withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public JournalEntryLineItem withTotalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Debit entries are considered positive, and credit entries are considered negative. - */ - public JournalEntryLineItem withTotalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } /** * Debit entries are considered positive, and credit entries are considered negative. */ - public JournalEntryLineItem withType(JournalEntryLineItemType type) { - Utils.checkNotNull(type, "type"); - this.type = type; + public JournalEntryLineItem withType(@Nonnull JournalEntryLineItemType type) { + this.type = Utils.checkNotNull(type, "type"); return this; } - public JournalEntryLineItem withTaxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public JournalEntryLineItem withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public JournalEntryLineItem withTaxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } + /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public JournalEntryLineItem withTrackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public JournalEntryLineItem withTrackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public JournalEntryLineItem withTrackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } /** * A list of linked tracking categories. */ - public JournalEntryLineItem withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public JournalEntryLineItem withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public JournalEntryLineItem withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - public JournalEntryLineItem withLedgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = Optional.ofNullable(ledgerAccount); + public JournalEntryLineItem withLedgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { + this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public JournalEntryLineItem withLedgerAccount(Optional ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - /** * The customer this entity is linked to. */ - public JournalEntryLineItem withCustomer(LinkedCustomer customer) { - Utils.checkNotNull(customer, "customer"); + public JournalEntryLineItem withCustomer(@Nullable LinkedCustomer customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public JournalEntryLineItem withCustomer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } /** * The supplier this entity is linked to. */ - public JournalEntryLineItem withSupplier(LinkedSupplier supplier) { - Utils.checkNotNull(supplier, "supplier"); + public JournalEntryLineItem withSupplier(@Nullable LinkedSupplier supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public JournalEntryLineItem withSupplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } /** * The ID of the department */ - public JournalEntryLineItem withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public JournalEntryLineItem withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public JournalEntryLineItem withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } /** * The ID of the location */ - public JournalEntryLineItem withLocationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public JournalEntryLineItem withLocationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public JournalEntryLineItem withLocationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } /** * Line number of the resource */ - public JournalEntryLineItem withLineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public JournalEntryLineItem withLineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public JournalEntryLineItem withLineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -624,123 +475,77 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable taxAmount = JsonNullable.undefined(); + private JsonNullable taxAmount; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private JsonNullable totalAmount = JsonNullable.undefined(); + private JsonNullable totalAmount; private JournalEntryLineItemType type; - private Optional taxRate = Optional.empty(); + private LinkedTaxRate taxRate; @Deprecated - private JsonNullable trackingCategory = JsonNullable.undefined(); + private JsonNullable trackingCategory; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional ledgerAccount = Optional.empty(); + private LinkedLedgerAccount ledgerAccount; - private JsonNullable customer = JsonNullable.undefined(); + private JsonNullable customer; - private JsonNullable supplier = JsonNullable.undefined(); + private JsonNullable supplier; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private JsonNullable locationId = JsonNullable.undefined(); + private JsonNullable locationId; - private JsonNullable lineNumber = JsonNullable.undefined(); + private JsonNullable lineNumber; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * User defined description */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * Tax amount */ - public Builder taxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public Builder taxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public Builder taxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } - - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Debit entries are considered positive, and credit entries are considered negative. */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } @@ -748,187 +553,80 @@ public Builder totalAmount(double totalAmount) { /** * Debit entries are considered positive, and credit entries are considered negative. */ - public Builder totalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - - /** - * Debit entries are considered positive, and credit entries are considered negative. - */ - public Builder type(JournalEntryLineItemType type) { - Utils.checkNotNull(type, "type"); - this.type = type; + public Builder type(@Nonnull JournalEntryLineItemType type) { + this.type = Utils.checkNotNull(type, "type"); return this; } - - public Builder taxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder trackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public Builder trackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder trackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder ledgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = Optional.ofNullable(ledgerAccount); - return this; - } - - public Builder ledgerAccount(Optional ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = ledgerAccount; return this; } - /** * The customer this entity is linked to. */ - public Builder customer(LinkedCustomer customer) { - Utils.checkNotNull(customer, "customer"); + public Builder customer(@Nullable LinkedCustomer customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public Builder customer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } - - /** * The supplier this entity is linked to. */ - public Builder supplier(LinkedSupplier supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Builder supplier(@Nullable LinkedSupplier supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public Builder supplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } - - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - /** * The ID of the location */ - public Builder locationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public Builder locationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public Builder locationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } - - /** * Line number of the resource */ - public Builder lineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public Builder lineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public Builder lineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } - public JournalEntryLineItem build() { - return new JournalEntryLineItem( id, description, taxAmount, subTotal, totalAmount, type, diff --git a/src/main/java/com/apideck/unify/models/components/JournalEntryLineItemInput.java b/src/main/java/com/apideck/unify/models/components/JournalEntryLineItemInput.java index 466583d7..feb6678a 100644 --- a/src/main/java/com/apideck/unify/models/components/JournalEntryLineItemInput.java +++ b/src/main/java/com/apideck/unify/models/components/JournalEntryLineItemInput.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Deprecated; import java.lang.Double; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -58,7 +58,7 @@ public class JournalEntryLineItemInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRateInput taxRate; /** * @@ -67,33 +67,33 @@ public class JournalEntryLineItemInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_category") @Deprecated - private JsonNullable trackingCategory; + private JsonNullable trackingCategory; /** * A list of linked tracking categories. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.ALWAYS) @JsonProperty("ledger_account") - private Optional ledgerAccount; + private JsonNullable ledgerAccount; /** * The customer this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer") - private JsonNullable customer; + private JsonNullable customer; /** * The supplier this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier") - private JsonNullable supplier; + private JsonNullable supplier; /** * The ID of the department @@ -118,103 +118,94 @@ public class JournalEntryLineItemInput { @JsonCreator public JournalEntryLineItemInput( - @JsonProperty("description") JsonNullable description, - @JsonProperty("tax_amount") JsonNullable taxAmount, - @JsonProperty("sub_total") JsonNullable subTotal, - @JsonProperty("total_amount") JsonNullable totalAmount, - @JsonProperty("type") JournalEntryLineItemType type, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("tracking_category") JsonNullable trackingCategory, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("ledger_account") Optional ledgerAccount, - @JsonProperty("customer") JsonNullable customer, - @JsonProperty("supplier") JsonNullable supplier, - @JsonProperty("department_id") JsonNullable departmentId, - @JsonProperty("location_id") JsonNullable locationId, - @JsonProperty("line_number") JsonNullable lineNumber) { - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(taxAmount, "taxAmount"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(trackingCategory, "trackingCategory"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(customer, "customer"); - Utils.checkNotNull(supplier, "supplier"); - Utils.checkNotNull(departmentId, "departmentId"); - Utils.checkNotNull(locationId, "locationId"); - Utils.checkNotNull(lineNumber, "lineNumber"); - this.description = description; - this.taxAmount = taxAmount; - this.subTotal = subTotal; - this.totalAmount = totalAmount; - this.type = type; + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("tax_amount") @Nullable JsonNullable taxAmount, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, + @JsonProperty("total_amount") @Nullable JsonNullable totalAmount, + @JsonProperty("type") @Nonnull JournalEntryLineItemType type, + @JsonProperty("tax_rate") @Nullable LinkedTaxRateInput taxRate, + @JsonProperty("tracking_category") @Nullable JsonNullable trackingCategory, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("ledger_account") @Nullable LinkedLedgerAccountInput ledgerAccount, + @JsonProperty("customer") @Nullable JsonNullable customer, + @JsonProperty("supplier") @Nullable JsonNullable supplier, + @JsonProperty("department_id") @Nullable JsonNullable departmentId, + @JsonProperty("location_id") @Nullable JsonNullable locationId, + @JsonProperty("line_number") @Nullable JsonNullable lineNumber) { + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.taxAmount = Optional.ofNullable(taxAmount) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); + this.totalAmount = Optional.ofNullable(totalAmount) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElseThrow(() -> new IllegalArgumentException("type cannot be null")); this.taxRate = taxRate; - this.trackingCategory = trackingCategory; - this.trackingCategories = trackingCategories; - this.ledgerAccount = ledgerAccount; - this.customer = customer; - this.supplier = supplier; - this.departmentId = departmentId; - this.locationId = locationId; - this.lineNumber = lineNumber; + this.trackingCategory = Optional.ofNullable(trackingCategory) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.ledgerAccount = JsonNullable.of(ledgerAccount); + this.customer = Optional.ofNullable(customer) + .orElse(JsonNullable.undefined()); + this.supplier = Optional.ofNullable(supplier) + .orElse(JsonNullable.undefined()); + this.departmentId = Optional.ofNullable(departmentId) + .orElse(JsonNullable.undefined()); + this.locationId = Optional.ofNullable(locationId) + .orElse(JsonNullable.undefined()); + this.lineNumber = Optional.ofNullable(lineNumber) + .orElse(JsonNullable.undefined()); } public JournalEntryLineItemInput( - JournalEntryLineItemType type) { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), type, Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + @Nonnull JournalEntryLineItemType type) { + this(null, null, null, + null, type, null, + null, null, null, + null, null, null, + null, null); } /** * User defined description */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Tax amount */ - @JsonIgnore public JsonNullable taxAmount() { - return taxAmount; + return this.taxAmount; } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Debit entries are considered positive, and credit entries are considered negative. */ - @JsonIgnore public JsonNullable totalAmount() { - return totalAmount; + return this.totalAmount; } /** * Debit entries are considered positive, and credit entries are considered negative. */ - @JsonIgnore public JournalEntryLineItemType type() { - return type; + return this.type; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } /** @@ -222,67 +213,54 @@ public Optional taxRate() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable trackingCategory() { - return (JsonNullable) trackingCategory; + return this.trackingCategory; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore - public Optional ledgerAccount() { - return (Optional) ledgerAccount; + public JsonNullable ledgerAccount() { + return this.ledgerAccount; } /** * The customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable customer() { - return (JsonNullable) customer; + return this.customer; } /** * The supplier this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable supplier() { - return (JsonNullable) supplier; + return this.supplier; } /** * The ID of the department */ - @JsonIgnore public JsonNullable departmentId() { - return departmentId; + return this.departmentId; } /** * The ID of the location */ - @JsonIgnore public JsonNullable locationId() { - return locationId; + return this.locationId; } /** * Line number of the resource */ - @JsonIgnore public JsonNullable lineNumber() { - return lineNumber; + return this.lineNumber; } public static Builder builder() { @@ -293,239 +271,124 @@ public static Builder builder() { /** * User defined description */ - public JournalEntryLineItemInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public JournalEntryLineItemInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public JournalEntryLineItemInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * Tax amount */ - public JournalEntryLineItemInput withTaxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public JournalEntryLineItemInput withTaxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public JournalEntryLineItemInput withTaxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } /** * Sub-total amount, normally before tax. */ - public JournalEntryLineItemInput withSubTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public JournalEntryLineItemInput withSubTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public JournalEntryLineItemInput withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Debit entries are considered positive, and credit entries are considered negative. */ - public JournalEntryLineItemInput withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public JournalEntryLineItemInput withTotalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * Debit entries are considered positive, and credit entries are considered negative. - */ - public JournalEntryLineItemInput withTotalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } /** * Debit entries are considered positive, and credit entries are considered negative. */ - public JournalEntryLineItemInput withType(JournalEntryLineItemType type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - public JournalEntryLineItemInput withTaxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); + public JournalEntryLineItemInput withType(@Nonnull JournalEntryLineItemType type) { + this.type = Utils.checkNotNull(type, "type"); return this; } - public JournalEntryLineItemInput withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public JournalEntryLineItemInput withTaxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } + /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public JournalEntryLineItemInput withTrackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public JournalEntryLineItemInput withTrackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public JournalEntryLineItemInput withTrackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } /** * A list of linked tracking categories. */ - public JournalEntryLineItemInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public JournalEntryLineItemInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public JournalEntryLineItemInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - public JournalEntryLineItemInput withLedgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = Optional.ofNullable(ledgerAccount); + public JournalEntryLineItemInput withLedgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { + this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public JournalEntryLineItemInput withLedgerAccount(Optional ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - /** * The customer this entity is linked to. */ - public JournalEntryLineItemInput withCustomer(LinkedCustomerInput customer) { - Utils.checkNotNull(customer, "customer"); + public JournalEntryLineItemInput withCustomer(@Nullable LinkedCustomerInput customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public JournalEntryLineItemInput withCustomer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } /** * The supplier this entity is linked to. */ - public JournalEntryLineItemInput withSupplier(LinkedSupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); + public JournalEntryLineItemInput withSupplier(@Nullable LinkedSupplierInput supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public JournalEntryLineItemInput withSupplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } /** * The ID of the department */ - public JournalEntryLineItemInput withDepartmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public JournalEntryLineItemInput withDepartmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public JournalEntryLineItemInput withDepartmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } /** * The ID of the location */ - public JournalEntryLineItemInput withLocationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public JournalEntryLineItemInput withLocationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public JournalEntryLineItemInput withLocationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } /** * Line number of the resource */ - public JournalEntryLineItemInput withLineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public JournalEntryLineItemInput withLineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public JournalEntryLineItemInput withLineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -585,102 +448,67 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable taxAmount = JsonNullable.undefined(); + private JsonNullable taxAmount; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private JsonNullable totalAmount = JsonNullable.undefined(); + private JsonNullable totalAmount; private JournalEntryLineItemType type; - private Optional taxRate = Optional.empty(); + private LinkedTaxRateInput taxRate; @Deprecated - private JsonNullable trackingCategory = JsonNullable.undefined(); + private JsonNullable trackingCategory; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional ledgerAccount = Optional.empty(); + private LinkedLedgerAccountInput ledgerAccount; - private JsonNullable customer = JsonNullable.undefined(); + private JsonNullable customer; - private JsonNullable supplier = JsonNullable.undefined(); + private JsonNullable supplier; - private JsonNullable departmentId = JsonNullable.undefined(); + private JsonNullable departmentId; - private JsonNullable locationId = JsonNullable.undefined(); + private JsonNullable locationId; - private JsonNullable lineNumber = JsonNullable.undefined(); + private JsonNullable lineNumber; private Builder() { // force use of static builder() method } - /** * User defined description */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * User defined description - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * Tax amount */ - public Builder taxAmount(double taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); + public Builder taxAmount(@Nullable Double taxAmount) { this.taxAmount = JsonNullable.of(taxAmount); return this; } - /** - * Tax amount - */ - public Builder taxAmount(JsonNullable taxAmount) { - Utils.checkNotNull(taxAmount, "taxAmount"); - this.taxAmount = taxAmount; - return this; - } - - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Debit entries are considered positive, and credit entries are considered negative. */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = JsonNullable.of(totalAmount); return this; } @@ -688,187 +516,80 @@ public Builder totalAmount(double totalAmount) { /** * Debit entries are considered positive, and credit entries are considered negative. */ - public Builder totalAmount(JsonNullable totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - - - /** - * Debit entries are considered positive, and credit entries are considered negative. - */ - public Builder type(JournalEntryLineItemType type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - - public Builder taxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); + public Builder type(@Nonnull JournalEntryLineItemType type) { + this.type = Utils.checkNotNull(type, "type"); return this; } - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - /** * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder trackingCategory(DeprecatedLinkedTrackingCategory trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); + public Builder trackingCategory(@Nullable DeprecatedLinkedTrackingCategory trackingCategory) { this.trackingCategory = JsonNullable.of(trackingCategory); return this; } - /** - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder trackingCategory(JsonNullable trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder ledgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = Optional.ofNullable(ledgerAccount); - return this; - } - - public Builder ledgerAccount(Optional ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { this.ledgerAccount = ledgerAccount; return this; } - /** * The customer this entity is linked to. */ - public Builder customer(LinkedCustomerInput customer) { - Utils.checkNotNull(customer, "customer"); + public Builder customer(@Nullable LinkedCustomerInput customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public Builder customer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } - - /** * The supplier this entity is linked to. */ - public Builder supplier(LinkedSupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Builder supplier(@Nullable LinkedSupplierInput supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public Builder supplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } - - /** * The ID of the department */ - public Builder departmentId(String departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); + public Builder departmentId(@Nullable String departmentId) { this.departmentId = JsonNullable.of(departmentId); return this; } - /** - * The ID of the department - */ - public Builder departmentId(JsonNullable departmentId) { - Utils.checkNotNull(departmentId, "departmentId"); - this.departmentId = departmentId; - return this; - } - - /** * The ID of the location */ - public Builder locationId(String locationId) { - Utils.checkNotNull(locationId, "locationId"); + public Builder locationId(@Nullable String locationId) { this.locationId = JsonNullable.of(locationId); return this; } - /** - * The ID of the location - */ - public Builder locationId(JsonNullable locationId) { - Utils.checkNotNull(locationId, "locationId"); - this.locationId = locationId; - return this; - } - - /** * Line number of the resource */ - public Builder lineNumber(long lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); + public Builder lineNumber(@Nullable Long lineNumber) { this.lineNumber = JsonNullable.of(lineNumber); return this; } - /** - * Line number of the resource - */ - public Builder lineNumber(JsonNullable lineNumber) { - Utils.checkNotNull(lineNumber, "lineNumber"); - this.lineNumber = lineNumber; - return this; - } - public JournalEntryLineItemInput build() { - return new JournalEntryLineItemInput( description, taxAmount, subTotal, totalAmount, type, taxRate, diff --git a/src/main/java/com/apideck/unify/models/components/Lead.java b/src/main/java/com/apideck/unify/models/components/Lead.java index cd4e3aee..aa499d7f 100644 --- a/src/main/java/com/apideck/unify/models/components/Lead.java +++ b/src/main/java/com/apideck/unify/models/components/Lead.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -26,7 +26,7 @@ public class Lead { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Full name of the lead. @@ -135,7 +135,7 @@ public class Lead { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The fax number of the lead. @@ -147,44 +147,44 @@ public class Lead { @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("social_links") - private Optional> socialLinks; + private List socialLinks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private JsonNullable> customFields; + private JsonNullable> customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * Date updated in ISO 8601 format @@ -205,329 +205,283 @@ public class Lead { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Lead( - @JsonProperty("id") Optional id, - @JsonProperty("name") String name, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("owner_name") JsonNullable ownerName, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("lead_id") JsonNullable leadId, - @JsonProperty("lead_source") JsonNullable leadSource, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("description") JsonNullable description, - @JsonProperty("prefix") JsonNullable prefix, - @JsonProperty("title") JsonNullable title, - @JsonProperty("language") JsonNullable language, - @JsonProperty("status") JsonNullable status, - @JsonProperty("monetary_amount") JsonNullable monetaryAmount, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("fax") JsonNullable fax, - @JsonProperty("websites") Optional> websites, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("social_links") Optional> socialLinks, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("custom_fields") JsonNullable> customFields, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(ownerName, "ownerName"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(leadId, "leadId"); - Utils.checkNotNull(leadSource, "leadSource"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(prefix, "prefix"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(fax, "fax"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(socialLinks, "socialLinks"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nonnull String name, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("owner_name") @Nullable JsonNullable ownerName, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("lead_id") @Nullable JsonNullable leadId, + @JsonProperty("lead_source") @Nullable JsonNullable leadSource, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("prefix") @Nullable JsonNullable prefix, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("monetary_amount") @Nullable JsonNullable monetaryAmount, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("fax") @Nullable JsonNullable fax, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("social_links") @Nullable List socialLinks, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("custom_fields") @Nullable JsonNullable> customFields, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.name = name; - this.companyName = companyName; - this.ownerId = ownerId; - this.ownerName = ownerName; - this.companyId = companyId; - this.leadId = leadId; - this.leadSource = leadSource; - this.firstName = firstName; - this.lastName = lastName; - this.description = description; - this.prefix = prefix; - this.title = title; - this.language = language; - this.status = status; - this.monetaryAmount = monetaryAmount; - this.currency = currency; - this.fax = fax; + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.ownerName = Optional.ofNullable(ownerName) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.leadId = Optional.ofNullable(leadId) + .orElse(JsonNullable.undefined()); + this.leadSource = Optional.ofNullable(leadSource) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.prefix = Optional.ofNullable(prefix) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.monetaryAmount = Optional.ofNullable(monetaryAmount) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.fax = Optional.ofNullable(fax) + .orElse(JsonNullable.undefined()); this.websites = websites; this.addresses = addresses; this.socialLinks = socialLinks; this.phoneNumbers = phoneNumbers; this.emails = emails; - this.customFields = customFields; - this.tags = tags; - this.customMappings = customMappings; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customFields = Optional.ofNullable(customFields) + .orElse(JsonNullable.undefined()); + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Lead( - String name) { - this(Optional.empty(), name, JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + @Nonnull String name) { + this(null, name, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * Unique identifier for the contact. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Full name of the lead. */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * The name of the company the lead is associated with. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The owner of the lead. */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The name of the owner of the lead. */ - @JsonIgnore public JsonNullable ownerName() { - return ownerName; + return this.ownerName; } /** * The company the lead is associated with. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The identifier of the lead. */ - @JsonIgnore public JsonNullable leadId() { - return leadId; + return this.leadId; } /** * The source of the lead. */ - @JsonIgnore public JsonNullable leadSource() { - return leadSource; + return this.leadSource; } /** * The first name of the lead. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the lead. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * The description of the lead. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The prefix of the lead. */ - @JsonIgnore public JsonNullable prefix() { - return prefix; + return this.prefix; } /** * The job title of the lead. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * The monetary amount of the lead. */ - @JsonIgnore public JsonNullable monetaryAmount() { - return monetaryAmount; + return this.monetaryAmount; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The fax number of the lead. */ - @JsonIgnore public JsonNullable fax() { - return fax; + return this.fax; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> socialLinks() { - return (Optional>) socialLinks; + return Optional.ofNullable(this.socialLinks); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customFields() { - return (JsonNullable>) customFields; + return this.customFields; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * Date updated in ISO 8601 format */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * Date created in ISO 8601 format */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -538,475 +492,240 @@ public static Builder builder() { /** * Unique identifier for the contact. */ - public Lead withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * Unique identifier for the contact. - */ - public Lead withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Lead withId(@Nullable String id) { this.id = id; return this; } + /** * Full name of the lead. */ - public Lead withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Lead withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } + /** * The name of the company the lead is associated with. */ - public Lead withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Lead withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company the lead is associated with. - */ - public Lead withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The owner of the lead. */ - public Lead withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Lead withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the lead. - */ - public Lead withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The name of the owner of the lead. */ - public Lead withOwnerName(String ownerName) { - Utils.checkNotNull(ownerName, "ownerName"); + public Lead withOwnerName(@Nullable String ownerName) { this.ownerName = JsonNullable.of(ownerName); return this; } - /** - * The name of the owner of the lead. - */ - public Lead withOwnerName(JsonNullable ownerName) { - Utils.checkNotNull(ownerName, "ownerName"); - this.ownerName = ownerName; - return this; - } /** * The company the lead is associated with. */ - public Lead withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Lead withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company the lead is associated with. - */ - public Lead withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The identifier of the lead. */ - public Lead withLeadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Lead withLeadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The identifier of the lead. - */ - public Lead withLeadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } /** * The source of the lead. */ - public Lead withLeadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public Lead withLeadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The source of the lead. - */ - public Lead withLeadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } /** * The first name of the lead. */ - public Lead withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Lead withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the lead. - */ - public Lead withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the lead. */ - public Lead withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Lead withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the lead. - */ - public Lead withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * The description of the lead. */ - public Lead withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Lead withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the lead. - */ - public Lead withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The prefix of the lead. */ - public Lead withPrefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public Lead withPrefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * The prefix of the lead. - */ - public Lead withPrefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } /** * The job title of the lead. */ - public Lead withTitle(String title) { - Utils.checkNotNull(title, "title"); + public Lead withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the lead. - */ - public Lead withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public Lead withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public Lead withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Lead withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - public Lead withStatus(String status) { - Utils.checkNotNull(status, "status"); + public Lead withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - public Lead withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The monetary amount of the lead. */ - public Lead withMonetaryAmount(double monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); + public Lead withMonetaryAmount(@Nullable Double monetaryAmount) { this.monetaryAmount = JsonNullable.of(monetaryAmount); return this; } - /** - * The monetary amount of the lead. - */ - public Lead withMonetaryAmount(JsonNullable monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - this.monetaryAmount = monetaryAmount; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Lead withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Lead withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Lead withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The fax number of the lead. */ - public Lead withFax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Lead withFax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the lead. - */ - public Lead withFax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } - public Lead withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - - public Lead withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Lead withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public Lead withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Lead withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Lead withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public Lead withSocialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Lead withSocialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Lead withSocialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - public Lead withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Lead withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Lead withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Lead withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Lead withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Lead withEmails(@Nullable List emails) { this.emails = emails; return this; } - public Lead withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); + + public Lead withCustomFields(@Nullable List customFields) { this.customFields = JsonNullable.of(customFields); return this; } - public Lead withCustomFields(JsonNullable> customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = customFields; - return this; - } - public Lead withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Lead withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Lead withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Lead withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Lead withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Lead withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * Date updated in ISO 8601 format */ - public Lead withUpdatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Lead withUpdatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * Date updated in ISO 8601 format - */ - public Lead withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * Date created in ISO 8601 format */ - public Lead withCreatedAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Lead withCreatedAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * Date created in ISO 8601 format - */ - public Lead withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Lead withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Lead withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Lead withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1100,564 +819,277 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private String name; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable ownerName = JsonNullable.undefined(); + private JsonNullable ownerName; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable leadId = JsonNullable.undefined(); + private JsonNullable leadId; - private JsonNullable leadSource = JsonNullable.undefined(); + private JsonNullable leadSource; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable prefix = JsonNullable.undefined(); + private JsonNullable prefix; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable monetaryAmount = JsonNullable.undefined(); + private JsonNullable monetaryAmount; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable fax = JsonNullable.undefined(); + private JsonNullable fax; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> socialLinks = Optional.empty(); + private List socialLinks; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private JsonNullable> customFields = JsonNullable.undefined(); + private JsonNullable> customFields; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * Unique identifier for the contact. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * Unique identifier for the contact. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Full name of the lead. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** * The name of the company the lead is associated with. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company the lead is associated with. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The owner of the lead. */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the lead. - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The name of the owner of the lead. */ - public Builder ownerName(String ownerName) { - Utils.checkNotNull(ownerName, "ownerName"); + public Builder ownerName(@Nullable String ownerName) { this.ownerName = JsonNullable.of(ownerName); return this; } - /** - * The name of the owner of the lead. - */ - public Builder ownerName(JsonNullable ownerName) { - Utils.checkNotNull(ownerName, "ownerName"); - this.ownerName = ownerName; - return this; - } - - /** * The company the lead is associated with. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company the lead is associated with. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The identifier of the lead. */ - public Builder leadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Builder leadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The identifier of the lead. - */ - public Builder leadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } - - /** * The source of the lead. */ - public Builder leadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public Builder leadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The source of the lead. - */ - public Builder leadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } - - /** * The first name of the lead. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the lead. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the lead. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the lead. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * The description of the lead. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the lead. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The prefix of the lead. */ - public Builder prefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public Builder prefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * The prefix of the lead. - */ - public Builder prefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } - - /** * The job title of the lead. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the lead. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The monetary amount of the lead. */ - public Builder monetaryAmount(double monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); + public Builder monetaryAmount(@Nullable Double monetaryAmount) { this.monetaryAmount = JsonNullable.of(monetaryAmount); return this; } - /** - * The monetary amount of the lead. - */ - public Builder monetaryAmount(JsonNullable monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - this.monetaryAmount = monetaryAmount; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The fax number of the lead. */ - public Builder fax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Builder fax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the lead. - */ - public Builder fax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } - - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder socialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Builder socialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Builder socialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = JsonNullable.of(customFields); return this; } - public Builder customFields(JsonNullable> customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = customFields; - return this; - } - - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * Date updated in ISO 8601 format */ - public Builder updatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * Date updated in ISO 8601 format - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * Date created in ISO 8601 format */ - public Builder createdAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * Date created in ISO 8601 format - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Lead build() { - return new Lead( id, name, companyName, ownerId, ownerName, companyId, diff --git a/src/main/java/com/apideck/unify/models/components/LeadInput.java b/src/main/java/com/apideck/unify/models/components/LeadInput.java index 5eda2da3..873dc1d7 100644 --- a/src/main/java/com/apideck/unify/models/components/LeadInput.java +++ b/src/main/java/com/apideck/unify/models/components/LeadInput.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -126,7 +126,7 @@ public class LeadInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The fax number of the lead. @@ -138,320 +138,280 @@ public class LeadInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("social_links") - private Optional> socialLinks; + private List socialLinks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private JsonNullable> customFields; + private JsonNullable> customFields; @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public LeadInput( - @JsonProperty("name") String name, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("owner_name") JsonNullable ownerName, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("lead_id") JsonNullable leadId, - @JsonProperty("lead_source") JsonNullable leadSource, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("description") JsonNullable description, - @JsonProperty("prefix") JsonNullable prefix, - @JsonProperty("title") JsonNullable title, - @JsonProperty("language") JsonNullable language, - @JsonProperty("status") JsonNullable status, - @JsonProperty("monetary_amount") JsonNullable monetaryAmount, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("fax") JsonNullable fax, - @JsonProperty("websites") Optional> websites, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("social_links") Optional> socialLinks, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("custom_fields") JsonNullable> customFields, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(ownerName, "ownerName"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(leadId, "leadId"); - Utils.checkNotNull(leadSource, "leadSource"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(prefix, "prefix"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(fax, "fax"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(socialLinks, "socialLinks"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(passThrough, "passThrough"); - this.name = name; - this.companyName = companyName; - this.ownerId = ownerId; - this.ownerName = ownerName; - this.companyId = companyId; - this.leadId = leadId; - this.leadSource = leadSource; - this.firstName = firstName; - this.lastName = lastName; - this.description = description; - this.prefix = prefix; - this.title = title; - this.language = language; - this.status = status; - this.monetaryAmount = monetaryAmount; - this.currency = currency; - this.fax = fax; + @JsonProperty("name") @Nonnull String name, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("owner_name") @Nullable JsonNullable ownerName, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("lead_id") @Nullable JsonNullable leadId, + @JsonProperty("lead_source") @Nullable JsonNullable leadSource, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("prefix") @Nullable JsonNullable prefix, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("monetary_amount") @Nullable JsonNullable monetaryAmount, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("fax") @Nullable JsonNullable fax, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("social_links") @Nullable List socialLinks, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("custom_fields") @Nullable JsonNullable> customFields, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.ownerName = Optional.ofNullable(ownerName) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.leadId = Optional.ofNullable(leadId) + .orElse(JsonNullable.undefined()); + this.leadSource = Optional.ofNullable(leadSource) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.prefix = Optional.ofNullable(prefix) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.monetaryAmount = Optional.ofNullable(monetaryAmount) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.fax = Optional.ofNullable(fax) + .orElse(JsonNullable.undefined()); this.websites = websites; this.addresses = addresses; this.socialLinks = socialLinks; this.phoneNumbers = phoneNumbers; this.emails = emails; - this.customFields = customFields; - this.tags = tags; + this.customFields = Optional.ofNullable(customFields) + .orElse(JsonNullable.undefined()); + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public LeadInput( - String name) { - this(name, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + @Nonnull String name) { + this(name, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Full name of the lead. */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * The name of the company the lead is associated with. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The owner of the lead. */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The name of the owner of the lead. */ - @JsonIgnore public JsonNullable ownerName() { - return ownerName; + return this.ownerName; } /** * The company the lead is associated with. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The identifier of the lead. */ - @JsonIgnore public JsonNullable leadId() { - return leadId; + return this.leadId; } /** * The source of the lead. */ - @JsonIgnore public JsonNullable leadSource() { - return leadSource; + return this.leadSource; } /** * The first name of the lead. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the lead. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * The description of the lead. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The prefix of the lead. */ - @JsonIgnore public JsonNullable prefix() { - return prefix; + return this.prefix; } /** * The job title of the lead. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * The monetary amount of the lead. */ - @JsonIgnore public JsonNullable monetaryAmount() { - return monetaryAmount; + return this.monetaryAmount; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The fax number of the lead. */ - @JsonIgnore public JsonNullable fax() { - return fax; + return this.fax; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> socialLinks() { - return (Optional>) socialLinks; + return Optional.ofNullable(this.socialLinks); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customFields() { - return (JsonNullable>) customFields; + return this.customFields; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -462,402 +422,204 @@ public static Builder builder() { /** * Full name of the lead. */ - public LeadInput withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public LeadInput withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } + /** * The name of the company the lead is associated with. */ - public LeadInput withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public LeadInput withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company the lead is associated with. - */ - public LeadInput withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The owner of the lead. */ - public LeadInput withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public LeadInput withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the lead. - */ - public LeadInput withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The name of the owner of the lead. */ - public LeadInput withOwnerName(String ownerName) { - Utils.checkNotNull(ownerName, "ownerName"); + public LeadInput withOwnerName(@Nullable String ownerName) { this.ownerName = JsonNullable.of(ownerName); return this; } - /** - * The name of the owner of the lead. - */ - public LeadInput withOwnerName(JsonNullable ownerName) { - Utils.checkNotNull(ownerName, "ownerName"); - this.ownerName = ownerName; - return this; - } /** * The company the lead is associated with. */ - public LeadInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public LeadInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company the lead is associated with. - */ - public LeadInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The identifier of the lead. */ - public LeadInput withLeadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public LeadInput withLeadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The identifier of the lead. - */ - public LeadInput withLeadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } /** * The source of the lead. */ - public LeadInput withLeadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public LeadInput withLeadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The source of the lead. - */ - public LeadInput withLeadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } /** * The first name of the lead. */ - public LeadInput withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public LeadInput withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the lead. - */ - public LeadInput withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the lead. */ - public LeadInput withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public LeadInput withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the lead. - */ - public LeadInput withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * The description of the lead. */ - public LeadInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public LeadInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the lead. - */ - public LeadInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The prefix of the lead. */ - public LeadInput withPrefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public LeadInput withPrefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * The prefix of the lead. - */ - public LeadInput withPrefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } /** * The job title of the lead. */ - public LeadInput withTitle(String title) { - Utils.checkNotNull(title, "title"); + public LeadInput withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the lead. - */ - public LeadInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public LeadInput withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public LeadInput withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public LeadInput withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - public LeadInput withStatus(String status) { - Utils.checkNotNull(status, "status"); + public LeadInput withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - public LeadInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The monetary amount of the lead. */ - public LeadInput withMonetaryAmount(double monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); + public LeadInput withMonetaryAmount(@Nullable Double monetaryAmount) { this.monetaryAmount = JsonNullable.of(monetaryAmount); return this; } - /** - * The monetary amount of the lead. - */ - public LeadInput withMonetaryAmount(JsonNullable monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - this.monetaryAmount = monetaryAmount; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public LeadInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public LeadInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public LeadInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The fax number of the lead. */ - public LeadInput withFax(String fax) { - Utils.checkNotNull(fax, "fax"); + public LeadInput withFax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the lead. - */ - public LeadInput withFax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } - - public LeadInput withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public LeadInput withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public LeadInput withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public LeadInput withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public LeadInput withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public LeadInput withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public LeadInput withSocialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public LeadInput withSocialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public LeadInput withSocialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - public LeadInput withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public LeadInput withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public LeadInput withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public LeadInput withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public LeadInput withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public LeadInput withEmails(@Nullable List emails) { this.emails = emails; return this; } - public LeadInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); + + public LeadInput withCustomFields(@Nullable List customFields) { this.customFields = JsonNullable.of(customFields); return this; } - public LeadInput withCustomFields(JsonNullable> customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = customFields; - return this; - } - public LeadInput withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + public LeadInput withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public LeadInput withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public LeadInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public LeadInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public LeadInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -944,478 +706,235 @@ public final static class Builder { private String name; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable ownerName = JsonNullable.undefined(); + private JsonNullable ownerName; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable leadId = JsonNullable.undefined(); + private JsonNullable leadId; - private JsonNullable leadSource = JsonNullable.undefined(); + private JsonNullable leadSource; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable prefix = JsonNullable.undefined(); + private JsonNullable prefix; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable monetaryAmount = JsonNullable.undefined(); + private JsonNullable monetaryAmount; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable fax = JsonNullable.undefined(); + private JsonNullable fax; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> socialLinks = Optional.empty(); + private List socialLinks; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private JsonNullable> customFields = JsonNullable.undefined(); + private JsonNullable> customFields; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Full name of the lead. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** * The name of the company the lead is associated with. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company the lead is associated with. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The owner of the lead. */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The owner of the lead. - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The name of the owner of the lead. */ - public Builder ownerName(String ownerName) { - Utils.checkNotNull(ownerName, "ownerName"); + public Builder ownerName(@Nullable String ownerName) { this.ownerName = JsonNullable.of(ownerName); return this; } - /** - * The name of the owner of the lead. - */ - public Builder ownerName(JsonNullable ownerName) { - Utils.checkNotNull(ownerName, "ownerName"); - this.ownerName = ownerName; - return this; - } - - /** * The company the lead is associated with. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company the lead is associated with. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The identifier of the lead. */ - public Builder leadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Builder leadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The identifier of the lead. - */ - public Builder leadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } - - /** * The source of the lead. */ - public Builder leadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public Builder leadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The source of the lead. - */ - public Builder leadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } - - /** * The first name of the lead. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the lead. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the lead. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the lead. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * The description of the lead. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the lead. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The prefix of the lead. */ - public Builder prefix(String prefix) { - Utils.checkNotNull(prefix, "prefix"); + public Builder prefix(@Nullable String prefix) { this.prefix = JsonNullable.of(prefix); return this; } - /** - * The prefix of the lead. - */ - public Builder prefix(JsonNullable prefix) { - Utils.checkNotNull(prefix, "prefix"); - this.prefix = prefix; - return this; - } - - /** * The job title of the lead. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the lead. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The monetary amount of the lead. */ - public Builder monetaryAmount(double monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); + public Builder monetaryAmount(@Nullable Double monetaryAmount) { this.monetaryAmount = JsonNullable.of(monetaryAmount); return this; } - /** - * The monetary amount of the lead. - */ - public Builder monetaryAmount(JsonNullable monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - this.monetaryAmount = monetaryAmount; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The fax number of the lead. */ - public Builder fax(String fax) { - Utils.checkNotNull(fax, "fax"); + public Builder fax(@Nullable String fax) { this.fax = JsonNullable.of(fax); return this; } - /** - * The fax number of the lead. - */ - public Builder fax(JsonNullable fax) { - Utils.checkNotNull(fax, "fax"); - this.fax = fax; - return this; - } - - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder socialLinks(List socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); - this.socialLinks = Optional.ofNullable(socialLinks); - return this; - } - - public Builder socialLinks(Optional> socialLinks) { - Utils.checkNotNull(socialLinks, "socialLinks"); + public Builder socialLinks(@Nullable List socialLinks) { this.socialLinks = socialLinks; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = JsonNullable.of(customFields); return this; } - public Builder customFields(JsonNullable> customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = customFields; - return this; - } - - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public LeadInput build() { - return new LeadInput( name, companyName, ownerId, ownerName, companyId, leadId, diff --git a/src/main/java/com/apideck/unify/models/components/LeadsFilter.java b/src/main/java/com/apideck/unify/models/components/LeadsFilter.java index 956aa1a4..e32bdac0 100644 --- a/src/main/java/com/apideck/unify/models/components/LeadsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/LeadsFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,44 +17,39 @@ public class LeadsFilter { * Name of the lead to filter on */ @SpeakeasyMetadata("queryParam:name=name") - private Optional name; + private String name; /** * First name of the lead to filter on */ @SpeakeasyMetadata("queryParam:name=first_name") - private Optional firstName; + private String firstName; /** * Last name of the lead to filter on */ @SpeakeasyMetadata("queryParam:name=last_name") - private Optional lastName; + private String lastName; /** * E-mail of the lead to filter on */ @SpeakeasyMetadata("queryParam:name=email") - private Optional email; + private String email; /** * Phone number of the lead to filter on */ @SpeakeasyMetadata("queryParam:name=phone_number") - private Optional phoneNumber; + private String phoneNumber; @JsonCreator public LeadsFilter( - Optional name, - Optional firstName, - Optional lastName, - Optional email, - Optional phoneNumber) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(phoneNumber, "phoneNumber"); + @Nullable String name, + @Nullable String firstName, + @Nullable String lastName, + @Nullable String email, + @Nullable String phoneNumber) { this.name = name; this.firstName = firstName; this.lastName = lastName; @@ -63,48 +58,43 @@ public LeadsFilter( } public LeadsFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * Name of the lead to filter on */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * First name of the lead to filter on */ - @JsonIgnore public Optional firstName() { - return firstName; + return Optional.ofNullable(this.firstName); } /** * Last name of the lead to filter on */ - @JsonIgnore public Optional lastName() { - return lastName; + return Optional.ofNullable(this.lastName); } /** * E-mail of the lead to filter on */ - @JsonIgnore public Optional email() { - return email; + return Optional.ofNullable(this.email); } /** * Phone number of the lead to filter on */ - @JsonIgnore public Optional phoneNumber() { - return phoneNumber; + return Optional.ofNullable(this.phoneNumber); } public static Builder builder() { @@ -115,98 +105,48 @@ public static Builder builder() { /** * Name of the lead to filter on */ - public LeadsFilter withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - /** - * Name of the lead to filter on - */ - public LeadsFilter withName(Optional name) { - Utils.checkNotNull(name, "name"); + public LeadsFilter withName(@Nullable String name) { this.name = name; return this; } - /** - * First name of the lead to filter on - */ - public LeadsFilter withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = Optional.ofNullable(firstName); - return this; - } - /** * First name of the lead to filter on */ - public LeadsFilter withFirstName(Optional firstName) { - Utils.checkNotNull(firstName, "firstName"); + public LeadsFilter withFirstName(@Nullable String firstName) { this.firstName = firstName; return this; } - /** - * Last name of the lead to filter on - */ - public LeadsFilter withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = Optional.ofNullable(lastName); - return this; - } - /** * Last name of the lead to filter on */ - public LeadsFilter withLastName(Optional lastName) { - Utils.checkNotNull(lastName, "lastName"); + public LeadsFilter withLastName(@Nullable String lastName) { this.lastName = lastName; return this; } - /** - * E-mail of the lead to filter on - */ - public LeadsFilter withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - /** * E-mail of the lead to filter on */ - public LeadsFilter withEmail(Optional email) { - Utils.checkNotNull(email, "email"); + public LeadsFilter withEmail(@Nullable String email) { this.email = email; return this; } - /** - * Phone number of the lead to filter on - */ - public LeadsFilter withPhoneNumber(String phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); - this.phoneNumber = Optional.ofNullable(phoneNumber); - return this; - } - /** * Phone number of the lead to filter on */ - public LeadsFilter withPhoneNumber(Optional phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); + public LeadsFilter withPhoneNumber(@Nullable String phoneNumber) { this.phoneNumber = phoneNumber; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -244,117 +184,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional name = Optional.empty(); + private String name; - private Optional firstName = Optional.empty(); + private String firstName; - private Optional lastName = Optional.empty(); + private String lastName; - private Optional email = Optional.empty(); + private String email; - private Optional phoneNumber = Optional.empty(); + private String phoneNumber; private Builder() { // force use of static builder() method } - - /** - * Name of the lead to filter on - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the lead to filter on */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * First name of the lead to filter on */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = Optional.ofNullable(firstName); - return this; - } - - /** - * First name of the lead to filter on - */ - public Builder firstName(Optional firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = firstName; return this; } - - /** - * Last name of the lead to filter on - */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = Optional.ofNullable(lastName); - return this; - } - /** * Last name of the lead to filter on */ - public Builder lastName(Optional lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = lastName; return this; } - - /** - * E-mail of the lead to filter on - */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - /** * E-mail of the lead to filter on */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } - - /** - * Phone number of the lead to filter on - */ - public Builder phoneNumber(String phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); - this.phoneNumber = Optional.ofNullable(phoneNumber); - return this; - } - /** * Phone number of the lead to filter on */ - public Builder phoneNumber(Optional phoneNumber) { - Utils.checkNotNull(phoneNumber, "phoneNumber"); + public Builder phoneNumber(@Nullable String phoneNumber) { this.phoneNumber = phoneNumber; return this; } public LeadsFilter build() { - return new LeadsFilter( name, firstName, lastName, email, phoneNumber); diff --git a/src/main/java/com/apideck/unify/models/components/LeadsSort.java b/src/main/java/com/apideck/unify/models/components/LeadsSort.java index fdc824d7..0cbe3f00 100644 --- a/src/main/java/com/apideck/unify/models/components/LeadsSort.java +++ b/src/main/java/com/apideck/unify/models/components/LeadsSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class LeadsSort { * The field on which to sort the Leads */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private LeadsSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public LeadsSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable LeadsSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public LeadsSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Leads */ - public LeadsSort withBy(LeadsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Leads - */ - public LeadsSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public LeadsSort withBy(@Nullable LeadsSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public LeadsSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public LeadsSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public LeadsSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private LeadsSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Leads - */ - public Builder by(LeadsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Leads */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable LeadsSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public LeadsSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new LeadsSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/LedgerAccount.java b/src/main/java/com/apideck/unify/models/components/LedgerAccount.java index e8209a0c..007d869e 100644 --- a/src/main/java/com/apideck/unify/models/components/LedgerAccount.java +++ b/src/main/java/com/apideck/unify/models/components/LedgerAccount.java @@ -5,17 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -30,14 +29,14 @@ public class LedgerAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The human readable display ID used when displaying the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("display_id") - private Optional displayId; + private String displayId; /** * The nominal code of the ledger account. @@ -61,14 +60,14 @@ public class LedgerAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("classification") - private JsonNullable classification; + private JsonNullable classification; /** * The type of account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private LedgerAccountType type; /** * The sub type of account. @@ -117,7 +116,7 @@ public class LedgerAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The tax type of the account. @@ -129,7 +128,7 @@ public class LedgerAccount { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRate taxRate; @JsonInclude(Include.NON_ABSENT) @@ -148,7 +147,7 @@ public class LedgerAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Whether the account is a header or not. @@ -160,19 +159,19 @@ public class LedgerAccount { @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_account") - private Optional bankAccount; + private BankAccount bankAccount; /** * The categories of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("categories") - private Optional> categories; + private List categories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("parent_account") - private Optional parentAccount; + private ParentAccount parentAccount; /** * Whether the account is a sub account or not. @@ -186,7 +185,7 @@ public class LedgerAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("sub_accounts") - private Optional> subAccounts; + private List subAccounts; /** * Reconciliation Date means the last calendar day of each Reconciliation Period. @@ -200,19 +199,19 @@ public class LedgerAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiaries") - private Optional> subsidiaries; + private List subsidiaries; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -254,143 +253,130 @@ public class LedgerAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public LedgerAccount( - @JsonProperty("id") Optional id, - @JsonProperty("display_id") Optional displayId, - @JsonProperty("nominal_code") JsonNullable nominalCode, - @JsonProperty("code") JsonNullable code, - @JsonProperty("classification") JsonNullable classification, - @JsonProperty("type") Optional type, - @JsonProperty("sub_type") JsonNullable subType, - @JsonProperty("name") JsonNullable name, - @JsonProperty("fully_qualified_name") JsonNullable fullyQualifiedName, - @JsonProperty("description") JsonNullable description, - @JsonProperty("opening_balance") JsonNullable openingBalance, - @JsonProperty("current_balance") JsonNullable currentBalance, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("tax_type") JsonNullable taxType, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("level") JsonNullable level, - @JsonProperty("active") JsonNullable active, - @JsonProperty("status") JsonNullable status, - @JsonProperty("header") JsonNullable header, - @JsonProperty("bank_account") Optional bankAccount, - @JsonProperty("categories") Optional> categories, - @JsonProperty("parent_account") Optional parentAccount, - @JsonProperty("sub_account") JsonNullable subAccount, - @JsonProperty("sub_accounts") Optional> subAccounts, - @JsonProperty("last_reconciliation_date") JsonNullable lastReconciliationDate, - @JsonProperty("subsidiaries") Optional> subsidiaries, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(nominalCode, "nominalCode"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(classification, "classification"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(subType, "subType"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(openingBalance, "openingBalance"); - Utils.checkNotNull(currentBalance, "currentBalance"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(taxType, "taxType"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(level, "level"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(header, "header"); - Utils.checkNotNull(bankAccount, "bankAccount"); - Utils.checkNotNull(categories, "categories"); - Utils.checkNotNull(parentAccount, "parentAccount"); - Utils.checkNotNull(subAccount, "subAccount"); - Utils.checkNotNull(subAccounts, "subAccounts"); - Utils.checkNotNull(lastReconciliationDate, "lastReconciliationDate"); - Utils.checkNotNull(subsidiaries, "subsidiaries"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("display_id") @Nullable String displayId, + @JsonProperty("nominal_code") @Nullable JsonNullable nominalCode, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("classification") @Nullable JsonNullable classification, + @JsonProperty("type") @Nullable LedgerAccountType type, + @JsonProperty("sub_type") @Nullable JsonNullable subType, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("fully_qualified_name") @Nullable JsonNullable fullyQualifiedName, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("opening_balance") @Nullable JsonNullable openingBalance, + @JsonProperty("current_balance") @Nullable JsonNullable currentBalance, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("tax_type") @Nullable JsonNullable taxType, + @JsonProperty("tax_rate") @Nullable LinkedTaxRate taxRate, + @JsonProperty("level") @Nullable JsonNullable level, + @JsonProperty("active") @Nullable JsonNullable active, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("header") @Nullable JsonNullable header, + @JsonProperty("bank_account") @Nullable BankAccount bankAccount, + @JsonProperty("categories") @Nullable List categories, + @JsonProperty("parent_account") @Nullable ParentAccount parentAccount, + @JsonProperty("sub_account") @Nullable JsonNullable subAccount, + @JsonProperty("sub_accounts") @Nullable List subAccounts, + @JsonProperty("last_reconciliation_date") @Nullable JsonNullable lastReconciliationDate, + @JsonProperty("subsidiaries") @Nullable List subsidiaries, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; this.displayId = displayId; - this.nominalCode = nominalCode; - this.code = code; - this.classification = classification; + this.nominalCode = Optional.ofNullable(nominalCode) + .orElse(JsonNullable.undefined()); + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.classification = Optional.ofNullable(classification) + .orElse(JsonNullable.undefined()); this.type = type; - this.subType = subType; - this.name = name; - this.fullyQualifiedName = fullyQualifiedName; - this.description = description; - this.openingBalance = openingBalance; - this.currentBalance = currentBalance; - this.currency = currency; - this.taxType = taxType; + this.subType = Optional.ofNullable(subType) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.fullyQualifiedName = Optional.ofNullable(fullyQualifiedName) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.openingBalance = Optional.ofNullable(openingBalance) + .orElse(JsonNullable.undefined()); + this.currentBalance = Optional.ofNullable(currentBalance) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.taxType = Optional.ofNullable(taxType) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; - this.level = level; - this.active = active; - this.status = status; - this.header = header; + this.level = Optional.ofNullable(level) + .orElse(JsonNullable.undefined()); + this.active = Optional.ofNullable(active) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.header = Optional.ofNullable(header) + .orElse(JsonNullable.undefined()); this.bankAccount = bankAccount; this.categories = categories; this.parentAccount = parentAccount; - this.subAccount = subAccount; + this.subAccount = Optional.ofNullable(subAccount) + .orElse(JsonNullable.undefined()); this.subAccounts = subAccounts; - this.lastReconciliationDate = lastReconciliationDate; + this.lastReconciliationDate = Optional.ofNullable(lastReconciliationDate) + .orElse(JsonNullable.undefined()); this.subsidiaries = subsidiaries; - this.customMappings = customMappings; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public LedgerAccount() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The human readable display ID used when displaying the account */ - @JsonIgnore public Optional displayId() { - return displayId; + return Optional.ofNullable(this.displayId); } /** @@ -399,255 +385,210 @@ public Optional displayId() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable nominalCode() { - return nominalCode; + return this.nominalCode; } /** * The code assigned to the account. */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * The classification of account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable classification() { - return (JsonNullable) classification; + return this.classification; } /** * The type of account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } /** * The sub type of account. */ - @JsonIgnore public JsonNullable subType() { - return subType; + return this.subType; } /** * The name of the account. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The fully qualified name of the account. */ - @JsonIgnore public JsonNullable fullyQualifiedName() { - return fullyQualifiedName; + return this.fullyQualifiedName; } /** * The description of the account. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The opening balance of the account. */ - @JsonIgnore public JsonNullable openingBalance() { - return openingBalance; + return this.openingBalance; } /** * The current balance of the account. */ - @JsonIgnore public JsonNullable currentBalance() { - return currentBalance; + return this.currentBalance; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The tax type of the account. */ - @JsonIgnore public JsonNullable taxType() { - return taxType; + return this.taxType; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } - @JsonIgnore public JsonNullable level() { - return level; + return this.level; } /** * Whether the account is active or not. */ - @JsonIgnore public JsonNullable active() { - return active; + return this.active; } /** * The status of the account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Whether the account is a header or not. */ - @JsonIgnore public JsonNullable header() { - return header; + return this.header; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional bankAccount() { - return (Optional) bankAccount; + return Optional.ofNullable(this.bankAccount); } /** * The categories of the account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> categories() { - return (Optional>) categories; + return Optional.ofNullable(this.categories); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional parentAccount() { - return (Optional) parentAccount; + return Optional.ofNullable(this.parentAccount); } /** * Whether the account is a sub account or not. */ - @JsonIgnore public JsonNullable subAccount() { - return subAccount; + return this.subAccount; } /** * The sub accounts of the account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subAccounts() { - return (Optional>) subAccounts; + return Optional.ofNullable(this.subAccounts); } /** * Reconciliation Date means the last calendar day of each Reconciliation Period. */ - @JsonIgnore public JsonNullable lastReconciliationDate() { - return lastReconciliationDate; + return this.lastReconciliationDate; } /** * The subsidiaries the account belongs to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subsidiaries() { - return (Optional>) subsidiaries; + return Optional.ofNullable(this.subsidiaries); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -658,412 +599,197 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public LedgerAccount withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public LedgerAccount withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LedgerAccount withId(@Nullable String id) { this.id = id; return this; } - /** - * The human readable display ID used when displaying the account - */ - public LedgerAccount withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = Optional.ofNullable(displayId); - return this; - } - /** * The human readable display ID used when displaying the account */ - public LedgerAccount withDisplayId(Optional displayId) { - Utils.checkNotNull(displayId, "displayId"); + public LedgerAccount withDisplayId(@Nullable String displayId) { this.displayId = displayId; return this; } + /** * The nominal code of the ledger account. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public LedgerAccount withNominalCode(String nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); + public LedgerAccount withNominalCode(@Nullable String nominalCode) { this.nominalCode = JsonNullable.of(nominalCode); return this; } - /** - * The nominal code of the ledger account. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public LedgerAccount withNominalCode(JsonNullable nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); - this.nominalCode = nominalCode; - return this; - } /** * The code assigned to the account. */ - public LedgerAccount withCode(String code) { - Utils.checkNotNull(code, "code"); + public LedgerAccount withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code assigned to the account. - */ - public LedgerAccount withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * The classification of account. */ - public LedgerAccount withClassification(LedgerAccountClassification classification) { - Utils.checkNotNull(classification, "classification"); + public LedgerAccount withClassification(@Nullable LedgerAccountClassification classification) { this.classification = JsonNullable.of(classification); return this; } - /** - * The classification of account. - */ - public LedgerAccount withClassification(JsonNullable classification) { - Utils.checkNotNull(classification, "classification"); - this.classification = classification; - return this; - } - - /** - * The type of account. - */ - public LedgerAccount withType(LedgerAccountType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * The type of account. */ - public LedgerAccount withType(Optional type) { - Utils.checkNotNull(type, "type"); + public LedgerAccount withType(@Nullable LedgerAccountType type) { this.type = type; return this; } + /** * The sub type of account. */ - public LedgerAccount withSubType(String subType) { - Utils.checkNotNull(subType, "subType"); + public LedgerAccount withSubType(@Nullable String subType) { this.subType = JsonNullable.of(subType); return this; } - /** - * The sub type of account. - */ - public LedgerAccount withSubType(JsonNullable subType) { - Utils.checkNotNull(subType, "subType"); - this.subType = subType; - return this; - } /** * The name of the account. */ - public LedgerAccount withName(String name) { - Utils.checkNotNull(name, "name"); + public LedgerAccount withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the account. - */ - public LedgerAccount withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The fully qualified name of the account. */ - public LedgerAccount withFullyQualifiedName(String fullyQualifiedName) { - Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + public LedgerAccount withFullyQualifiedName(@Nullable String fullyQualifiedName) { this.fullyQualifiedName = JsonNullable.of(fullyQualifiedName); return this; } - /** - * The fully qualified name of the account. - */ - public LedgerAccount withFullyQualifiedName(JsonNullable fullyQualifiedName) { - Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); - this.fullyQualifiedName = fullyQualifiedName; - return this; - } /** * The description of the account. */ - public LedgerAccount withDescription(String description) { - Utils.checkNotNull(description, "description"); + public LedgerAccount withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the account. - */ - public LedgerAccount withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The opening balance of the account. */ - public LedgerAccount withOpeningBalance(double openingBalance) { - Utils.checkNotNull(openingBalance, "openingBalance"); + public LedgerAccount withOpeningBalance(@Nullable Double openingBalance) { this.openingBalance = JsonNullable.of(openingBalance); return this; } - /** - * The opening balance of the account. - */ - public LedgerAccount withOpeningBalance(JsonNullable openingBalance) { - Utils.checkNotNull(openingBalance, "openingBalance"); - this.openingBalance = openingBalance; - return this; - } /** * The current balance of the account. */ - public LedgerAccount withCurrentBalance(double currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); + public LedgerAccount withCurrentBalance(@Nullable Double currentBalance) { this.currentBalance = JsonNullable.of(currentBalance); return this; } - /** - * The current balance of the account. - */ - public LedgerAccount withCurrentBalance(JsonNullable currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); - this.currentBalance = currentBalance; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public LedgerAccount withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public LedgerAccount withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public LedgerAccount withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The tax type of the account. */ - public LedgerAccount withTaxType(String taxType) { - Utils.checkNotNull(taxType, "taxType"); + public LedgerAccount withTaxType(@Nullable String taxType) { this.taxType = JsonNullable.of(taxType); return this; } - /** - * The tax type of the account. - */ - public LedgerAccount withTaxType(JsonNullable taxType) { - Utils.checkNotNull(taxType, "taxType"); - this.taxType = taxType; - return this; - } - public LedgerAccount withTaxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - - public LedgerAccount withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public LedgerAccount withTaxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - public LedgerAccount withLevel(double level) { - Utils.checkNotNull(level, "level"); + + public LedgerAccount withLevel(@Nullable Double level) { this.level = JsonNullable.of(level); return this; } - public LedgerAccount withLevel(JsonNullable level) { - Utils.checkNotNull(level, "level"); - this.level = level; - return this; - } /** * Whether the account is active or not. */ - public LedgerAccount withActive(boolean active) { - Utils.checkNotNull(active, "active"); + public LedgerAccount withActive(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the account is active or not. - */ - public LedgerAccount withActive(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } /** * The status of the account. */ - public LedgerAccount withStatus(AccountStatus status) { - Utils.checkNotNull(status, "status"); + public LedgerAccount withStatus(@Nullable AccountStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the account. - */ - public LedgerAccount withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Whether the account is a header or not. */ - public LedgerAccount withHeader(boolean header) { - Utils.checkNotNull(header, "header"); + public LedgerAccount withHeader(@Nullable Boolean header) { this.header = JsonNullable.of(header); return this; } - /** - * Whether the account is a header or not. - */ - public LedgerAccount withHeader(JsonNullable header) { - Utils.checkNotNull(header, "header"); - this.header = header; - return this; - } - - public LedgerAccount withBankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public LedgerAccount withBankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public LedgerAccount withBankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - /** - * The categories of the account. - */ - public LedgerAccount withCategories(List categories) { - Utils.checkNotNull(categories, "categories"); - this.categories = Optional.ofNullable(categories); - return this; - } - /** * The categories of the account. */ - public LedgerAccount withCategories(Optional> categories) { - Utils.checkNotNull(categories, "categories"); + public LedgerAccount withCategories(@Nullable List categories) { this.categories = categories; return this; } - public LedgerAccount withParentAccount(ParentAccount parentAccount) { - Utils.checkNotNull(parentAccount, "parentAccount"); - this.parentAccount = Optional.ofNullable(parentAccount); - return this; - } - - public LedgerAccount withParentAccount(Optional parentAccount) { - Utils.checkNotNull(parentAccount, "parentAccount"); + public LedgerAccount withParentAccount(@Nullable ParentAccount parentAccount) { this.parentAccount = parentAccount; return this; } - /** - * Whether the account is a sub account or not. - */ - public LedgerAccount withSubAccount(boolean subAccount) { - Utils.checkNotNull(subAccount, "subAccount"); - this.subAccount = JsonNullable.of(subAccount); - return this; - } /** * Whether the account is a sub account or not. */ - public LedgerAccount withSubAccount(JsonNullable subAccount) { - Utils.checkNotNull(subAccount, "subAccount"); - this.subAccount = subAccount; - return this; - } - - /** - * The sub accounts of the account. - */ - public LedgerAccount withSubAccounts(List subAccounts) { - Utils.checkNotNull(subAccounts, "subAccounts"); - this.subAccounts = Optional.ofNullable(subAccounts); + public LedgerAccount withSubAccount(@Nullable Boolean subAccount) { + this.subAccount = JsonNullable.of(subAccount); return this; } @@ -1071,36 +797,17 @@ public LedgerAccount withSubAccounts(List subAccounts) { /** * The sub accounts of the account. */ - public LedgerAccount withSubAccounts(Optional> subAccounts) { - Utils.checkNotNull(subAccounts, "subAccounts"); + public LedgerAccount withSubAccounts(@Nullable List subAccounts) { this.subAccounts = subAccounts; return this; } - /** - * Reconciliation Date means the last calendar day of each Reconciliation Period. - */ - public LedgerAccount withLastReconciliationDate(LocalDate lastReconciliationDate) { - Utils.checkNotNull(lastReconciliationDate, "lastReconciliationDate"); - this.lastReconciliationDate = JsonNullable.of(lastReconciliationDate); - return this; - } /** * Reconciliation Date means the last calendar day of each Reconciliation Period. */ - public LedgerAccount withLastReconciliationDate(JsonNullable lastReconciliationDate) { - Utils.checkNotNull(lastReconciliationDate, "lastReconciliationDate"); - this.lastReconciliationDate = lastReconciliationDate; - return this; - } - - /** - * The subsidiaries the account belongs to. - */ - public LedgerAccount withSubsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); + public LedgerAccount withLastReconciliationDate(@Nullable LocalDate lastReconciliationDate) { + this.lastReconciliationDate = JsonNullable.of(lastReconciliationDate); return this; } @@ -1108,152 +815,81 @@ public LedgerAccount withSubsidiaries(List subsidiari /** * The subsidiaries the account belongs to. */ - public LedgerAccount withSubsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public LedgerAccount withSubsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public LedgerAccount withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = JsonNullable.of(customMappings); - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public LedgerAccount withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - public LedgerAccount withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); + public LedgerAccount withCustomMappings(@Nullable Map customMappings) { + this.customMappings = JsonNullable.of(customMappings); return this; } - public LedgerAccount withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public LedgerAccount withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public LedgerAccount withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public LedgerAccount withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public LedgerAccount withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public LedgerAccount withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public LedgerAccount withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public LedgerAccount withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public LedgerAccount withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public LedgerAccount withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public LedgerAccount withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public LedgerAccount withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public LedgerAccount withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public LedgerAccount withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public LedgerAccount withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public LedgerAccount withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public LedgerAccount withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public LedgerAccount withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public LedgerAccount withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public LedgerAccount withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1359,703 +995,340 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional displayId = Optional.empty(); + private String displayId; @Deprecated - private JsonNullable nominalCode = JsonNullable.undefined(); + private JsonNullable nominalCode; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable classification = JsonNullable.undefined(); + private JsonNullable classification; - private Optional type = Optional.empty(); + private LedgerAccountType type; - private JsonNullable subType = JsonNullable.undefined(); + private JsonNullable subType; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable fullyQualifiedName = JsonNullable.undefined(); + private JsonNullable fullyQualifiedName; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable openingBalance = JsonNullable.undefined(); + private JsonNullable openingBalance; - private JsonNullable currentBalance = JsonNullable.undefined(); + private JsonNullable currentBalance; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable taxType = JsonNullable.undefined(); + private JsonNullable taxType; - private Optional taxRate = Optional.empty(); + private LinkedTaxRate taxRate; - private JsonNullable level = JsonNullable.undefined(); + private JsonNullable level; - private JsonNullable active = JsonNullable.undefined(); + private JsonNullable active; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable header = JsonNullable.undefined(); + private JsonNullable header; - private Optional bankAccount = Optional.empty(); + private BankAccount bankAccount; - private Optional> categories = Optional.empty(); + private List categories; - private Optional parentAccount = Optional.empty(); + private ParentAccount parentAccount; - private JsonNullable subAccount = JsonNullable.undefined(); + private JsonNullable subAccount; - private Optional> subAccounts = Optional.empty(); + private List subAccounts; - private JsonNullable lastReconciliationDate = JsonNullable.undefined(); + private JsonNullable lastReconciliationDate; - private Optional> subsidiaries = Optional.empty(); + private List subsidiaries; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The human readable display ID used when displaying the account */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = Optional.ofNullable(displayId); - return this; - } - - /** - * The human readable display ID used when displaying the account - */ - public Builder displayId(Optional displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = displayId; return this; } - /** * The nominal code of the ledger account. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder nominalCode(String nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); + public Builder nominalCode(@Nullable String nominalCode) { this.nominalCode = JsonNullable.of(nominalCode); return this; } - /** - * The nominal code of the ledger account. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder nominalCode(JsonNullable nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); - this.nominalCode = nominalCode; - return this; - } - - /** * The code assigned to the account. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code assigned to the account. - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * The classification of account. */ - public Builder classification(LedgerAccountClassification classification) { - Utils.checkNotNull(classification, "classification"); + public Builder classification(@Nullable LedgerAccountClassification classification) { this.classification = JsonNullable.of(classification); return this; } - /** - * The classification of account. - */ - public Builder classification(JsonNullable classification) { - Utils.checkNotNull(classification, "classification"); - this.classification = classification; - return this; - } - - /** * The type of account. */ - public Builder type(LedgerAccountType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - /** - * The type of account. - */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable LedgerAccountType type) { this.type = type; return this; } - /** * The sub type of account. */ - public Builder subType(String subType) { - Utils.checkNotNull(subType, "subType"); + public Builder subType(@Nullable String subType) { this.subType = JsonNullable.of(subType); return this; } - /** - * The sub type of account. - */ - public Builder subType(JsonNullable subType) { - Utils.checkNotNull(subType, "subType"); - this.subType = subType; - return this; - } - - /** * The name of the account. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the account. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The fully qualified name of the account. */ - public Builder fullyQualifiedName(String fullyQualifiedName) { - Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + public Builder fullyQualifiedName(@Nullable String fullyQualifiedName) { this.fullyQualifiedName = JsonNullable.of(fullyQualifiedName); return this; } - /** - * The fully qualified name of the account. - */ - public Builder fullyQualifiedName(JsonNullable fullyQualifiedName) { - Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); - this.fullyQualifiedName = fullyQualifiedName; - return this; - } - - /** * The description of the account. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the account. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The opening balance of the account. */ - public Builder openingBalance(double openingBalance) { - Utils.checkNotNull(openingBalance, "openingBalance"); + public Builder openingBalance(@Nullable Double openingBalance) { this.openingBalance = JsonNullable.of(openingBalance); return this; } - /** - * The opening balance of the account. - */ - public Builder openingBalance(JsonNullable openingBalance) { - Utils.checkNotNull(openingBalance, "openingBalance"); - this.openingBalance = openingBalance; - return this; - } - - /** * The current balance of the account. */ - public Builder currentBalance(double currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); + public Builder currentBalance(@Nullable Double currentBalance) { this.currentBalance = JsonNullable.of(currentBalance); return this; } - /** - * The current balance of the account. - */ - public Builder currentBalance(JsonNullable currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); - this.currentBalance = currentBalance; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The tax type of the account. */ - public Builder taxType(String taxType) { - Utils.checkNotNull(taxType, "taxType"); + public Builder taxType(@Nullable String taxType) { this.taxType = JsonNullable.of(taxType); return this; } - /** - * The tax type of the account. - */ - public Builder taxType(JsonNullable taxType) { - Utils.checkNotNull(taxType, "taxType"); - this.taxType = taxType; - return this; - } - - - public Builder taxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - - public Builder level(double level) { - Utils.checkNotNull(level, "level"); + public Builder level(@Nullable Double level) { this.level = JsonNullable.of(level); return this; } - public Builder level(JsonNullable level) { - Utils.checkNotNull(level, "level"); - this.level = level; - return this; - } - - /** * Whether the account is active or not. */ - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the account is active or not. - */ - public Builder active(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - /** * The status of the account. */ - public Builder status(AccountStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable AccountStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the account. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Whether the account is a header or not. */ - public Builder header(boolean header) { - Utils.checkNotNull(header, "header"); + public Builder header(@Nullable Boolean header) { this.header = JsonNullable.of(header); return this; } - /** - * Whether the account is a header or not. - */ - public Builder header(JsonNullable header) { - Utils.checkNotNull(header, "header"); - this.header = header; - return this; - } - - - public Builder bankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public Builder bankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public Builder bankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - - /** - * The categories of the account. - */ - public Builder categories(List categories) { - Utils.checkNotNull(categories, "categories"); - this.categories = Optional.ofNullable(categories); - return this; - } - /** * The categories of the account. */ - public Builder categories(Optional> categories) { - Utils.checkNotNull(categories, "categories"); + public Builder categories(@Nullable List categories) { this.categories = categories; return this; } - - public Builder parentAccount(ParentAccount parentAccount) { - Utils.checkNotNull(parentAccount, "parentAccount"); - this.parentAccount = Optional.ofNullable(parentAccount); - return this; - } - - public Builder parentAccount(Optional parentAccount) { - Utils.checkNotNull(parentAccount, "parentAccount"); + public Builder parentAccount(@Nullable ParentAccount parentAccount) { this.parentAccount = parentAccount; return this; } - /** * Whether the account is a sub account or not. */ - public Builder subAccount(boolean subAccount) { - Utils.checkNotNull(subAccount, "subAccount"); + public Builder subAccount(@Nullable Boolean subAccount) { this.subAccount = JsonNullable.of(subAccount); return this; } - /** - * Whether the account is a sub account or not. - */ - public Builder subAccount(JsonNullable subAccount) { - Utils.checkNotNull(subAccount, "subAccount"); - this.subAccount = subAccount; - return this; - } - - /** * The sub accounts of the account. */ - public Builder subAccounts(List subAccounts) { - Utils.checkNotNull(subAccounts, "subAccounts"); - this.subAccounts = Optional.ofNullable(subAccounts); - return this; - } - - /** - * The sub accounts of the account. - */ - public Builder subAccounts(Optional> subAccounts) { - Utils.checkNotNull(subAccounts, "subAccounts"); + public Builder subAccounts(@Nullable List subAccounts) { this.subAccounts = subAccounts; return this; } - /** * Reconciliation Date means the last calendar day of each Reconciliation Period. */ - public Builder lastReconciliationDate(LocalDate lastReconciliationDate) { - Utils.checkNotNull(lastReconciliationDate, "lastReconciliationDate"); + public Builder lastReconciliationDate(@Nullable LocalDate lastReconciliationDate) { this.lastReconciliationDate = JsonNullable.of(lastReconciliationDate); return this; } - /** - * Reconciliation Date means the last calendar day of each Reconciliation Period. - */ - public Builder lastReconciliationDate(JsonNullable lastReconciliationDate) { - Utils.checkNotNull(lastReconciliationDate, "lastReconciliationDate"); - this.lastReconciliationDate = lastReconciliationDate; - return this; - } - - /** * The subsidiaries the account belongs to. */ - public Builder subsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - /** - * The subsidiaries the account belongs to. - */ - public Builder subsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public Builder subsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public LedgerAccount build() { - return new LedgerAccount( id, displayId, nominalCode, code, classification, type, diff --git a/src/main/java/com/apideck/unify/models/components/LedgerAccountInput.java b/src/main/java/com/apideck/unify/models/components/LedgerAccountInput.java index 7c2959ae..a173a3c2 100644 --- a/src/main/java/com/apideck/unify/models/components/LedgerAccountInput.java +++ b/src/main/java/com/apideck/unify/models/components/LedgerAccountInput.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -27,7 +26,7 @@ public class LedgerAccountInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("display_id") - private Optional displayId; + private String displayId; /** * The nominal code of the ledger account. @@ -51,14 +50,14 @@ public class LedgerAccountInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("classification") - private JsonNullable classification; + private JsonNullable classification; /** * The type of account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private LedgerAccountType type; /** * The sub type of account. @@ -107,7 +106,7 @@ public class LedgerAccountInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The tax type of the account. @@ -119,7 +118,7 @@ public class LedgerAccountInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRateInput taxRate; @JsonInclude(Include.NON_ABSENT) @@ -138,7 +137,7 @@ public class LedgerAccountInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Whether the account is a header or not. @@ -150,12 +149,12 @@ public class LedgerAccountInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_account") - private Optional bankAccount; + private BankAccount bankAccount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("parent_account") - private Optional parentAccount; + private ParentAccount parentAccount; /** * Whether the account is a sub account or not. @@ -176,12 +175,12 @@ public class LedgerAccountInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiaries") - private Optional> subsidiaries; + private List subsidiaries; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -195,108 +194,99 @@ public class LedgerAccountInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public LedgerAccountInput( - @JsonProperty("display_id") Optional displayId, - @JsonProperty("nominal_code") JsonNullable nominalCode, - @JsonProperty("code") JsonNullable code, - @JsonProperty("classification") JsonNullable classification, - @JsonProperty("type") Optional type, - @JsonProperty("sub_type") JsonNullable subType, - @JsonProperty("name") JsonNullable name, - @JsonProperty("fully_qualified_name") JsonNullable fullyQualifiedName, - @JsonProperty("description") JsonNullable description, - @JsonProperty("opening_balance") JsonNullable openingBalance, - @JsonProperty("current_balance") JsonNullable currentBalance, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("tax_type") JsonNullable taxType, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("level") JsonNullable level, - @JsonProperty("active") JsonNullable active, - @JsonProperty("status") JsonNullable status, - @JsonProperty("header") JsonNullable header, - @JsonProperty("bank_account") Optional bankAccount, - @JsonProperty("parent_account") Optional parentAccount, - @JsonProperty("sub_account") JsonNullable subAccount, - @JsonProperty("last_reconciliation_date") JsonNullable lastReconciliationDate, - @JsonProperty("subsidiaries") Optional> subsidiaries, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(nominalCode, "nominalCode"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(classification, "classification"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(subType, "subType"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(openingBalance, "openingBalance"); - Utils.checkNotNull(currentBalance, "currentBalance"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(taxType, "taxType"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(level, "level"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(header, "header"); - Utils.checkNotNull(bankAccount, "bankAccount"); - Utils.checkNotNull(parentAccount, "parentAccount"); - Utils.checkNotNull(subAccount, "subAccount"); - Utils.checkNotNull(lastReconciliationDate, "lastReconciliationDate"); - Utils.checkNotNull(subsidiaries, "subsidiaries"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("display_id") @Nullable String displayId, + @JsonProperty("nominal_code") @Nullable JsonNullable nominalCode, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("classification") @Nullable JsonNullable classification, + @JsonProperty("type") @Nullable LedgerAccountType type, + @JsonProperty("sub_type") @Nullable JsonNullable subType, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("fully_qualified_name") @Nullable JsonNullable fullyQualifiedName, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("opening_balance") @Nullable JsonNullable openingBalance, + @JsonProperty("current_balance") @Nullable JsonNullable currentBalance, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("tax_type") @Nullable JsonNullable taxType, + @JsonProperty("tax_rate") @Nullable LinkedTaxRateInput taxRate, + @JsonProperty("level") @Nullable JsonNullable level, + @JsonProperty("active") @Nullable JsonNullable active, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("header") @Nullable JsonNullable header, + @JsonProperty("bank_account") @Nullable BankAccount bankAccount, + @JsonProperty("parent_account") @Nullable ParentAccount parentAccount, + @JsonProperty("sub_account") @Nullable JsonNullable subAccount, + @JsonProperty("last_reconciliation_date") @Nullable JsonNullable lastReconciliationDate, + @JsonProperty("subsidiaries") @Nullable List subsidiaries, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { this.displayId = displayId; - this.nominalCode = nominalCode; - this.code = code; - this.classification = classification; + this.nominalCode = Optional.ofNullable(nominalCode) + .orElse(JsonNullable.undefined()); + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.classification = Optional.ofNullable(classification) + .orElse(JsonNullable.undefined()); this.type = type; - this.subType = subType; - this.name = name; - this.fullyQualifiedName = fullyQualifiedName; - this.description = description; - this.openingBalance = openingBalance; - this.currentBalance = currentBalance; - this.currency = currency; - this.taxType = taxType; + this.subType = Optional.ofNullable(subType) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.fullyQualifiedName = Optional.ofNullable(fullyQualifiedName) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.openingBalance = Optional.ofNullable(openingBalance) + .orElse(JsonNullable.undefined()); + this.currentBalance = Optional.ofNullable(currentBalance) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.taxType = Optional.ofNullable(taxType) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; - this.level = level; - this.active = active; - this.status = status; - this.header = header; + this.level = Optional.ofNullable(level) + .orElse(JsonNullable.undefined()); + this.active = Optional.ofNullable(active) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.header = Optional.ofNullable(header) + .orElse(JsonNullable.undefined()); this.bankAccount = bankAccount; this.parentAccount = parentAccount; - this.subAccount = subAccount; - this.lastReconciliationDate = lastReconciliationDate; + this.subAccount = Optional.ofNullable(subAccount) + .orElse(JsonNullable.undefined()); + this.lastReconciliationDate = Optional.ofNullable(lastReconciliationDate) + .orElse(JsonNullable.undefined()); this.subsidiaries = subsidiaries; this.customFields = customFields; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public LedgerAccountInput() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * The human readable display ID used when displaying the account */ - @JsonIgnore public Optional displayId() { - return displayId; + return Optional.ofNullable(this.displayId); } /** @@ -305,196 +295,161 @@ public Optional displayId() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable nominalCode() { - return nominalCode; + return this.nominalCode; } /** * The code assigned to the account. */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * The classification of account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable classification() { - return (JsonNullable) classification; + return this.classification; } /** * The type of account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } /** * The sub type of account. */ - @JsonIgnore public JsonNullable subType() { - return subType; + return this.subType; } /** * The name of the account. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The fully qualified name of the account. */ - @JsonIgnore public JsonNullable fullyQualifiedName() { - return fullyQualifiedName; + return this.fullyQualifiedName; } /** * The description of the account. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The opening balance of the account. */ - @JsonIgnore public JsonNullable openingBalance() { - return openingBalance; + return this.openingBalance; } /** * The current balance of the account. */ - @JsonIgnore public JsonNullable currentBalance() { - return currentBalance; + return this.currentBalance; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The tax type of the account. */ - @JsonIgnore public JsonNullable taxType() { - return taxType; + return this.taxType; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } - @JsonIgnore public JsonNullable level() { - return level; + return this.level; } /** * Whether the account is active or not. */ - @JsonIgnore public JsonNullable active() { - return active; + return this.active; } /** * The status of the account. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Whether the account is a header or not. */ - @JsonIgnore public JsonNullable header() { - return header; + return this.header; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional bankAccount() { - return (Optional) bankAccount; + return Optional.ofNullable(this.bankAccount); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional parentAccount() { - return (Optional) parentAccount; + return Optional.ofNullable(this.parentAccount); } /** * Whether the account is a sub account or not. */ - @JsonIgnore public JsonNullable subAccount() { - return subAccount; + return this.subAccount; } /** * Reconciliation Date means the last calendar day of each Reconciliation Period. */ - @JsonIgnore public JsonNullable lastReconciliationDate() { - return lastReconciliationDate; + return this.lastReconciliationDate; } /** * The subsidiaries the account belongs to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subsidiaries() { - return (Optional>) subsidiaries; + return Optional.ofNullable(this.subsidiaries); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -505,442 +460,212 @@ public static Builder builder() { /** * The human readable display ID used when displaying the account */ - public LedgerAccountInput withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = Optional.ofNullable(displayId); - return this; - } - - - /** - * The human readable display ID used when displaying the account - */ - public LedgerAccountInput withDisplayId(Optional displayId) { - Utils.checkNotNull(displayId, "displayId"); + public LedgerAccountInput withDisplayId(@Nullable String displayId) { this.displayId = displayId; return this; } + /** * The nominal code of the ledger account. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public LedgerAccountInput withNominalCode(String nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); + public LedgerAccountInput withNominalCode(@Nullable String nominalCode) { this.nominalCode = JsonNullable.of(nominalCode); return this; } - /** - * The nominal code of the ledger account. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public LedgerAccountInput withNominalCode(JsonNullable nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); - this.nominalCode = nominalCode; - return this; - } /** * The code assigned to the account. */ - public LedgerAccountInput withCode(String code) { - Utils.checkNotNull(code, "code"); + public LedgerAccountInput withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code assigned to the account. - */ - public LedgerAccountInput withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * The classification of account. */ - public LedgerAccountInput withClassification(LedgerAccountClassification classification) { - Utils.checkNotNull(classification, "classification"); + public LedgerAccountInput withClassification(@Nullable LedgerAccountClassification classification) { this.classification = JsonNullable.of(classification); return this; } - /** - * The classification of account. - */ - public LedgerAccountInput withClassification(JsonNullable classification) { - Utils.checkNotNull(classification, "classification"); - this.classification = classification; - return this; - } /** * The type of account. */ - public LedgerAccountInput withType(LedgerAccountType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - - /** - * The type of account. - */ - public LedgerAccountInput withType(Optional type) { - Utils.checkNotNull(type, "type"); + public LedgerAccountInput withType(@Nullable LedgerAccountType type) { this.type = type; return this; } + /** * The sub type of account. */ - public LedgerAccountInput withSubType(String subType) { - Utils.checkNotNull(subType, "subType"); + public LedgerAccountInput withSubType(@Nullable String subType) { this.subType = JsonNullable.of(subType); return this; } - /** - * The sub type of account. - */ - public LedgerAccountInput withSubType(JsonNullable subType) { - Utils.checkNotNull(subType, "subType"); - this.subType = subType; - return this; - } /** * The name of the account. */ - public LedgerAccountInput withName(String name) { - Utils.checkNotNull(name, "name"); + public LedgerAccountInput withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the account. - */ - public LedgerAccountInput withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The fully qualified name of the account. */ - public LedgerAccountInput withFullyQualifiedName(String fullyQualifiedName) { - Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + public LedgerAccountInput withFullyQualifiedName(@Nullable String fullyQualifiedName) { this.fullyQualifiedName = JsonNullable.of(fullyQualifiedName); return this; } - /** - * The fully qualified name of the account. - */ - public LedgerAccountInput withFullyQualifiedName(JsonNullable fullyQualifiedName) { - Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); - this.fullyQualifiedName = fullyQualifiedName; - return this; - } /** * The description of the account. */ - public LedgerAccountInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public LedgerAccountInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the account. - */ - public LedgerAccountInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The opening balance of the account. */ - public LedgerAccountInput withOpeningBalance(double openingBalance) { - Utils.checkNotNull(openingBalance, "openingBalance"); + public LedgerAccountInput withOpeningBalance(@Nullable Double openingBalance) { this.openingBalance = JsonNullable.of(openingBalance); return this; } - /** - * The opening balance of the account. - */ - public LedgerAccountInput withOpeningBalance(JsonNullable openingBalance) { - Utils.checkNotNull(openingBalance, "openingBalance"); - this.openingBalance = openingBalance; - return this; - } /** * The current balance of the account. */ - public LedgerAccountInput withCurrentBalance(double currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); + public LedgerAccountInput withCurrentBalance(@Nullable Double currentBalance) { this.currentBalance = JsonNullable.of(currentBalance); return this; } - /** - * The current balance of the account. - */ - public LedgerAccountInput withCurrentBalance(JsonNullable currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); - this.currentBalance = currentBalance; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public LedgerAccountInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public LedgerAccountInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public LedgerAccountInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The tax type of the account. */ - public LedgerAccountInput withTaxType(String taxType) { - Utils.checkNotNull(taxType, "taxType"); + public LedgerAccountInput withTaxType(@Nullable String taxType) { this.taxType = JsonNullable.of(taxType); return this; } - /** - * The tax type of the account. - */ - public LedgerAccountInput withTaxType(JsonNullable taxType) { - Utils.checkNotNull(taxType, "taxType"); - this.taxType = taxType; - return this; - } - - public LedgerAccountInput withTaxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public LedgerAccountInput withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public LedgerAccountInput withTaxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - public LedgerAccountInput withLevel(double level) { - Utils.checkNotNull(level, "level"); + + public LedgerAccountInput withLevel(@Nullable Double level) { this.level = JsonNullable.of(level); return this; } - public LedgerAccountInput withLevel(JsonNullable level) { - Utils.checkNotNull(level, "level"); - this.level = level; - return this; - } /** * Whether the account is active or not. */ - public LedgerAccountInput withActive(boolean active) { - Utils.checkNotNull(active, "active"); + public LedgerAccountInput withActive(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the account is active or not. - */ - public LedgerAccountInput withActive(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } /** * The status of the account. */ - public LedgerAccountInput withStatus(AccountStatus status) { - Utils.checkNotNull(status, "status"); + public LedgerAccountInput withStatus(@Nullable AccountStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the account. - */ - public LedgerAccountInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Whether the account is a header or not. */ - public LedgerAccountInput withHeader(boolean header) { - Utils.checkNotNull(header, "header"); + public LedgerAccountInput withHeader(@Nullable Boolean header) { this.header = JsonNullable.of(header); return this; } - /** - * Whether the account is a header or not. - */ - public LedgerAccountInput withHeader(JsonNullable header) { - Utils.checkNotNull(header, "header"); - this.header = header; - return this; - } - public LedgerAccountInput withBankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - - public LedgerAccountInput withBankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public LedgerAccountInput withBankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - public LedgerAccountInput withParentAccount(ParentAccount parentAccount) { - Utils.checkNotNull(parentAccount, "parentAccount"); - this.parentAccount = Optional.ofNullable(parentAccount); - return this; - } - - public LedgerAccountInput withParentAccount(Optional parentAccount) { - Utils.checkNotNull(parentAccount, "parentAccount"); + public LedgerAccountInput withParentAccount(@Nullable ParentAccount parentAccount) { this.parentAccount = parentAccount; return this; } + /** * Whether the account is a sub account or not. */ - public LedgerAccountInput withSubAccount(boolean subAccount) { - Utils.checkNotNull(subAccount, "subAccount"); + public LedgerAccountInput withSubAccount(@Nullable Boolean subAccount) { this.subAccount = JsonNullable.of(subAccount); return this; } - /** - * Whether the account is a sub account or not. - */ - public LedgerAccountInput withSubAccount(JsonNullable subAccount) { - Utils.checkNotNull(subAccount, "subAccount"); - this.subAccount = subAccount; - return this; - } /** * Reconciliation Date means the last calendar day of each Reconciliation Period. */ - public LedgerAccountInput withLastReconciliationDate(LocalDate lastReconciliationDate) { - Utils.checkNotNull(lastReconciliationDate, "lastReconciliationDate"); + public LedgerAccountInput withLastReconciliationDate(@Nullable LocalDate lastReconciliationDate) { this.lastReconciliationDate = JsonNullable.of(lastReconciliationDate); return this; } - /** - * Reconciliation Date means the last calendar day of each Reconciliation Period. - */ - public LedgerAccountInput withLastReconciliationDate(JsonNullable lastReconciliationDate) { - Utils.checkNotNull(lastReconciliationDate, "lastReconciliationDate"); - this.lastReconciliationDate = lastReconciliationDate; - return this; - } /** * The subsidiaries the account belongs to. */ - public LedgerAccountInput withSubsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - - /** - * The subsidiaries the account belongs to. - */ - public LedgerAccountInput withSubsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public LedgerAccountInput withSubsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - public LedgerAccountInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public LedgerAccountInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public LedgerAccountInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public LedgerAccountInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public LedgerAccountInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public LedgerAccountInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public LedgerAccountInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -948,12 +673,12 @@ public LedgerAccountInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public LedgerAccountInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public LedgerAccountInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1040,535 +765,260 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional displayId = Optional.empty(); + private String displayId; @Deprecated - private JsonNullable nominalCode = JsonNullable.undefined(); + private JsonNullable nominalCode; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable classification = JsonNullable.undefined(); + private JsonNullable classification; - private Optional type = Optional.empty(); + private LedgerAccountType type; - private JsonNullable subType = JsonNullable.undefined(); + private JsonNullable subType; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable fullyQualifiedName = JsonNullable.undefined(); + private JsonNullable fullyQualifiedName; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable openingBalance = JsonNullable.undefined(); + private JsonNullable openingBalance; - private JsonNullable currentBalance = JsonNullable.undefined(); + private JsonNullable currentBalance; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable taxType = JsonNullable.undefined(); + private JsonNullable taxType; - private Optional taxRate = Optional.empty(); + private LinkedTaxRateInput taxRate; - private JsonNullable level = JsonNullable.undefined(); + private JsonNullable level; - private JsonNullable active = JsonNullable.undefined(); + private JsonNullable active; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable header = JsonNullable.undefined(); + private JsonNullable header; - private Optional bankAccount = Optional.empty(); + private BankAccount bankAccount; - private Optional parentAccount = Optional.empty(); + private ParentAccount parentAccount; - private JsonNullable subAccount = JsonNullable.undefined(); + private JsonNullable subAccount; - private JsonNullable lastReconciliationDate = JsonNullable.undefined(); + private JsonNullable lastReconciliationDate; - private Optional> subsidiaries = Optional.empty(); + private List subsidiaries; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * The human readable display ID used when displaying the account - */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = Optional.ofNullable(displayId); - return this; - } - /** * The human readable display ID used when displaying the account */ - public Builder displayId(Optional displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = displayId; return this; } - /** * The nominal code of the ledger account. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder nominalCode(String nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); + public Builder nominalCode(@Nullable String nominalCode) { this.nominalCode = JsonNullable.of(nominalCode); return this; } - /** - * The nominal code of the ledger account. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder nominalCode(JsonNullable nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); - this.nominalCode = nominalCode; - return this; - } - - /** * The code assigned to the account. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code assigned to the account. - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * The classification of account. */ - public Builder classification(LedgerAccountClassification classification) { - Utils.checkNotNull(classification, "classification"); + public Builder classification(@Nullable LedgerAccountClassification classification) { this.classification = JsonNullable.of(classification); return this; } - /** - * The classification of account. - */ - public Builder classification(JsonNullable classification) { - Utils.checkNotNull(classification, "classification"); - this.classification = classification; - return this; - } - - /** * The type of account. */ - public Builder type(LedgerAccountType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - /** - * The type of account. - */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable LedgerAccountType type) { this.type = type; return this; } - /** * The sub type of account. */ - public Builder subType(String subType) { - Utils.checkNotNull(subType, "subType"); + public Builder subType(@Nullable String subType) { this.subType = JsonNullable.of(subType); return this; } - /** - * The sub type of account. - */ - public Builder subType(JsonNullable subType) { - Utils.checkNotNull(subType, "subType"); - this.subType = subType; - return this; - } - - /** * The name of the account. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the account. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The fully qualified name of the account. */ - public Builder fullyQualifiedName(String fullyQualifiedName) { - Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); + public Builder fullyQualifiedName(@Nullable String fullyQualifiedName) { this.fullyQualifiedName = JsonNullable.of(fullyQualifiedName); return this; } - /** - * The fully qualified name of the account. - */ - public Builder fullyQualifiedName(JsonNullable fullyQualifiedName) { - Utils.checkNotNull(fullyQualifiedName, "fullyQualifiedName"); - this.fullyQualifiedName = fullyQualifiedName; - return this; - } - - /** * The description of the account. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The description of the account. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The opening balance of the account. */ - public Builder openingBalance(double openingBalance) { - Utils.checkNotNull(openingBalance, "openingBalance"); + public Builder openingBalance(@Nullable Double openingBalance) { this.openingBalance = JsonNullable.of(openingBalance); return this; } - /** - * The opening balance of the account. - */ - public Builder openingBalance(JsonNullable openingBalance) { - Utils.checkNotNull(openingBalance, "openingBalance"); - this.openingBalance = openingBalance; - return this; - } - - /** * The current balance of the account. */ - public Builder currentBalance(double currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); + public Builder currentBalance(@Nullable Double currentBalance) { this.currentBalance = JsonNullable.of(currentBalance); return this; } - /** - * The current balance of the account. - */ - public Builder currentBalance(JsonNullable currentBalance) { - Utils.checkNotNull(currentBalance, "currentBalance"); - this.currentBalance = currentBalance; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The tax type of the account. */ - public Builder taxType(String taxType) { - Utils.checkNotNull(taxType, "taxType"); + public Builder taxType(@Nullable String taxType) { this.taxType = JsonNullable.of(taxType); return this; } - /** - * The tax type of the account. - */ - public Builder taxType(JsonNullable taxType) { - Utils.checkNotNull(taxType, "taxType"); - this.taxType = taxType; - return this; - } - - - public Builder taxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - - public Builder level(double level) { - Utils.checkNotNull(level, "level"); + public Builder level(@Nullable Double level) { this.level = JsonNullable.of(level); return this; } - public Builder level(JsonNullable level) { - Utils.checkNotNull(level, "level"); - this.level = level; - return this; - } - - /** * Whether the account is active or not. */ - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the account is active or not. - */ - public Builder active(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - /** * The status of the account. */ - public Builder status(AccountStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable AccountStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the account. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Whether the account is a header or not. */ - public Builder header(boolean header) { - Utils.checkNotNull(header, "header"); + public Builder header(@Nullable Boolean header) { this.header = JsonNullable.of(header); return this; } - /** - * Whether the account is a header or not. - */ - public Builder header(JsonNullable header) { - Utils.checkNotNull(header, "header"); - this.header = header; - return this; - } - - - public Builder bankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public Builder bankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public Builder bankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - - public Builder parentAccount(ParentAccount parentAccount) { - Utils.checkNotNull(parentAccount, "parentAccount"); - this.parentAccount = Optional.ofNullable(parentAccount); - return this; - } - - public Builder parentAccount(Optional parentAccount) { - Utils.checkNotNull(parentAccount, "parentAccount"); + public Builder parentAccount(@Nullable ParentAccount parentAccount) { this.parentAccount = parentAccount; return this; } - /** * Whether the account is a sub account or not. */ - public Builder subAccount(boolean subAccount) { - Utils.checkNotNull(subAccount, "subAccount"); + public Builder subAccount(@Nullable Boolean subAccount) { this.subAccount = JsonNullable.of(subAccount); return this; } - /** - * Whether the account is a sub account or not. - */ - public Builder subAccount(JsonNullable subAccount) { - Utils.checkNotNull(subAccount, "subAccount"); - this.subAccount = subAccount; - return this; - } - - /** * Reconciliation Date means the last calendar day of each Reconciliation Period. */ - public Builder lastReconciliationDate(LocalDate lastReconciliationDate) { - Utils.checkNotNull(lastReconciliationDate, "lastReconciliationDate"); + public Builder lastReconciliationDate(@Nullable LocalDate lastReconciliationDate) { this.lastReconciliationDate = JsonNullable.of(lastReconciliationDate); return this; } - /** - * Reconciliation Date means the last calendar day of each Reconciliation Period. - */ - public Builder lastReconciliationDate(JsonNullable lastReconciliationDate) { - Utils.checkNotNull(lastReconciliationDate, "lastReconciliationDate"); - this.lastReconciliationDate = lastReconciliationDate; - return this; - } - - - /** - * The subsidiaries the account belongs to. - */ - public Builder subsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - /** * The subsidiaries the account belongs to. */ - public Builder subsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public Builder subsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public LedgerAccountInput build() { - return new LedgerAccountInput( displayId, nominalCode, code, classification, type, subType, diff --git a/src/main/java/com/apideck/unify/models/components/LedgerAccountSubsidiaries.java b/src/main/java/com/apideck/unify/models/components/LedgerAccountSubsidiaries.java index a14e069a..b4e6cfbb 100644 --- a/src/main/java/com/apideck/unify/models/components/LedgerAccountSubsidiaries.java +++ b/src/main/java/com/apideck/unify/models/components/LedgerAccountSubsidiaries.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -20,25 +20,23 @@ public class LedgerAccountSubsidiaries { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonCreator public LedgerAccountSubsidiaries( - @JsonProperty("id") Optional id) { - Utils.checkNotNull(id, "id"); + @JsonProperty("id") @Nullable String id) { this.id = id; } public LedgerAccountSubsidiaries() { - this(Optional.empty()); + this(null); } /** * The ID of the subsidiary. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } public static Builder builder() { @@ -49,22 +47,12 @@ public static Builder builder() { /** * The ID of the subsidiary. */ - public LedgerAccountSubsidiaries withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The ID of the subsidiary. - */ - public LedgerAccountSubsidiaries withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LedgerAccountSubsidiaries withId(@Nullable String id) { this.id = id; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -93,33 +81,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private Builder() { // force use of static builder() method } - - /** - * The ID of the subsidiary. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The ID of the subsidiary. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } public LedgerAccountSubsidiaries build() { - return new LedgerAccountSubsidiaries( id); } diff --git a/src/main/java/com/apideck/unify/models/components/LedgerAccountsFilter.java b/src/main/java/com/apideck/unify/models/components/LedgerAccountsFilter.java index fc6c099e..dbe493ef 100644 --- a/src/main/java/com/apideck/unify/models/components/LedgerAccountsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/LedgerAccountsFilter.java @@ -6,10 +6,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.Optional; @@ -17,40 +16,35 @@ public class LedgerAccountsFilter { @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private OffsetDateTime updatedSince; /** * Filter by account classification. */ @SpeakeasyMetadata("queryParam:name=classification") - private Optional classification; + private Classification classification; @JsonCreator public LedgerAccountsFilter( - Optional updatedSince, - Optional classification) { - Utils.checkNotNull(updatedSince, "updatedSince"); - Utils.checkNotNull(classification, "classification"); + @Nullable OffsetDateTime updatedSince, + @Nullable Classification classification) { this.updatedSince = updatedSince; this.classification = classification; } public LedgerAccountsFilter() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } /** * Filter by account classification. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional classification() { - return (Optional) classification; + return Optional.ofNullable(this.classification); } public static Builder builder() { @@ -58,38 +52,21 @@ public static Builder builder() { } - public LedgerAccountsFilter withUpdatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - - public LedgerAccountsFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public LedgerAccountsFilter withUpdatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - /** - * Filter by account classification. - */ - public LedgerAccountsFilter withClassification(Classification classification) { - Utils.checkNotNull(classification, "classification"); - this.classification = Optional.ofNullable(classification); - return this; - } - /** * Filter by account classification. */ - public LedgerAccountsFilter withClassification(Optional classification) { - Utils.checkNotNull(classification, "classification"); + public LedgerAccountsFilter withClassification(@Nullable Classification classification) { this.classification = classification; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -120,48 +97,28 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional updatedSince = Optional.empty(); + private OffsetDateTime updatedSince; - private Optional classification = Optional.empty(); + private Classification classification; private Builder() { // force use of static builder() method } - - public Builder updatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - /** * Filter by account classification. */ - public Builder classification(Classification classification) { - Utils.checkNotNull(classification, "classification"); - this.classification = Optional.ofNullable(classification); - return this; - } - - /** - * Filter by account classification. - */ - public Builder classification(Optional classification) { - Utils.checkNotNull(classification, "classification"); + public Builder classification(@Nullable Classification classification) { this.classification = classification; return this; } public LedgerAccountsFilter build() { - return new LedgerAccountsFilter( updatedSince, classification); } diff --git a/src/main/java/com/apideck/unify/models/components/LedgerAccountsSort.java b/src/main/java/com/apideck/unify/models/components/LedgerAccountsSort.java index cf7a2e84..330d9d9f 100644 --- a/src/main/java/com/apideck/unify/models/components/LedgerAccountsSort.java +++ b/src/main/java/com/apideck/unify/models/components/LedgerAccountsSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class LedgerAccountsSort { * The field on which to sort the Ledger Accounts */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private LedgerAccountsSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public LedgerAccountsSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable LedgerAccountsSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public LedgerAccountsSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Ledger Accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Ledger Accounts */ - public LedgerAccountsSort withBy(LedgerAccountsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Ledger Accounts - */ - public LedgerAccountsSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public LedgerAccountsSort withBy(@Nullable LedgerAccountsSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public LedgerAccountsSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public LedgerAccountsSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public LedgerAccountsSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private LedgerAccountsSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Ledger Accounts - */ - public Builder by(LedgerAccountsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Ledger Accounts */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable LedgerAccountsSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public LedgerAccountsSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new LedgerAccountsSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/LinkedConnectorResource.java b/src/main/java/com/apideck/unify/models/components/LinkedConnectorResource.java index fece6528..169e6281 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedConnectorResource.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedConnectorResource.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -21,48 +20,43 @@ public class LinkedConnectorResource { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Name of the resource (plural) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Status of the resource. Resources with status live or beta are callable. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private ResourceStatus status; /** * ID of the resource in the Connector's API (downstream) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_id") - private Optional downstreamId; + private String downstreamId; /** * Name of the resource in the Connector's API (downstream) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_name") - private Optional downstreamName; + private String downstreamName; @JsonCreator public LinkedConnectorResource( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("status") Optional status, - @JsonProperty("downstream_id") Optional downstreamId, - @JsonProperty("downstream_name") Optional downstreamName) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(downstreamName, "downstreamName"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("status") @Nullable ResourceStatus status, + @JsonProperty("downstream_id") @Nullable String downstreamId, + @JsonProperty("downstream_name") @Nullable String downstreamName) { this.id = id; this.name = name; this.status = status; @@ -71,49 +65,43 @@ public LinkedConnectorResource( } public LinkedConnectorResource() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * ID of the resource, typically a lowercased version of name. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Name of the resource (plural) */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Status of the resource. Resources with status live or beta are callable. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * ID of the resource in the Connector's API (downstream) */ - @JsonIgnore public Optional downstreamId() { - return downstreamId; + return Optional.ofNullable(this.downstreamId); } /** * Name of the resource in the Connector's API (downstream) */ - @JsonIgnore public Optional downstreamName() { - return downstreamName; + return Optional.ofNullable(this.downstreamName); } public static Builder builder() { @@ -124,98 +112,48 @@ public static Builder builder() { /** * ID of the resource, typically a lowercased version of name. */ - public LinkedConnectorResource withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the resource, typically a lowercased version of name. - */ - public LinkedConnectorResource withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LinkedConnectorResource withId(@Nullable String id) { this.id = id; return this; } - /** - * Name of the resource (plural) - */ - public LinkedConnectorResource withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the resource (plural) */ - public LinkedConnectorResource withName(Optional name) { - Utils.checkNotNull(name, "name"); + public LinkedConnectorResource withName(@Nullable String name) { this.name = name; return this; } - /** - * Status of the resource. Resources with status live or beta are callable. - */ - public LinkedConnectorResource withStatus(ResourceStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the resource. Resources with status live or beta are callable. */ - public LinkedConnectorResource withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public LinkedConnectorResource withStatus(@Nullable ResourceStatus status) { this.status = status; return this; } - /** - * ID of the resource in the Connector's API (downstream) - */ - public LinkedConnectorResource withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = Optional.ofNullable(downstreamId); - return this; - } - /** * ID of the resource in the Connector's API (downstream) */ - public LinkedConnectorResource withDownstreamId(Optional downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public LinkedConnectorResource withDownstreamId(@Nullable String downstreamId) { this.downstreamId = downstreamId; return this; } - /** - * Name of the resource in the Connector's API (downstream) - */ - public LinkedConnectorResource withDownstreamName(String downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); - this.downstreamName = Optional.ofNullable(downstreamName); - return this; - } - /** * Name of the resource in the Connector's API (downstream) */ - public LinkedConnectorResource withDownstreamName(Optional downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); + public LinkedConnectorResource withDownstreamName(@Nullable String downstreamName) { this.downstreamName = downstreamName; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -253,117 +191,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private Optional status = Optional.empty(); + private ResourceStatus status; - private Optional downstreamId = Optional.empty(); + private String downstreamId; - private Optional downstreamName = Optional.empty(); + private String downstreamName; private Builder() { // force use of static builder() method } - - /** - * ID of the resource, typically a lowercased version of name. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * ID of the resource, typically a lowercased version of name. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Name of the resource (plural) */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * Name of the resource (plural) - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * Status of the resource. Resources with status live or beta are callable. - */ - public Builder status(ResourceStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the resource. Resources with status live or beta are callable. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ResourceStatus status) { this.status = status; return this; } - - /** - * ID of the resource in the Connector's API (downstream) - */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = Optional.ofNullable(downstreamId); - return this; - } - /** * ID of the resource in the Connector's API (downstream) */ - public Builder downstreamId(Optional downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = downstreamId; return this; } - - /** - * Name of the resource in the Connector's API (downstream) - */ - public Builder downstreamName(String downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); - this.downstreamName = Optional.ofNullable(downstreamName); - return this; - } - /** * Name of the resource in the Connector's API (downstream) */ - public Builder downstreamName(Optional downstreamName) { - Utils.checkNotNull(downstreamName, "downstreamName"); + public Builder downstreamName(@Nullable String downstreamName) { this.downstreamName = downstreamName; return this; } public LinkedConnectorResource build() { - return new LinkedConnectorResource( id, name, status, downstreamId, downstreamName); diff --git a/src/main/java/com/apideck/unify/models/components/LinkedCustomer.java b/src/main/java/com/apideck/unify/models/components/LinkedCustomer.java index f62e9a61..18f8c498 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedCustomer.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedCustomer.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Deprecated; import java.lang.Override; import java.lang.String; @@ -26,7 +26,7 @@ public class LinkedCustomer { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The display ID of the customer. @@ -50,7 +50,7 @@ public class LinkedCustomer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") @Deprecated - private Optional name; + private String name; /** * The company name of the customer. @@ -64,57 +64,51 @@ public class LinkedCustomer { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("email") - private Optional email; + private String email; @JsonCreator public LinkedCustomer( - @JsonProperty("id") Optional id, - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("name") Optional name, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("email") Optional email) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(email, "email"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("name") @Nullable String name, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("email") @Nullable String email) { this.id = id; - this.displayId = displayId; - this.displayName = displayName; + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); this.name = name; - this.companyName = companyName; + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); this.email = email; } public LinkedCustomer() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * The ID of the customer this entity is linked to. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The display ID of the customer. */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * The display name of the customer. */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** @@ -123,25 +117,22 @@ public JsonNullable displayName() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The company name of the customer. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The email address of the customer. */ - @JsonIgnore public Optional email() { - return email; + return Optional.ofNullable(this.email); } public static Builder builder() { @@ -152,70 +143,29 @@ public static Builder builder() { /** * The ID of the customer this entity is linked to. */ - public LinkedCustomer withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The ID of the customer this entity is linked to. - */ - public LinkedCustomer withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LinkedCustomer withId(@Nullable String id) { this.id = id; return this; } + /** * The display ID of the customer. */ - public LinkedCustomer withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public LinkedCustomer withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * The display ID of the customer. - */ - public LinkedCustomer withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } /** * The display name of the customer. */ - public LinkedCustomer withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public LinkedCustomer withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the customer. - */ - public LinkedCustomer withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** - * The name of the customer. Deprecated, use display_name instead. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public LinkedCustomer withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the customer. Deprecated, use display_name instead. @@ -223,36 +173,17 @@ public LinkedCustomer withName(String name) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public LinkedCustomer withName(Optional name) { - Utils.checkNotNull(name, "name"); + public LinkedCustomer withName(@Nullable String name) { this.name = name; return this; } - /** - * The company name of the customer. - */ - public LinkedCustomer withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = JsonNullable.of(companyName); - return this; - } /** * The company name of the customer. */ - public LinkedCustomer withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** - * The email address of the customer. - */ - public LinkedCustomer withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); + public LinkedCustomer withCompanyName(@Nullable String companyName) { + this.companyName = JsonNullable.of(companyName); return this; } @@ -260,12 +191,12 @@ public LinkedCustomer withEmail(String email) { /** * The email address of the customer. */ - public LinkedCustomer withEmail(Optional email) { - Utils.checkNotNull(email, "email"); + public LinkedCustomer withEmail(@Nullable String email) { this.email = email; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -305,145 +236,75 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; @Deprecated - private Optional name = Optional.empty(); + private String name; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private Optional email = Optional.empty(); + private String email; private Builder() { // force use of static builder() method } - - /** - * The ID of the customer this entity is linked to. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The ID of the customer this entity is linked to. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The display ID of the customer. */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * The display ID of the customer. - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * The display name of the customer. */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the customer. - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - - /** - * The name of the customer. Deprecated, use display_name instead. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the customer. Deprecated, use display_name instead. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * The company name of the customer. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The company name of the customer. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The email address of the customer. */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - - /** - * The email address of the customer. - */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } public LinkedCustomer build() { - return new LinkedCustomer( id, displayId, displayName, name, companyName, email); diff --git a/src/main/java/com/apideck/unify/models/components/LinkedCustomerInput.java b/src/main/java/com/apideck/unify/models/components/LinkedCustomerInput.java index f3e89008..998d20e8 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedCustomerInput.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedCustomerInput.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Deprecated; import java.lang.Override; import java.lang.String; @@ -26,7 +26,7 @@ public class LinkedCustomerInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The display name of the customer. @@ -43,50 +43,45 @@ public class LinkedCustomerInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") @Deprecated - private Optional name; + private String name; /** * The email address of the customer. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("email") - private Optional email; + private String email; @JsonCreator public LinkedCustomerInput( - @JsonProperty("id") Optional id, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("name") Optional name, - @JsonProperty("email") Optional email) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(email, "email"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("name") @Nullable String name, + @JsonProperty("email") @Nullable String email) { this.id = id; - this.displayName = displayName; + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); this.name = name; this.email = email; } public LinkedCustomerInput() { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * The ID of the customer this entity is linked to. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The display name of the customer. */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** @@ -95,17 +90,15 @@ public JsonNullable displayName() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The email address of the customer. */ - @JsonIgnore public Optional email() { - return email; + return Optional.ofNullable(this.email); } public static Builder builder() { @@ -116,49 +109,17 @@ public static Builder builder() { /** * The ID of the customer this entity is linked to. */ - public LinkedCustomerInput withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The ID of the customer this entity is linked to. - */ - public LinkedCustomerInput withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LinkedCustomerInput withId(@Nullable String id) { this.id = id; return this; } - /** - * The display name of the customer. - */ - public LinkedCustomerInput withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = JsonNullable.of(displayName); - return this; - } /** * The display name of the customer. */ - public LinkedCustomerInput withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** - * The name of the customer. Deprecated, use display_name instead. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public LinkedCustomerInput withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); + public LinkedCustomerInput withDisplayName(@Nullable String displayName) { + this.displayName = JsonNullable.of(displayName); return this; } @@ -169,31 +130,21 @@ public LinkedCustomerInput withName(String name) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public LinkedCustomerInput withName(Optional name) { - Utils.checkNotNull(name, "name"); + public LinkedCustomerInput withName(@Nullable String name) { this.name = name; return this; } - /** - * The email address of the customer. - */ - public LinkedCustomerInput withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - /** * The email address of the customer. */ - public LinkedCustomerInput withEmail(Optional email) { - Utils.checkNotNull(email, "email"); + public LinkedCustomerInput withEmail(@Nullable String email) { this.email = email; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -229,103 +180,55 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; @Deprecated - private Optional name = Optional.empty(); + private String name; - private Optional email = Optional.empty(); + private String email; private Builder() { // force use of static builder() method } - - /** - * The ID of the customer this entity is linked to. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The ID of the customer this entity is linked to. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The display name of the customer. */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the customer. - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * The name of the customer. Deprecated, use display_name instead. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * The name of the customer. Deprecated, use display_name instead. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * The email address of the customer. */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - - /** - * The email address of the customer. - */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } public LinkedCustomerInput build() { - return new LinkedCustomerInput( id, displayName, name, email); diff --git a/src/main/java/com/apideck/unify/models/components/LinkedEcommerceCustomer.java b/src/main/java/com/apideck/unify/models/components/LinkedEcommerceCustomer.java index 6bbbdde0..3b9ae882 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedEcommerceCustomer.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedEcommerceCustomer.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -59,94 +59,85 @@ public class LinkedEcommerceCustomer { @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private JsonNullable> phoneNumbers; + private JsonNullable> phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private JsonNullable> emails; + private JsonNullable> emails; @JsonCreator public LinkedEcommerceCustomer( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("phone_numbers") JsonNullable> phoneNumbers, - @JsonProperty("emails") JsonNullable> emails) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - this.id = id; - this.name = name; - this.firstName = firstName; - this.lastName = lastName; - this.companyName = companyName; - this.phoneNumbers = phoneNumbers; - this.emails = emails; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("phone_numbers") @Nullable JsonNullable> phoneNumbers, + @JsonProperty("emails") @Nullable JsonNullable> emails) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.phoneNumbers = Optional.ofNullable(phoneNumbers) + .orElse(JsonNullable.undefined()); + this.emails = Optional.ofNullable(emails) + .orElse(JsonNullable.undefined()); } public LinkedEcommerceCustomer() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null); } /** * The ID of the customer this entity is linked to. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Full name of the customer */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * First name of the customer */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * Last name of the customer */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Company name of the customer */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> phoneNumbers() { - return (JsonNullable>) phoneNumbers; + return this.phoneNumbers; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> emails() { - return (JsonNullable>) emails; + return this.emails; } public static Builder builder() { @@ -157,116 +148,59 @@ public static Builder builder() { /** * The ID of the customer this entity is linked to. */ - public LinkedEcommerceCustomer withId(String id) { - Utils.checkNotNull(id, "id"); + public LinkedEcommerceCustomer withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * The ID of the customer this entity is linked to. - */ - public LinkedEcommerceCustomer withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * Full name of the customer */ - public LinkedEcommerceCustomer withName(String name) { - Utils.checkNotNull(name, "name"); + public LinkedEcommerceCustomer withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the customer - */ - public LinkedEcommerceCustomer withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * First name of the customer */ - public LinkedEcommerceCustomer withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public LinkedEcommerceCustomer withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * First name of the customer - */ - public LinkedEcommerceCustomer withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * Last name of the customer */ - public LinkedEcommerceCustomer withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public LinkedEcommerceCustomer withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * Last name of the customer - */ - public LinkedEcommerceCustomer withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Company name of the customer */ - public LinkedEcommerceCustomer withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public LinkedEcommerceCustomer withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * Company name of the customer - */ - public LinkedEcommerceCustomer withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - public LinkedEcommerceCustomer withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public LinkedEcommerceCustomer withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = JsonNullable.of(phoneNumbers); return this; } - public LinkedEcommerceCustomer withPhoneNumbers(JsonNullable> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = phoneNumbers; - return this; - } - public LinkedEcommerceCustomer withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); + public LinkedEcommerceCustomer withEmails(@Nullable List emails) { this.emails = JsonNullable.of(emails); return this; } - public LinkedEcommerceCustomer withEmails(JsonNullable> emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = emails; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -310,147 +244,75 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable> phoneNumbers = JsonNullable.undefined(); + private JsonNullable> phoneNumbers; - private JsonNullable> emails = JsonNullable.undefined(); + private JsonNullable> emails; private Builder() { // force use of static builder() method } - /** * The ID of the customer this entity is linked to. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * The ID of the customer this entity is linked to. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * Full name of the customer */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Full name of the customer - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * First name of the customer */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * First name of the customer - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * Last name of the customer */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * Last name of the customer - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Company name of the customer */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * Company name of the customer - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = JsonNullable.of(phoneNumbers); return this; } - public Builder phoneNumbers(JsonNullable> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = phoneNumbers; - return this; - } - - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = JsonNullable.of(emails); return this; } - public Builder emails(JsonNullable> emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = emails; - return this; - } - public LinkedEcommerceCustomer build() { - return new LinkedEcommerceCustomer( id, name, firstName, lastName, companyName, phoneNumbers, diff --git a/src/main/java/com/apideck/unify/models/components/LinkedEcommerceOrder.java b/src/main/java/com/apideck/unify/models/components/LinkedEcommerceOrder.java index 45b0844d..666d3fbd 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedEcommerceOrder.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedEcommerceOrder.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,7 +25,7 @@ public class LinkedEcommerceOrder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The total amount of the order. @@ -40,48 +39,43 @@ public class LinkedEcommerceOrder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; @JsonCreator public LinkedEcommerceOrder( - @JsonProperty("id") Optional id, - @JsonProperty("total") JsonNullable total, - @JsonProperty("status") JsonNullable status) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(status, "status"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("total") @Nullable JsonNullable total, + @JsonProperty("status") @Nullable JsonNullable status) { this.id = id; - this.total = total; - this.status = status; + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); } public LinkedEcommerceOrder() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The total amount of the order. */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } /** * Current status of the order. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } public static Builder builder() { @@ -92,57 +86,29 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public LinkedEcommerceOrder withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public LinkedEcommerceOrder withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LinkedEcommerceOrder withId(@Nullable String id) { this.id = id; return this; } + /** * The total amount of the order. */ - public LinkedEcommerceOrder withTotal(String total) { - Utils.checkNotNull(total, "total"); + public LinkedEcommerceOrder withTotal(@Nullable String total) { this.total = JsonNullable.of(total); return this; } - /** - * The total amount of the order. - */ - public LinkedEcommerceOrder withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } /** * Current status of the order. */ - public LinkedEcommerceOrder withStatus(EcommerceOrderStatus status) { - Utils.checkNotNull(status, "status"); + public LinkedEcommerceOrder withStatus(@Nullable EcommerceOrderStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Current status of the order. - */ - public LinkedEcommerceOrder withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -176,75 +142,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The total amount of the order. */ - public Builder total(String total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable String total) { this.total = JsonNullable.of(total); return this; } - /** - * The total amount of the order. - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - - /** * Current status of the order. */ - public Builder status(EcommerceOrderStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable EcommerceOrderStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Current status of the order. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - public LinkedEcommerceOrder build() { - return new LinkedEcommerceOrder( id, total, status); } diff --git a/src/main/java/com/apideck/unify/models/components/LinkedFolder.java b/src/main/java/com/apideck/unify/models/components/LinkedFolder.java index 0d4341d9..0c5f2a59 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedFolder.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedFolder.java @@ -5,12 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,33 +32,31 @@ public class LinkedFolder { @JsonCreator public LinkedFolder( - @JsonProperty("id") String id, - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - this.id = id; - this.name = name; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("name") @Nullable JsonNullable name) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public LinkedFolder( - String id) { - this(id, JsonNullable.undefined()); + @Nonnull String id) { + this(id, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The name of the folder */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -67,29 +67,20 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public LinkedFolder withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public LinkedFolder withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The name of the folder */ - public LinkedFolder withName(String name) { - Utils.checkNotNull(name, "name"); + public LinkedFolder withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the folder - */ - public LinkedFolder withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -123,43 +114,29 @@ public final static class Builder { private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The name of the folder */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the folder - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public LinkedFolder build() { - return new LinkedFolder( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/LinkedInvoiceItem.java b/src/main/java/com/apideck/unify/models/components/LinkedInvoiceItem.java index 76c06656..7d5a7847 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedInvoiceItem.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedInvoiceItem.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -38,43 +39,40 @@ public class LinkedInvoiceItem { @JsonCreator public LinkedInvoiceItem( - @JsonProperty("id") JsonNullable id, - @JsonProperty("code") JsonNullable code, - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(name, "name"); - this.id = id; - this.code = code; - this.name = name; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("name") @Nullable JsonNullable name) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public LinkedInvoiceItem() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * User defined item code */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * User defined item name */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -85,56 +83,29 @@ public static Builder builder() { /** * ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item */ - public LinkedInvoiceItem withId(String id) { - Utils.checkNotNull(id, "id"); + public LinkedInvoiceItem withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item - */ - public LinkedInvoiceItem withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * User defined item code */ - public LinkedInvoiceItem withCode(String code) { - Utils.checkNotNull(code, "code"); + public LinkedInvoiceItem withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public LinkedInvoiceItem withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * User defined item name */ - public LinkedInvoiceItem withName(String name) { - Utils.checkNotNull(name, "name"); + public LinkedInvoiceItem withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * User defined item name - */ - public LinkedInvoiceItem withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -168,75 +139,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - /** * ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * ID of the linked item. A reference to the [invoice item](https://developers.apideck.com/apis/accounting/reference#tag/Invoice-Items) that was used to create this line item - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * User defined item code */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * User defined item code - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * User defined item name */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * User defined item name - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public LinkedInvoiceItem build() { - return new LinkedInvoiceItem( id, code, name); } diff --git a/src/main/java/com/apideck/unify/models/components/LinkedLedgerAccount.java b/src/main/java/com/apideck/unify/models/components/LinkedLedgerAccount.java index c8181883..f6e3fa64 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedLedgerAccount.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedLedgerAccount.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -21,7 +21,7 @@ public class LinkedLedgerAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the account. @@ -46,55 +46,50 @@ public class LinkedLedgerAccount { @JsonCreator public LinkedLedgerAccount( - @JsonProperty("id") Optional id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("nominal_code") JsonNullable nominalCode, - @JsonProperty("code") JsonNullable code) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(nominalCode, "nominalCode"); - Utils.checkNotNull(code, "code"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("nominal_code") @Nullable JsonNullable nominalCode, + @JsonProperty("code") @Nullable JsonNullable code) { this.id = id; - this.name = name; - this.nominalCode = nominalCode; - this.code = code; + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.nominalCode = Optional.ofNullable(nominalCode) + .orElse(JsonNullable.undefined()); + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); } public LinkedLedgerAccount() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null); } /** * The unique identifier for the account. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the account. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The nominal code of the account. */ - @JsonIgnore public JsonNullable nominalCode() { - return nominalCode; + return this.nominalCode; } /** * The code assigned to the account. */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } public static Builder builder() { @@ -105,75 +100,38 @@ public static Builder builder() { /** * The unique identifier for the account. */ - public LinkedLedgerAccount withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier for the account. - */ - public LinkedLedgerAccount withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LinkedLedgerAccount withId(@Nullable String id) { this.id = id; return this; } + /** * The name of the account. */ - public LinkedLedgerAccount withName(String name) { - Utils.checkNotNull(name, "name"); + public LinkedLedgerAccount withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the account. - */ - public LinkedLedgerAccount withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The nominal code of the account. */ - public LinkedLedgerAccount withNominalCode(String nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); + public LinkedLedgerAccount withNominalCode(@Nullable String nominalCode) { this.nominalCode = JsonNullable.of(nominalCode); return this; } - /** - * The nominal code of the account. - */ - public LinkedLedgerAccount withNominalCode(JsonNullable nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); - this.nominalCode = nominalCode; - return this; - } /** * The code assigned to the account. */ - public LinkedLedgerAccount withCode(String code) { - Utils.checkNotNull(code, "code"); + public LinkedLedgerAccount withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code assigned to the account. - */ - public LinkedLedgerAccount withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -210,96 +168,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable nominalCode = JsonNullable.undefined(); + private JsonNullable nominalCode; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; private Builder() { // force use of static builder() method } - - /** - * The unique identifier for the account. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The unique identifier for the account. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the account. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the account. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The nominal code of the account. */ - public Builder nominalCode(String nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); + public Builder nominalCode(@Nullable String nominalCode) { this.nominalCode = JsonNullable.of(nominalCode); return this; } - /** - * The nominal code of the account. - */ - public Builder nominalCode(JsonNullable nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); - this.nominalCode = nominalCode; - return this; - } - - /** * The code assigned to the account. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code assigned to the account. - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - public LinkedLedgerAccount build() { - return new LinkedLedgerAccount( id, name, nominalCode, code); diff --git a/src/main/java/com/apideck/unify/models/components/LinkedLedgerAccountInput.java b/src/main/java/com/apideck/unify/models/components/LinkedLedgerAccountInput.java index 83ec2c54..2c3b5dbf 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedLedgerAccountInput.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedLedgerAccountInput.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -21,7 +21,7 @@ public class LinkedLedgerAccountInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The nominal code of the account. @@ -39,43 +39,39 @@ public class LinkedLedgerAccountInput { @JsonCreator public LinkedLedgerAccountInput( - @JsonProperty("id") Optional id, - @JsonProperty("nominal_code") JsonNullable nominalCode, - @JsonProperty("code") JsonNullable code) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(nominalCode, "nominalCode"); - Utils.checkNotNull(code, "code"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("nominal_code") @Nullable JsonNullable nominalCode, + @JsonProperty("code") @Nullable JsonNullable code) { this.id = id; - this.nominalCode = nominalCode; - this.code = code; + this.nominalCode = Optional.ofNullable(nominalCode) + .orElse(JsonNullable.undefined()); + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); } public LinkedLedgerAccountInput() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * The unique identifier for the account. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The nominal code of the account. */ - @JsonIgnore public JsonNullable nominalCode() { - return nominalCode; + return this.nominalCode; } /** * The code assigned to the account. */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } public static Builder builder() { @@ -86,57 +82,29 @@ public static Builder builder() { /** * The unique identifier for the account. */ - public LinkedLedgerAccountInput withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier for the account. - */ - public LinkedLedgerAccountInput withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LinkedLedgerAccountInput withId(@Nullable String id) { this.id = id; return this; } + /** * The nominal code of the account. */ - public LinkedLedgerAccountInput withNominalCode(String nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); + public LinkedLedgerAccountInput withNominalCode(@Nullable String nominalCode) { this.nominalCode = JsonNullable.of(nominalCode); return this; } - /** - * The nominal code of the account. - */ - public LinkedLedgerAccountInput withNominalCode(JsonNullable nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); - this.nominalCode = nominalCode; - return this; - } /** * The code assigned to the account. */ - public LinkedLedgerAccountInput withCode(String code) { - Utils.checkNotNull(code, "code"); + public LinkedLedgerAccountInput withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code assigned to the account. - */ - public LinkedLedgerAccountInput withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -170,75 +138,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable nominalCode = JsonNullable.undefined(); + private JsonNullable nominalCode; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; private Builder() { // force use of static builder() method } - - /** - * The unique identifier for the account. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The unique identifier for the account. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The nominal code of the account. */ - public Builder nominalCode(String nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); + public Builder nominalCode(@Nullable String nominalCode) { this.nominalCode = JsonNullable.of(nominalCode); return this; } - /** - * The nominal code of the account. - */ - public Builder nominalCode(JsonNullable nominalCode) { - Utils.checkNotNull(nominalCode, "nominalCode"); - this.nominalCode = nominalCode; - return this; - } - - /** * The code assigned to the account. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code assigned to the account. - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - public LinkedLedgerAccountInput build() { - return new LinkedLedgerAccountInput( id, nominalCode, code); } diff --git a/src/main/java/com/apideck/unify/models/components/LinkedParentCustomer.java b/src/main/java/com/apideck/unify/models/components/LinkedParentCustomer.java index deaddb93..606035aa 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedParentCustomer.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedParentCustomer.java @@ -5,10 +5,11 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -30,37 +31,34 @@ public class LinkedParentCustomer { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; @JsonCreator public LinkedParentCustomer( - @JsonProperty("id") String id, - @JsonProperty("name") Optional name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - this.id = id; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("name") @Nullable String name) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.name = name; } public LinkedParentCustomer( - String id) { - this(id, Optional.empty()); + @Nonnull String id) { + this(id, null); } /** * The parent ID of the customer this entity is linked to. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The name of the parent customer. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } public static Builder builder() { @@ -71,18 +69,8 @@ public static Builder builder() { /** * The parent ID of the customer this entity is linked to. */ - public LinkedParentCustomer withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * The name of the parent customer. - */ - public LinkedParentCustomer withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); + public LinkedParentCustomer withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -90,12 +78,12 @@ public LinkedParentCustomer withName(String name) { /** * The name of the parent customer. */ - public LinkedParentCustomer withName(Optional name) { - Utils.checkNotNull(name, "name"); + public LinkedParentCustomer withName(@Nullable String name) { this.name = name; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -128,43 +116,29 @@ public final static class Builder { private String id; - private Optional name = Optional.empty(); + private String name; private Builder() { // force use of static builder() method } - /** * The parent ID of the customer this entity is linked to. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * The name of the parent customer. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * The name of the parent customer. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } public LinkedParentCustomer build() { - return new LinkedParentCustomer( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/LinkedResources.java b/src/main/java/com/apideck/unify/models/components/LinkedResources.java index a14bfd94..de9e5248 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedResources.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedResources.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -20,43 +20,39 @@ public class LinkedResources { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Name of the property in our Unified API. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("unified_property") - private Optional unifiedProperty; + private String unifiedProperty; @JsonCreator public LinkedResources( - @JsonProperty("id") Optional id, - @JsonProperty("unified_property") Optional unifiedProperty) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(unifiedProperty, "unifiedProperty"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("unified_property") @Nullable String unifiedProperty) { this.id = id; this.unifiedProperty = unifiedProperty; } public LinkedResources() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * ID of the resource, typically a lowercased version of name. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Name of the property in our Unified API. */ - @JsonIgnore public Optional unifiedProperty() { - return unifiedProperty; + return Optional.ofNullable(this.unifiedProperty); } public static Builder builder() { @@ -67,41 +63,21 @@ public static Builder builder() { /** * ID of the resource, typically a lowercased version of name. */ - public LinkedResources withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the resource, typically a lowercased version of name. - */ - public LinkedResources withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LinkedResources withId(@Nullable String id) { this.id = id; return this; } - /** - * Name of the property in our Unified API. - */ - public LinkedResources withUnifiedProperty(String unifiedProperty) { - Utils.checkNotNull(unifiedProperty, "unifiedProperty"); - this.unifiedProperty = Optional.ofNullable(unifiedProperty); - return this; - } - /** * Name of the property in our Unified API. */ - public LinkedResources withUnifiedProperty(Optional unifiedProperty) { - Utils.checkNotNull(unifiedProperty, "unifiedProperty"); + public LinkedResources withUnifiedProperty(@Nullable String unifiedProperty) { this.unifiedProperty = unifiedProperty; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -132,54 +108,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional unifiedProperty = Optional.empty(); + private String unifiedProperty; private Builder() { // force use of static builder() method } - /** * ID of the resource, typically a lowercased version of name. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * ID of the resource, typically a lowercased version of name. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Name of the property in our Unified API. - */ - public Builder unifiedProperty(String unifiedProperty) { - Utils.checkNotNull(unifiedProperty, "unifiedProperty"); - this.unifiedProperty = Optional.ofNullable(unifiedProperty); - return this; - } - /** * Name of the property in our Unified API. */ - public Builder unifiedProperty(Optional unifiedProperty) { - Utils.checkNotNull(unifiedProperty, "unifiedProperty"); + public Builder unifiedProperty(@Nullable String unifiedProperty) { this.unifiedProperty = unifiedProperty; return this; } public LinkedResources build() { - return new LinkedResources( id, unifiedProperty); } diff --git a/src/main/java/com/apideck/unify/models/components/LinkedSupplier.java b/src/main/java/com/apideck/unify/models/components/LinkedSupplier.java index f9c69be1..67bdf29c 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedSupplier.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedSupplier.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,7 +25,7 @@ public class LinkedSupplier { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The display ID of the supplier. @@ -52,68 +51,60 @@ public class LinkedSupplier { @JsonInclude(Include.NON_ABSENT) @JsonProperty("address") - private Optional address; + private Address address; @JsonCreator public LinkedSupplier( - @JsonProperty("id") Optional id, - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("address") Optional address) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(address, "address"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("address") @Nullable Address address) { this.id = id; - this.displayId = displayId; - this.displayName = displayName; - this.companyName = companyName; + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); this.address = address; } public LinkedSupplier() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null); } /** * The ID of the supplier this entity is linked to. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The display ID of the supplier. */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * The display name of the supplier. */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * The company name of the supplier. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
address() { - return (Optional
) address; + return Optional.ofNullable(this.address); } public static Builder builder() { @@ -124,89 +115,45 @@ public static Builder builder() { /** * The ID of the supplier this entity is linked to. */ - public LinkedSupplier withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The ID of the supplier this entity is linked to. - */ - public LinkedSupplier withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LinkedSupplier withId(@Nullable String id) { this.id = id; return this; } + /** * The display ID of the supplier. */ - public LinkedSupplier withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public LinkedSupplier withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * The display ID of the supplier. - */ - public LinkedSupplier withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } /** * The display name of the supplier. */ - public LinkedSupplier withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public LinkedSupplier withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the supplier. - */ - public LinkedSupplier withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } /** * The company name of the supplier. */ - public LinkedSupplier withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public LinkedSupplier withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The company name of the supplier. - */ - public LinkedSupplier withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - public LinkedSupplier withAddress(Address address) { - Utils.checkNotNull(address, "address"); - this.address = Optional.ofNullable(address); - return this; - } - - - public LinkedSupplier withAddress(Optional address) { - Utils.checkNotNull(address, "address"); + public LinkedSupplier withAddress(@Nullable Address address) { this.address = address; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -244,111 +191,58 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private Optional address = Optional.empty(); + private Address address; private Builder() { // force use of static builder() method } - /** * The ID of the supplier this entity is linked to. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * The ID of the supplier this entity is linked to. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The display ID of the supplier. */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * The display ID of the supplier. - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * The display name of the supplier. */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the supplier. - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * The company name of the supplier. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The company name of the supplier. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - - public Builder address(Address address) { - Utils.checkNotNull(address, "address"); - this.address = Optional.ofNullable(address); - return this; - } - - public Builder address(Optional address) { - Utils.checkNotNull(address, "address"); + public Builder address(@Nullable Address address) { this.address = address; return this; } public LinkedSupplier build() { - return new LinkedSupplier( id, displayId, displayName, companyName, address); diff --git a/src/main/java/com/apideck/unify/models/components/LinkedSupplierInput.java b/src/main/java/com/apideck/unify/models/components/LinkedSupplierInput.java index f689f05b..f38f9577 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedSupplierInput.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedSupplierInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,7 +25,7 @@ public class LinkedSupplierInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The display name of the supplier. @@ -38,45 +37,39 @@ public class LinkedSupplierInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("address") - private Optional address; + private Address address; @JsonCreator public LinkedSupplierInput( - @JsonProperty("id") Optional id, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("address") Optional address) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(address, "address"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("address") @Nullable Address address) { this.id = id; - this.displayName = displayName; + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); this.address = address; } public LinkedSupplierInput() { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null); } /** * The ID of the supplier this entity is linked to. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The display name of the supplier. */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
address() { - return (Optional
) address; + return Optional.ofNullable(this.address); } public static Builder builder() { @@ -87,53 +80,27 @@ public static Builder builder() { /** * The ID of the supplier this entity is linked to. */ - public LinkedSupplierInput withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The ID of the supplier this entity is linked to. - */ - public LinkedSupplierInput withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LinkedSupplierInput withId(@Nullable String id) { this.id = id; return this; } - /** - * The display name of the supplier. - */ - public LinkedSupplierInput withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = JsonNullable.of(displayName); - return this; - } /** * The display name of the supplier. */ - public LinkedSupplierInput withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - public LinkedSupplierInput withAddress(Address address) { - Utils.checkNotNull(address, "address"); - this.address = Optional.ofNullable(address); + public LinkedSupplierInput withDisplayName(@Nullable String displayName) { + this.displayName = JsonNullable.of(displayName); return this; } - public LinkedSupplierInput withAddress(Optional address) { - Utils.checkNotNull(address, "address"); + public LinkedSupplierInput withAddress(@Nullable Address address) { this.address = address; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -166,69 +133,38 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private Optional address = Optional.empty(); + private Address address; private Builder() { // force use of static builder() method } - /** * The ID of the supplier this entity is linked to. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * The ID of the supplier this entity is linked to. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The display name of the supplier. */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * The display name of the supplier. - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - - public Builder address(Address address) { - Utils.checkNotNull(address, "address"); - this.address = Optional.ofNullable(address); - return this; - } - - public Builder address(Optional address) { - Utils.checkNotNull(address, "address"); + public Builder address(@Nullable Address address) { this.address = address; return this; } public LinkedSupplierInput build() { - return new LinkedSupplierInput( id, displayName, address); } diff --git a/src/main/java/com/apideck/unify/models/components/LinkedTaxRate.java b/src/main/java/com/apideck/unify/models/components/LinkedTaxRate.java index 7bedcdf1..8dec2bdc 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedTaxRate.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedTaxRate.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -46,55 +47,51 @@ public class LinkedTaxRate { @JsonCreator public LinkedTaxRate( - @JsonProperty("id") JsonNullable id, - @JsonProperty("code") JsonNullable code, - @JsonProperty("name") JsonNullable name, - @JsonProperty("rate") JsonNullable rate) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(rate, "rate"); - this.id = id; - this.code = code; - this.name = name; - this.rate = rate; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("rate") @Nullable JsonNullable rate) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.rate = Optional.ofNullable(rate) + .orElse(JsonNullable.undefined()); } public LinkedTaxRate() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null); } /** * The ID of the object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Tax rate code */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Name of the tax rate */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * Rate of the tax rate */ - @JsonIgnore public JsonNullable rate() { - return rate; + return this.rate; } public static Builder builder() { @@ -105,74 +102,38 @@ public static Builder builder() { /** * The ID of the object. */ - public LinkedTaxRate withId(String id) { - Utils.checkNotNull(id, "id"); + public LinkedTaxRate withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * The ID of the object. - */ - public LinkedTaxRate withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * Tax rate code */ - public LinkedTaxRate withCode(String code) { - Utils.checkNotNull(code, "code"); + public LinkedTaxRate withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * Tax rate code - */ - public LinkedTaxRate withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * Name of the tax rate */ - public LinkedTaxRate withName(String name) { - Utils.checkNotNull(name, "name"); + public LinkedTaxRate withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Name of the tax rate - */ - public LinkedTaxRate withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * Rate of the tax rate */ - public LinkedTaxRate withRate(double rate) { - Utils.checkNotNull(rate, "rate"); + public LinkedTaxRate withRate(@Nullable Double rate) { this.rate = JsonNullable.of(rate); return this; } - /** - * Rate of the tax rate - */ - public LinkedTaxRate withRate(JsonNullable rate) { - Utils.checkNotNull(rate, "rate"); - this.rate = rate; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -209,96 +170,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable rate = JsonNullable.undefined(); + private JsonNullable rate; private Builder() { // force use of static builder() method } - /** * The ID of the object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * The ID of the object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * Tax rate code */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * Tax rate code - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Name of the tax rate */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Name of the tax rate - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * Rate of the tax rate */ - public Builder rate(double rate) { - Utils.checkNotNull(rate, "rate"); + public Builder rate(@Nullable Double rate) { this.rate = JsonNullable.of(rate); return this; } - /** - * Rate of the tax rate - */ - public Builder rate(JsonNullable rate) { - Utils.checkNotNull(rate, "rate"); - this.rate = rate; - return this; - } - public LinkedTaxRate build() { - return new LinkedTaxRate( id, code, name, rate); diff --git a/src/main/java/com/apideck/unify/models/components/LinkedTaxRateInput.java b/src/main/java/com/apideck/unify/models/components/LinkedTaxRateInput.java index b8daa34d..fd59599c 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedTaxRateInput.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedTaxRateInput.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -32,32 +33,30 @@ public class LinkedTaxRateInput { @JsonCreator public LinkedTaxRateInput( - @JsonProperty("id") JsonNullable id, - @JsonProperty("rate") JsonNullable rate) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(rate, "rate"); - this.id = id; - this.rate = rate; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("rate") @Nullable JsonNullable rate) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.rate = Optional.ofNullable(rate) + .orElse(JsonNullable.undefined()); } public LinkedTaxRateInput() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } /** * The ID of the object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Rate of the tax rate */ - @JsonIgnore public JsonNullable rate() { - return rate; + return this.rate; } public static Builder builder() { @@ -68,38 +67,20 @@ public static Builder builder() { /** * The ID of the object. */ - public LinkedTaxRateInput withId(String id) { - Utils.checkNotNull(id, "id"); + public LinkedTaxRateInput withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * The ID of the object. - */ - public LinkedTaxRateInput withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * Rate of the tax rate */ - public LinkedTaxRateInput withRate(double rate) { - Utils.checkNotNull(rate, "rate"); + public LinkedTaxRateInput withRate(@Nullable Double rate) { this.rate = JsonNullable.of(rate); return this; } - /** - * Rate of the tax rate - */ - public LinkedTaxRateInput withRate(JsonNullable rate) { - Utils.checkNotNull(rate, "rate"); - this.rate = rate; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -131,54 +112,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable rate = JsonNullable.undefined(); + private JsonNullable rate; private Builder() { // force use of static builder() method } - /** * The ID of the object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * The ID of the object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * Rate of the tax rate */ - public Builder rate(double rate) { - Utils.checkNotNull(rate, "rate"); + public Builder rate(@Nullable Double rate) { this.rate = JsonNullable.of(rate); return this; } - /** - * Rate of the tax rate - */ - public Builder rate(JsonNullable rate) { - Utils.checkNotNull(rate, "rate"); - this.rate = rate; - return this; - } - public LinkedTaxRateInput build() { - return new LinkedTaxRateInput( id, rate); } diff --git a/src/main/java/com/apideck/unify/models/components/LinkedTrackingCategory.java b/src/main/java/com/apideck/unify/models/components/LinkedTrackingCategory.java index a471661b..30273da0 100644 --- a/src/main/java/com/apideck/unify/models/components/LinkedTrackingCategory.java +++ b/src/main/java/com/apideck/unify/models/components/LinkedTrackingCategory.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -21,7 +21,7 @@ public class LinkedTrackingCategory { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the tracking category. @@ -32,32 +32,29 @@ public class LinkedTrackingCategory { @JsonCreator public LinkedTrackingCategory( - @JsonProperty("id") Optional id, - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable JsonNullable name) { this.id = id; - this.name = name; + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public LinkedTrackingCategory() { - this(Optional.empty(), JsonNullable.undefined()); + this(null, null); } /** * The unique identifier for the tracking category. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the tracking category. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -68,39 +65,20 @@ public static Builder builder() { /** * The unique identifier for the tracking category. */ - public LinkedTrackingCategory withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier for the tracking category. - */ - public LinkedTrackingCategory withId(Optional id) { - Utils.checkNotNull(id, "id"); + public LinkedTrackingCategory withId(@Nullable String id) { this.id = id; return this; } + /** * The name of the tracking category. */ - public LinkedTrackingCategory withName(String name) { - Utils.checkNotNull(name, "name"); + public LinkedTrackingCategory withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the tracking category. - */ - public LinkedTrackingCategory withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -132,54 +110,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - - /** - * The unique identifier for the tracking category. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The unique identifier for the tracking category. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the tracking category. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the tracking category. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public LinkedTrackingCategory build() { - return new LinkedTrackingCategory( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/Links.java b/src/main/java/com/apideck/unify/models/components/Links.java index 23f96419..195f185d 100644 --- a/src/main/java/com/apideck/unify/models/components/Links.java +++ b/src/main/java/com/apideck/unify/models/components/Links.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -32,7 +32,7 @@ public class Links { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("current") - private Optional current; + private String current; /** * Link to navigate to the previous page through the API @@ -43,43 +43,39 @@ public class Links { @JsonCreator public Links( - @JsonProperty("previous") JsonNullable previous, - @JsonProperty("current") Optional current, - @JsonProperty("next") JsonNullable next) { - Utils.checkNotNull(previous, "previous"); - Utils.checkNotNull(current, "current"); - Utils.checkNotNull(next, "next"); - this.previous = previous; + @JsonProperty("previous") @Nullable JsonNullable previous, + @JsonProperty("current") @Nullable String current, + @JsonProperty("next") @Nullable JsonNullable next) { + this.previous = Optional.ofNullable(previous) + .orElse(JsonNullable.undefined()); this.current = current; - this.next = next; + this.next = Optional.ofNullable(next) + .orElse(JsonNullable.undefined()); } public Links() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null); } /** * Link to navigate to the previous page through the API */ - @JsonIgnore public JsonNullable previous() { - return previous; + return this.previous; } /** * Link to navigate to the current page through the API */ - @JsonIgnore public Optional current() { - return current; + return Optional.ofNullable(this.current); } /** * Link to navigate to the previous page through the API */ - @JsonIgnore public JsonNullable next() { - return next; + return this.next; } public static Builder builder() { @@ -90,57 +86,29 @@ public static Builder builder() { /** * Link to navigate to the previous page through the API */ - public Links withPrevious(String previous) { - Utils.checkNotNull(previous, "previous"); + public Links withPrevious(@Nullable String previous) { this.previous = JsonNullable.of(previous); return this; } - /** - * Link to navigate to the previous page through the API - */ - public Links withPrevious(JsonNullable previous) { - Utils.checkNotNull(previous, "previous"); - this.previous = previous; - return this; - } - - /** - * Link to navigate to the current page through the API - */ - public Links withCurrent(String current) { - Utils.checkNotNull(current, "current"); - this.current = Optional.ofNullable(current); - return this; - } - /** * Link to navigate to the current page through the API */ - public Links withCurrent(Optional current) { - Utils.checkNotNull(current, "current"); + public Links withCurrent(@Nullable String current) { this.current = current; return this; } + /** * Link to navigate to the previous page through the API */ - public Links withNext(String next) { - Utils.checkNotNull(next, "next"); + public Links withNext(@Nullable String next) { this.next = JsonNullable.of(next); return this; } - /** - * Link to navigate to the previous page through the API - */ - public Links withNext(JsonNullable next) { - Utils.checkNotNull(next, "next"); - this.next = next; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -174,75 +142,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable previous = JsonNullable.undefined(); + private JsonNullable previous; - private Optional current = Optional.empty(); + private String current; - private JsonNullable next = JsonNullable.undefined(); + private JsonNullable next; private Builder() { // force use of static builder() method } - /** * Link to navigate to the previous page through the API */ - public Builder previous(String previous) { - Utils.checkNotNull(previous, "previous"); + public Builder previous(@Nullable String previous) { this.previous = JsonNullable.of(previous); return this; } - /** - * Link to navigate to the previous page through the API - */ - public Builder previous(JsonNullable previous) { - Utils.checkNotNull(previous, "previous"); - this.previous = previous; - return this; - } - - - /** - * Link to navigate to the current page through the API - */ - public Builder current(String current) { - Utils.checkNotNull(current, "current"); - this.current = Optional.ofNullable(current); - return this; - } - /** * Link to navigate to the current page through the API */ - public Builder current(Optional current) { - Utils.checkNotNull(current, "current"); + public Builder current(@Nullable String current) { this.current = current; return this; } - /** * Link to navigate to the previous page through the API */ - public Builder next(String next) { - Utils.checkNotNull(next, "next"); + public Builder next(@Nullable String next) { this.next = JsonNullable.of(next); return this; } - /** - * Link to navigate to the previous page through the API - */ - public Builder next(JsonNullable next) { - Utils.checkNotNull(next, "next"); - this.next = next; - return this; - } - public Links build() { - return new Links( previous, current, next); } diff --git a/src/main/java/com/apideck/unify/models/components/Log.java b/src/main/java/com/apideck/unify/models/components/Log.java index 15763fed..de927bae 100644 --- a/src/main/java/com/apideck/unify/models/components/Log.java +++ b/src/main/java/com/apideck/unify/models/components/Log.java @@ -5,13 +5,11 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Boolean; -import java.lang.Double; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -97,7 +95,7 @@ public class Log { */ @JsonInclude(Include.ALWAYS) @JsonProperty("parent_id") - private Optional parentId; + private JsonNullable parentId; /** * The path component of the URI the request was made to. @@ -150,265 +148,235 @@ public class Log { @JsonCreator public Log( - @JsonProperty("api_style") String apiStyle, - @JsonProperty("base_url") String baseUrl, + @JsonProperty("api_style") @Nonnull String apiStyle, + @JsonProperty("base_url") @Nonnull String baseUrl, @JsonProperty("child_request") boolean childRequest, - @JsonProperty("consumer_id") String consumerId, + @JsonProperty("consumer_id") @Nonnull String consumerId, @JsonProperty("duration") double duration, - @JsonProperty("error_message") JsonNullable errorMessage, + @JsonProperty("error_message") @Nullable JsonNullable errorMessage, @JsonProperty("execution") long execution, @JsonProperty("has_children") boolean hasChildren, - @JsonProperty("http_method") String httpMethod, - @JsonProperty("id") String id, + @JsonProperty("http_method") @Nonnull String httpMethod, + @JsonProperty("id") @Nonnull String id, @JsonProperty("latency") double latency, - @JsonProperty("operation") Operation operation, - @JsonProperty("parent_id") Optional parentId, - @JsonProperty("path") String path, + @JsonProperty("operation") @Nonnull Operation operation, + @JsonProperty("parent_id") @Nullable String parentId, + @JsonProperty("path") @Nonnull String path, @JsonProperty("sandbox") boolean sandbox, - @JsonProperty("service") Service service, - @JsonProperty("source_ip") JsonNullable sourceIp, + @JsonProperty("service") @Nonnull Service service, + @JsonProperty("source_ip") @Nullable JsonNullable sourceIp, @JsonProperty("status_code") long statusCode, @JsonProperty("success") boolean success, - @JsonProperty("timestamp") String timestamp, - @JsonProperty("unified_api") UnifiedApi unifiedApi) { - Utils.checkNotNull(apiStyle, "apiStyle"); - Utils.checkNotNull(baseUrl, "baseUrl"); - Utils.checkNotNull(childRequest, "childRequest"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(duration, "duration"); - Utils.checkNotNull(errorMessage, "errorMessage"); - Utils.checkNotNull(execution, "execution"); - Utils.checkNotNull(hasChildren, "hasChildren"); - Utils.checkNotNull(httpMethod, "httpMethod"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(latency, "latency"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(path, "path"); - Utils.checkNotNull(sandbox, "sandbox"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(sourceIp, "sourceIp"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(success, "success"); - Utils.checkNotNull(timestamp, "timestamp"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.apiStyle = apiStyle; - this.baseUrl = baseUrl; + @JsonProperty("timestamp") @Nonnull String timestamp, + @JsonProperty("unified_api") @Nonnull UnifiedApi unifiedApi) { + this.apiStyle = Optional.ofNullable(apiStyle) + .orElseThrow(() -> new IllegalArgumentException("apiStyle cannot be null")); + this.baseUrl = Optional.ofNullable(baseUrl) + .orElseThrow(() -> new IllegalArgumentException("baseUrl cannot be null")); this.childRequest = childRequest; - this.consumerId = consumerId; + this.consumerId = Optional.ofNullable(consumerId) + .orElseThrow(() -> new IllegalArgumentException("consumerId cannot be null")); this.duration = duration; - this.errorMessage = errorMessage; + this.errorMessage = Optional.ofNullable(errorMessage) + .orElse(JsonNullable.undefined()); this.execution = execution; this.hasChildren = hasChildren; - this.httpMethod = httpMethod; - this.id = id; + this.httpMethod = Optional.ofNullable(httpMethod) + .orElseThrow(() -> new IllegalArgumentException("httpMethod cannot be null")); + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.latency = latency; - this.operation = operation; - this.parentId = parentId; - this.path = path; + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.parentId = JsonNullable.of(parentId); + this.path = Optional.ofNullable(path) + .orElseThrow(() -> new IllegalArgumentException("path cannot be null")); this.sandbox = sandbox; - this.service = service; - this.sourceIp = sourceIp; + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.sourceIp = Optional.ofNullable(sourceIp) + .orElse(JsonNullable.undefined()); this.statusCode = statusCode; this.success = success; - this.timestamp = timestamp; - this.unifiedApi = unifiedApi; + this.timestamp = Optional.ofNullable(timestamp) + .orElseThrow(() -> new IllegalArgumentException("timestamp cannot be null")); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); } public Log( - String apiStyle, - String baseUrl, + @Nonnull String apiStyle, + @Nonnull String baseUrl, boolean childRequest, - String consumerId, + @Nonnull String consumerId, double duration, long execution, boolean hasChildren, - String httpMethod, - String id, + @Nonnull String httpMethod, + @Nonnull String id, double latency, - Operation operation, - String path, + @Nonnull Operation operation, + @Nonnull String path, boolean sandbox, - Service service, + @Nonnull Service service, long statusCode, boolean success, - String timestamp, - UnifiedApi unifiedApi) { + @Nonnull String timestamp, + @Nonnull UnifiedApi unifiedApi) { this(apiStyle, baseUrl, childRequest, - consumerId, duration, JsonNullable.undefined(), + consumerId, duration, null, execution, hasChildren, httpMethod, id, latency, operation, - Optional.empty(), path, sandbox, - service, JsonNullable.undefined(), statusCode, + null, path, sandbox, + service, null, statusCode, success, timestamp, unifiedApi); } /** * Indicates if the request was made via REST or Graphql endpoint. */ - @JsonIgnore public String apiStyle() { - return apiStyle; + return this.apiStyle; } /** * The Apideck base URL the request was made to. */ - @JsonIgnore public String baseUrl() { - return baseUrl; + return this.baseUrl; } /** * Indicates whether or not this is a child or parent request. */ - @JsonIgnore public boolean childRequest() { - return childRequest; + return this.childRequest; } /** * The consumer Id associated with the request. */ - @JsonIgnore public String consumerId() { - return consumerId; + return this.consumerId; } /** * The entire execution time in milliseconds it took to call the Apideck service provider. */ - @JsonIgnore public double duration() { - return duration; + return this.duration; } /** * If error occurred, this is brief explanation */ - @JsonIgnore public JsonNullable errorMessage() { - return errorMessage; + return this.errorMessage; } /** * The entire execution time in milliseconds it took to make the request. */ - @JsonIgnore public long execution() { - return execution; + return this.execution; } /** * When request is a parent request, this indicates if there are child requests associated. */ - @JsonIgnore public boolean hasChildren() { - return hasChildren; + return this.hasChildren; } /** * HTTP Method of request. */ - @JsonIgnore public String httpMethod() { - return httpMethod; + return this.httpMethod; } /** * UUID acting as Request Identifier. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Latency added by making this request via Unified Api. */ - @JsonIgnore public double latency() { - return latency; + return this.latency; } /** * The request as defined in OpenApi Spec. */ - @JsonIgnore public Operation operation() { - return operation; + return this.operation; } /** * When request is a child request, this UUID indicates it's parent request. */ - @JsonIgnore - public Optional parentId() { - return parentId; + public JsonNullable parentId() { + return this.parentId; } /** * The path component of the URI the request was made to. */ - @JsonIgnore public String path() { - return path; + return this.path; } /** * Indicates whether the request was made using Apidecks sandbox credentials or not. */ - @JsonIgnore public boolean sandbox() { - return sandbox; + return this.sandbox; } /** * Apideck service provider associated with request. */ - @JsonIgnore public Service service() { - return service; + return this.service; } /** * The IP address of the source of the request. */ - @JsonIgnore public JsonNullable sourceIp() { - return sourceIp; + return this.sourceIp; } /** * HTTP Status code that was returned. */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * Whether or not the request was successful. */ - @JsonIgnore public boolean success() { - return success; + return this.success; } /** * ISO Date and time when the request was made. */ - @JsonIgnore public String timestamp() { - return timestamp; + return this.timestamp; } /** * Which Unified Api request was made to. */ - @JsonIgnore public UnifiedApi unifiedApi() { - return unifiedApi; + return this.unifiedApi; } public static Builder builder() { @@ -419,126 +387,107 @@ public static Builder builder() { /** * Indicates if the request was made via REST or Graphql endpoint. */ - public Log withApiStyle(String apiStyle) { - Utils.checkNotNull(apiStyle, "apiStyle"); - this.apiStyle = apiStyle; + public Log withApiStyle(@Nonnull String apiStyle) { + this.apiStyle = Utils.checkNotNull(apiStyle, "apiStyle"); return this; } + /** * The Apideck base URL the request was made to. */ - public Log withBaseUrl(String baseUrl) { - Utils.checkNotNull(baseUrl, "baseUrl"); - this.baseUrl = baseUrl; + public Log withBaseUrl(@Nonnull String baseUrl) { + this.baseUrl = Utils.checkNotNull(baseUrl, "baseUrl"); return this; } + /** * Indicates whether or not this is a child or parent request. */ public Log withChildRequest(boolean childRequest) { - Utils.checkNotNull(childRequest, "childRequest"); this.childRequest = childRequest; return this; } + /** * The consumer Id associated with the request. */ - public Log withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public Log withConsumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } + /** * The entire execution time in milliseconds it took to call the Apideck service provider. */ public Log withDuration(double duration) { - Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; } + /** * If error occurred, this is brief explanation */ - public Log withErrorMessage(String errorMessage) { - Utils.checkNotNull(errorMessage, "errorMessage"); + public Log withErrorMessage(@Nullable String errorMessage) { this.errorMessage = JsonNullable.of(errorMessage); return this; } - /** - * If error occurred, this is brief explanation - */ - public Log withErrorMessage(JsonNullable errorMessage) { - Utils.checkNotNull(errorMessage, "errorMessage"); - this.errorMessage = errorMessage; - return this; - } /** * The entire execution time in milliseconds it took to make the request. */ public Log withExecution(long execution) { - Utils.checkNotNull(execution, "execution"); this.execution = execution; return this; } + /** * When request is a parent request, this indicates if there are child requests associated. */ public Log withHasChildren(boolean hasChildren) { - Utils.checkNotNull(hasChildren, "hasChildren"); this.hasChildren = hasChildren; return this; } + /** * HTTP Method of request. */ - public Log withHttpMethod(String httpMethod) { - Utils.checkNotNull(httpMethod, "httpMethod"); - this.httpMethod = httpMethod; + public Log withHttpMethod(@Nonnull String httpMethod) { + this.httpMethod = Utils.checkNotNull(httpMethod, "httpMethod"); return this; } + /** * UUID acting as Request Identifier. */ - public Log withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Log withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * Latency added by making this request via Unified Api. */ public Log withLatency(double latency) { - Utils.checkNotNull(latency, "latency"); this.latency = latency; return this; } - /** - * The request as defined in OpenApi Spec. - */ - public Log withOperation(Operation operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; - return this; - } /** - * When request is a child request, this UUID indicates it's parent request. + * The request as defined in OpenApi Spec. */ - public Log withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = Optional.ofNullable(parentId); + public Log withOperation(@Nonnull Operation operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } @@ -546,93 +495,84 @@ public Log withParentId(String parentId) { /** * When request is a child request, this UUID indicates it's parent request. */ - public Log withParentId(Optional parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; + public Log withParentId(@Nullable String parentId) { + this.parentId = JsonNullable.of(parentId); return this; } + /** * The path component of the URI the request was made to. */ - public Log withPath(String path) { - Utils.checkNotNull(path, "path"); - this.path = path; + public Log withPath(@Nonnull String path) { + this.path = Utils.checkNotNull(path, "path"); return this; } + /** * Indicates whether the request was made using Apidecks sandbox credentials or not. */ public Log withSandbox(boolean sandbox) { - Utils.checkNotNull(sandbox, "sandbox"); this.sandbox = sandbox; return this; } + /** * Apideck service provider associated with request. */ - public Log withService(Service service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Log withService(@Nonnull Service service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * The IP address of the source of the request. */ - public Log withSourceIp(String sourceIp) { - Utils.checkNotNull(sourceIp, "sourceIp"); + public Log withSourceIp(@Nullable String sourceIp) { this.sourceIp = JsonNullable.of(sourceIp); return this; } - /** - * The IP address of the source of the request. - */ - public Log withSourceIp(JsonNullable sourceIp) { - Utils.checkNotNull(sourceIp, "sourceIp"); - this.sourceIp = sourceIp; - return this; - } /** * HTTP Status code that was returned. */ public Log withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * Whether or not the request was successful. */ public Log withSuccess(boolean success) { - Utils.checkNotNull(success, "success"); this.success = success; return this; } + /** * ISO Date and time when the request was made. */ - public Log withTimestamp(String timestamp) { - Utils.checkNotNull(timestamp, "timestamp"); - this.timestamp = timestamp; + public Log withTimestamp(@Nonnull String timestamp) { + this.timestamp = Utils.checkNotNull(timestamp, "timestamp"); return this; } + /** * Which Unified Api request was made to. */ - public Log withUnifiedApi(UnifiedApi unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Log withUnifiedApi(@Nonnull UnifiedApi unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -711,39 +651,39 @@ public final static class Builder { private String baseUrl; - private Boolean childRequest; + private boolean childRequest; private String consumerId; - private Double duration; + private double duration; - private JsonNullable errorMessage = JsonNullable.undefined(); + private JsonNullable errorMessage; - private Long execution; + private long execution; - private Boolean hasChildren; + private boolean hasChildren; private String httpMethod; private String id; - private Double latency; + private double latency; private Operation operation; - private Optional parentId = Optional.empty(); + private String parentId; private String path; - private Boolean sandbox; + private boolean sandbox; private Service service; - private JsonNullable sourceIp = JsonNullable.undefined(); + private JsonNullable sourceIp; - private Long statusCode; + private long statusCode; - private Boolean success; + private boolean success; private String timestamp; @@ -753,245 +693,175 @@ private Builder() { // force use of static builder() method } - /** * Indicates if the request was made via REST or Graphql endpoint. */ - public Builder apiStyle(String apiStyle) { - Utils.checkNotNull(apiStyle, "apiStyle"); - this.apiStyle = apiStyle; + public Builder apiStyle(@Nonnull String apiStyle) { + this.apiStyle = Utils.checkNotNull(apiStyle, "apiStyle"); return this; } - /** * The Apideck base URL the request was made to. */ - public Builder baseUrl(String baseUrl) { - Utils.checkNotNull(baseUrl, "baseUrl"); - this.baseUrl = baseUrl; + public Builder baseUrl(@Nonnull String baseUrl) { + this.baseUrl = Utils.checkNotNull(baseUrl, "baseUrl"); return this; } - /** * Indicates whether or not this is a child or parent request. */ public Builder childRequest(boolean childRequest) { - Utils.checkNotNull(childRequest, "childRequest"); this.childRequest = childRequest; return this; } - /** * The consumer Id associated with the request. */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public Builder consumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } - /** * The entire execution time in milliseconds it took to call the Apideck service provider. */ public Builder duration(double duration) { - Utils.checkNotNull(duration, "duration"); this.duration = duration; return this; } - /** * If error occurred, this is brief explanation */ - public Builder errorMessage(String errorMessage) { - Utils.checkNotNull(errorMessage, "errorMessage"); + public Builder errorMessage(@Nullable String errorMessage) { this.errorMessage = JsonNullable.of(errorMessage); return this; } - /** - * If error occurred, this is brief explanation - */ - public Builder errorMessage(JsonNullable errorMessage) { - Utils.checkNotNull(errorMessage, "errorMessage"); - this.errorMessage = errorMessage; - return this; - } - - /** * The entire execution time in milliseconds it took to make the request. */ public Builder execution(long execution) { - Utils.checkNotNull(execution, "execution"); this.execution = execution; return this; } - /** * When request is a parent request, this indicates if there are child requests associated. */ public Builder hasChildren(boolean hasChildren) { - Utils.checkNotNull(hasChildren, "hasChildren"); this.hasChildren = hasChildren; return this; } - /** * HTTP Method of request. */ - public Builder httpMethod(String httpMethod) { - Utils.checkNotNull(httpMethod, "httpMethod"); - this.httpMethod = httpMethod; + public Builder httpMethod(@Nonnull String httpMethod) { + this.httpMethod = Utils.checkNotNull(httpMethod, "httpMethod"); return this; } - /** * UUID acting as Request Identifier. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * Latency added by making this request via Unified Api. */ public Builder latency(double latency) { - Utils.checkNotNull(latency, "latency"); this.latency = latency; return this; } - /** * The request as defined in OpenApi Spec. */ - public Builder operation(Operation operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull Operation operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * When request is a child request, this UUID indicates it's parent request. */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = Optional.ofNullable(parentId); - return this; - } - - /** - * When request is a child request, this UUID indicates it's parent request. - */ - public Builder parentId(Optional parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = parentId; return this; } - /** * The path component of the URI the request was made to. */ - public Builder path(String path) { - Utils.checkNotNull(path, "path"); - this.path = path; + public Builder path(@Nonnull String path) { + this.path = Utils.checkNotNull(path, "path"); return this; } - /** * Indicates whether the request was made using Apidecks sandbox credentials or not. */ public Builder sandbox(boolean sandbox) { - Utils.checkNotNull(sandbox, "sandbox"); this.sandbox = sandbox; return this; } - /** * Apideck service provider associated with request. */ - public Builder service(Service service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull Service service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * The IP address of the source of the request. */ - public Builder sourceIp(String sourceIp) { - Utils.checkNotNull(sourceIp, "sourceIp"); + public Builder sourceIp(@Nullable String sourceIp) { this.sourceIp = JsonNullable.of(sourceIp); return this; } - /** - * The IP address of the source of the request. - */ - public Builder sourceIp(JsonNullable sourceIp) { - Utils.checkNotNull(sourceIp, "sourceIp"); - this.sourceIp = sourceIp; - return this; - } - - /** * HTTP Status code that was returned. */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Whether or not the request was successful. */ public Builder success(boolean success) { - Utils.checkNotNull(success, "success"); this.success = success; return this; } - /** * ISO Date and time when the request was made. */ - public Builder timestamp(String timestamp) { - Utils.checkNotNull(timestamp, "timestamp"); - this.timestamp = timestamp; + public Builder timestamp(@Nonnull String timestamp) { + this.timestamp = Utils.checkNotNull(timestamp, "timestamp"); return this; } - /** * Which Unified Api request was made to. */ - public Builder unifiedApi(UnifiedApi unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull UnifiedApi unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } public Log build() { - return new Log( apiStyle, baseUrl, childRequest, consumerId, duration, errorMessage, diff --git a/src/main/java/com/apideck/unify/models/components/LogsFilter.java b/src/main/java/com/apideck/unify/models/components/LogsFilter.java index f7607374..2e56a4d3 100644 --- a/src/main/java/com/apideck/unify/models/components/LogsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/LogsFilter.java @@ -6,10 +6,11 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -28,34 +29,31 @@ public class LogsFilter { @JsonCreator public LogsFilter( - JsonNullable connectorId, - JsonNullable statusCode, - JsonNullable excludeUnifiedApis) { - Utils.checkNotNull(connectorId, "connectorId"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(excludeUnifiedApis, "excludeUnifiedApis"); - this.connectorId = connectorId; - this.statusCode = statusCode; - this.excludeUnifiedApis = excludeUnifiedApis; + @Nullable JsonNullable connectorId, + @Nullable JsonNullable statusCode, + @Nullable JsonNullable excludeUnifiedApis) { + this.connectorId = Optional.ofNullable(connectorId) + .orElse(JsonNullable.undefined()); + this.statusCode = Optional.ofNullable(statusCode) + .orElse(JsonNullable.undefined()); + this.excludeUnifiedApis = Optional.ofNullable(excludeUnifiedApis) + .orElse(JsonNullable.undefined()); } public LogsFilter() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } - @JsonIgnore public JsonNullable connectorId() { - return connectorId; + return this.connectorId; } - @JsonIgnore public JsonNullable statusCode() { - return statusCode; + return this.statusCode; } - @JsonIgnore public JsonNullable excludeUnifiedApis() { - return excludeUnifiedApis; + return this.excludeUnifiedApis; } public static Builder builder() { @@ -63,41 +61,23 @@ public static Builder builder() { } - public LogsFilter withConnectorId(String connectorId) { - Utils.checkNotNull(connectorId, "connectorId"); + public LogsFilter withConnectorId(@Nullable String connectorId) { this.connectorId = JsonNullable.of(connectorId); return this; } - public LogsFilter withConnectorId(JsonNullable connectorId) { - Utils.checkNotNull(connectorId, "connectorId"); - this.connectorId = connectorId; - return this; - } - public LogsFilter withStatusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public LogsFilter withStatusCode(@Nullable Double statusCode) { this.statusCode = JsonNullable.of(statusCode); return this; } - public LogsFilter withStatusCode(JsonNullable statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = statusCode; - return this; - } - public LogsFilter withExcludeUnifiedApis(String excludeUnifiedApis) { - Utils.checkNotNull(excludeUnifiedApis, "excludeUnifiedApis"); + public LogsFilter withExcludeUnifiedApis(@Nullable String excludeUnifiedApis) { this.excludeUnifiedApis = JsonNullable.of(excludeUnifiedApis); return this; } - public LogsFilter withExcludeUnifiedApis(JsonNullable excludeUnifiedApis) { - Utils.checkNotNull(excludeUnifiedApis, "excludeUnifiedApis"); - this.excludeUnifiedApis = excludeUnifiedApis; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -131,57 +111,32 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable connectorId = JsonNullable.undefined(); + private JsonNullable connectorId; - private JsonNullable statusCode = JsonNullable.undefined(); + private JsonNullable statusCode; - private JsonNullable excludeUnifiedApis = JsonNullable.undefined(); + private JsonNullable excludeUnifiedApis; private Builder() { // force use of static builder() method } - - public Builder connectorId(String connectorId) { - Utils.checkNotNull(connectorId, "connectorId"); + public Builder connectorId(@Nullable String connectorId) { this.connectorId = JsonNullable.of(connectorId); return this; } - public Builder connectorId(JsonNullable connectorId) { - Utils.checkNotNull(connectorId, "connectorId"); - this.connectorId = connectorId; - return this; - } - - - public Builder statusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public Builder statusCode(@Nullable Double statusCode) { this.statusCode = JsonNullable.of(statusCode); return this; } - public Builder statusCode(JsonNullable statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = statusCode; - return this; - } - - - public Builder excludeUnifiedApis(String excludeUnifiedApis) { - Utils.checkNotNull(excludeUnifiedApis, "excludeUnifiedApis"); + public Builder excludeUnifiedApis(@Nullable String excludeUnifiedApis) { this.excludeUnifiedApis = JsonNullable.of(excludeUnifiedApis); return this; } - public Builder excludeUnifiedApis(JsonNullable excludeUnifiedApis) { - Utils.checkNotNull(excludeUnifiedApis, "excludeUnifiedApis"); - this.excludeUnifiedApis = excludeUnifiedApis; - return this; - } - public LogsFilter build() { - return new LogsFilter( connectorId, statusCode, excludeUnifiedApis); } diff --git a/src/main/java/com/apideck/unify/models/components/Manager.java b/src/main/java/com/apideck/unify/models/components/Manager.java index bca67346..0d9f205c 100644 --- a/src/main/java/com/apideck/unify/models/components/Manager.java +++ b/src/main/java/com/apideck/unify/models/components/Manager.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -56,82 +56,75 @@ public class Manager { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("employment_status") - private JsonNullable employmentStatus; + private JsonNullable employmentStatus; @JsonCreator public Manager( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("email") JsonNullable email, - @JsonProperty("employment_status") JsonNullable employmentStatus) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(employmentStatus, "employmentStatus"); - this.id = id; - this.name = name; - this.firstName = firstName; - this.lastName = lastName; - this.email = email; - this.employmentStatus = employmentStatus; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("email") @Nullable JsonNullable email, + @JsonProperty("employment_status") @Nullable JsonNullable employmentStatus) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.email = Optional.ofNullable(email) + .orElse(JsonNullable.undefined()); + this.employmentStatus = Optional.ofNullable(employmentStatus) + .orElse(JsonNullable.undefined()); } public Manager() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The name of the manager, often a combination of their first and last names. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * The email address of the manager. */ - @JsonIgnore public JsonNullable email() { - return email; + return this.email; } /** * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable employmentStatus() { - return (JsonNullable) employmentStatus; + return this.employmentStatus; } public static Builder builder() { @@ -142,110 +135,56 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Manager withId(String id) { - Utils.checkNotNull(id, "id"); + public Manager withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Manager withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The name of the manager, often a combination of their first and last names. */ - public Manager withName(String name) { - Utils.checkNotNull(name, "name"); + public Manager withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the manager, often a combination of their first and last names. - */ - public Manager withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The first name of the person. */ - public Manager withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Manager withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Manager withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public Manager withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Manager withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Manager withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * The email address of the manager. */ - public Manager withEmail(String email) { - Utils.checkNotNull(email, "email"); + public Manager withEmail(@Nullable String email) { this.email = JsonNullable.of(email); return this; } - /** - * The email address of the manager. - */ - public Manager withEmail(JsonNullable email) { - Utils.checkNotNull(email, "email"); - this.email = email; - return this; - } /** * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. */ - public Manager withEmploymentStatus(EmploymentStatus employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); + public Manager withEmploymentStatus(@Nullable EmploymentStatus employmentStatus) { this.employmentStatus = JsonNullable.of(employmentStatus); return this; } - /** - * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. - */ - public Manager withEmploymentStatus(JsonNullable employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); - this.employmentStatus = employmentStatus; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -286,138 +225,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable email = JsonNullable.undefined(); + private JsonNullable email; - private JsonNullable employmentStatus = JsonNullable.undefined(); + private JsonNullable employmentStatus; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The name of the manager, often a combination of their first and last names. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the manager, often a combination of their first and last names. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * The email address of the manager. */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = JsonNullable.of(email); return this; } - /** - * The email address of the manager. - */ - public Builder email(JsonNullable email) { - Utils.checkNotNull(email, "email"); - this.email = email; - return this; - } - - /** * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. */ - public Builder employmentStatus(EmploymentStatus employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); + public Builder employmentStatus(@Nullable EmploymentStatus employmentStatus) { this.employmentStatus = JsonNullable.of(employmentStatus); return this; } - /** - * The employment status of the employee, indicating whether they are currently employed, inactive, terminated, or in another status. - */ - public Builder employmentStatus(JsonNullable employmentStatus) { - Utils.checkNotNull(employmentStatus, "employmentStatus"); - this.employmentStatus = employmentStatus; - return this; - } - public Manager build() { - return new Manager( id, name, firstName, lastName, email, employmentStatus); diff --git a/src/main/java/com/apideck/unify/models/components/Message.java b/src/main/java/com/apideck/unify/models/components/Message.java index 802238a5..a352d7ad 100644 --- a/src/main/java/com/apideck/unify/models/components/Message.java +++ b/src/main/java/com/apideck/unify/models/components/Message.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -27,7 +27,7 @@ public class Message { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The phone number that initiated the message. @@ -44,7 +44,7 @@ public class Message { @JsonInclude(Include.NON_ABSENT) @JsonProperty("subject") - private Optional subject; + private String subject; /** * The message text. @@ -57,91 +57,91 @@ public class Message { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private MessageType type; /** * The number of units that make up the complete message. Messages can be split up due to the constraints of the message size. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("number_of_units") - private Optional numberOfUnits; + private Long numberOfUnits; /** * The number of media files associated with the message. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("number_of_media_files") - private Optional numberOfMediaFiles; + private Long numberOfMediaFiles; /** * The direction of the message. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("direction") - private Optional direction; + private Direction direction; /** * Status of the delivery of the message. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private MessageStatus status; /** * The scheduled date and time of the message. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("scheduled_at") - private Optional scheduledAt; + private OffsetDateTime scheduledAt; /** * The date and time that the message was sent */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("sent_at") - private Optional sentAt; + private OffsetDateTime sentAt; /** * Define a webhook to receive delivery notifications. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("webhook_url") - private Optional webhookUrl; + private String webhookUrl; /** * A client reference. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("reference") - private Optional reference; + private String reference; /** * Price of the message. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("price") - private Optional price; + private Price price; /** * The error returned if your message status is failed or undelivered. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("error") - private Optional error; + private Error error; /** * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("messaging_service_id") - private Optional messagingServiceId; + private String messagingServiceId; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -176,61 +176,41 @@ public class Message { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Message( - @JsonProperty("id") Optional id, - @JsonProperty("from") String from, - @JsonProperty("to") String to, - @JsonProperty("subject") Optional subject, - @JsonProperty("body") String body, - @JsonProperty("type") Optional type, - @JsonProperty("number_of_units") Optional numberOfUnits, - @JsonProperty("number_of_media_files") Optional numberOfMediaFiles, - @JsonProperty("direction") Optional direction, - @JsonProperty("status") Optional status, - @JsonProperty("scheduled_at") Optional scheduledAt, - @JsonProperty("sent_at") Optional sentAt, - @JsonProperty("webhook_url") Optional webhookUrl, - @JsonProperty("reference") Optional reference, - @JsonProperty("price") Optional price, - @JsonProperty("error") Optional error, - @JsonProperty("messaging_service_id") Optional messagingServiceId, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(from, "from"); - Utils.checkNotNull(to, "to"); - Utils.checkNotNull(subject, "subject"); - Utils.checkNotNull(body, "body"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(numberOfUnits, "numberOfUnits"); - Utils.checkNotNull(numberOfMediaFiles, "numberOfMediaFiles"); - Utils.checkNotNull(direction, "direction"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(scheduledAt, "scheduledAt"); - Utils.checkNotNull(sentAt, "sentAt"); - Utils.checkNotNull(webhookUrl, "webhookUrl"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(price, "price"); - Utils.checkNotNull(error, "error"); - Utils.checkNotNull(messagingServiceId, "messagingServiceId"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("from") @Nonnull String from, + @JsonProperty("to") @Nonnull String to, + @JsonProperty("subject") @Nullable String subject, + @JsonProperty("body") @Nonnull String body, + @JsonProperty("type") @Nullable MessageType type, + @JsonProperty("number_of_units") @Nullable Long numberOfUnits, + @JsonProperty("number_of_media_files") @Nullable Long numberOfMediaFiles, + @JsonProperty("direction") @Nullable Direction direction, + @JsonProperty("status") @Nullable MessageStatus status, + @JsonProperty("scheduled_at") @Nullable OffsetDateTime scheduledAt, + @JsonProperty("sent_at") @Nullable OffsetDateTime sentAt, + @JsonProperty("webhook_url") @Nullable String webhookUrl, + @JsonProperty("reference") @Nullable String reference, + @JsonProperty("price") @Nullable Price price, + @JsonProperty("error") @Nullable Error error, + @JsonProperty("messaging_service_id") @Nullable String messagingServiceId, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.from = from; - this.to = to; + this.from = Optional.ofNullable(from) + .orElseThrow(() -> new IllegalArgumentException("from cannot be null")); + this.to = Optional.ofNullable(to) + .orElseThrow(() -> new IllegalArgumentException("to cannot be null")); this.subject = subject; - this.body = body; + this.body = Optional.ofNullable(body) + .orElseThrow(() -> new IllegalArgumentException("body cannot be null")); this.type = type; this.numberOfUnits = numberOfUnits; this.numberOfMediaFiles = numberOfMediaFiles; @@ -243,214 +223,189 @@ public Message( this.price = price; this.error = error; this.messagingServiceId = messagingServiceId; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Message( - String from, - String to, - String body) { - this(Optional.empty(), from, to, - Optional.empty(), body, Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + @Nonnull String from, + @Nonnull String to, + @Nonnull String body) { + this(null, from, to, + null, body, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The phone number that initiated the message. */ - @JsonIgnore public String from() { - return from; + return this.from; } /** * The phone number that received the message. */ - @JsonIgnore public String to() { - return to; + return this.to; } - @JsonIgnore public Optional subject() { - return subject; + return Optional.ofNullable(this.subject); } /** * The message text. */ - @JsonIgnore public String body() { - return body; + return this.body; } /** * Set to sms for SMS messages and mms for MMS messages. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } /** * The number of units that make up the complete message. Messages can be split up due to the constraints of the message size. */ - @JsonIgnore public Optional numberOfUnits() { - return numberOfUnits; + return Optional.ofNullable(this.numberOfUnits); } /** * The number of media files associated with the message. */ - @JsonIgnore public Optional numberOfMediaFiles() { - return numberOfMediaFiles; + return Optional.ofNullable(this.numberOfMediaFiles); } /** * The direction of the message. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } /** * Status of the delivery of the message. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * The scheduled date and time of the message. */ - @JsonIgnore public Optional scheduledAt() { - return scheduledAt; + return Optional.ofNullable(this.scheduledAt); } /** * The date and time that the message was sent */ - @JsonIgnore public Optional sentAt() { - return sentAt; + return Optional.ofNullable(this.sentAt); } /** * Define a webhook to receive delivery notifications. */ - @JsonIgnore public Optional webhookUrl() { - return webhookUrl; + return Optional.ofNullable(this.webhookUrl); } /** * A client reference. */ - @JsonIgnore public Optional reference() { - return reference; + return Optional.ofNullable(this.reference); } /** * Price of the message. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional price() { - return (Optional) price; + return Optional.ofNullable(this.price); } /** * The error returned if your message status is failed or undelivered. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional error() { - return (Optional) error; + return Optional.ofNullable(this.error); } /** * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. */ - @JsonIgnore public Optional messagingServiceId() { - return messagingServiceId; + return Optional.ofNullable(this.messagingServiceId); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -461,68 +416,41 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Message withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Message withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Message withId(@Nullable String id) { this.id = id; return this; } + /** * The phone number that initiated the message. */ - public Message withFrom(String from) { - Utils.checkNotNull(from, "from"); - this.from = from; + public Message withFrom(@Nonnull String from) { + this.from = Utils.checkNotNull(from, "from"); return this; } + /** * The phone number that received the message. */ - public Message withTo(String to) { - Utils.checkNotNull(to, "to"); - this.to = to; + public Message withTo(@Nonnull String to) { + this.to = Utils.checkNotNull(to, "to"); return this; } - public Message withSubject(String subject) { - Utils.checkNotNull(subject, "subject"); - this.subject = Optional.ofNullable(subject); - return this; - } - - public Message withSubject(Optional subject) { - Utils.checkNotNull(subject, "subject"); + public Message withSubject(@Nullable String subject) { this.subject = subject; return this; } - /** - * The message text. - */ - public Message withBody(String body) { - Utils.checkNotNull(body, "body"); - this.body = body; - return this; - } /** - * Set to sms for SMS messages and mms for MMS messages. + * The message text. */ - public Message withType(MessageType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); + public Message withBody(@Nonnull String body) { + this.body = Utils.checkNotNull(body, "body"); return this; } @@ -530,330 +458,165 @@ public Message withType(MessageType type) { /** * Set to sms for SMS messages and mms for MMS messages. */ - public Message withType(Optional type) { - Utils.checkNotNull(type, "type"); + public Message withType(@Nullable MessageType type) { this.type = type; return this; } - /** - * The number of units that make up the complete message. Messages can be split up due to the constraints of the message size. - */ - public Message withNumberOfUnits(long numberOfUnits) { - Utils.checkNotNull(numberOfUnits, "numberOfUnits"); - this.numberOfUnits = Optional.ofNullable(numberOfUnits); - return this; - } - /** * The number of units that make up the complete message. Messages can be split up due to the constraints of the message size. */ - public Message withNumberOfUnits(Optional numberOfUnits) { - Utils.checkNotNull(numberOfUnits, "numberOfUnits"); + public Message withNumberOfUnits(@Nullable Long numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - /** - * The number of media files associated with the message. - */ - public Message withNumberOfMediaFiles(long numberOfMediaFiles) { - Utils.checkNotNull(numberOfMediaFiles, "numberOfMediaFiles"); - this.numberOfMediaFiles = Optional.ofNullable(numberOfMediaFiles); - return this; - } - /** * The number of media files associated with the message. */ - public Message withNumberOfMediaFiles(Optional numberOfMediaFiles) { - Utils.checkNotNull(numberOfMediaFiles, "numberOfMediaFiles"); + public Message withNumberOfMediaFiles(@Nullable Long numberOfMediaFiles) { this.numberOfMediaFiles = numberOfMediaFiles; return this; } - /** - * The direction of the message. - */ - public Message withDirection(Direction direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction of the message. */ - public Message withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Message withDirection(@Nullable Direction direction) { this.direction = direction; return this; } - /** - * Status of the delivery of the message. - */ - public Message withStatus(MessageStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the delivery of the message. */ - public Message withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public Message withStatus(@Nullable MessageStatus status) { this.status = status; return this; } - /** - * The scheduled date and time of the message. - */ - public Message withScheduledAt(OffsetDateTime scheduledAt) { - Utils.checkNotNull(scheduledAt, "scheduledAt"); - this.scheduledAt = Optional.ofNullable(scheduledAt); - return this; - } - /** * The scheduled date and time of the message. */ - public Message withScheduledAt(Optional scheduledAt) { - Utils.checkNotNull(scheduledAt, "scheduledAt"); + public Message withScheduledAt(@Nullable OffsetDateTime scheduledAt) { this.scheduledAt = scheduledAt; return this; } - /** - * The date and time that the message was sent - */ - public Message withSentAt(OffsetDateTime sentAt) { - Utils.checkNotNull(sentAt, "sentAt"); - this.sentAt = Optional.ofNullable(sentAt); - return this; - } - /** * The date and time that the message was sent */ - public Message withSentAt(Optional sentAt) { - Utils.checkNotNull(sentAt, "sentAt"); + public Message withSentAt(@Nullable OffsetDateTime sentAt) { this.sentAt = sentAt; return this; } - /** - * Define a webhook to receive delivery notifications. - */ - public Message withWebhookUrl(String webhookUrl) { - Utils.checkNotNull(webhookUrl, "webhookUrl"); - this.webhookUrl = Optional.ofNullable(webhookUrl); - return this; - } - /** * Define a webhook to receive delivery notifications. */ - public Message withWebhookUrl(Optional webhookUrl) { - Utils.checkNotNull(webhookUrl, "webhookUrl"); + public Message withWebhookUrl(@Nullable String webhookUrl) { this.webhookUrl = webhookUrl; return this; } - /** - * A client reference. - */ - public Message withReference(String reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = Optional.ofNullable(reference); - return this; - } - /** * A client reference. */ - public Message withReference(Optional reference) { - Utils.checkNotNull(reference, "reference"); + public Message withReference(@Nullable String reference) { this.reference = reference; return this; } - /** - * Price of the message. - */ - public Message withPrice(Price price) { - Utils.checkNotNull(price, "price"); - this.price = Optional.ofNullable(price); - return this; - } - /** * Price of the message. */ - public Message withPrice(Optional price) { - Utils.checkNotNull(price, "price"); + public Message withPrice(@Nullable Price price) { this.price = price; return this; } - /** - * The error returned if your message status is failed or undelivered. - */ - public Message withError(Error error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * The error returned if your message status is failed or undelivered. */ - public Message withError(Optional error) { - Utils.checkNotNull(error, "error"); + public Message withError(@Nullable Error error) { this.error = error; return this; } - /** - * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. - */ - public Message withMessagingServiceId(String messagingServiceId) { - Utils.checkNotNull(messagingServiceId, "messagingServiceId"); - this.messagingServiceId = Optional.ofNullable(messagingServiceId); - return this; - } - /** * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. */ - public Message withMessagingServiceId(Optional messagingServiceId) { - Utils.checkNotNull(messagingServiceId, "messagingServiceId"); + public Message withMessagingServiceId(@Nullable String messagingServiceId) { this.messagingServiceId = messagingServiceId; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public Message withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Message withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Message withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public Message withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Message withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Message withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Message withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Message withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Message withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Message withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Message withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Message withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Message withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Message withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Message withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Message withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Message withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Message withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -933,462 +696,238 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private String from; private String to; - private Optional subject = Optional.empty(); + private String subject; private String body; - private Optional type = Optional.empty(); + private MessageType type; - private Optional numberOfUnits = Optional.empty(); + private Long numberOfUnits; - private Optional numberOfMediaFiles = Optional.empty(); + private Long numberOfMediaFiles; - private Optional direction = Optional.empty(); + private Direction direction; - private Optional status = Optional.empty(); + private MessageStatus status; - private Optional scheduledAt = Optional.empty(); + private OffsetDateTime scheduledAt; - private Optional sentAt = Optional.empty(); + private OffsetDateTime sentAt; - private Optional webhookUrl = Optional.empty(); + private String webhookUrl; - private Optional reference = Optional.empty(); + private String reference; - private Optional price = Optional.empty(); + private Price price; - private Optional error = Optional.empty(); + private Error error; - private Optional messagingServiceId = Optional.empty(); + private String messagingServiceId; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The phone number that initiated the message. */ - public Builder from(String from) { - Utils.checkNotNull(from, "from"); - this.from = from; + public Builder from(@Nonnull String from) { + this.from = Utils.checkNotNull(from, "from"); return this; } - /** * The phone number that received the message. */ - public Builder to(String to) { - Utils.checkNotNull(to, "to"); - this.to = to; - return this; - } - - - public Builder subject(String subject) { - Utils.checkNotNull(subject, "subject"); - this.subject = Optional.ofNullable(subject); + public Builder to(@Nonnull String to) { + this.to = Utils.checkNotNull(to, "to"); return this; } - public Builder subject(Optional subject) { - Utils.checkNotNull(subject, "subject"); + public Builder subject(@Nullable String subject) { this.subject = subject; return this; } - /** * The message text. */ - public Builder body(String body) { - Utils.checkNotNull(body, "body"); - this.body = body; + public Builder body(@Nonnull String body) { + this.body = Utils.checkNotNull(body, "body"); return this; } - /** * Set to sms for SMS messages and mms for MMS messages. */ - public Builder type(MessageType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - /** - * Set to sms for SMS messages and mms for MMS messages. - */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable MessageType type) { this.type = type; return this; } - - /** - * The number of units that make up the complete message. Messages can be split up due to the constraints of the message size. - */ - public Builder numberOfUnits(long numberOfUnits) { - Utils.checkNotNull(numberOfUnits, "numberOfUnits"); - this.numberOfUnits = Optional.ofNullable(numberOfUnits); - return this; - } - /** * The number of units that make up the complete message. Messages can be split up due to the constraints of the message size. */ - public Builder numberOfUnits(Optional numberOfUnits) { - Utils.checkNotNull(numberOfUnits, "numberOfUnits"); + public Builder numberOfUnits(@Nullable Long numberOfUnits) { this.numberOfUnits = numberOfUnits; return this; } - - /** - * The number of media files associated with the message. - */ - public Builder numberOfMediaFiles(long numberOfMediaFiles) { - Utils.checkNotNull(numberOfMediaFiles, "numberOfMediaFiles"); - this.numberOfMediaFiles = Optional.ofNullable(numberOfMediaFiles); - return this; - } - /** * The number of media files associated with the message. */ - public Builder numberOfMediaFiles(Optional numberOfMediaFiles) { - Utils.checkNotNull(numberOfMediaFiles, "numberOfMediaFiles"); + public Builder numberOfMediaFiles(@Nullable Long numberOfMediaFiles) { this.numberOfMediaFiles = numberOfMediaFiles; return this; } - - /** - * The direction of the message. - */ - public Builder direction(Direction direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction of the message. */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable Direction direction) { this.direction = direction; return this; } - /** * Status of the delivery of the message. */ - public Builder status(MessageStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * Status of the delivery of the message. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable MessageStatus status) { this.status = status; return this; } - - /** - * The scheduled date and time of the message. - */ - public Builder scheduledAt(OffsetDateTime scheduledAt) { - Utils.checkNotNull(scheduledAt, "scheduledAt"); - this.scheduledAt = Optional.ofNullable(scheduledAt); - return this; - } - /** * The scheduled date and time of the message. */ - public Builder scheduledAt(Optional scheduledAt) { - Utils.checkNotNull(scheduledAt, "scheduledAt"); + public Builder scheduledAt(@Nullable OffsetDateTime scheduledAt) { this.scheduledAt = scheduledAt; return this; } - - /** - * The date and time that the message was sent - */ - public Builder sentAt(OffsetDateTime sentAt) { - Utils.checkNotNull(sentAt, "sentAt"); - this.sentAt = Optional.ofNullable(sentAt); - return this; - } - /** * The date and time that the message was sent */ - public Builder sentAt(Optional sentAt) { - Utils.checkNotNull(sentAt, "sentAt"); + public Builder sentAt(@Nullable OffsetDateTime sentAt) { this.sentAt = sentAt; return this; } - - /** - * Define a webhook to receive delivery notifications. - */ - public Builder webhookUrl(String webhookUrl) { - Utils.checkNotNull(webhookUrl, "webhookUrl"); - this.webhookUrl = Optional.ofNullable(webhookUrl); - return this; - } - /** * Define a webhook to receive delivery notifications. */ - public Builder webhookUrl(Optional webhookUrl) { - Utils.checkNotNull(webhookUrl, "webhookUrl"); + public Builder webhookUrl(@Nullable String webhookUrl) { this.webhookUrl = webhookUrl; return this; } - - /** - * A client reference. - */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = Optional.ofNullable(reference); - return this; - } - /** * A client reference. */ - public Builder reference(Optional reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = reference; return this; } - /** * Price of the message. */ - public Builder price(Price price) { - Utils.checkNotNull(price, "price"); - this.price = Optional.ofNullable(price); - return this; - } - - /** - * Price of the message. - */ - public Builder price(Optional price) { - Utils.checkNotNull(price, "price"); + public Builder price(@Nullable Price price) { this.price = price; return this; } - /** * The error returned if your message status is failed or undelivered. */ - public Builder error(Error error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - - /** - * The error returned if your message status is failed or undelivered. - */ - public Builder error(Optional error) { - Utils.checkNotNull(error, "error"); + public Builder error(@Nullable Error error) { this.error = error; return this; } - /** * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. */ - public Builder messagingServiceId(String messagingServiceId) { - Utils.checkNotNull(messagingServiceId, "messagingServiceId"); - this.messagingServiceId = Optional.ofNullable(messagingServiceId); - return this; - } - - /** - * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. - */ - public Builder messagingServiceId(Optional messagingServiceId) { - Utils.checkNotNull(messagingServiceId, "messagingServiceId"); + public Builder messagingServiceId(@Nullable String messagingServiceId) { this.messagingServiceId = messagingServiceId; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Message build() { - return new Message( id, from, to, subject, body, type, diff --git a/src/main/java/com/apideck/unify/models/components/MessageInput.java b/src/main/java/com/apideck/unify/models/components/MessageInput.java index c6f2ad64..94b6ebcb 100644 --- a/src/main/java/com/apideck/unify/models/components/MessageInput.java +++ b/src/main/java/com/apideck/unify/models/components/MessageInput.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -33,7 +33,7 @@ public class MessageInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("subject") - private Optional subject; + private String subject; /** * The message text. @@ -46,69 +46,62 @@ public class MessageInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private MessageType type; /** * The scheduled date and time of the message. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("scheduled_at") - private Optional scheduledAt; + private OffsetDateTime scheduledAt; /** * Define a webhook to receive delivery notifications. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("webhook_url") - private Optional webhookUrl; + private String webhookUrl; /** * A client reference. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("reference") - private Optional reference; + private String reference; /** * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("messaging_service_id") - private Optional messagingServiceId; + private String messagingServiceId; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public MessageInput( - @JsonProperty("from") String from, - @JsonProperty("to") String to, - @JsonProperty("subject") Optional subject, - @JsonProperty("body") String body, - @JsonProperty("type") Optional type, - @JsonProperty("scheduled_at") Optional scheduledAt, - @JsonProperty("webhook_url") Optional webhookUrl, - @JsonProperty("reference") Optional reference, - @JsonProperty("messaging_service_id") Optional messagingServiceId, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(from, "from"); - Utils.checkNotNull(to, "to"); - Utils.checkNotNull(subject, "subject"); - Utils.checkNotNull(body, "body"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(scheduledAt, "scheduledAt"); - Utils.checkNotNull(webhookUrl, "webhookUrl"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(messagingServiceId, "messagingServiceId"); - Utils.checkNotNull(passThrough, "passThrough"); - this.from = from; - this.to = to; + @JsonProperty("from") @Nonnull String from, + @JsonProperty("to") @Nonnull String to, + @JsonProperty("subject") @Nullable String subject, + @JsonProperty("body") @Nonnull String body, + @JsonProperty("type") @Nullable MessageType type, + @JsonProperty("scheduled_at") @Nullable OffsetDateTime scheduledAt, + @JsonProperty("webhook_url") @Nullable String webhookUrl, + @JsonProperty("reference") @Nullable String reference, + @JsonProperty("messaging_service_id") @Nullable String messagingServiceId, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.from = Optional.ofNullable(from) + .orElseThrow(() -> new IllegalArgumentException("from cannot be null")); + this.to = Optional.ofNullable(to) + .orElseThrow(() -> new IllegalArgumentException("to cannot be null")); this.subject = subject; - this.body = body; + this.body = Optional.ofNullable(body) + .orElseThrow(() -> new IllegalArgumentException("body cannot be null")); this.type = type; this.scheduledAt = scheduledAt; this.webhookUrl = webhookUrl; @@ -118,92 +111,80 @@ public MessageInput( } public MessageInput( - String from, - String to, - String body) { - this(from, to, Optional.empty(), - body, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + @Nonnull String from, + @Nonnull String to, + @Nonnull String body) { + this(from, to, null, + body, null, null, + null, null, null, + null); } /** * The phone number that initiated the message. */ - @JsonIgnore public String from() { - return from; + return this.from; } /** * The phone number that received the message. */ - @JsonIgnore public String to() { - return to; + return this.to; } - @JsonIgnore public Optional subject() { - return subject; + return Optional.ofNullable(this.subject); } /** * The message text. */ - @JsonIgnore public String body() { - return body; + return this.body; } /** * Set to sms for SMS messages and mms for MMS messages. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } /** * The scheduled date and time of the message. */ - @JsonIgnore public Optional scheduledAt() { - return scheduledAt; + return Optional.ofNullable(this.scheduledAt); } /** * Define a webhook to receive delivery notifications. */ - @JsonIgnore public Optional webhookUrl() { - return webhookUrl; + return Optional.ofNullable(this.webhookUrl); } /** * A client reference. */ - @JsonIgnore public Optional reference() { - return reference; + return Optional.ofNullable(this.reference); } /** * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. */ - @JsonIgnore public Optional messagingServiceId() { - return messagingServiceId; + return Optional.ofNullable(this.messagingServiceId); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -214,49 +195,32 @@ public static Builder builder() { /** * The phone number that initiated the message. */ - public MessageInput withFrom(String from) { - Utils.checkNotNull(from, "from"); - this.from = from; + public MessageInput withFrom(@Nonnull String from) { + this.from = Utils.checkNotNull(from, "from"); return this; } + /** * The phone number that received the message. */ - public MessageInput withTo(String to) { - Utils.checkNotNull(to, "to"); - this.to = to; - return this; - } - - public MessageInput withSubject(String subject) { - Utils.checkNotNull(subject, "subject"); - this.subject = Optional.ofNullable(subject); + public MessageInput withTo(@Nonnull String to) { + this.to = Utils.checkNotNull(to, "to"); return this; } - public MessageInput withSubject(Optional subject) { - Utils.checkNotNull(subject, "subject"); + public MessageInput withSubject(@Nullable String subject) { this.subject = subject; return this; } - /** - * The message text. - */ - public MessageInput withBody(String body) { - Utils.checkNotNull(body, "body"); - this.body = body; - return this; - } /** - * Set to sms for SMS messages and mms for MMS messages. + * The message text. */ - public MessageInput withType(MessageType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); + public MessageInput withBody(@Nonnull String body) { + this.body = Utils.checkNotNull(body, "body"); return this; } @@ -264,107 +228,57 @@ public MessageInput withType(MessageType type) { /** * Set to sms for SMS messages and mms for MMS messages. */ - public MessageInput withType(Optional type) { - Utils.checkNotNull(type, "type"); + public MessageInput withType(@Nullable MessageType type) { this.type = type; return this; } - /** - * The scheduled date and time of the message. - */ - public MessageInput withScheduledAt(OffsetDateTime scheduledAt) { - Utils.checkNotNull(scheduledAt, "scheduledAt"); - this.scheduledAt = Optional.ofNullable(scheduledAt); - return this; - } - /** * The scheduled date and time of the message. */ - public MessageInput withScheduledAt(Optional scheduledAt) { - Utils.checkNotNull(scheduledAt, "scheduledAt"); + public MessageInput withScheduledAt(@Nullable OffsetDateTime scheduledAt) { this.scheduledAt = scheduledAt; return this; } - /** - * Define a webhook to receive delivery notifications. - */ - public MessageInput withWebhookUrl(String webhookUrl) { - Utils.checkNotNull(webhookUrl, "webhookUrl"); - this.webhookUrl = Optional.ofNullable(webhookUrl); - return this; - } - /** * Define a webhook to receive delivery notifications. */ - public MessageInput withWebhookUrl(Optional webhookUrl) { - Utils.checkNotNull(webhookUrl, "webhookUrl"); + public MessageInput withWebhookUrl(@Nullable String webhookUrl) { this.webhookUrl = webhookUrl; return this; } - /** - * A client reference. - */ - public MessageInput withReference(String reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = Optional.ofNullable(reference); - return this; - } - /** * A client reference. */ - public MessageInput withReference(Optional reference) { - Utils.checkNotNull(reference, "reference"); + public MessageInput withReference(@Nullable String reference) { this.reference = reference; return this; } - /** - * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. - */ - public MessageInput withMessagingServiceId(String messagingServiceId) { - Utils.checkNotNull(messagingServiceId, "messagingServiceId"); - this.messagingServiceId = Optional.ofNullable(messagingServiceId); - return this; - } - /** * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. */ - public MessageInput withMessagingServiceId(Optional messagingServiceId) { - Utils.checkNotNull(messagingServiceId, "messagingServiceId"); + public MessageInput withMessagingServiceId(@Nullable String messagingServiceId) { this.messagingServiceId = messagingServiceId; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public MessageInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public MessageInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public MessageInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -418,185 +332,104 @@ public final static class Builder { private String to; - private Optional subject = Optional.empty(); + private String subject; private String body; - private Optional type = Optional.empty(); + private MessageType type; - private Optional scheduledAt = Optional.empty(); + private OffsetDateTime scheduledAt; - private Optional webhookUrl = Optional.empty(); + private String webhookUrl; - private Optional reference = Optional.empty(); + private String reference; - private Optional messagingServiceId = Optional.empty(); + private String messagingServiceId; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The phone number that initiated the message. */ - public Builder from(String from) { - Utils.checkNotNull(from, "from"); - this.from = from; + public Builder from(@Nonnull String from) { + this.from = Utils.checkNotNull(from, "from"); return this; } - /** * The phone number that received the message. */ - public Builder to(String to) { - Utils.checkNotNull(to, "to"); - this.to = to; - return this; - } - - - public Builder subject(String subject) { - Utils.checkNotNull(subject, "subject"); - this.subject = Optional.ofNullable(subject); + public Builder to(@Nonnull String to) { + this.to = Utils.checkNotNull(to, "to"); return this; } - public Builder subject(Optional subject) { - Utils.checkNotNull(subject, "subject"); + public Builder subject(@Nullable String subject) { this.subject = subject; return this; } - /** * The message text. */ - public Builder body(String body) { - Utils.checkNotNull(body, "body"); - this.body = body; - return this; - } - - - /** - * Set to sms for SMS messages and mms for MMS messages. - */ - public Builder type(MessageType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); + public Builder body(@Nonnull String body) { + this.body = Utils.checkNotNull(body, "body"); return this; } /** * Set to sms for SMS messages and mms for MMS messages. */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable MessageType type) { this.type = type; return this; } - /** * The scheduled date and time of the message. */ - public Builder scheduledAt(OffsetDateTime scheduledAt) { - Utils.checkNotNull(scheduledAt, "scheduledAt"); - this.scheduledAt = Optional.ofNullable(scheduledAt); - return this; - } - - /** - * The scheduled date and time of the message. - */ - public Builder scheduledAt(Optional scheduledAt) { - Utils.checkNotNull(scheduledAt, "scheduledAt"); + public Builder scheduledAt(@Nullable OffsetDateTime scheduledAt) { this.scheduledAt = scheduledAt; return this; } - - /** - * Define a webhook to receive delivery notifications. - */ - public Builder webhookUrl(String webhookUrl) { - Utils.checkNotNull(webhookUrl, "webhookUrl"); - this.webhookUrl = Optional.ofNullable(webhookUrl); - return this; - } - /** * Define a webhook to receive delivery notifications. */ - public Builder webhookUrl(Optional webhookUrl) { - Utils.checkNotNull(webhookUrl, "webhookUrl"); + public Builder webhookUrl(@Nullable String webhookUrl) { this.webhookUrl = webhookUrl; return this; } - - /** - * A client reference. - */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = Optional.ofNullable(reference); - return this; - } - /** * A client reference. */ - public Builder reference(Optional reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = reference; return this; } - /** * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. */ - public Builder messagingServiceId(String messagingServiceId) { - Utils.checkNotNull(messagingServiceId, "messagingServiceId"); - this.messagingServiceId = Optional.ofNullable(messagingServiceId); - return this; - } - - /** - * The ID of the Messaging Service used with the message. In case of Plivo this links to the Powerpack ID. - */ - public Builder messagingServiceId(Optional messagingServiceId) { - Utils.checkNotNull(messagingServiceId, "messagingServiceId"); + public Builder messagingServiceId(@Nullable String messagingServiceId) { this.messagingServiceId = messagingServiceId; return this; } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public MessageInput build() { - return new MessageInput( from, to, subject, body, type, scheduledAt, diff --git a/src/main/java/com/apideck/unify/models/components/Meta.java b/src/main/java/com/apideck/unify/models/components/Meta.java index 95011538..ce43bec9 100644 --- a/src/main/java/com/apideck/unify/models/components/Meta.java +++ b/src/main/java/com/apideck/unify/models/components/Meta.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; /** @@ -26,44 +25,39 @@ public class Meta { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("items_on_page") - private Optional itemsOnPage; + private Long itemsOnPage; /** * Cursors to navigate to previous or next pages through the API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("cursors") - private Optional cursors; + private Cursors cursors; @JsonCreator public Meta( - @JsonProperty("items_on_page") Optional itemsOnPage, - @JsonProperty("cursors") Optional cursors) { - Utils.checkNotNull(itemsOnPage, "itemsOnPage"); - Utils.checkNotNull(cursors, "cursors"); + @JsonProperty("items_on_page") @Nullable Long itemsOnPage, + @JsonProperty("cursors") @Nullable Cursors cursors) { this.itemsOnPage = itemsOnPage; this.cursors = cursors; } public Meta() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * Number of items returned in the data property of the response */ - @JsonIgnore public Optional itemsOnPage() { - return itemsOnPage; + return Optional.ofNullable(this.itemsOnPage); } /** * Cursors to navigate to previous or next pages through the API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional cursors() { - return (Optional) cursors; + return Optional.ofNullable(this.cursors); } public static Builder builder() { @@ -74,41 +68,21 @@ public static Builder builder() { /** * Number of items returned in the data property of the response */ - public Meta withItemsOnPage(long itemsOnPage) { - Utils.checkNotNull(itemsOnPage, "itemsOnPage"); - this.itemsOnPage = Optional.ofNullable(itemsOnPage); - return this; - } - - - /** - * Number of items returned in the data property of the response - */ - public Meta withItemsOnPage(Optional itemsOnPage) { - Utils.checkNotNull(itemsOnPage, "itemsOnPage"); + public Meta withItemsOnPage(@Nullable Long itemsOnPage) { this.itemsOnPage = itemsOnPage; return this; } - /** - * Cursors to navigate to previous or next pages through the API - */ - public Meta withCursors(Cursors cursors) { - Utils.checkNotNull(cursors, "cursors"); - this.cursors = Optional.ofNullable(cursors); - return this; - } - /** * Cursors to navigate to previous or next pages through the API */ - public Meta withCursors(Optional cursors) { - Utils.checkNotNull(cursors, "cursors"); + public Meta withCursors(@Nullable Cursors cursors) { this.cursors = cursors; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -139,54 +113,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional itemsOnPage = Optional.empty(); + private Long itemsOnPage; - private Optional cursors = Optional.empty(); + private Cursors cursors; private Builder() { // force use of static builder() method } - /** * Number of items returned in the data property of the response */ - public Builder itemsOnPage(long itemsOnPage) { - Utils.checkNotNull(itemsOnPage, "itemsOnPage"); - this.itemsOnPage = Optional.ofNullable(itemsOnPage); - return this; - } - - /** - * Number of items returned in the data property of the response - */ - public Builder itemsOnPage(Optional itemsOnPage) { - Utils.checkNotNull(itemsOnPage, "itemsOnPage"); + public Builder itemsOnPage(@Nullable Long itemsOnPage) { this.itemsOnPage = itemsOnPage; return this; } - - /** - * Cursors to navigate to previous or next pages through the API - */ - public Builder cursors(Cursors cursors) { - Utils.checkNotNull(cursors, "cursors"); - this.cursors = Optional.ofNullable(cursors); - return this; - } - /** * Cursors to navigate to previous or next pages through the API */ - public Builder cursors(Optional cursors) { - Utils.checkNotNull(cursors, "cursors"); + public Builder cursors(@Nullable Cursors cursors) { this.cursors = cursors; return this; } public Meta build() { - return new Meta( itemsOnPage, cursors); } diff --git a/src/main/java/com/apideck/unify/models/components/Note.java b/src/main/java/com/apideck/unify/models/components/Note.java index 9b28261e..cfbcb62f 100644 --- a/src/main/java/com/apideck/unify/models/components/Note.java +++ b/src/main/java/com/apideck/unify/models/components/Note.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -26,7 +25,7 @@ public class Note { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The title of the note @@ -96,7 +95,7 @@ public class Note { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user that last updated the note. @@ -131,197 +130,177 @@ public class Note { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Note( - @JsonProperty("id") Optional id, - @JsonProperty("title") JsonNullable title, - @JsonProperty("content") JsonNullable content, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("contact_id") JsonNullable contactId, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("opportunity_id") JsonNullable opportunityId, - @JsonProperty("activity_id") JsonNullable activityId, - @JsonProperty("lead_id") JsonNullable leadId, - @JsonProperty("active") JsonNullable active, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(content, "content"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(contactId, "contactId"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(opportunityId, "opportunityId"); - Utils.checkNotNull(activityId, "activityId"); - Utils.checkNotNull(leadId, "leadId"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("content") @Nullable JsonNullable content, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("contact_id") @Nullable JsonNullable contactId, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("opportunity_id") @Nullable JsonNullable opportunityId, + @JsonProperty("activity_id") @Nullable JsonNullable activityId, + @JsonProperty("lead_id") @Nullable JsonNullable leadId, + @JsonProperty("active") @Nullable JsonNullable active, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.title = title; - this.content = content; - this.ownerId = ownerId; - this.contactId = contactId; - this.companyId = companyId; - this.opportunityId = opportunityId; - this.activityId = activityId; - this.leadId = leadId; - this.active = active; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.content = Optional.ofNullable(content) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.contactId = Optional.ofNullable(contactId) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.opportunityId = Optional.ofNullable(opportunityId) + .orElse(JsonNullable.undefined()); + this.activityId = Optional.ofNullable(activityId) + .orElse(JsonNullable.undefined()); + this.leadId = Optional.ofNullable(leadId) + .orElse(JsonNullable.undefined()); + this.active = Optional.ofNullable(active) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Note() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * The unique identifier of the note */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The title of the note */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The content of the note. */ - @JsonIgnore public JsonNullable content() { - return content; + return this.content; } /** * The user that owns the note. */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The contact that is related to the note. */ - @JsonIgnore public JsonNullable contactId() { - return contactId; + return this.contactId; } /** * The company that is related to the note. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The opportunity that is related to the note. */ - @JsonIgnore public JsonNullable opportunityId() { - return opportunityId; + return this.opportunityId; } /** * The activity that is related to the note. */ - @JsonIgnore public JsonNullable activityId() { - return activityId; + return this.activityId; } /** * The lead that is related to the note. */ - @JsonIgnore public JsonNullable leadId() { - return leadId; + return this.leadId; } /** * Whether the Note is active or not. */ - @JsonIgnore public JsonNullable active() { - return active; + return this.active; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user that last updated the note. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user that created the note. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The timestamp when the note was last updated */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The timestamp when the note was created */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -332,293 +311,147 @@ public static Builder builder() { /** * The unique identifier of the note */ - public Note withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier of the note - */ - public Note withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Note withId(@Nullable String id) { this.id = id; return this; } + /** * The title of the note */ - public Note withTitle(String title) { - Utils.checkNotNull(title, "title"); + public Note withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The title of the note - */ - public Note withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The content of the note. */ - public Note withContent(String content) { - Utils.checkNotNull(content, "content"); + public Note withContent(@Nullable String content) { this.content = JsonNullable.of(content); return this; } - /** - * The content of the note. - */ - public Note withContent(JsonNullable content) { - Utils.checkNotNull(content, "content"); - this.content = content; - return this; - } /** * The user that owns the note. */ - public Note withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Note withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The user that owns the note. - */ - public Note withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The contact that is related to the note. */ - public Note withContactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public Note withContactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The contact that is related to the note. - */ - public Note withContactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } /** * The company that is related to the note. */ - public Note withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Note withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company that is related to the note. - */ - public Note withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The opportunity that is related to the note. */ - public Note withOpportunityId(String opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); + public Note withOpportunityId(@Nullable String opportunityId) { this.opportunityId = JsonNullable.of(opportunityId); return this; } - /** - * The opportunity that is related to the note. - */ - public Note withOpportunityId(JsonNullable opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); - this.opportunityId = opportunityId; - return this; - } /** * The activity that is related to the note. */ - public Note withActivityId(String activityId) { - Utils.checkNotNull(activityId, "activityId"); + public Note withActivityId(@Nullable String activityId) { this.activityId = JsonNullable.of(activityId); return this; } - /** - * The activity that is related to the note. - */ - public Note withActivityId(JsonNullable activityId) { - Utils.checkNotNull(activityId, "activityId"); - this.activityId = activityId; - return this; - } /** * The lead that is related to the note. */ - public Note withLeadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Note withLeadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead that is related to the note. - */ - public Note withLeadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } /** * Whether the Note is active or not. */ - public Note withActive(boolean active) { - Utils.checkNotNull(active, "active"); + public Note withActive(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the Note is active or not. - */ - public Note withActive(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Note withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Note withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Note withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user that last updated the note. */ - public Note withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Note withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user that last updated the note. - */ - public Note withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user that created the note. */ - public Note withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Note withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user that created the note. - */ - public Note withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The timestamp when the note was last updated */ - public Note withUpdatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Note withUpdatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The timestamp when the note was last updated - */ - public Note withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The timestamp when the note was created */ - public Note withCreatedAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Note withCreatedAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The timestamp when the note was created - */ - public Note withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Note withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Note withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Note withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -682,348 +515,171 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable content = JsonNullable.undefined(); + private JsonNullable content; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable contactId = JsonNullable.undefined(); + private JsonNullable contactId; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable opportunityId = JsonNullable.undefined(); + private JsonNullable opportunityId; - private JsonNullable activityId = JsonNullable.undefined(); + private JsonNullable activityId; - private JsonNullable leadId = JsonNullable.undefined(); + private JsonNullable leadId; - private JsonNullable active = JsonNullable.undefined(); + private JsonNullable active; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The unique identifier of the note */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * The unique identifier of the note - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The title of the note */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The title of the note - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The content of the note. */ - public Builder content(String content) { - Utils.checkNotNull(content, "content"); + public Builder content(@Nullable String content) { this.content = JsonNullable.of(content); return this; } - /** - * The content of the note. - */ - public Builder content(JsonNullable content) { - Utils.checkNotNull(content, "content"); - this.content = content; - return this; - } - - /** * The user that owns the note. */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The user that owns the note. - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The contact that is related to the note. */ - public Builder contactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public Builder contactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The contact that is related to the note. - */ - public Builder contactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } - - /** * The company that is related to the note. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company that is related to the note. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The opportunity that is related to the note. */ - public Builder opportunityId(String opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); + public Builder opportunityId(@Nullable String opportunityId) { this.opportunityId = JsonNullable.of(opportunityId); return this; } - /** - * The opportunity that is related to the note. - */ - public Builder opportunityId(JsonNullable opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); - this.opportunityId = opportunityId; - return this; - } - - /** * The activity that is related to the note. */ - public Builder activityId(String activityId) { - Utils.checkNotNull(activityId, "activityId"); + public Builder activityId(@Nullable String activityId) { this.activityId = JsonNullable.of(activityId); return this; } - /** - * The activity that is related to the note. - */ - public Builder activityId(JsonNullable activityId) { - Utils.checkNotNull(activityId, "activityId"); - this.activityId = activityId; - return this; - } - - /** * The lead that is related to the note. */ - public Builder leadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Builder leadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead that is related to the note. - */ - public Builder leadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } - - /** * Whether the Note is active or not. */ - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the Note is active or not. - */ - public Builder active(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user that last updated the note. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user that last updated the note. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user that created the note. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user that created the note. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The timestamp when the note was last updated */ - public Builder updatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The timestamp when the note was last updated - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The timestamp when the note was created */ - public Builder createdAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The timestamp when the note was created - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Note build() { - return new Note( id, title, content, ownerId, contactId, companyId, diff --git a/src/main/java/com/apideck/unify/models/components/NoteInput.java b/src/main/java/com/apideck/unify/models/components/NoteInput.java index c5ea8851..187c062d 100644 --- a/src/main/java/com/apideck/unify/models/components/NoteInput.java +++ b/src/main/java/com/apideck/unify/models/components/NoteInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -87,128 +86,116 @@ public class NoteInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public NoteInput( - @JsonProperty("title") JsonNullable title, - @JsonProperty("content") JsonNullable content, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("contact_id") JsonNullable contactId, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("opportunity_id") JsonNullable opportunityId, - @JsonProperty("activity_id") JsonNullable activityId, - @JsonProperty("lead_id") JsonNullable leadId, - @JsonProperty("active") JsonNullable active, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(content, "content"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(contactId, "contactId"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(opportunityId, "opportunityId"); - Utils.checkNotNull(activityId, "activityId"); - Utils.checkNotNull(leadId, "leadId"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(passThrough, "passThrough"); - this.title = title; - this.content = content; - this.ownerId = ownerId; - this.contactId = contactId; - this.companyId = companyId; - this.opportunityId = opportunityId; - this.activityId = activityId; - this.leadId = leadId; - this.active = active; + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("content") @Nullable JsonNullable content, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("contact_id") @Nullable JsonNullable contactId, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("opportunity_id") @Nullable JsonNullable opportunityId, + @JsonProperty("activity_id") @Nullable JsonNullable activityId, + @JsonProperty("lead_id") @Nullable JsonNullable leadId, + @JsonProperty("active") @Nullable JsonNullable active, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.content = Optional.ofNullable(content) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.contactId = Optional.ofNullable(contactId) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.opportunityId = Optional.ofNullable(opportunityId) + .orElse(JsonNullable.undefined()); + this.activityId = Optional.ofNullable(activityId) + .orElse(JsonNullable.undefined()); + this.leadId = Optional.ofNullable(leadId) + .orElse(JsonNullable.undefined()); + this.active = Optional.ofNullable(active) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public NoteInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * The title of the note */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The content of the note. */ - @JsonIgnore public JsonNullable content() { - return content; + return this.content; } /** * The user that owns the note. */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The contact that is related to the note. */ - @JsonIgnore public JsonNullable contactId() { - return contactId; + return this.contactId; } /** * The company that is related to the note. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The opportunity that is related to the note. */ - @JsonIgnore public JsonNullable opportunityId() { - return opportunityId; + return this.opportunityId; } /** * The activity that is related to the note. */ - @JsonIgnore public JsonNullable activityId() { - return activityId; + return this.activityId; } /** * The lead that is related to the note. */ - @JsonIgnore public JsonNullable leadId() { - return leadId; + return this.leadId; } /** * Whether the Note is active or not. */ - @JsonIgnore public JsonNullable active() { - return active; + return this.active; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -219,184 +206,93 @@ public static Builder builder() { /** * The title of the note */ - public NoteInput withTitle(String title) { - Utils.checkNotNull(title, "title"); + public NoteInput withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The title of the note - */ - public NoteInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The content of the note. */ - public NoteInput withContent(String content) { - Utils.checkNotNull(content, "content"); + public NoteInput withContent(@Nullable String content) { this.content = JsonNullable.of(content); return this; } - /** - * The content of the note. - */ - public NoteInput withContent(JsonNullable content) { - Utils.checkNotNull(content, "content"); - this.content = content; - return this; - } /** * The user that owns the note. */ - public NoteInput withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public NoteInput withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The user that owns the note. - */ - public NoteInput withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The contact that is related to the note. */ - public NoteInput withContactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public NoteInput withContactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The contact that is related to the note. - */ - public NoteInput withContactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } /** * The company that is related to the note. */ - public NoteInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public NoteInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company that is related to the note. - */ - public NoteInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The opportunity that is related to the note. */ - public NoteInput withOpportunityId(String opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); + public NoteInput withOpportunityId(@Nullable String opportunityId) { this.opportunityId = JsonNullable.of(opportunityId); return this; } - /** - * The opportunity that is related to the note. - */ - public NoteInput withOpportunityId(JsonNullable opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); - this.opportunityId = opportunityId; - return this; - } /** * The activity that is related to the note. */ - public NoteInput withActivityId(String activityId) { - Utils.checkNotNull(activityId, "activityId"); + public NoteInput withActivityId(@Nullable String activityId) { this.activityId = JsonNullable.of(activityId); return this; } - /** - * The activity that is related to the note. - */ - public NoteInput withActivityId(JsonNullable activityId) { - Utils.checkNotNull(activityId, "activityId"); - this.activityId = activityId; - return this; - } /** * The lead that is related to the note. */ - public NoteInput withLeadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public NoteInput withLeadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead that is related to the note. - */ - public NoteInput withLeadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } /** * Whether the Note is active or not. */ - public NoteInput withActive(boolean active) { - Utils.checkNotNull(active, "active"); + public NoteInput withActive(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the Note is active or not. - */ - public NoteInput withActive(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public NoteInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public NoteInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public NoteInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -446,222 +342,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable content = JsonNullable.undefined(); + private JsonNullable content; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable contactId = JsonNullable.undefined(); + private JsonNullable contactId; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable opportunityId = JsonNullable.undefined(); + private JsonNullable opportunityId; - private JsonNullable activityId = JsonNullable.undefined(); + private JsonNullable activityId; - private JsonNullable leadId = JsonNullable.undefined(); + private JsonNullable leadId; - private JsonNullable active = JsonNullable.undefined(); + private JsonNullable active; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The title of the note */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The title of the note - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The content of the note. */ - public Builder content(String content) { - Utils.checkNotNull(content, "content"); + public Builder content(@Nullable String content) { this.content = JsonNullable.of(content); return this; } - /** - * The content of the note. - */ - public Builder content(JsonNullable content) { - Utils.checkNotNull(content, "content"); - this.content = content; - return this; - } - - /** * The user that owns the note. */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The user that owns the note. - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The contact that is related to the note. */ - public Builder contactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public Builder contactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The contact that is related to the note. - */ - public Builder contactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } - - /** * The company that is related to the note. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company that is related to the note. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The opportunity that is related to the note. */ - public Builder opportunityId(String opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); + public Builder opportunityId(@Nullable String opportunityId) { this.opportunityId = JsonNullable.of(opportunityId); return this; } - /** - * The opportunity that is related to the note. - */ - public Builder opportunityId(JsonNullable opportunityId) { - Utils.checkNotNull(opportunityId, "opportunityId"); - this.opportunityId = opportunityId; - return this; - } - - /** * The activity that is related to the note. */ - public Builder activityId(String activityId) { - Utils.checkNotNull(activityId, "activityId"); + public Builder activityId(@Nullable String activityId) { this.activityId = JsonNullable.of(activityId); return this; } - /** - * The activity that is related to the note. - */ - public Builder activityId(JsonNullable activityId) { - Utils.checkNotNull(activityId, "activityId"); - this.activityId = activityId; - return this; - } - - /** * The lead that is related to the note. */ - public Builder leadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Builder leadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The lead that is related to the note. - */ - public Builder leadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } - - /** * Whether the Note is active or not. */ - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = JsonNullable.of(active); return this; } - /** - * Whether the Note is active or not. - */ - public Builder active(JsonNullable active) { - Utils.checkNotNull(active, "active"); - this.active = active; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public NoteInput build() { - return new NoteInput( title, content, ownerId, contactId, companyId, opportunityId, diff --git a/src/main/java/com/apideck/unify/models/components/Notes.java b/src/main/java/com/apideck/unify/models/components/Notes.java index 4d6673b6..2331f5ea 100644 --- a/src/main/java/com/apideck/unify/models/components/Notes.java +++ b/src/main/java/com/apideck/unify/models/components/Notes.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,26 +28,24 @@ public class Notes { @JsonCreator public Notes( - @JsonProperty("employee") JsonNullable employee, - @JsonProperty("manager") JsonNullable manager) { - Utils.checkNotNull(employee, "employee"); - Utils.checkNotNull(manager, "manager"); - this.employee = employee; - this.manager = manager; + @JsonProperty("employee") @Nullable JsonNullable employee, + @JsonProperty("manager") @Nullable JsonNullable manager) { + this.employee = Optional.ofNullable(employee) + .orElse(JsonNullable.undefined()); + this.manager = Optional.ofNullable(manager) + .orElse(JsonNullable.undefined()); } public Notes() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } - @JsonIgnore public JsonNullable employee() { - return employee; + return this.employee; } - @JsonIgnore public JsonNullable manager() { - return manager; + return this.manager; } public static Builder builder() { @@ -54,29 +53,17 @@ public static Builder builder() { } - public Notes withEmployee(String employee) { - Utils.checkNotNull(employee, "employee"); + public Notes withEmployee(@Nullable String employee) { this.employee = JsonNullable.of(employee); return this; } - public Notes withEmployee(JsonNullable employee) { - Utils.checkNotNull(employee, "employee"); - this.employee = employee; - return this; - } - public Notes withManager(String manager) { - Utils.checkNotNull(manager, "manager"); + public Notes withManager(@Nullable String manager) { this.manager = JsonNullable.of(manager); return this; } - public Notes withManager(JsonNullable manager) { - Utils.checkNotNull(manager, "manager"); - this.manager = manager; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -108,42 +95,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable employee = JsonNullable.undefined(); + private JsonNullable employee; - private JsonNullable manager = JsonNullable.undefined(); + private JsonNullable manager; private Builder() { // force use of static builder() method } - - public Builder employee(String employee) { - Utils.checkNotNull(employee, "employee"); + public Builder employee(@Nullable String employee) { this.employee = JsonNullable.of(employee); return this; } - public Builder employee(JsonNullable employee) { - Utils.checkNotNull(employee, "employee"); - this.employee = employee; - return this; - } - - - public Builder manager(String manager) { - Utils.checkNotNull(manager, "manager"); + public Builder manager(@Nullable String manager) { this.manager = JsonNullable.of(manager); return this; } - public Builder manager(JsonNullable manager) { - Utils.checkNotNull(manager, "manager"); - this.manager = manager; - return this; - } - public Notes build() { - return new Notes( employee, manager); } diff --git a/src/main/java/com/apideck/unify/models/components/OauthScopes.java b/src/main/java/com/apideck/unify/models/components/OauthScopes.java index d0f25f14..75c42467 100644 --- a/src/main/java/com/apideck/unify/models/components/OauthScopes.java +++ b/src/main/java/com/apideck/unify/models/components/OauthScopes.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -22,62 +21,55 @@ public class OauthScopes { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Label of the OAuth scope. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("label") - private Optional label; + private String label; /** * List of Unified APIs that request this OAuth Scope by default. Application owners can customize the requested scopes. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("default_apis") - private Optional> defaultApis; + private List defaultApis; @JsonCreator public OauthScopes( - @JsonProperty("id") Optional id, - @JsonProperty("label") Optional label, - @JsonProperty("default_apis") Optional> defaultApis) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(label, "label"); - Utils.checkNotNull(defaultApis, "defaultApis"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("label") @Nullable String label, + @JsonProperty("default_apis") @Nullable List defaultApis) { this.id = id; this.label = label; this.defaultApis = defaultApis; } public OauthScopes() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } /** * ID of the OAuth scope. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Label of the OAuth scope. */ - @JsonIgnore public Optional label() { - return label; + return Optional.ofNullable(this.label); } /** * List of Unified APIs that request this OAuth Scope by default. Application owners can customize the requested scopes. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> defaultApis() { - return (Optional>) defaultApis; + return Optional.ofNullable(this.defaultApis); } public static Builder builder() { @@ -88,60 +80,30 @@ public static Builder builder() { /** * ID of the OAuth scope. */ - public OauthScopes withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the OAuth scope. - */ - public OauthScopes withId(Optional id) { - Utils.checkNotNull(id, "id"); + public OauthScopes withId(@Nullable String id) { this.id = id; return this; } - /** - * Label of the OAuth scope. - */ - public OauthScopes withLabel(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - /** * Label of the OAuth scope. */ - public OauthScopes withLabel(Optional label) { - Utils.checkNotNull(label, "label"); + public OauthScopes withLabel(@Nullable String label) { this.label = label; return this; } - /** - * List of Unified APIs that request this OAuth Scope by default. Application owners can customize the requested scopes. - */ - public OauthScopes withDefaultApis(List defaultApis) { - Utils.checkNotNull(defaultApis, "defaultApis"); - this.defaultApis = Optional.ofNullable(defaultApis); - return this; - } - /** * List of Unified APIs that request this OAuth Scope by default. Application owners can customize the requested scopes. */ - public OauthScopes withDefaultApis(Optional> defaultApis) { - Utils.checkNotNull(defaultApis, "defaultApis"); + public OauthScopes withDefaultApis(@Nullable List defaultApis) { this.defaultApis = defaultApis; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -174,75 +136,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional label = Optional.empty(); + private String label; - private Optional> defaultApis = Optional.empty(); + private List defaultApis; private Builder() { // force use of static builder() method } - - /** - * ID of the OAuth scope. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * ID of the OAuth scope. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Label of the OAuth scope. */ - public Builder label(String label) { - Utils.checkNotNull(label, "label"); - this.label = Optional.ofNullable(label); - return this; - } - - /** - * Label of the OAuth scope. - */ - public Builder label(Optional label) { - Utils.checkNotNull(label, "label"); + public Builder label(@Nullable String label) { this.label = label; return this; } - - /** - * List of Unified APIs that request this OAuth Scope by default. Application owners can customize the requested scopes. - */ - public Builder defaultApis(List defaultApis) { - Utils.checkNotNull(defaultApis, "defaultApis"); - this.defaultApis = Optional.ofNullable(defaultApis); - return this; - } - /** * List of Unified APIs that request this OAuth Scope by default. Application owners can customize the requested scopes. */ - public Builder defaultApis(Optional> defaultApis) { - Utils.checkNotNull(defaultApis, "defaultApis"); + public Builder defaultApis(@Nullable List defaultApis) { this.defaultApis = defaultApis; return this; } public OauthScopes build() { - return new OauthScopes( id, label, defaultApis); } diff --git a/src/main/java/com/apideck/unify/models/components/OddWeeks.java b/src/main/java/com/apideck/unify/models/components/OddWeeks.java index 3f1a72ad..cecd40cb 100644 --- a/src/main/java/com/apideck/unify/models/components/OddWeeks.java +++ b/src/main/java/com/apideck/unify/models/components/OddWeeks.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; @@ -19,54 +19,47 @@ public class OddWeeks { @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_monday") - private Optional hoursMonday; + private Double hoursMonday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_tuesday") - private Optional hoursTuesday; + private Double hoursTuesday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_wednesday") - private Optional hoursWednesday; + private Double hoursWednesday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_thursday") - private Optional hoursThursday; + private Double hoursThursday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_friday") - private Optional hoursFriday; + private Double hoursFriday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_saturday") - private Optional hoursSaturday; + private Double hoursSaturday; @JsonInclude(Include.NON_ABSENT) @JsonProperty("hours_sunday") - private Optional hoursSunday; + private Double hoursSunday; @JsonCreator public OddWeeks( - @JsonProperty("hours_monday") Optional hoursMonday, - @JsonProperty("hours_tuesday") Optional hoursTuesday, - @JsonProperty("hours_wednesday") Optional hoursWednesday, - @JsonProperty("hours_thursday") Optional hoursThursday, - @JsonProperty("hours_friday") Optional hoursFriday, - @JsonProperty("hours_saturday") Optional hoursSaturday, - @JsonProperty("hours_sunday") Optional hoursSunday) { - Utils.checkNotNull(hoursMonday, "hoursMonday"); - Utils.checkNotNull(hoursTuesday, "hoursTuesday"); - Utils.checkNotNull(hoursWednesday, "hoursWednesday"); - Utils.checkNotNull(hoursThursday, "hoursThursday"); - Utils.checkNotNull(hoursFriday, "hoursFriday"); - Utils.checkNotNull(hoursSaturday, "hoursSaturday"); - Utils.checkNotNull(hoursSunday, "hoursSunday"); + @JsonProperty("hours_monday") @Nullable Double hoursMonday, + @JsonProperty("hours_tuesday") @Nullable Double hoursTuesday, + @JsonProperty("hours_wednesday") @Nullable Double hoursWednesday, + @JsonProperty("hours_thursday") @Nullable Double hoursThursday, + @JsonProperty("hours_friday") @Nullable Double hoursFriday, + @JsonProperty("hours_saturday") @Nullable Double hoursSaturday, + @JsonProperty("hours_sunday") @Nullable Double hoursSunday) { this.hoursMonday = hoursMonday; this.hoursTuesday = hoursTuesday; this.hoursWednesday = hoursWednesday; @@ -77,44 +70,37 @@ public OddWeeks( } public OddWeeks() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } - @JsonIgnore public Optional hoursMonday() { - return hoursMonday; + return Optional.ofNullable(this.hoursMonday); } - @JsonIgnore public Optional hoursTuesday() { - return hoursTuesday; + return Optional.ofNullable(this.hoursTuesday); } - @JsonIgnore public Optional hoursWednesday() { - return hoursWednesday; + return Optional.ofNullable(this.hoursWednesday); } - @JsonIgnore public Optional hoursThursday() { - return hoursThursday; + return Optional.ofNullable(this.hoursThursday); } - @JsonIgnore public Optional hoursFriday() { - return hoursFriday; + return Optional.ofNullable(this.hoursFriday); } - @JsonIgnore public Optional hoursSaturday() { - return hoursSaturday; + return Optional.ofNullable(this.hoursSaturday); } - @JsonIgnore public Optional hoursSunday() { - return hoursSunday; + return Optional.ofNullable(this.hoursSunday); } public static Builder builder() { @@ -122,97 +108,48 @@ public static Builder builder() { } - public OddWeeks withHoursMonday(double hoursMonday) { - Utils.checkNotNull(hoursMonday, "hoursMonday"); - this.hoursMonday = Optional.ofNullable(hoursMonday); - return this; - } - - - public OddWeeks withHoursMonday(Optional hoursMonday) { - Utils.checkNotNull(hoursMonday, "hoursMonday"); + public OddWeeks withHoursMonday(@Nullable Double hoursMonday) { this.hoursMonday = hoursMonday; return this; } - public OddWeeks withHoursTuesday(double hoursTuesday) { - Utils.checkNotNull(hoursTuesday, "hoursTuesday"); - this.hoursTuesday = Optional.ofNullable(hoursTuesday); - return this; - } - - public OddWeeks withHoursTuesday(Optional hoursTuesday) { - Utils.checkNotNull(hoursTuesday, "hoursTuesday"); + public OddWeeks withHoursTuesday(@Nullable Double hoursTuesday) { this.hoursTuesday = hoursTuesday; return this; } - public OddWeeks withHoursWednesday(double hoursWednesday) { - Utils.checkNotNull(hoursWednesday, "hoursWednesday"); - this.hoursWednesday = Optional.ofNullable(hoursWednesday); - return this; - } - - public OddWeeks withHoursWednesday(Optional hoursWednesday) { - Utils.checkNotNull(hoursWednesday, "hoursWednesday"); + public OddWeeks withHoursWednesday(@Nullable Double hoursWednesday) { this.hoursWednesday = hoursWednesday; return this; } - public OddWeeks withHoursThursday(double hoursThursday) { - Utils.checkNotNull(hoursThursday, "hoursThursday"); - this.hoursThursday = Optional.ofNullable(hoursThursday); - return this; - } - - public OddWeeks withHoursThursday(Optional hoursThursday) { - Utils.checkNotNull(hoursThursday, "hoursThursday"); + public OddWeeks withHoursThursday(@Nullable Double hoursThursday) { this.hoursThursday = hoursThursday; return this; } - public OddWeeks withHoursFriday(double hoursFriday) { - Utils.checkNotNull(hoursFriday, "hoursFriday"); - this.hoursFriday = Optional.ofNullable(hoursFriday); - return this; - } - - public OddWeeks withHoursFriday(Optional hoursFriday) { - Utils.checkNotNull(hoursFriday, "hoursFriday"); + public OddWeeks withHoursFriday(@Nullable Double hoursFriday) { this.hoursFriday = hoursFriday; return this; } - public OddWeeks withHoursSaturday(double hoursSaturday) { - Utils.checkNotNull(hoursSaturday, "hoursSaturday"); - this.hoursSaturday = Optional.ofNullable(hoursSaturday); - return this; - } - - public OddWeeks withHoursSaturday(Optional hoursSaturday) { - Utils.checkNotNull(hoursSaturday, "hoursSaturday"); + public OddWeeks withHoursSaturday(@Nullable Double hoursSaturday) { this.hoursSaturday = hoursSaturday; return this; } - public OddWeeks withHoursSunday(double hoursSunday) { - Utils.checkNotNull(hoursSunday, "hoursSunday"); - this.hoursSunday = Optional.ofNullable(hoursSunday); - return this; - } - - public OddWeeks withHoursSunday(Optional hoursSunday) { - Utils.checkNotNull(hoursSunday, "hoursSunday"); + public OddWeeks withHoursSunday(@Nullable Double hoursSunday) { this.hoursSunday = hoursSunday; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -255,117 +192,60 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional hoursMonday = Optional.empty(); + private Double hoursMonday; - private Optional hoursTuesday = Optional.empty(); + private Double hoursTuesday; - private Optional hoursWednesday = Optional.empty(); + private Double hoursWednesday; - private Optional hoursThursday = Optional.empty(); + private Double hoursThursday; - private Optional hoursFriday = Optional.empty(); + private Double hoursFriday; - private Optional hoursSaturday = Optional.empty(); + private Double hoursSaturday; - private Optional hoursSunday = Optional.empty(); + private Double hoursSunday; private Builder() { // force use of static builder() method } - - public Builder hoursMonday(double hoursMonday) { - Utils.checkNotNull(hoursMonday, "hoursMonday"); - this.hoursMonday = Optional.ofNullable(hoursMonday); - return this; - } - - public Builder hoursMonday(Optional hoursMonday) { - Utils.checkNotNull(hoursMonday, "hoursMonday"); + public Builder hoursMonday(@Nullable Double hoursMonday) { this.hoursMonday = hoursMonday; return this; } - - public Builder hoursTuesday(double hoursTuesday) { - Utils.checkNotNull(hoursTuesday, "hoursTuesday"); - this.hoursTuesday = Optional.ofNullable(hoursTuesday); - return this; - } - - public Builder hoursTuesday(Optional hoursTuesday) { - Utils.checkNotNull(hoursTuesday, "hoursTuesday"); + public Builder hoursTuesday(@Nullable Double hoursTuesday) { this.hoursTuesday = hoursTuesday; return this; } - - public Builder hoursWednesday(double hoursWednesday) { - Utils.checkNotNull(hoursWednesday, "hoursWednesday"); - this.hoursWednesday = Optional.ofNullable(hoursWednesday); - return this; - } - - public Builder hoursWednesday(Optional hoursWednesday) { - Utils.checkNotNull(hoursWednesday, "hoursWednesday"); + public Builder hoursWednesday(@Nullable Double hoursWednesday) { this.hoursWednesday = hoursWednesday; return this; } - - public Builder hoursThursday(double hoursThursday) { - Utils.checkNotNull(hoursThursday, "hoursThursday"); - this.hoursThursday = Optional.ofNullable(hoursThursday); - return this; - } - - public Builder hoursThursday(Optional hoursThursday) { - Utils.checkNotNull(hoursThursday, "hoursThursday"); + public Builder hoursThursday(@Nullable Double hoursThursday) { this.hoursThursday = hoursThursday; return this; } - - public Builder hoursFriday(double hoursFriday) { - Utils.checkNotNull(hoursFriday, "hoursFriday"); - this.hoursFriday = Optional.ofNullable(hoursFriday); - return this; - } - - public Builder hoursFriday(Optional hoursFriday) { - Utils.checkNotNull(hoursFriday, "hoursFriday"); + public Builder hoursFriday(@Nullable Double hoursFriday) { this.hoursFriday = hoursFriday; return this; } - - public Builder hoursSaturday(double hoursSaturday) { - Utils.checkNotNull(hoursSaturday, "hoursSaturday"); - this.hoursSaturday = Optional.ofNullable(hoursSaturday); - return this; - } - - public Builder hoursSaturday(Optional hoursSaturday) { - Utils.checkNotNull(hoursSaturday, "hoursSaturday"); + public Builder hoursSaturday(@Nullable Double hoursSaturday) { this.hoursSaturday = hoursSaturday; return this; } - - public Builder hoursSunday(double hoursSunday) { - Utils.checkNotNull(hoursSunday, "hoursSunday"); - this.hoursSunday = Optional.ofNullable(hoursSunday); - return this; - } - - public Builder hoursSunday(Optional hoursSunday) { - Utils.checkNotNull(hoursSunday, "hoursSunday"); + public Builder hoursSunday(@Nullable Double hoursSunday) { this.hoursSunday = hoursSunday; return this; } public OddWeeks build() { - return new OddWeeks( hoursMonday, hoursTuesday, hoursWednesday, hoursThursday, hoursFriday, hoursSaturday, diff --git a/src/main/java/com/apideck/unify/models/components/Operation.java b/src/main/java/com/apideck/unify/models/components/Operation.java index 2bc237bf..3bfc4791 100644 --- a/src/main/java/com/apideck/unify/models/components/Operation.java +++ b/src/main/java/com/apideck/unify/models/components/Operation.java @@ -5,10 +5,11 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; import java.lang.Override; import java.lang.String; +import java.util.Optional; /** * Operation @@ -30,28 +31,26 @@ public class Operation { @JsonCreator public Operation( - @JsonProperty("id") String id, - @JsonProperty("name") String name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - this.id = id; - this.name = name; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("name") @Nonnull String name) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); } /** * The OpenApi Operation Id associated with the request */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The OpenApi Operation name associated with the request */ - @JsonIgnore public String name() { - return name; + return this.name; } public static Builder builder() { @@ -62,21 +61,21 @@ public static Builder builder() { /** * The OpenApi Operation Id associated with the request */ - public Operation withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Operation withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The OpenApi Operation name associated with the request */ - public Operation withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Operation withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -115,28 +114,23 @@ private Builder() { // force use of static builder() method } - /** * The OpenApi Operation Id associated with the request */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The OpenApi Operation name associated with the request */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } public Operation build() { - return new Operation( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/OpportunitiesFilter.java b/src/main/java/com/apideck/unify/models/components/OpportunitiesFilter.java index 42124357..ac9e8b91 100644 --- a/src/main/java/com/apideck/unify/models/components/OpportunitiesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/OpportunitiesFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; @@ -18,60 +18,53 @@ public class OpportunitiesFilter { * Title of the opportunity to filter on */ @SpeakeasyMetadata("queryParam:name=title") - private Optional title; + private String title; /** * Status to filter on */ @SpeakeasyMetadata("queryParam:name=status") - private Optional status; + private String status; /** * Monetary amount to filter on */ @SpeakeasyMetadata("queryParam:name=monetary_amount") - private Optional monetaryAmount; + private Double monetaryAmount; /** * Win probability to filter on */ @SpeakeasyMetadata("queryParam:name=win_probability") - private Optional winProbability; + private Double winProbability; /** * Company ID to filter on */ @SpeakeasyMetadata("queryParam:name=company_id") - private Optional companyId; + private String companyId; /** * Owner ID to filter on */ @SpeakeasyMetadata("queryParam:name=owner_id") - private Optional ownerId; + private String ownerId; /** * Primary contact ID to filter on */ @SpeakeasyMetadata("queryParam:name=primary_contact_id") - private Optional primaryContactId; + private String primaryContactId; @JsonCreator public OpportunitiesFilter( - Optional title, - Optional status, - Optional monetaryAmount, - Optional winProbability, - Optional companyId, - Optional ownerId, - Optional primaryContactId) { - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - Utils.checkNotNull(winProbability, "winProbability"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(primaryContactId, "primaryContactId"); + @Nullable String title, + @Nullable String status, + @Nullable Double monetaryAmount, + @Nullable Double winProbability, + @Nullable String companyId, + @Nullable String ownerId, + @Nullable String primaryContactId) { this.title = title; this.status = status; this.monetaryAmount = monetaryAmount; @@ -82,65 +75,58 @@ public OpportunitiesFilter( } public OpportunitiesFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } /** * Title of the opportunity to filter on */ - @JsonIgnore public Optional title() { - return title; + return Optional.ofNullable(this.title); } /** * Status to filter on */ - @JsonIgnore public Optional status() { - return status; + return Optional.ofNullable(this.status); } /** * Monetary amount to filter on */ - @JsonIgnore public Optional monetaryAmount() { - return monetaryAmount; + return Optional.ofNullable(this.monetaryAmount); } /** * Win probability to filter on */ - @JsonIgnore public Optional winProbability() { - return winProbability; + return Optional.ofNullable(this.winProbability); } /** * Company ID to filter on */ - @JsonIgnore public Optional companyId() { - return companyId; + return Optional.ofNullable(this.companyId); } /** * Owner ID to filter on */ - @JsonIgnore public Optional ownerId() { - return ownerId; + return Optional.ofNullable(this.ownerId); } /** * Primary contact ID to filter on */ - @JsonIgnore public Optional primaryContactId() { - return primaryContactId; + return Optional.ofNullable(this.primaryContactId); } public static Builder builder() { @@ -151,136 +137,66 @@ public static Builder builder() { /** * Title of the opportunity to filter on */ - public OpportunitiesFilter withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - - - /** - * Title of the opportunity to filter on - */ - public OpportunitiesFilter withTitle(Optional title) { - Utils.checkNotNull(title, "title"); + public OpportunitiesFilter withTitle(@Nullable String title) { this.title = title; return this; } - /** - * Status to filter on - */ - public OpportunitiesFilter withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status to filter on */ - public OpportunitiesFilter withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public OpportunitiesFilter withStatus(@Nullable String status) { this.status = status; return this; } - /** - * Monetary amount to filter on - */ - public OpportunitiesFilter withMonetaryAmount(double monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - this.monetaryAmount = Optional.ofNullable(monetaryAmount); - return this; - } - /** * Monetary amount to filter on */ - public OpportunitiesFilter withMonetaryAmount(Optional monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); + public OpportunitiesFilter withMonetaryAmount(@Nullable Double monetaryAmount) { this.monetaryAmount = monetaryAmount; return this; } - /** - * Win probability to filter on - */ - public OpportunitiesFilter withWinProbability(double winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); - this.winProbability = Optional.ofNullable(winProbability); - return this; - } - /** * Win probability to filter on */ - public OpportunitiesFilter withWinProbability(Optional winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); + public OpportunitiesFilter withWinProbability(@Nullable Double winProbability) { this.winProbability = winProbability; return this; } - /** - * Company ID to filter on - */ - public OpportunitiesFilter withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - /** * Company ID to filter on */ - public OpportunitiesFilter withCompanyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public OpportunitiesFilter withCompanyId(@Nullable String companyId) { this.companyId = companyId; return this; } - /** - * Owner ID to filter on - */ - public OpportunitiesFilter withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = Optional.ofNullable(ownerId); - return this; - } - /** * Owner ID to filter on */ - public OpportunitiesFilter withOwnerId(Optional ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public OpportunitiesFilter withOwnerId(@Nullable String ownerId) { this.ownerId = ownerId; return this; } - /** - * Primary contact ID to filter on - */ - public OpportunitiesFilter withPrimaryContactId(String primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); - this.primaryContactId = Optional.ofNullable(primaryContactId); - return this; - } - /** * Primary contact ID to filter on */ - public OpportunitiesFilter withPrimaryContactId(Optional primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); + public OpportunitiesFilter withPrimaryContactId(@Nullable String primaryContactId) { this.primaryContactId = primaryContactId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -323,159 +239,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional title = Optional.empty(); + private String title; - private Optional status = Optional.empty(); + private String status; - private Optional monetaryAmount = Optional.empty(); + private Double monetaryAmount; - private Optional winProbability = Optional.empty(); + private Double winProbability; - private Optional companyId = Optional.empty(); + private String companyId; - private Optional ownerId = Optional.empty(); + private String ownerId; - private Optional primaryContactId = Optional.empty(); + private String primaryContactId; private Builder() { // force use of static builder() method } - - /** - * Title of the opportunity to filter on - */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * Title of the opportunity to filter on */ - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = title; return this; } - - /** - * Status to filter on - */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status to filter on */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = status; return this; } - - /** - * Monetary amount to filter on - */ - public Builder monetaryAmount(double monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - this.monetaryAmount = Optional.ofNullable(monetaryAmount); - return this; - } - /** * Monetary amount to filter on */ - public Builder monetaryAmount(Optional monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); + public Builder monetaryAmount(@Nullable Double monetaryAmount) { this.monetaryAmount = monetaryAmount; return this; } - /** * Win probability to filter on */ - public Builder winProbability(double winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); - this.winProbability = Optional.ofNullable(winProbability); - return this; - } - - /** - * Win probability to filter on - */ - public Builder winProbability(Optional winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); + public Builder winProbability(@Nullable Double winProbability) { this.winProbability = winProbability; return this; } - - /** - * Company ID to filter on - */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - /** * Company ID to filter on */ - public Builder companyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = companyId; return this; } - /** * Owner ID to filter on */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = Optional.ofNullable(ownerId); - return this; - } - - /** - * Owner ID to filter on - */ - public Builder ownerId(Optional ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = ownerId; return this; } - /** * Primary contact ID to filter on */ - public Builder primaryContactId(String primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); - this.primaryContactId = Optional.ofNullable(primaryContactId); - return this; - } - - /** - * Primary contact ID to filter on - */ - public Builder primaryContactId(Optional primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); + public Builder primaryContactId(@Nullable String primaryContactId) { this.primaryContactId = primaryContactId; return this; } public OpportunitiesFilter build() { - return new OpportunitiesFilter( title, status, monetaryAmount, winProbability, companyId, ownerId, diff --git a/src/main/java/com/apideck/unify/models/components/OpportunitiesSort.java b/src/main/java/com/apideck/unify/models/components/OpportunitiesSort.java index 4dfe58dd..8f0af09f 100644 --- a/src/main/java/com/apideck/unify/models/components/OpportunitiesSort.java +++ b/src/main/java/com/apideck/unify/models/components/OpportunitiesSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class OpportunitiesSort { * The field on which to sort the Opportunities */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private OpportunitiesSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public OpportunitiesSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable OpportunitiesSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public OpportunitiesSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Opportunities */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Opportunities */ - public OpportunitiesSort withBy(OpportunitiesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Opportunities - */ - public OpportunitiesSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public OpportunitiesSort withBy(@Nullable OpportunitiesSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public OpportunitiesSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public OpportunitiesSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public OpportunitiesSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private OpportunitiesSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Opportunities - */ - public Builder by(OpportunitiesSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Opportunities */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable OpportunitiesSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public OpportunitiesSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new OpportunitiesSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/Opportunity.java b/src/main/java/com/apideck/unify/models/components/Opportunity.java index 2e1476d7..4d8c45c1 100644 --- a/src/main/java/com/apideck/unify/models/components/Opportunity.java +++ b/src/main/java/com/apideck/unify/models/components/Opportunity.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -29,7 +29,7 @@ public class Opportunity { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The title or name of the opportunity. @@ -70,7 +70,7 @@ public class Opportunity { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The probability of winning the opportunity, expressed as a percentage. @@ -168,7 +168,7 @@ public class Opportunity { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("contact_ids") - private Optional> contactIds; + private List contactIds; /** * The unique identifier of the company associated with the opportunity. @@ -215,7 +215,7 @@ public class Opportunity { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; /** * The number of interactions with the opportunity. @@ -227,7 +227,7 @@ public class Opportunity { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * The date and time when the stage of the opportunity was last changed. @@ -248,7 +248,7 @@ public class Opportunity { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("deleted") - private Optional deleted; + private Boolean deleted; /** * The date and time when the stage of the opportunity was last changed. @@ -276,7 +276,7 @@ public class Opportunity { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The unique identifier of the user who last updated the opportunity. @@ -311,490 +311,437 @@ public class Opportunity { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Opportunity( - @JsonProperty("id") Optional id, - @JsonProperty("title") String title, - @JsonProperty("primary_contact_id") JsonNullable primaryContactId, - @JsonProperty("description") JsonNullable description, - @JsonProperty("type") JsonNullable type, - @JsonProperty("monetary_amount") JsonNullable monetaryAmount, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("win_probability") JsonNullable winProbability, - @JsonProperty("expected_revenue") JsonNullable expectedRevenue, - @JsonProperty("close_date") JsonNullable closeDate, - @JsonProperty("loss_reason_id") JsonNullable lossReasonId, - @JsonProperty("loss_reason") JsonNullable lossReason, - @JsonProperty("won_reason_id") JsonNullable wonReasonId, - @JsonProperty("won_reason") JsonNullable wonReason, - @JsonProperty("pipeline_id") JsonNullable pipelineId, - @JsonProperty("pipeline_stage_id") JsonNullable pipelineStageId, - @JsonProperty("source_id") JsonNullable sourceId, - @JsonProperty("lead_id") JsonNullable leadId, - @JsonProperty("lead_source") JsonNullable leadSource, - @JsonProperty("contact_id") JsonNullable contactId, - @JsonProperty("contact_ids") Optional> contactIds, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("priority") JsonNullable priority, - @JsonProperty("status") JsonNullable status, - @JsonProperty("status_id") JsonNullable statusId, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("interaction_count") JsonNullable interactionCount, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("stage_last_changed_at") JsonNullable stageLastChangedAt, - @JsonProperty("last_activity_at") JsonNullable lastActivityAt, - @JsonProperty("deleted") Optional deleted, - @JsonProperty("date_stage_changed") JsonNullable dateStageChanged, - @JsonProperty("date_last_contacted") JsonNullable dateLastContacted, - @JsonProperty("date_lead_created") JsonNullable dateLeadCreated, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(primaryContactId, "primaryContactId"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(winProbability, "winProbability"); - Utils.checkNotNull(expectedRevenue, "expectedRevenue"); - Utils.checkNotNull(closeDate, "closeDate"); - Utils.checkNotNull(lossReasonId, "lossReasonId"); - Utils.checkNotNull(lossReason, "lossReason"); - Utils.checkNotNull(wonReasonId, "wonReasonId"); - Utils.checkNotNull(wonReason, "wonReason"); - Utils.checkNotNull(pipelineId, "pipelineId"); - Utils.checkNotNull(pipelineStageId, "pipelineStageId"); - Utils.checkNotNull(sourceId, "sourceId"); - Utils.checkNotNull(leadId, "leadId"); - Utils.checkNotNull(leadSource, "leadSource"); - Utils.checkNotNull(contactId, "contactId"); - Utils.checkNotNull(contactIds, "contactIds"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(priority, "priority"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(statusId, "statusId"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(interactionCount, "interactionCount"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(stageLastChangedAt, "stageLastChangedAt"); - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); - Utils.checkNotNull(deleted, "deleted"); - Utils.checkNotNull(dateStageChanged, "dateStageChanged"); - Utils.checkNotNull(dateLastContacted, "dateLastContacted"); - Utils.checkNotNull(dateLeadCreated, "dateLeadCreated"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("title") @Nonnull String title, + @JsonProperty("primary_contact_id") @Nullable JsonNullable primaryContactId, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("monetary_amount") @Nullable JsonNullable monetaryAmount, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("win_probability") @Nullable JsonNullable winProbability, + @JsonProperty("expected_revenue") @Nullable JsonNullable expectedRevenue, + @JsonProperty("close_date") @Nullable JsonNullable closeDate, + @JsonProperty("loss_reason_id") @Nullable JsonNullable lossReasonId, + @JsonProperty("loss_reason") @Nullable JsonNullable lossReason, + @JsonProperty("won_reason_id") @Nullable JsonNullable wonReasonId, + @JsonProperty("won_reason") @Nullable JsonNullable wonReason, + @JsonProperty("pipeline_id") @Nullable JsonNullable pipelineId, + @JsonProperty("pipeline_stage_id") @Nullable JsonNullable pipelineStageId, + @JsonProperty("source_id") @Nullable JsonNullable sourceId, + @JsonProperty("lead_id") @Nullable JsonNullable leadId, + @JsonProperty("lead_source") @Nullable JsonNullable leadSource, + @JsonProperty("contact_id") @Nullable JsonNullable contactId, + @JsonProperty("contact_ids") @Nullable List contactIds, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("priority") @Nullable JsonNullable priority, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("status_id") @Nullable JsonNullable statusId, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("interaction_count") @Nullable JsonNullable interactionCount, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("stage_last_changed_at") @Nullable JsonNullable stageLastChangedAt, + @JsonProperty("last_activity_at") @Nullable JsonNullable lastActivityAt, + @JsonProperty("deleted") @Nullable Boolean deleted, + @JsonProperty("date_stage_changed") @Nullable JsonNullable dateStageChanged, + @JsonProperty("date_last_contacted") @Nullable JsonNullable dateLastContacted, + @JsonProperty("date_lead_created") @Nullable JsonNullable dateLeadCreated, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.title = title; - this.primaryContactId = primaryContactId; - this.description = description; - this.type = type; - this.monetaryAmount = monetaryAmount; - this.currency = currency; - this.winProbability = winProbability; - this.expectedRevenue = expectedRevenue; - this.closeDate = closeDate; - this.lossReasonId = lossReasonId; - this.lossReason = lossReason; - this.wonReasonId = wonReasonId; - this.wonReason = wonReason; - this.pipelineId = pipelineId; - this.pipelineStageId = pipelineStageId; - this.sourceId = sourceId; - this.leadId = leadId; - this.leadSource = leadSource; - this.contactId = contactId; + this.title = Optional.ofNullable(title) + .orElseThrow(() -> new IllegalArgumentException("title cannot be null")); + this.primaryContactId = Optional.ofNullable(primaryContactId) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.monetaryAmount = Optional.ofNullable(monetaryAmount) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.winProbability = Optional.ofNullable(winProbability) + .orElse(JsonNullable.undefined()); + this.expectedRevenue = Optional.ofNullable(expectedRevenue) + .orElse(JsonNullable.undefined()); + this.closeDate = Optional.ofNullable(closeDate) + .orElse(JsonNullable.undefined()); + this.lossReasonId = Optional.ofNullable(lossReasonId) + .orElse(JsonNullable.undefined()); + this.lossReason = Optional.ofNullable(lossReason) + .orElse(JsonNullable.undefined()); + this.wonReasonId = Optional.ofNullable(wonReasonId) + .orElse(JsonNullable.undefined()); + this.wonReason = Optional.ofNullable(wonReason) + .orElse(JsonNullable.undefined()); + this.pipelineId = Optional.ofNullable(pipelineId) + .orElse(JsonNullable.undefined()); + this.pipelineStageId = Optional.ofNullable(pipelineStageId) + .orElse(JsonNullable.undefined()); + this.sourceId = Optional.ofNullable(sourceId) + .orElse(JsonNullable.undefined()); + this.leadId = Optional.ofNullable(leadId) + .orElse(JsonNullable.undefined()); + this.leadSource = Optional.ofNullable(leadSource) + .orElse(JsonNullable.undefined()); + this.contactId = Optional.ofNullable(contactId) + .orElse(JsonNullable.undefined()); this.contactIds = contactIds; - this.companyId = companyId; - this.companyName = companyName; - this.ownerId = ownerId; - this.priority = priority; - this.status = status; - this.statusId = statusId; - this.tags = tags; - this.interactionCount = interactionCount; + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.priority = Optional.ofNullable(priority) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.statusId = Optional.ofNullable(statusId) + .orElse(JsonNullable.undefined()); + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); + this.interactionCount = Optional.ofNullable(interactionCount) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.stageLastChangedAt = stageLastChangedAt; - this.lastActivityAt = lastActivityAt; + this.stageLastChangedAt = Optional.ofNullable(stageLastChangedAt) + .orElse(JsonNullable.undefined()); + this.lastActivityAt = Optional.ofNullable(lastActivityAt) + .orElse(JsonNullable.undefined()); this.deleted = deleted; - this.dateStageChanged = dateStageChanged; - this.dateLastContacted = dateLastContacted; - this.dateLeadCreated = dateLeadCreated; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.dateStageChanged = Optional.ofNullable(dateStageChanged) + .orElse(JsonNullable.undefined()); + this.dateLastContacted = Optional.ofNullable(dateLastContacted) + .orElse(JsonNullable.undefined()); + this.dateLeadCreated = Optional.ofNullable(dateLeadCreated) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Opportunity( - String title) { - this(Optional.empty(), title, JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + @Nonnull String title) { + this(null, title, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for the opportunity. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The title or name of the opportunity. */ - @JsonIgnore public String title() { - return title; + return this.title; } /** * The unique identifier of the primary contact associated with the opportunity. */ - @JsonIgnore public JsonNullable primaryContactId() { - return primaryContactId; + return this.primaryContactId; } /** * A description of the opportunity. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The type of the opportunity */ - @JsonIgnore public JsonNullable type() { - return type; + return this.type; } /** * The monetary value associated with the opportunity */ - @JsonIgnore public JsonNullable monetaryAmount() { - return monetaryAmount; + return this.monetaryAmount; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The probability of winning the opportunity, expressed as a percentage. */ - @JsonIgnore public JsonNullable winProbability() { - return winProbability; + return this.winProbability; } /** * The expected revenue from the opportunity */ - @JsonIgnore public JsonNullable expectedRevenue() { - return expectedRevenue; + return this.expectedRevenue; } /** * The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. */ - @JsonIgnore public JsonNullable closeDate() { - return closeDate; + return this.closeDate; } /** * The unique identifier of the reason why the opportunity was lost. */ - @JsonIgnore public JsonNullable lossReasonId() { - return lossReasonId; + return this.lossReasonId; } /** * The reason why the opportunity was lost. */ - @JsonIgnore public JsonNullable lossReason() { - return lossReason; + return this.lossReason; } /** * The unique identifier of the reason why the opportunity was won. */ - @JsonIgnore public JsonNullable wonReasonId() { - return wonReasonId; + return this.wonReasonId; } /** * The reason why the opportunity was won. */ - @JsonIgnore public JsonNullable wonReason() { - return wonReason; + return this.wonReason; } /** * The unique identifier of the pipeline associated with the opportunity */ - @JsonIgnore public JsonNullable pipelineId() { - return pipelineId; + return this.pipelineId; } /** * The unique identifier of the stage in the pipeline associated with the opportunity. */ - @JsonIgnore public JsonNullable pipelineStageId() { - return pipelineStageId; + return this.pipelineStageId; } /** * The unique identifier of the source of the opportunity. */ - @JsonIgnore public JsonNullable sourceId() { - return sourceId; + return this.sourceId; } /** * The unique identifier of the lead associated with the opportunity. */ - @JsonIgnore public JsonNullable leadId() { - return leadId; + return this.leadId; } /** * The source of the lead associated with the opportunity. */ - @JsonIgnore public JsonNullable leadSource() { - return leadSource; + return this.leadSource; } /** * The unique identifier of the contact associated with the opportunity. */ - @JsonIgnore public JsonNullable contactId() { - return contactId; + return this.contactId; } /** * An array of unique identifiers of all contacts associated with the opportunity. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> contactIds() { - return (Optional>) contactIds; + return Optional.ofNullable(this.contactIds); } /** * The unique identifier of the company associated with the opportunity. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The name of the company associated with the opportunity. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The unique identifier of the user who owns the opportunity. */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The priority level of the opportunity. */ - @JsonIgnore public JsonNullable priority() { - return priority; + return this.priority; } /** * The current status of the opportunity. */ - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * The unique identifier of the current status of the opportunity. */ - @JsonIgnore public JsonNullable statusId() { - return statusId; + return this.statusId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } /** * The number of interactions with the opportunity. */ - @JsonIgnore public JsonNullable interactionCount() { - return interactionCount; + return this.interactionCount; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * The date and time when the stage of the opportunity was last changed. */ - @JsonIgnore public JsonNullable stageLastChangedAt() { - return stageLastChangedAt; + return this.stageLastChangedAt; } /** * The date and time of the last activity associated with the opportunity. */ - @JsonIgnore public JsonNullable lastActivityAt() { - return lastActivityAt; + return this.lastActivityAt; } /** * Indicates whether the opportunity has been deleted. */ - @JsonIgnore public Optional deleted() { - return deleted; + return Optional.ofNullable(this.deleted); } /** * The date and time when the stage of the opportunity was last changed. */ - @JsonIgnore public JsonNullable dateStageChanged() { - return dateStageChanged; + return this.dateStageChanged; } /** * The date and time when the opportunity was last contacted. */ - @JsonIgnore public JsonNullable dateLastContacted() { - return dateLastContacted; + return this.dateLastContacted; } /** * The date and time when the lead associated with the opportunity was created. */ - @JsonIgnore public JsonNullable dateLeadCreated() { - return dateLeadCreated; + return this.dateLeadCreated; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The unique identifier of the user who last updated the opportunity. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The unique identifier of the user who created the opportunity. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the opportunity was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the opportunity was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -805,743 +752,375 @@ public static Builder builder() { /** * A unique identifier for the opportunity. */ - public Opportunity withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for the opportunity. - */ - public Opportunity withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Opportunity withId(@Nullable String id) { this.id = id; return this; } + /** * The title or name of the opportunity. */ - public Opportunity withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = title; + public Opportunity withTitle(@Nonnull String title) { + this.title = Utils.checkNotNull(title, "title"); return this; } + /** * The unique identifier of the primary contact associated with the opportunity. */ - public Opportunity withPrimaryContactId(String primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); + public Opportunity withPrimaryContactId(@Nullable String primaryContactId) { this.primaryContactId = JsonNullable.of(primaryContactId); return this; } - /** - * The unique identifier of the primary contact associated with the opportunity. - */ - public Opportunity withPrimaryContactId(JsonNullable primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); - this.primaryContactId = primaryContactId; - return this; - } /** * A description of the opportunity. */ - public Opportunity withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Opportunity withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the opportunity. - */ - public Opportunity withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The type of the opportunity */ - public Opportunity withType(String type) { - Utils.checkNotNull(type, "type"); + public Opportunity withType(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of the opportunity - */ - public Opportunity withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The monetary value associated with the opportunity */ - public Opportunity withMonetaryAmount(double monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); + public Opportunity withMonetaryAmount(@Nullable Double monetaryAmount) { this.monetaryAmount = JsonNullable.of(monetaryAmount); return this; } - /** - * The monetary value associated with the opportunity - */ - public Opportunity withMonetaryAmount(JsonNullable monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - this.monetaryAmount = monetaryAmount; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Opportunity withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Opportunity withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Opportunity withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The probability of winning the opportunity, expressed as a percentage. */ - public Opportunity withWinProbability(double winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); + public Opportunity withWinProbability(@Nullable Double winProbability) { this.winProbability = JsonNullable.of(winProbability); return this; } - /** - * The probability of winning the opportunity, expressed as a percentage. - */ - public Opportunity withWinProbability(JsonNullable winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); - this.winProbability = winProbability; - return this; - } /** * The expected revenue from the opportunity */ - public Opportunity withExpectedRevenue(double expectedRevenue) { - Utils.checkNotNull(expectedRevenue, "expectedRevenue"); + public Opportunity withExpectedRevenue(@Nullable Double expectedRevenue) { this.expectedRevenue = JsonNullable.of(expectedRevenue); return this; } - /** - * The expected revenue from the opportunity - */ - public Opportunity withExpectedRevenue(JsonNullable expectedRevenue) { - Utils.checkNotNull(expectedRevenue, "expectedRevenue"); - this.expectedRevenue = expectedRevenue; - return this; - } /** * The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. */ - public Opportunity withCloseDate(LocalDate closeDate) { - Utils.checkNotNull(closeDate, "closeDate"); + public Opportunity withCloseDate(@Nullable LocalDate closeDate) { this.closeDate = JsonNullable.of(closeDate); return this; } - /** - * The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. - */ - public Opportunity withCloseDate(JsonNullable closeDate) { - Utils.checkNotNull(closeDate, "closeDate"); - this.closeDate = closeDate; - return this; - } /** * The unique identifier of the reason why the opportunity was lost. */ - public Opportunity withLossReasonId(String lossReasonId) { - Utils.checkNotNull(lossReasonId, "lossReasonId"); + public Opportunity withLossReasonId(@Nullable String lossReasonId) { this.lossReasonId = JsonNullable.of(lossReasonId); return this; } - /** - * The unique identifier of the reason why the opportunity was lost. - */ - public Opportunity withLossReasonId(JsonNullable lossReasonId) { - Utils.checkNotNull(lossReasonId, "lossReasonId"); - this.lossReasonId = lossReasonId; - return this; - } /** * The reason why the opportunity was lost. */ - public Opportunity withLossReason(String lossReason) { - Utils.checkNotNull(lossReason, "lossReason"); + public Opportunity withLossReason(@Nullable String lossReason) { this.lossReason = JsonNullable.of(lossReason); return this; } - /** - * The reason why the opportunity was lost. - */ - public Opportunity withLossReason(JsonNullable lossReason) { - Utils.checkNotNull(lossReason, "lossReason"); - this.lossReason = lossReason; - return this; - } /** * The unique identifier of the reason why the opportunity was won. */ - public Opportunity withWonReasonId(String wonReasonId) { - Utils.checkNotNull(wonReasonId, "wonReasonId"); + public Opportunity withWonReasonId(@Nullable String wonReasonId) { this.wonReasonId = JsonNullable.of(wonReasonId); return this; } - /** - * The unique identifier of the reason why the opportunity was won. - */ - public Opportunity withWonReasonId(JsonNullable wonReasonId) { - Utils.checkNotNull(wonReasonId, "wonReasonId"); - this.wonReasonId = wonReasonId; - return this; - } /** * The reason why the opportunity was won. */ - public Opportunity withWonReason(String wonReason) { - Utils.checkNotNull(wonReason, "wonReason"); + public Opportunity withWonReason(@Nullable String wonReason) { this.wonReason = JsonNullable.of(wonReason); return this; } - /** - * The reason why the opportunity was won. - */ - public Opportunity withWonReason(JsonNullable wonReason) { - Utils.checkNotNull(wonReason, "wonReason"); - this.wonReason = wonReason; - return this; - } /** * The unique identifier of the pipeline associated with the opportunity */ - public Opportunity withPipelineId(String pipelineId) { - Utils.checkNotNull(pipelineId, "pipelineId"); + public Opportunity withPipelineId(@Nullable String pipelineId) { this.pipelineId = JsonNullable.of(pipelineId); return this; } - /** - * The unique identifier of the pipeline associated with the opportunity - */ - public Opportunity withPipelineId(JsonNullable pipelineId) { - Utils.checkNotNull(pipelineId, "pipelineId"); - this.pipelineId = pipelineId; - return this; - } /** * The unique identifier of the stage in the pipeline associated with the opportunity. */ - public Opportunity withPipelineStageId(String pipelineStageId) { - Utils.checkNotNull(pipelineStageId, "pipelineStageId"); + public Opportunity withPipelineStageId(@Nullable String pipelineStageId) { this.pipelineStageId = JsonNullable.of(pipelineStageId); return this; } - /** - * The unique identifier of the stage in the pipeline associated with the opportunity. - */ - public Opportunity withPipelineStageId(JsonNullable pipelineStageId) { - Utils.checkNotNull(pipelineStageId, "pipelineStageId"); - this.pipelineStageId = pipelineStageId; - return this; - } /** * The unique identifier of the source of the opportunity. */ - public Opportunity withSourceId(String sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); + public Opportunity withSourceId(@Nullable String sourceId) { this.sourceId = JsonNullable.of(sourceId); return this; } - /** - * The unique identifier of the source of the opportunity. - */ - public Opportunity withSourceId(JsonNullable sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); - this.sourceId = sourceId; - return this; - } /** * The unique identifier of the lead associated with the opportunity. */ - public Opportunity withLeadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Opportunity withLeadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The unique identifier of the lead associated with the opportunity. - */ - public Opportunity withLeadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } /** * The source of the lead associated with the opportunity. */ - public Opportunity withLeadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public Opportunity withLeadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The source of the lead associated with the opportunity. - */ - public Opportunity withLeadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } /** * The unique identifier of the contact associated with the opportunity. */ - public Opportunity withContactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public Opportunity withContactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The unique identifier of the contact associated with the opportunity. - */ - public Opportunity withContactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } - - /** - * An array of unique identifiers of all contacts associated with the opportunity. - */ - public Opportunity withContactIds(List contactIds) { - Utils.checkNotNull(contactIds, "contactIds"); - this.contactIds = Optional.ofNullable(contactIds); - return this; - } - /** * An array of unique identifiers of all contacts associated with the opportunity. */ - public Opportunity withContactIds(Optional> contactIds) { - Utils.checkNotNull(contactIds, "contactIds"); + public Opportunity withContactIds(@Nullable List contactIds) { this.contactIds = contactIds; return this; } + /** * The unique identifier of the company associated with the opportunity. */ - public Opportunity withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Opportunity withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company associated with the opportunity. - */ - public Opportunity withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The name of the company associated with the opportunity. */ - public Opportunity withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Opportunity withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company associated with the opportunity. - */ - public Opportunity withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The unique identifier of the user who owns the opportunity. */ - public Opportunity withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Opportunity withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The unique identifier of the user who owns the opportunity. - */ - public Opportunity withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The priority level of the opportunity. */ - public Opportunity withPriority(String priority) { - Utils.checkNotNull(priority, "priority"); + public Opportunity withPriority(@Nullable String priority) { this.priority = JsonNullable.of(priority); return this; } - /** - * The priority level of the opportunity. - */ - public Opportunity withPriority(JsonNullable priority) { - Utils.checkNotNull(priority, "priority"); - this.priority = priority; - return this; - } /** * The current status of the opportunity. */ - public Opportunity withStatus(String status) { - Utils.checkNotNull(status, "status"); + public Opportunity withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the opportunity. - */ - public Opportunity withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The unique identifier of the current status of the opportunity. */ - public Opportunity withStatusId(String statusId) { - Utils.checkNotNull(statusId, "statusId"); + public Opportunity withStatusId(@Nullable String statusId) { this.statusId = JsonNullable.of(statusId); return this; } - /** - * The unique identifier of the current status of the opportunity. - */ - public Opportunity withStatusId(JsonNullable statusId) { - Utils.checkNotNull(statusId, "statusId"); - this.statusId = statusId; - return this; - } - public Opportunity withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Opportunity withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Opportunity withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } /** * The number of interactions with the opportunity. */ - public Opportunity withInteractionCount(double interactionCount) { - Utils.checkNotNull(interactionCount, "interactionCount"); + public Opportunity withInteractionCount(@Nullable Double interactionCount) { this.interactionCount = JsonNullable.of(interactionCount); return this; } - /** - * The number of interactions with the opportunity. - */ - public Opportunity withInteractionCount(JsonNullable interactionCount) { - Utils.checkNotNull(interactionCount, "interactionCount"); - this.interactionCount = interactionCount; - return this; - } - - public Opportunity withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Opportunity withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Opportunity withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * The date and time when the stage of the opportunity was last changed. */ - public Opportunity withStageLastChangedAt(OffsetDateTime stageLastChangedAt) { - Utils.checkNotNull(stageLastChangedAt, "stageLastChangedAt"); + public Opportunity withStageLastChangedAt(@Nullable OffsetDateTime stageLastChangedAt) { this.stageLastChangedAt = JsonNullable.of(stageLastChangedAt); return this; } - /** - * The date and time when the stage of the opportunity was last changed. - */ - public Opportunity withStageLastChangedAt(JsonNullable stageLastChangedAt) { - Utils.checkNotNull(stageLastChangedAt, "stageLastChangedAt"); - this.stageLastChangedAt = stageLastChangedAt; - return this; - } /** * The date and time of the last activity associated with the opportunity. */ - public Opportunity withLastActivityAt(String lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); + public Opportunity withLastActivityAt(@Nullable String lastActivityAt) { this.lastActivityAt = JsonNullable.of(lastActivityAt); return this; } - /** - * The date and time of the last activity associated with the opportunity. - */ - public Opportunity withLastActivityAt(JsonNullable lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); - this.lastActivityAt = lastActivityAt; - return this; - } - - /** - * Indicates whether the opportunity has been deleted. - */ - public Opportunity withDeleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = Optional.ofNullable(deleted); - return this; - } - /** * Indicates whether the opportunity has been deleted. */ - public Opportunity withDeleted(Optional deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Opportunity withDeleted(@Nullable Boolean deleted) { this.deleted = deleted; return this; } + /** * The date and time when the stage of the opportunity was last changed. */ - public Opportunity withDateStageChanged(OffsetDateTime dateStageChanged) { - Utils.checkNotNull(dateStageChanged, "dateStageChanged"); + public Opportunity withDateStageChanged(@Nullable OffsetDateTime dateStageChanged) { this.dateStageChanged = JsonNullable.of(dateStageChanged); return this; } - /** - * The date and time when the stage of the opportunity was last changed. - */ - public Opportunity withDateStageChanged(JsonNullable dateStageChanged) { - Utils.checkNotNull(dateStageChanged, "dateStageChanged"); - this.dateStageChanged = dateStageChanged; - return this; - } /** * The date and time when the opportunity was last contacted. */ - public Opportunity withDateLastContacted(OffsetDateTime dateLastContacted) { - Utils.checkNotNull(dateLastContacted, "dateLastContacted"); + public Opportunity withDateLastContacted(@Nullable OffsetDateTime dateLastContacted) { this.dateLastContacted = JsonNullable.of(dateLastContacted); return this; } - /** - * The date and time when the opportunity was last contacted. - */ - public Opportunity withDateLastContacted(JsonNullable dateLastContacted) { - Utils.checkNotNull(dateLastContacted, "dateLastContacted"); - this.dateLastContacted = dateLastContacted; - return this; - } /** * The date and time when the lead associated with the opportunity was created. */ - public Opportunity withDateLeadCreated(OffsetDateTime dateLeadCreated) { - Utils.checkNotNull(dateLeadCreated, "dateLeadCreated"); + public Opportunity withDateLeadCreated(@Nullable OffsetDateTime dateLeadCreated) { this.dateLeadCreated = JsonNullable.of(dateLeadCreated); return this; } - /** - * The date and time when the lead associated with the opportunity was created. - */ - public Opportunity withDateLeadCreated(JsonNullable dateLeadCreated) { - Utils.checkNotNull(dateLeadCreated, "dateLeadCreated"); - this.dateLeadCreated = dateLeadCreated; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Opportunity withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Opportunity withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Opportunity withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The unique identifier of the user who last updated the opportunity. */ - public Opportunity withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Opportunity withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The unique identifier of the user who last updated the opportunity. - */ - public Opportunity withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The unique identifier of the user who created the opportunity. */ - public Opportunity withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Opportunity withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The unique identifier of the user who created the opportunity. - */ - public Opportunity withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the opportunity was last updated. */ - public Opportunity withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Opportunity withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the opportunity was last updated. - */ - public Opportunity withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the opportunity was created. */ - public Opportunity withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Opportunity withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the opportunity was created. - */ - public Opportunity withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Opportunity withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Opportunity withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Opportunity withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1665,873 +1244,425 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private String title; - private JsonNullable primaryContactId = JsonNullable.undefined(); + private JsonNullable primaryContactId; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable monetaryAmount = JsonNullable.undefined(); + private JsonNullable monetaryAmount; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable winProbability = JsonNullable.undefined(); + private JsonNullable winProbability; - private JsonNullable expectedRevenue = JsonNullable.undefined(); + private JsonNullable expectedRevenue; - private JsonNullable closeDate = JsonNullable.undefined(); + private JsonNullable closeDate; - private JsonNullable lossReasonId = JsonNullable.undefined(); + private JsonNullable lossReasonId; - private JsonNullable lossReason = JsonNullable.undefined(); + private JsonNullable lossReason; - private JsonNullable wonReasonId = JsonNullable.undefined(); + private JsonNullable wonReasonId; - private JsonNullable wonReason = JsonNullable.undefined(); + private JsonNullable wonReason; - private JsonNullable pipelineId = JsonNullable.undefined(); + private JsonNullable pipelineId; - private JsonNullable pipelineStageId = JsonNullable.undefined(); + private JsonNullable pipelineStageId; - private JsonNullable sourceId = JsonNullable.undefined(); + private JsonNullable sourceId; - private JsonNullable leadId = JsonNullable.undefined(); + private JsonNullable leadId; - private JsonNullable leadSource = JsonNullable.undefined(); + private JsonNullable leadSource; - private JsonNullable contactId = JsonNullable.undefined(); + private JsonNullable contactId; - private Optional> contactIds = Optional.empty(); + private List contactIds; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable priority = JsonNullable.undefined(); + private JsonNullable priority; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable statusId = JsonNullable.undefined(); + private JsonNullable statusId; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private JsonNullable interactionCount = JsonNullable.undefined(); + private JsonNullable interactionCount; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable stageLastChangedAt = JsonNullable.undefined(); + private JsonNullable stageLastChangedAt; - private JsonNullable lastActivityAt = JsonNullable.undefined(); + private JsonNullable lastActivityAt; - private Optional deleted = Optional.empty(); + private Boolean deleted; - private JsonNullable dateStageChanged = JsonNullable.undefined(); + private JsonNullable dateStageChanged; - private JsonNullable dateLastContacted = JsonNullable.undefined(); + private JsonNullable dateLastContacted; - private JsonNullable dateLeadCreated = JsonNullable.undefined(); + private JsonNullable dateLeadCreated; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for the opportunity. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for the opportunity. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The title or name of the opportunity. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = title; + public Builder title(@Nonnull String title) { + this.title = Utils.checkNotNull(title, "title"); return this; } - /** * The unique identifier of the primary contact associated with the opportunity. */ - public Builder primaryContactId(String primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); + public Builder primaryContactId(@Nullable String primaryContactId) { this.primaryContactId = JsonNullable.of(primaryContactId); return this; } - /** - * The unique identifier of the primary contact associated with the opportunity. - */ - public Builder primaryContactId(JsonNullable primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); - this.primaryContactId = primaryContactId; - return this; - } - - /** * A description of the opportunity. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the opportunity. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The type of the opportunity */ - public Builder type(String type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of the opportunity - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The monetary value associated with the opportunity */ - public Builder monetaryAmount(double monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); + public Builder monetaryAmount(@Nullable Double monetaryAmount) { this.monetaryAmount = JsonNullable.of(monetaryAmount); return this; } - /** - * The monetary value associated with the opportunity - */ - public Builder monetaryAmount(JsonNullable monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - this.monetaryAmount = monetaryAmount; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The probability of winning the opportunity, expressed as a percentage. */ - public Builder winProbability(double winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); + public Builder winProbability(@Nullable Double winProbability) { this.winProbability = JsonNullable.of(winProbability); return this; } - /** - * The probability of winning the opportunity, expressed as a percentage. - */ - public Builder winProbability(JsonNullable winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); - this.winProbability = winProbability; - return this; - } - - /** * The expected revenue from the opportunity */ - public Builder expectedRevenue(double expectedRevenue) { - Utils.checkNotNull(expectedRevenue, "expectedRevenue"); + public Builder expectedRevenue(@Nullable Double expectedRevenue) { this.expectedRevenue = JsonNullable.of(expectedRevenue); return this; } - /** - * The expected revenue from the opportunity - */ - public Builder expectedRevenue(JsonNullable expectedRevenue) { - Utils.checkNotNull(expectedRevenue, "expectedRevenue"); - this.expectedRevenue = expectedRevenue; - return this; - } - - /** * The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. */ - public Builder closeDate(LocalDate closeDate) { - Utils.checkNotNull(closeDate, "closeDate"); + public Builder closeDate(@Nullable LocalDate closeDate) { this.closeDate = JsonNullable.of(closeDate); return this; } - /** - * The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. - */ - public Builder closeDate(JsonNullable closeDate) { - Utils.checkNotNull(closeDate, "closeDate"); - this.closeDate = closeDate; - return this; - } - - /** * The unique identifier of the reason why the opportunity was lost. */ - public Builder lossReasonId(String lossReasonId) { - Utils.checkNotNull(lossReasonId, "lossReasonId"); + public Builder lossReasonId(@Nullable String lossReasonId) { this.lossReasonId = JsonNullable.of(lossReasonId); return this; } - /** - * The unique identifier of the reason why the opportunity was lost. - */ - public Builder lossReasonId(JsonNullable lossReasonId) { - Utils.checkNotNull(lossReasonId, "lossReasonId"); - this.lossReasonId = lossReasonId; - return this; - } - - /** * The reason why the opportunity was lost. */ - public Builder lossReason(String lossReason) { - Utils.checkNotNull(lossReason, "lossReason"); + public Builder lossReason(@Nullable String lossReason) { this.lossReason = JsonNullable.of(lossReason); return this; } - /** - * The reason why the opportunity was lost. - */ - public Builder lossReason(JsonNullable lossReason) { - Utils.checkNotNull(lossReason, "lossReason"); - this.lossReason = lossReason; - return this; - } - - /** * The unique identifier of the reason why the opportunity was won. */ - public Builder wonReasonId(String wonReasonId) { - Utils.checkNotNull(wonReasonId, "wonReasonId"); + public Builder wonReasonId(@Nullable String wonReasonId) { this.wonReasonId = JsonNullable.of(wonReasonId); return this; } - /** - * The unique identifier of the reason why the opportunity was won. - */ - public Builder wonReasonId(JsonNullable wonReasonId) { - Utils.checkNotNull(wonReasonId, "wonReasonId"); - this.wonReasonId = wonReasonId; - return this; - } - - /** * The reason why the opportunity was won. */ - public Builder wonReason(String wonReason) { - Utils.checkNotNull(wonReason, "wonReason"); + public Builder wonReason(@Nullable String wonReason) { this.wonReason = JsonNullable.of(wonReason); return this; } - /** - * The reason why the opportunity was won. - */ - public Builder wonReason(JsonNullable wonReason) { - Utils.checkNotNull(wonReason, "wonReason"); - this.wonReason = wonReason; - return this; - } - - /** * The unique identifier of the pipeline associated with the opportunity */ - public Builder pipelineId(String pipelineId) { - Utils.checkNotNull(pipelineId, "pipelineId"); + public Builder pipelineId(@Nullable String pipelineId) { this.pipelineId = JsonNullable.of(pipelineId); return this; } - /** - * The unique identifier of the pipeline associated with the opportunity - */ - public Builder pipelineId(JsonNullable pipelineId) { - Utils.checkNotNull(pipelineId, "pipelineId"); - this.pipelineId = pipelineId; - return this; - } - - /** * The unique identifier of the stage in the pipeline associated with the opportunity. */ - public Builder pipelineStageId(String pipelineStageId) { - Utils.checkNotNull(pipelineStageId, "pipelineStageId"); + public Builder pipelineStageId(@Nullable String pipelineStageId) { this.pipelineStageId = JsonNullable.of(pipelineStageId); return this; } - /** - * The unique identifier of the stage in the pipeline associated with the opportunity. - */ - public Builder pipelineStageId(JsonNullable pipelineStageId) { - Utils.checkNotNull(pipelineStageId, "pipelineStageId"); - this.pipelineStageId = pipelineStageId; - return this; - } - - /** * The unique identifier of the source of the opportunity. */ - public Builder sourceId(String sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); + public Builder sourceId(@Nullable String sourceId) { this.sourceId = JsonNullable.of(sourceId); return this; } - /** - * The unique identifier of the source of the opportunity. - */ - public Builder sourceId(JsonNullable sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); - this.sourceId = sourceId; - return this; - } - - /** * The unique identifier of the lead associated with the opportunity. */ - public Builder leadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Builder leadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The unique identifier of the lead associated with the opportunity. - */ - public Builder leadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } - - /** * The source of the lead associated with the opportunity. */ - public Builder leadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public Builder leadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The source of the lead associated with the opportunity. - */ - public Builder leadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } - - /** * The unique identifier of the contact associated with the opportunity. */ - public Builder contactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public Builder contactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The unique identifier of the contact associated with the opportunity. - */ - public Builder contactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } - - - /** - * An array of unique identifiers of all contacts associated with the opportunity. - */ - public Builder contactIds(List contactIds) { - Utils.checkNotNull(contactIds, "contactIds"); - this.contactIds = Optional.ofNullable(contactIds); - return this; - } - /** * An array of unique identifiers of all contacts associated with the opportunity. */ - public Builder contactIds(Optional> contactIds) { - Utils.checkNotNull(contactIds, "contactIds"); + public Builder contactIds(@Nullable List contactIds) { this.contactIds = contactIds; return this; } - /** * The unique identifier of the company associated with the opportunity. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company associated with the opportunity. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The name of the company associated with the opportunity. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company associated with the opportunity. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The unique identifier of the user who owns the opportunity. */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The unique identifier of the user who owns the opportunity. - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The priority level of the opportunity. */ - public Builder priority(String priority) { - Utils.checkNotNull(priority, "priority"); + public Builder priority(@Nullable String priority) { this.priority = JsonNullable.of(priority); return this; } - /** - * The priority level of the opportunity. - */ - public Builder priority(JsonNullable priority) { - Utils.checkNotNull(priority, "priority"); - this.priority = priority; - return this; - } - - /** * The current status of the opportunity. */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the opportunity. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The unique identifier of the current status of the opportunity. */ - public Builder statusId(String statusId) { - Utils.checkNotNull(statusId, "statusId"); + public Builder statusId(@Nullable String statusId) { this.statusId = JsonNullable.of(statusId); return this; } - /** - * The unique identifier of the current status of the opportunity. - */ - public Builder statusId(JsonNullable statusId) { - Utils.checkNotNull(statusId, "statusId"); - this.statusId = statusId; - return this; - } - - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - /** * The number of interactions with the opportunity. */ - public Builder interactionCount(double interactionCount) { - Utils.checkNotNull(interactionCount, "interactionCount"); + public Builder interactionCount(@Nullable Double interactionCount) { this.interactionCount = JsonNullable.of(interactionCount); return this; } - /** - * The number of interactions with the opportunity. - */ - public Builder interactionCount(JsonNullable interactionCount) { - Utils.checkNotNull(interactionCount, "interactionCount"); - this.interactionCount = interactionCount; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * The date and time when the stage of the opportunity was last changed. */ - public Builder stageLastChangedAt(OffsetDateTime stageLastChangedAt) { - Utils.checkNotNull(stageLastChangedAt, "stageLastChangedAt"); + public Builder stageLastChangedAt(@Nullable OffsetDateTime stageLastChangedAt) { this.stageLastChangedAt = JsonNullable.of(stageLastChangedAt); return this; } - /** - * The date and time when the stage of the opportunity was last changed. - */ - public Builder stageLastChangedAt(JsonNullable stageLastChangedAt) { - Utils.checkNotNull(stageLastChangedAt, "stageLastChangedAt"); - this.stageLastChangedAt = stageLastChangedAt; - return this; - } - - /** * The date and time of the last activity associated with the opportunity. */ - public Builder lastActivityAt(String lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); + public Builder lastActivityAt(@Nullable String lastActivityAt) { this.lastActivityAt = JsonNullable.of(lastActivityAt); return this; } - /** - * The date and time of the last activity associated with the opportunity. - */ - public Builder lastActivityAt(JsonNullable lastActivityAt) { - Utils.checkNotNull(lastActivityAt, "lastActivityAt"); - this.lastActivityAt = lastActivityAt; - return this; - } - - /** * Indicates whether the opportunity has been deleted. */ - public Builder deleted(boolean deleted) { - Utils.checkNotNull(deleted, "deleted"); - this.deleted = Optional.ofNullable(deleted); - return this; - } - - /** - * Indicates whether the opportunity has been deleted. - */ - public Builder deleted(Optional deleted) { - Utils.checkNotNull(deleted, "deleted"); + public Builder deleted(@Nullable Boolean deleted) { this.deleted = deleted; return this; } - /** * The date and time when the stage of the opportunity was last changed. */ - public Builder dateStageChanged(OffsetDateTime dateStageChanged) { - Utils.checkNotNull(dateStageChanged, "dateStageChanged"); + public Builder dateStageChanged(@Nullable OffsetDateTime dateStageChanged) { this.dateStageChanged = JsonNullable.of(dateStageChanged); return this; } - /** - * The date and time when the stage of the opportunity was last changed. - */ - public Builder dateStageChanged(JsonNullable dateStageChanged) { - Utils.checkNotNull(dateStageChanged, "dateStageChanged"); - this.dateStageChanged = dateStageChanged; - return this; - } - - /** * The date and time when the opportunity was last contacted. */ - public Builder dateLastContacted(OffsetDateTime dateLastContacted) { - Utils.checkNotNull(dateLastContacted, "dateLastContacted"); + public Builder dateLastContacted(@Nullable OffsetDateTime dateLastContacted) { this.dateLastContacted = JsonNullable.of(dateLastContacted); return this; } - /** - * The date and time when the opportunity was last contacted. - */ - public Builder dateLastContacted(JsonNullable dateLastContacted) { - Utils.checkNotNull(dateLastContacted, "dateLastContacted"); - this.dateLastContacted = dateLastContacted; - return this; - } - - /** * The date and time when the lead associated with the opportunity was created. */ - public Builder dateLeadCreated(OffsetDateTime dateLeadCreated) { - Utils.checkNotNull(dateLeadCreated, "dateLeadCreated"); + public Builder dateLeadCreated(@Nullable OffsetDateTime dateLeadCreated) { this.dateLeadCreated = JsonNullable.of(dateLeadCreated); return this; } - /** - * The date and time when the lead associated with the opportunity was created. - */ - public Builder dateLeadCreated(JsonNullable dateLeadCreated) { - Utils.checkNotNull(dateLeadCreated, "dateLeadCreated"); - this.dateLeadCreated = dateLeadCreated; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The unique identifier of the user who last updated the opportunity. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The unique identifier of the user who last updated the opportunity. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The unique identifier of the user who created the opportunity. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The unique identifier of the user who created the opportunity. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the opportunity was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the opportunity was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the opportunity was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the opportunity was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Opportunity build() { - return new Opportunity( id, title, primaryContactId, description, type, monetaryAmount, diff --git a/src/main/java/com/apideck/unify/models/components/OpportunityInput.java b/src/main/java/com/apideck/unify/models/components/OpportunityInput.java index 3ed8b266..609dd40c 100644 --- a/src/main/java/com/apideck/unify/models/components/OpportunityInput.java +++ b/src/main/java/com/apideck/unify/models/components/OpportunityInput.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -60,7 +60,7 @@ public class OpportunityInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The probability of winning the opportunity, expressed as a percentage. @@ -151,7 +151,7 @@ public class OpportunityInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("contact_ids") - private Optional> contactIds; + private List contactIds; /** * The unique identifier of the company associated with the opportunity. @@ -198,12 +198,12 @@ public class OpportunityInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private JsonNullable> tags; + private JsonNullable> tags; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * The date and time when the stage of the opportunity was last changed. @@ -217,342 +217,305 @@ public class OpportunityInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public OpportunityInput( - @JsonProperty("title") String title, - @JsonProperty("primary_contact_id") JsonNullable primaryContactId, - @JsonProperty("description") JsonNullable description, - @JsonProperty("type") JsonNullable type, - @JsonProperty("monetary_amount") JsonNullable monetaryAmount, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("win_probability") JsonNullable winProbability, - @JsonProperty("close_date") JsonNullable closeDate, - @JsonProperty("loss_reason_id") JsonNullable lossReasonId, - @JsonProperty("loss_reason") JsonNullable lossReason, - @JsonProperty("won_reason_id") JsonNullable wonReasonId, - @JsonProperty("won_reason") JsonNullable wonReason, - @JsonProperty("pipeline_id") JsonNullable pipelineId, - @JsonProperty("pipeline_stage_id") JsonNullable pipelineStageId, - @JsonProperty("source_id") JsonNullable sourceId, - @JsonProperty("lead_id") JsonNullable leadId, - @JsonProperty("lead_source") JsonNullable leadSource, - @JsonProperty("contact_id") JsonNullable contactId, - @JsonProperty("contact_ids") Optional> contactIds, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("owner_id") JsonNullable ownerId, - @JsonProperty("priority") JsonNullable priority, - @JsonProperty("status") JsonNullable status, - @JsonProperty("status_id") JsonNullable statusId, - @JsonProperty("tags") JsonNullable> tags, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("stage_last_changed_at") JsonNullable stageLastChangedAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(primaryContactId, "primaryContactId"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(winProbability, "winProbability"); - Utils.checkNotNull(closeDate, "closeDate"); - Utils.checkNotNull(lossReasonId, "lossReasonId"); - Utils.checkNotNull(lossReason, "lossReason"); - Utils.checkNotNull(wonReasonId, "wonReasonId"); - Utils.checkNotNull(wonReason, "wonReason"); - Utils.checkNotNull(pipelineId, "pipelineId"); - Utils.checkNotNull(pipelineStageId, "pipelineStageId"); - Utils.checkNotNull(sourceId, "sourceId"); - Utils.checkNotNull(leadId, "leadId"); - Utils.checkNotNull(leadSource, "leadSource"); - Utils.checkNotNull(contactId, "contactId"); - Utils.checkNotNull(contactIds, "contactIds"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(ownerId, "ownerId"); - Utils.checkNotNull(priority, "priority"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(statusId, "statusId"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(stageLastChangedAt, "stageLastChangedAt"); - Utils.checkNotNull(passThrough, "passThrough"); - this.title = title; - this.primaryContactId = primaryContactId; - this.description = description; - this.type = type; - this.monetaryAmount = monetaryAmount; - this.currency = currency; - this.winProbability = winProbability; - this.closeDate = closeDate; - this.lossReasonId = lossReasonId; - this.lossReason = lossReason; - this.wonReasonId = wonReasonId; - this.wonReason = wonReason; - this.pipelineId = pipelineId; - this.pipelineStageId = pipelineStageId; - this.sourceId = sourceId; - this.leadId = leadId; - this.leadSource = leadSource; - this.contactId = contactId; + @JsonProperty("title") @Nonnull String title, + @JsonProperty("primary_contact_id") @Nullable JsonNullable primaryContactId, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("monetary_amount") @Nullable JsonNullable monetaryAmount, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("win_probability") @Nullable JsonNullable winProbability, + @JsonProperty("close_date") @Nullable JsonNullable closeDate, + @JsonProperty("loss_reason_id") @Nullable JsonNullable lossReasonId, + @JsonProperty("loss_reason") @Nullable JsonNullable lossReason, + @JsonProperty("won_reason_id") @Nullable JsonNullable wonReasonId, + @JsonProperty("won_reason") @Nullable JsonNullable wonReason, + @JsonProperty("pipeline_id") @Nullable JsonNullable pipelineId, + @JsonProperty("pipeline_stage_id") @Nullable JsonNullable pipelineStageId, + @JsonProperty("source_id") @Nullable JsonNullable sourceId, + @JsonProperty("lead_id") @Nullable JsonNullable leadId, + @JsonProperty("lead_source") @Nullable JsonNullable leadSource, + @JsonProperty("contact_id") @Nullable JsonNullable contactId, + @JsonProperty("contact_ids") @Nullable List contactIds, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("owner_id") @Nullable JsonNullable ownerId, + @JsonProperty("priority") @Nullable JsonNullable priority, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("status_id") @Nullable JsonNullable statusId, + @JsonProperty("tags") @Nullable JsonNullable> tags, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("stage_last_changed_at") @Nullable JsonNullable stageLastChangedAt, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.title = Optional.ofNullable(title) + .orElseThrow(() -> new IllegalArgumentException("title cannot be null")); + this.primaryContactId = Optional.ofNullable(primaryContactId) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.monetaryAmount = Optional.ofNullable(monetaryAmount) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.winProbability = Optional.ofNullable(winProbability) + .orElse(JsonNullable.undefined()); + this.closeDate = Optional.ofNullable(closeDate) + .orElse(JsonNullable.undefined()); + this.lossReasonId = Optional.ofNullable(lossReasonId) + .orElse(JsonNullable.undefined()); + this.lossReason = Optional.ofNullable(lossReason) + .orElse(JsonNullable.undefined()); + this.wonReasonId = Optional.ofNullable(wonReasonId) + .orElse(JsonNullable.undefined()); + this.wonReason = Optional.ofNullable(wonReason) + .orElse(JsonNullable.undefined()); + this.pipelineId = Optional.ofNullable(pipelineId) + .orElse(JsonNullable.undefined()); + this.pipelineStageId = Optional.ofNullable(pipelineStageId) + .orElse(JsonNullable.undefined()); + this.sourceId = Optional.ofNullable(sourceId) + .orElse(JsonNullable.undefined()); + this.leadId = Optional.ofNullable(leadId) + .orElse(JsonNullable.undefined()); + this.leadSource = Optional.ofNullable(leadSource) + .orElse(JsonNullable.undefined()); + this.contactId = Optional.ofNullable(contactId) + .orElse(JsonNullable.undefined()); this.contactIds = contactIds; - this.companyId = companyId; - this.companyName = companyName; - this.ownerId = ownerId; - this.priority = priority; - this.status = status; - this.statusId = statusId; - this.tags = tags; + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.ownerId = Optional.ofNullable(ownerId) + .orElse(JsonNullable.undefined()); + this.priority = Optional.ofNullable(priority) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.statusId = Optional.ofNullable(statusId) + .orElse(JsonNullable.undefined()); + this.tags = Optional.ofNullable(tags) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.stageLastChangedAt = stageLastChangedAt; + this.stageLastChangedAt = Optional.ofNullable(stageLastChangedAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public OpportunityInput( - String title) { - this(title, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty()); + @Nonnull String title) { + this(title, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * The title or name of the opportunity. */ - @JsonIgnore public String title() { - return title; + return this.title; } /** * The unique identifier of the primary contact associated with the opportunity. */ - @JsonIgnore public JsonNullable primaryContactId() { - return primaryContactId; + return this.primaryContactId; } /** * A description of the opportunity. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The type of the opportunity */ - @JsonIgnore public JsonNullable type() { - return type; + return this.type; } /** * The monetary value associated with the opportunity */ - @JsonIgnore public JsonNullable monetaryAmount() { - return monetaryAmount; + return this.monetaryAmount; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The probability of winning the opportunity, expressed as a percentage. */ - @JsonIgnore public JsonNullable winProbability() { - return winProbability; + return this.winProbability; } /** * The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. */ - @JsonIgnore public JsonNullable closeDate() { - return closeDate; + return this.closeDate; } /** * The unique identifier of the reason why the opportunity was lost. */ - @JsonIgnore public JsonNullable lossReasonId() { - return lossReasonId; + return this.lossReasonId; } /** * The reason why the opportunity was lost. */ - @JsonIgnore public JsonNullable lossReason() { - return lossReason; + return this.lossReason; } /** * The unique identifier of the reason why the opportunity was won. */ - @JsonIgnore public JsonNullable wonReasonId() { - return wonReasonId; + return this.wonReasonId; } /** * The reason why the opportunity was won. */ - @JsonIgnore public JsonNullable wonReason() { - return wonReason; + return this.wonReason; } /** * The unique identifier of the pipeline associated with the opportunity */ - @JsonIgnore public JsonNullable pipelineId() { - return pipelineId; + return this.pipelineId; } /** * The unique identifier of the stage in the pipeline associated with the opportunity. */ - @JsonIgnore public JsonNullable pipelineStageId() { - return pipelineStageId; + return this.pipelineStageId; } /** * The unique identifier of the source of the opportunity. */ - @JsonIgnore public JsonNullable sourceId() { - return sourceId; + return this.sourceId; } /** * The unique identifier of the lead associated with the opportunity. */ - @JsonIgnore public JsonNullable leadId() { - return leadId; + return this.leadId; } /** * The source of the lead associated with the opportunity. */ - @JsonIgnore public JsonNullable leadSource() { - return leadSource; + return this.leadSource; } /** * The unique identifier of the contact associated with the opportunity. */ - @JsonIgnore public JsonNullable contactId() { - return contactId; + return this.contactId; } /** * An array of unique identifiers of all contacts associated with the opportunity. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> contactIds() { - return (Optional>) contactIds; + return Optional.ofNullable(this.contactIds); } /** * The unique identifier of the company associated with the opportunity. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The name of the company associated with the opportunity. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The unique identifier of the user who owns the opportunity. */ - @JsonIgnore public JsonNullable ownerId() { - return ownerId; + return this.ownerId; } /** * The priority level of the opportunity. */ - @JsonIgnore public JsonNullable priority() { - return priority; + return this.priority; } /** * The current status of the opportunity. */ - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * The unique identifier of the current status of the opportunity. */ - @JsonIgnore public JsonNullable statusId() { - return statusId; + return this.statusId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> tags() { - return (JsonNullable>) tags; + return this.tags; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * The date and time when the stage of the opportunity was last changed. */ - @JsonIgnore public JsonNullable stageLastChangedAt() { - return stageLastChangedAt; + return this.stageLastChangedAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -563,494 +526,245 @@ public static Builder builder() { /** * The title or name of the opportunity. */ - public OpportunityInput withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = title; + public OpportunityInput withTitle(@Nonnull String title) { + this.title = Utils.checkNotNull(title, "title"); return this; } + /** * The unique identifier of the primary contact associated with the opportunity. */ - public OpportunityInput withPrimaryContactId(String primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); + public OpportunityInput withPrimaryContactId(@Nullable String primaryContactId) { this.primaryContactId = JsonNullable.of(primaryContactId); return this; } - /** - * The unique identifier of the primary contact associated with the opportunity. - */ - public OpportunityInput withPrimaryContactId(JsonNullable primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); - this.primaryContactId = primaryContactId; - return this; - } /** * A description of the opportunity. */ - public OpportunityInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public OpportunityInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the opportunity. - */ - public OpportunityInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The type of the opportunity */ - public OpportunityInput withType(String type) { - Utils.checkNotNull(type, "type"); + public OpportunityInput withType(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of the opportunity - */ - public OpportunityInput withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The monetary value associated with the opportunity */ - public OpportunityInput withMonetaryAmount(double monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); + public OpportunityInput withMonetaryAmount(@Nullable Double monetaryAmount) { this.monetaryAmount = JsonNullable.of(monetaryAmount); return this; } - /** - * The monetary value associated with the opportunity - */ - public OpportunityInput withMonetaryAmount(JsonNullable monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - this.monetaryAmount = monetaryAmount; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public OpportunityInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public OpportunityInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public OpportunityInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The probability of winning the opportunity, expressed as a percentage. */ - public OpportunityInput withWinProbability(double winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); + public OpportunityInput withWinProbability(@Nullable Double winProbability) { this.winProbability = JsonNullable.of(winProbability); return this; } - /** - * The probability of winning the opportunity, expressed as a percentage. - */ - public OpportunityInput withWinProbability(JsonNullable winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); - this.winProbability = winProbability; - return this; - } /** * The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. */ - public OpportunityInput withCloseDate(LocalDate closeDate) { - Utils.checkNotNull(closeDate, "closeDate"); + public OpportunityInput withCloseDate(@Nullable LocalDate closeDate) { this.closeDate = JsonNullable.of(closeDate); return this; } - /** - * The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. - */ - public OpportunityInput withCloseDate(JsonNullable closeDate) { - Utils.checkNotNull(closeDate, "closeDate"); - this.closeDate = closeDate; - return this; - } /** * The unique identifier of the reason why the opportunity was lost. */ - public OpportunityInput withLossReasonId(String lossReasonId) { - Utils.checkNotNull(lossReasonId, "lossReasonId"); + public OpportunityInput withLossReasonId(@Nullable String lossReasonId) { this.lossReasonId = JsonNullable.of(lossReasonId); return this; } - /** - * The unique identifier of the reason why the opportunity was lost. - */ - public OpportunityInput withLossReasonId(JsonNullable lossReasonId) { - Utils.checkNotNull(lossReasonId, "lossReasonId"); - this.lossReasonId = lossReasonId; - return this; - } /** * The reason why the opportunity was lost. */ - public OpportunityInput withLossReason(String lossReason) { - Utils.checkNotNull(lossReason, "lossReason"); + public OpportunityInput withLossReason(@Nullable String lossReason) { this.lossReason = JsonNullable.of(lossReason); return this; } - /** - * The reason why the opportunity was lost. - */ - public OpportunityInput withLossReason(JsonNullable lossReason) { - Utils.checkNotNull(lossReason, "lossReason"); - this.lossReason = lossReason; - return this; - } /** * The unique identifier of the reason why the opportunity was won. */ - public OpportunityInput withWonReasonId(String wonReasonId) { - Utils.checkNotNull(wonReasonId, "wonReasonId"); + public OpportunityInput withWonReasonId(@Nullable String wonReasonId) { this.wonReasonId = JsonNullable.of(wonReasonId); return this; } - /** - * The unique identifier of the reason why the opportunity was won. - */ - public OpportunityInput withWonReasonId(JsonNullable wonReasonId) { - Utils.checkNotNull(wonReasonId, "wonReasonId"); - this.wonReasonId = wonReasonId; - return this; - } /** * The reason why the opportunity was won. */ - public OpportunityInput withWonReason(String wonReason) { - Utils.checkNotNull(wonReason, "wonReason"); + public OpportunityInput withWonReason(@Nullable String wonReason) { this.wonReason = JsonNullable.of(wonReason); return this; } - /** - * The reason why the opportunity was won. - */ - public OpportunityInput withWonReason(JsonNullable wonReason) { - Utils.checkNotNull(wonReason, "wonReason"); - this.wonReason = wonReason; - return this; - } /** * The unique identifier of the pipeline associated with the opportunity */ - public OpportunityInput withPipelineId(String pipelineId) { - Utils.checkNotNull(pipelineId, "pipelineId"); + public OpportunityInput withPipelineId(@Nullable String pipelineId) { this.pipelineId = JsonNullable.of(pipelineId); return this; } - /** - * The unique identifier of the pipeline associated with the opportunity - */ - public OpportunityInput withPipelineId(JsonNullable pipelineId) { - Utils.checkNotNull(pipelineId, "pipelineId"); - this.pipelineId = pipelineId; - return this; - } /** * The unique identifier of the stage in the pipeline associated with the opportunity. */ - public OpportunityInput withPipelineStageId(String pipelineStageId) { - Utils.checkNotNull(pipelineStageId, "pipelineStageId"); + public OpportunityInput withPipelineStageId(@Nullable String pipelineStageId) { this.pipelineStageId = JsonNullable.of(pipelineStageId); return this; } - /** - * The unique identifier of the stage in the pipeline associated with the opportunity. - */ - public OpportunityInput withPipelineStageId(JsonNullable pipelineStageId) { - Utils.checkNotNull(pipelineStageId, "pipelineStageId"); - this.pipelineStageId = pipelineStageId; - return this; - } /** * The unique identifier of the source of the opportunity. */ - public OpportunityInput withSourceId(String sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); + public OpportunityInput withSourceId(@Nullable String sourceId) { this.sourceId = JsonNullable.of(sourceId); return this; } - /** - * The unique identifier of the source of the opportunity. - */ - public OpportunityInput withSourceId(JsonNullable sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); - this.sourceId = sourceId; - return this; - } /** * The unique identifier of the lead associated with the opportunity. */ - public OpportunityInput withLeadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public OpportunityInput withLeadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The unique identifier of the lead associated with the opportunity. - */ - public OpportunityInput withLeadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } /** * The source of the lead associated with the opportunity. */ - public OpportunityInput withLeadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public OpportunityInput withLeadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The source of the lead associated with the opportunity. - */ - public OpportunityInput withLeadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } /** * The unique identifier of the contact associated with the opportunity. */ - public OpportunityInput withContactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public OpportunityInput withContactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The unique identifier of the contact associated with the opportunity. - */ - public OpportunityInput withContactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } - - /** - * An array of unique identifiers of all contacts associated with the opportunity. - */ - public OpportunityInput withContactIds(List contactIds) { - Utils.checkNotNull(contactIds, "contactIds"); - this.contactIds = Optional.ofNullable(contactIds); - return this; - } - /** * An array of unique identifiers of all contacts associated with the opportunity. */ - public OpportunityInput withContactIds(Optional> contactIds) { - Utils.checkNotNull(contactIds, "contactIds"); + public OpportunityInput withContactIds(@Nullable List contactIds) { this.contactIds = contactIds; return this; } + /** * The unique identifier of the company associated with the opportunity. */ - public OpportunityInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public OpportunityInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company associated with the opportunity. - */ - public OpportunityInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The name of the company associated with the opportunity. */ - public OpportunityInput withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public OpportunityInput withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company associated with the opportunity. - */ - public OpportunityInput withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The unique identifier of the user who owns the opportunity. */ - public OpportunityInput withOwnerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public OpportunityInput withOwnerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The unique identifier of the user who owns the opportunity. - */ - public OpportunityInput withOwnerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } /** * The priority level of the opportunity. */ - public OpportunityInput withPriority(String priority) { - Utils.checkNotNull(priority, "priority"); + public OpportunityInput withPriority(@Nullable String priority) { this.priority = JsonNullable.of(priority); return this; } - /** - * The priority level of the opportunity. - */ - public OpportunityInput withPriority(JsonNullable priority) { - Utils.checkNotNull(priority, "priority"); - this.priority = priority; - return this; - } /** * The current status of the opportunity. */ - public OpportunityInput withStatus(String status) { - Utils.checkNotNull(status, "status"); + public OpportunityInput withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the opportunity. - */ - public OpportunityInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The unique identifier of the current status of the opportunity. */ - public OpportunityInput withStatusId(String statusId) { - Utils.checkNotNull(statusId, "statusId"); + public OpportunityInput withStatusId(@Nullable String statusId) { this.statusId = JsonNullable.of(statusId); return this; } - /** - * The unique identifier of the current status of the opportunity. - */ - public OpportunityInput withStatusId(JsonNullable statusId) { - Utils.checkNotNull(statusId, "statusId"); - this.statusId = statusId; - return this; - } - public OpportunityInput withTags(List tags) { - Utils.checkNotNull(tags, "tags"); + public OpportunityInput withTags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public OpportunityInput withTags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - public OpportunityInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public OpportunityInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public OpportunityInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * The date and time when the stage of the opportunity was last changed. - */ - public OpportunityInput withStageLastChangedAt(OffsetDateTime stageLastChangedAt) { - Utils.checkNotNull(stageLastChangedAt, "stageLastChangedAt"); - this.stageLastChangedAt = JsonNullable.of(stageLastChangedAt); - return this; - } /** * The date and time when the stage of the opportunity was last changed. */ - public OpportunityInput withStageLastChangedAt(JsonNullable stageLastChangedAt) { - Utils.checkNotNull(stageLastChangedAt, "stageLastChangedAt"); - this.stageLastChangedAt = stageLastChangedAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public OpportunityInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public OpportunityInput withStageLastChangedAt(@Nullable OffsetDateTime stageLastChangedAt) { + this.stageLastChangedAt = JsonNullable.of(stageLastChangedAt); return this; } @@ -1058,12 +772,12 @@ public OpportunityInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public OpportunityInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public OpportunityInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1159,598 +873,293 @@ public final static class Builder { private String title; - private JsonNullable primaryContactId = JsonNullable.undefined(); + private JsonNullable primaryContactId; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable monetaryAmount = JsonNullable.undefined(); + private JsonNullable monetaryAmount; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable winProbability = JsonNullable.undefined(); + private JsonNullable winProbability; - private JsonNullable closeDate = JsonNullable.undefined(); + private JsonNullable closeDate; - private JsonNullable lossReasonId = JsonNullable.undefined(); + private JsonNullable lossReasonId; - private JsonNullable lossReason = JsonNullable.undefined(); + private JsonNullable lossReason; - private JsonNullable wonReasonId = JsonNullable.undefined(); + private JsonNullable wonReasonId; - private JsonNullable wonReason = JsonNullable.undefined(); + private JsonNullable wonReason; - private JsonNullable pipelineId = JsonNullable.undefined(); + private JsonNullable pipelineId; - private JsonNullable pipelineStageId = JsonNullable.undefined(); + private JsonNullable pipelineStageId; - private JsonNullable sourceId = JsonNullable.undefined(); + private JsonNullable sourceId; - private JsonNullable leadId = JsonNullable.undefined(); + private JsonNullable leadId; - private JsonNullable leadSource = JsonNullable.undefined(); + private JsonNullable leadSource; - private JsonNullable contactId = JsonNullable.undefined(); + private JsonNullable contactId; - private Optional> contactIds = Optional.empty(); + private List contactIds; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable ownerId = JsonNullable.undefined(); + private JsonNullable ownerId; - private JsonNullable priority = JsonNullable.undefined(); + private JsonNullable priority; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable statusId = JsonNullable.undefined(); + private JsonNullable statusId; - private JsonNullable> tags = JsonNullable.undefined(); + private JsonNullable> tags; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable stageLastChangedAt = JsonNullable.undefined(); + private JsonNullable stageLastChangedAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The title or name of the opportunity. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = title; + public Builder title(@Nonnull String title) { + this.title = Utils.checkNotNull(title, "title"); return this; } - /** * The unique identifier of the primary contact associated with the opportunity. */ - public Builder primaryContactId(String primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); + public Builder primaryContactId(@Nullable String primaryContactId) { this.primaryContactId = JsonNullable.of(primaryContactId); return this; } - /** - * The unique identifier of the primary contact associated with the opportunity. - */ - public Builder primaryContactId(JsonNullable primaryContactId) { - Utils.checkNotNull(primaryContactId, "primaryContactId"); - this.primaryContactId = primaryContactId; - return this; - } - - /** * A description of the opportunity. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the opportunity. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The type of the opportunity */ - public Builder type(String type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of the opportunity - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The monetary value associated with the opportunity */ - public Builder monetaryAmount(double monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); + public Builder monetaryAmount(@Nullable Double monetaryAmount) { this.monetaryAmount = JsonNullable.of(monetaryAmount); return this; } - /** - * The monetary value associated with the opportunity - */ - public Builder monetaryAmount(JsonNullable monetaryAmount) { - Utils.checkNotNull(monetaryAmount, "monetaryAmount"); - this.monetaryAmount = monetaryAmount; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The probability of winning the opportunity, expressed as a percentage. */ - public Builder winProbability(double winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); + public Builder winProbability(@Nullable Double winProbability) { this.winProbability = JsonNullable.of(winProbability); return this; } - /** - * The probability of winning the opportunity, expressed as a percentage. - */ - public Builder winProbability(JsonNullable winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); - this.winProbability = winProbability; - return this; - } - - /** * The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. */ - public Builder closeDate(LocalDate closeDate) { - Utils.checkNotNull(closeDate, "closeDate"); + public Builder closeDate(@Nullable LocalDate closeDate) { this.closeDate = JsonNullable.of(closeDate); return this; } - /** - * The actual closing date for the opportunity. If close_date is null, the opportunity is not closed yet. - */ - public Builder closeDate(JsonNullable closeDate) { - Utils.checkNotNull(closeDate, "closeDate"); - this.closeDate = closeDate; - return this; - } - - /** * The unique identifier of the reason why the opportunity was lost. */ - public Builder lossReasonId(String lossReasonId) { - Utils.checkNotNull(lossReasonId, "lossReasonId"); + public Builder lossReasonId(@Nullable String lossReasonId) { this.lossReasonId = JsonNullable.of(lossReasonId); return this; } - /** - * The unique identifier of the reason why the opportunity was lost. - */ - public Builder lossReasonId(JsonNullable lossReasonId) { - Utils.checkNotNull(lossReasonId, "lossReasonId"); - this.lossReasonId = lossReasonId; - return this; - } - - /** * The reason why the opportunity was lost. */ - public Builder lossReason(String lossReason) { - Utils.checkNotNull(lossReason, "lossReason"); + public Builder lossReason(@Nullable String lossReason) { this.lossReason = JsonNullable.of(lossReason); return this; } - /** - * The reason why the opportunity was lost. - */ - public Builder lossReason(JsonNullable lossReason) { - Utils.checkNotNull(lossReason, "lossReason"); - this.lossReason = lossReason; - return this; - } - - /** * The unique identifier of the reason why the opportunity was won. */ - public Builder wonReasonId(String wonReasonId) { - Utils.checkNotNull(wonReasonId, "wonReasonId"); + public Builder wonReasonId(@Nullable String wonReasonId) { this.wonReasonId = JsonNullable.of(wonReasonId); return this; } - /** - * The unique identifier of the reason why the opportunity was won. - */ - public Builder wonReasonId(JsonNullable wonReasonId) { - Utils.checkNotNull(wonReasonId, "wonReasonId"); - this.wonReasonId = wonReasonId; - return this; - } - - /** * The reason why the opportunity was won. */ - public Builder wonReason(String wonReason) { - Utils.checkNotNull(wonReason, "wonReason"); + public Builder wonReason(@Nullable String wonReason) { this.wonReason = JsonNullable.of(wonReason); return this; } - /** - * The reason why the opportunity was won. - */ - public Builder wonReason(JsonNullable wonReason) { - Utils.checkNotNull(wonReason, "wonReason"); - this.wonReason = wonReason; - return this; - } - - /** * The unique identifier of the pipeline associated with the opportunity */ - public Builder pipelineId(String pipelineId) { - Utils.checkNotNull(pipelineId, "pipelineId"); + public Builder pipelineId(@Nullable String pipelineId) { this.pipelineId = JsonNullable.of(pipelineId); return this; } - /** - * The unique identifier of the pipeline associated with the opportunity - */ - public Builder pipelineId(JsonNullable pipelineId) { - Utils.checkNotNull(pipelineId, "pipelineId"); - this.pipelineId = pipelineId; - return this; - } - - /** * The unique identifier of the stage in the pipeline associated with the opportunity. */ - public Builder pipelineStageId(String pipelineStageId) { - Utils.checkNotNull(pipelineStageId, "pipelineStageId"); + public Builder pipelineStageId(@Nullable String pipelineStageId) { this.pipelineStageId = JsonNullable.of(pipelineStageId); return this; } - /** - * The unique identifier of the stage in the pipeline associated with the opportunity. - */ - public Builder pipelineStageId(JsonNullable pipelineStageId) { - Utils.checkNotNull(pipelineStageId, "pipelineStageId"); - this.pipelineStageId = pipelineStageId; - return this; - } - - /** * The unique identifier of the source of the opportunity. */ - public Builder sourceId(String sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); + public Builder sourceId(@Nullable String sourceId) { this.sourceId = JsonNullable.of(sourceId); return this; } - /** - * The unique identifier of the source of the opportunity. - */ - public Builder sourceId(JsonNullable sourceId) { - Utils.checkNotNull(sourceId, "sourceId"); - this.sourceId = sourceId; - return this; - } - - /** * The unique identifier of the lead associated with the opportunity. */ - public Builder leadId(String leadId) { - Utils.checkNotNull(leadId, "leadId"); + public Builder leadId(@Nullable String leadId) { this.leadId = JsonNullable.of(leadId); return this; } - /** - * The unique identifier of the lead associated with the opportunity. - */ - public Builder leadId(JsonNullable leadId) { - Utils.checkNotNull(leadId, "leadId"); - this.leadId = leadId; - return this; - } - - /** * The source of the lead associated with the opportunity. */ - public Builder leadSource(String leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); + public Builder leadSource(@Nullable String leadSource) { this.leadSource = JsonNullable.of(leadSource); return this; } - /** - * The source of the lead associated with the opportunity. - */ - public Builder leadSource(JsonNullable leadSource) { - Utils.checkNotNull(leadSource, "leadSource"); - this.leadSource = leadSource; - return this; - } - - /** * The unique identifier of the contact associated with the opportunity. */ - public Builder contactId(String contactId) { - Utils.checkNotNull(contactId, "contactId"); + public Builder contactId(@Nullable String contactId) { this.contactId = JsonNullable.of(contactId); return this; } - /** - * The unique identifier of the contact associated with the opportunity. - */ - public Builder contactId(JsonNullable contactId) { - Utils.checkNotNull(contactId, "contactId"); - this.contactId = contactId; - return this; - } - - - /** - * An array of unique identifiers of all contacts associated with the opportunity. - */ - public Builder contactIds(List contactIds) { - Utils.checkNotNull(contactIds, "contactIds"); - this.contactIds = Optional.ofNullable(contactIds); - return this; - } - /** * An array of unique identifiers of all contacts associated with the opportunity. */ - public Builder contactIds(Optional> contactIds) { - Utils.checkNotNull(contactIds, "contactIds"); + public Builder contactIds(@Nullable List contactIds) { this.contactIds = contactIds; return this; } - /** * The unique identifier of the company associated with the opportunity. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company associated with the opportunity. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The name of the company associated with the opportunity. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company associated with the opportunity. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The unique identifier of the user who owns the opportunity. */ - public Builder ownerId(String ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); + public Builder ownerId(@Nullable String ownerId) { this.ownerId = JsonNullable.of(ownerId); return this; } - /** - * The unique identifier of the user who owns the opportunity. - */ - public Builder ownerId(JsonNullable ownerId) { - Utils.checkNotNull(ownerId, "ownerId"); - this.ownerId = ownerId; - return this; - } - - /** * The priority level of the opportunity. */ - public Builder priority(String priority) { - Utils.checkNotNull(priority, "priority"); + public Builder priority(@Nullable String priority) { this.priority = JsonNullable.of(priority); return this; } - /** - * The priority level of the opportunity. - */ - public Builder priority(JsonNullable priority) { - Utils.checkNotNull(priority, "priority"); - this.priority = priority; - return this; - } - - /** * The current status of the opportunity. */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the opportunity. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The unique identifier of the current status of the opportunity. */ - public Builder statusId(String statusId) { - Utils.checkNotNull(statusId, "statusId"); + public Builder statusId(@Nullable String statusId) { this.statusId = JsonNullable.of(statusId); return this; } - /** - * The unique identifier of the current status of the opportunity. - */ - public Builder statusId(JsonNullable statusId) { - Utils.checkNotNull(statusId, "statusId"); - this.statusId = statusId; - return this; - } - - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = JsonNullable.of(tags); return this; } - public Builder tags(JsonNullable> tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = tags; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * The date and time when the stage of the opportunity was last changed. */ - public Builder stageLastChangedAt(OffsetDateTime stageLastChangedAt) { - Utils.checkNotNull(stageLastChangedAt, "stageLastChangedAt"); + public Builder stageLastChangedAt(@Nullable OffsetDateTime stageLastChangedAt) { this.stageLastChangedAt = JsonNullable.of(stageLastChangedAt); return this; } - /** - * The date and time when the stage of the opportunity was last changed. - */ - public Builder stageLastChangedAt(JsonNullable stageLastChangedAt) { - Utils.checkNotNull(stageLastChangedAt, "stageLastChangedAt"); - this.stageLastChangedAt = stageLastChangedAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public OpportunityInput build() { - return new OpportunityInput( title, primaryContactId, description, type, monetaryAmount, currency, diff --git a/src/main/java/com/apideck/unify/models/components/Options.java b/src/main/java/com/apideck/unify/models/components/Options.java index 7e0826f2..d152e689 100644 --- a/src/main/java/com/apideck/unify/models/components/Options.java +++ b/src/main/java/com/apideck/unify/models/components/Options.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -38,43 +39,40 @@ public class Options { @JsonCreator public Options( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("value") JsonNullable value) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(value, "value"); - this.id = id; - this.name = name; - this.value = value; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("value") @Nullable JsonNullable value) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.value = Optional.ofNullable(value) + .orElse(JsonNullable.undefined()); } public Options() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * A unique identifier for the option. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The name of the option. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The value of the option. */ - @JsonIgnore public JsonNullable value() { - return value; + return this.value; } public static Builder builder() { @@ -85,56 +83,29 @@ public static Builder builder() { /** * A unique identifier for the option. */ - public Options withId(String id) { - Utils.checkNotNull(id, "id"); + public Options withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for the option. - */ - public Options withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The name of the option. */ - public Options withName(String name) { - Utils.checkNotNull(name, "name"); + public Options withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the option. - */ - public Options withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The value of the option. */ - public Options withValue(String value) { - Utils.checkNotNull(value, "value"); + public Options withValue(@Nullable String value) { this.value = JsonNullable.of(value); return this; } - /** - * The value of the option. - */ - public Options withValue(JsonNullable value) { - Utils.checkNotNull(value, "value"); - this.value = value; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -168,75 +139,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable value = JsonNullable.undefined(); + private JsonNullable value; private Builder() { // force use of static builder() method } - /** * A unique identifier for the option. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for the option. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The name of the option. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the option. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The value of the option. */ - public Builder value(String value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable String value) { this.value = JsonNullable.of(value); return this; } - /** - * The value of the option. - */ - public Builder value(JsonNullable value) { - Utils.checkNotNull(value, "value"); - this.value = value; - return this; - } - public Options build() { - return new Options( id, name, value); } diff --git a/src/main/java/com/apideck/unify/models/components/OrdersSort.java b/src/main/java/com/apideck/unify/models/components/OrdersSort.java index 36e1ee29..e5d816c8 100644 --- a/src/main/java/com/apideck/unify/models/components/OrdersSort.java +++ b/src/main/java/com/apideck/unify/models/components/OrdersSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class OrdersSort { * The field on which to sort the Orders */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private OrdersSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public OrdersSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable OrdersSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public OrdersSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Orders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Orders */ - public OrdersSort withBy(OrdersSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Orders - */ - public OrdersSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public OrdersSort withBy(@Nullable OrdersSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public OrdersSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public OrdersSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public OrdersSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private OrdersSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Orders - */ - public Builder by(OrdersSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Orders */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable OrdersSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public OrdersSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new OrdersSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/OtherExpenses.java b/src/main/java/com/apideck/unify/models/components/OtherExpenses.java index 41a03039..4275661b 100644 --- a/src/main/java/com/apideck/unify/models/components/OtherExpenses.java +++ b/src/main/java/com/apideck/unify/models/components/OtherExpenses.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -28,28 +28,28 @@ public class OtherExpenses { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The account code of the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * The name of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") - private Optional title; + private String title; /** * The type of profit and loss */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The aggregated total of all accounts within this category. @@ -64,76 +64,66 @@ public class OtherExpenses { @JsonCreator public OtherExpenses( - @JsonProperty("id") Optional id, - @JsonProperty("code") Optional code, - @JsonProperty("title") Optional title, - @JsonProperty("type") JsonNullable type, - @JsonProperty("total") JsonNullable total, - @JsonProperty("records") Object records) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(records, "records"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("code") @Nullable String code, + @JsonProperty("title") @Nullable String title, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("total") @Nullable JsonNullable total, + @JsonProperty("records") @Nonnull Object records) { this.id = id; this.code = code; this.title = title; - this.type = type; - this.total = total; - this.records = records; + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); + this.records = Optional.ofNullable(records) + .orElseThrow(() -> new IllegalArgumentException("records cannot be null")); } public OtherExpenses( - Object records) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), records); + @Nonnull Object records) { + this(null, null, null, + null, null, records); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The account code of the account */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * The name of the account. */ - @JsonIgnore public Optional title() { - return title; + return Optional.ofNullable(this.title); } /** * The type of profit and loss */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The aggregated total of all accounts within this category. */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } - @JsonIgnore public Object records() { - return records; + return this.records; } public static Builder builder() { @@ -144,102 +134,54 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public OtherExpenses withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public OtherExpenses withId(Optional id) { - Utils.checkNotNull(id, "id"); + public OtherExpenses withId(@Nullable String id) { this.id = id; return this; } - /** - * The account code of the account - */ - public OtherExpenses withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The account code of the account */ - public OtherExpenses withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public OtherExpenses withCode(@Nullable String code) { this.code = code; return this; } - /** - * The name of the account. - */ - public OtherExpenses withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public OtherExpenses withTitle(Optional title) { - Utils.checkNotNull(title, "title"); + public OtherExpenses withTitle(@Nullable String title) { this.title = title; return this; } + /** * The type of profit and loss */ - public OtherExpenses withType(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public OtherExpenses withType(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public OtherExpenses withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The aggregated total of all accounts within this category. */ - public OtherExpenses withTotal(double total) { - Utils.checkNotNull(total, "total"); + public OtherExpenses withTotal(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * The aggregated total of all accounts within this category. - */ - public OtherExpenses withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - public OtherExpenses withRecords(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; + public OtherExpenses withRecords(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -279,15 +221,15 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional code = Optional.empty(); + private String code; - private Optional title = Optional.empty(); + private String title; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; private Object records; @@ -295,110 +237,52 @@ private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The account code of the account */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The account code of the account - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - /** - * The name of the account. - */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = title; return this; } - /** * The type of profit and loss */ - public Builder type(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The aggregated total of all accounts within this category. */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * The aggregated total of all accounts within this category. - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - - - public Builder records(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; + public Builder records(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } public OtherExpenses build() { - return new OtherExpenses( id, code, title, type, total, records); diff --git a/src/main/java/com/apideck/unify/models/components/OtherIncome.java b/src/main/java/com/apideck/unify/models/components/OtherIncome.java index 5ddc34bf..d52f20ee 100644 --- a/src/main/java/com/apideck/unify/models/components/OtherIncome.java +++ b/src/main/java/com/apideck/unify/models/components/OtherIncome.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -28,28 +28,28 @@ public class OtherIncome { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The account code of the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * The name of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") - private Optional title; + private String title; /** * The type of profit and loss */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The aggregated total of all accounts within this category. @@ -64,76 +64,66 @@ public class OtherIncome { @JsonCreator public OtherIncome( - @JsonProperty("id") Optional id, - @JsonProperty("code") Optional code, - @JsonProperty("title") Optional title, - @JsonProperty("type") JsonNullable type, - @JsonProperty("total") JsonNullable total, - @JsonProperty("records") Object records) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(records, "records"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("code") @Nullable String code, + @JsonProperty("title") @Nullable String title, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("total") @Nullable JsonNullable total, + @JsonProperty("records") @Nonnull Object records) { this.id = id; this.code = code; this.title = title; - this.type = type; - this.total = total; - this.records = records; + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); + this.records = Optional.ofNullable(records) + .orElseThrow(() -> new IllegalArgumentException("records cannot be null")); } public OtherIncome( - Object records) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), records); + @Nonnull Object records) { + this(null, null, null, + null, null, records); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The account code of the account */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * The name of the account. */ - @JsonIgnore public Optional title() { - return title; + return Optional.ofNullable(this.title); } /** * The type of profit and loss */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The aggregated total of all accounts within this category. */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } - @JsonIgnore public Object records() { - return records; + return this.records; } public static Builder builder() { @@ -144,102 +134,54 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public OtherIncome withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public OtherIncome withId(Optional id) { - Utils.checkNotNull(id, "id"); + public OtherIncome withId(@Nullable String id) { this.id = id; return this; } - /** - * The account code of the account - */ - public OtherIncome withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The account code of the account */ - public OtherIncome withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public OtherIncome withCode(@Nullable String code) { this.code = code; return this; } - /** - * The name of the account. - */ - public OtherIncome withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public OtherIncome withTitle(Optional title) { - Utils.checkNotNull(title, "title"); + public OtherIncome withTitle(@Nullable String title) { this.title = title; return this; } + /** * The type of profit and loss */ - public OtherIncome withType(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public OtherIncome withType(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public OtherIncome withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The aggregated total of all accounts within this category. */ - public OtherIncome withTotal(double total) { - Utils.checkNotNull(total, "total"); + public OtherIncome withTotal(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * The aggregated total of all accounts within this category. - */ - public OtherIncome withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - public OtherIncome withRecords(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; + public OtherIncome withRecords(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -279,15 +221,15 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional code = Optional.empty(); + private String code; - private Optional title = Optional.empty(); + private String title; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; private Object records; @@ -295,110 +237,52 @@ private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The account code of the account */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The account code of the account - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - /** - * The name of the account. - */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = title; return this; } - /** * The type of profit and loss */ - public Builder type(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * The aggregated total of all accounts within this category. */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * The aggregated total of all accounts within this category. - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - - - public Builder records(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; + public Builder records(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } public OtherIncome build() { - return new OtherIncome( id, code, title, type, total, records); diff --git a/src/main/java/com/apideck/unify/models/components/OutstandingBalanceByCurrency.java b/src/main/java/com/apideck/unify/models/components/OutstandingBalanceByCurrency.java index 602b5673..de716a13 100644 --- a/src/main/java/com/apideck/unify/models/components/OutstandingBalanceByCurrency.java +++ b/src/main/java/com/apideck/unify/models/components/OutstandingBalanceByCurrency.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,58 +23,51 @@ public class OutstandingBalanceByCurrency { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Total amount of the outstanding balance. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("total_amount") - private Optional totalAmount; + private Double totalAmount; @JsonInclude(Include.NON_ABSENT) @JsonProperty("balances_by_period") - private Optional> balancesByPeriod; + private List balancesByPeriod; @JsonCreator public OutstandingBalanceByCurrency( - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("total_amount") Optional totalAmount, - @JsonProperty("balances_by_period") Optional> balancesByPeriod) { - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(balancesByPeriod, "balancesByPeriod"); - this.currency = currency; + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("total_amount") @Nullable Double totalAmount, + @JsonProperty("balances_by_period") @Nullable List balancesByPeriod) { + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); this.totalAmount = totalAmount; this.balancesByPeriod = balancesByPeriod; } public OutstandingBalanceByCurrency() { - this(JsonNullable.undefined(), Optional.empty(), Optional.empty()); + this(null, null, null); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Total amount of the outstanding balance. */ - @JsonIgnore public Optional totalAmount() { - return totalAmount; + return Optional.ofNullable(this.totalAmount); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> balancesByPeriod() { - return (Optional>) balancesByPeriod; + return Optional.ofNullable(this.balancesByPeriod); } public static Builder builder() { @@ -86,53 +78,27 @@ public static Builder builder() { /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public OutstandingBalanceByCurrency withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public OutstandingBalanceByCurrency withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public OutstandingBalanceByCurrency withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** - * Total amount of the outstanding balance. - */ - public OutstandingBalanceByCurrency withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - /** * Total amount of the outstanding balance. */ - public OutstandingBalanceByCurrency withTotalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public OutstandingBalanceByCurrency withTotalAmount(@Nullable Double totalAmount) { this.totalAmount = totalAmount; return this; } - public OutstandingBalanceByCurrency withBalancesByPeriod(List balancesByPeriod) { - Utils.checkNotNull(balancesByPeriod, "balancesByPeriod"); - this.balancesByPeriod = Optional.ofNullable(balancesByPeriod); - return this; - } - - public OutstandingBalanceByCurrency withBalancesByPeriod(Optional> balancesByPeriod) { - Utils.checkNotNull(balancesByPeriod, "balancesByPeriod"); + public OutstandingBalanceByCurrency withBalancesByPeriod(@Nullable List balancesByPeriod) { this.balancesByPeriod = balancesByPeriod; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -165,69 +131,38 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private Optional totalAmount = Optional.empty(); + private Double totalAmount; - private Optional> balancesByPeriod = Optional.empty(); + private List balancesByPeriod; private Builder() { // force use of static builder() method } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Total amount of the outstanding balance. */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - - /** - * Total amount of the outstanding balance. - */ - public Builder totalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = totalAmount; return this; } - - public Builder balancesByPeriod(List balancesByPeriod) { - Utils.checkNotNull(balancesByPeriod, "balancesByPeriod"); - this.balancesByPeriod = Optional.ofNullable(balancesByPeriod); - return this; - } - - public Builder balancesByPeriod(Optional> balancesByPeriod) { - Utils.checkNotNull(balancesByPeriod, "balancesByPeriod"); + public Builder balancesByPeriod(@Nullable List balancesByPeriod) { this.balancesByPeriod = balancesByPeriod; return this; } public OutstandingBalanceByCurrency build() { - return new OutstandingBalanceByCurrency( currency, totalAmount, balancesByPeriod); } diff --git a/src/main/java/com/apideck/unify/models/components/OutstandingBalanceByCustomer.java b/src/main/java/com/apideck/unify/models/components/OutstandingBalanceByCustomer.java index f347bd54..30c803c8 100644 --- a/src/main/java/com/apideck/unify/models/components/OutstandingBalanceByCustomer.java +++ b/src/main/java/com/apideck/unify/models/components/OutstandingBalanceByCustomer.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -22,57 +21,50 @@ public class OutstandingBalanceByCustomer { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer_id") - private Optional customerId; + private String customerId; /** * Full name of the customer. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer_name") - private Optional customerName; + private String customerName; @JsonInclude(Include.NON_ABSENT) @JsonProperty("outstanding_balances_by_currency") - private Optional> outstandingBalancesByCurrency; + private List outstandingBalancesByCurrency; @JsonCreator public OutstandingBalanceByCustomer( - @JsonProperty("customer_id") Optional customerId, - @JsonProperty("customer_name") Optional customerName, - @JsonProperty("outstanding_balances_by_currency") Optional> outstandingBalancesByCurrency) { - Utils.checkNotNull(customerId, "customerId"); - Utils.checkNotNull(customerName, "customerName"); - Utils.checkNotNull(outstandingBalancesByCurrency, "outstandingBalancesByCurrency"); + @JsonProperty("customer_id") @Nullable String customerId, + @JsonProperty("customer_name") @Nullable String customerName, + @JsonProperty("outstanding_balances_by_currency") @Nullable List outstandingBalancesByCurrency) { this.customerId = customerId; this.customerName = customerName; this.outstandingBalancesByCurrency = outstandingBalancesByCurrency; } public OutstandingBalanceByCustomer() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } /** * Unique identifier for the customer. */ - @JsonIgnore public Optional customerId() { - return customerId; + return Optional.ofNullable(this.customerId); } /** * Full name of the customer. */ - @JsonIgnore public Optional customerName() { - return customerName; + return Optional.ofNullable(this.customerName); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> outstandingBalancesByCurrency() { - return (Optional>) outstandingBalancesByCurrency; + return Optional.ofNullable(this.outstandingBalancesByCurrency); } public static Builder builder() { @@ -83,54 +75,27 @@ public static Builder builder() { /** * Unique identifier for the customer. */ - public OutstandingBalanceByCustomer withCustomerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - - - /** - * Unique identifier for the customer. - */ - public OutstandingBalanceByCustomer withCustomerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public OutstandingBalanceByCustomer withCustomerId(@Nullable String customerId) { this.customerId = customerId; return this; } - /** - * Full name of the customer. - */ - public OutstandingBalanceByCustomer withCustomerName(String customerName) { - Utils.checkNotNull(customerName, "customerName"); - this.customerName = Optional.ofNullable(customerName); - return this; - } - /** * Full name of the customer. */ - public OutstandingBalanceByCustomer withCustomerName(Optional customerName) { - Utils.checkNotNull(customerName, "customerName"); + public OutstandingBalanceByCustomer withCustomerName(@Nullable String customerName) { this.customerName = customerName; return this; } - public OutstandingBalanceByCustomer withOutstandingBalancesByCurrency(List outstandingBalancesByCurrency) { - Utils.checkNotNull(outstandingBalancesByCurrency, "outstandingBalancesByCurrency"); - this.outstandingBalancesByCurrency = Optional.ofNullable(outstandingBalancesByCurrency); - return this; - } - - public OutstandingBalanceByCustomer withOutstandingBalancesByCurrency(Optional> outstandingBalancesByCurrency) { - Utils.checkNotNull(outstandingBalancesByCurrency, "outstandingBalancesByCurrency"); + public OutstandingBalanceByCustomer withOutstandingBalancesByCurrency(@Nullable List outstandingBalancesByCurrency) { this.outstandingBalancesByCurrency = outstandingBalancesByCurrency; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -163,69 +128,38 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional customerId = Optional.empty(); + private String customerId; - private Optional customerName = Optional.empty(); + private String customerName; - private Optional> outstandingBalancesByCurrency = Optional.empty(); + private List outstandingBalancesByCurrency; private Builder() { // force use of static builder() method } - - /** - * Unique identifier for the customer. - */ - public Builder customerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - /** * Unique identifier for the customer. */ - public Builder customerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public Builder customerId(@Nullable String customerId) { this.customerId = customerId; return this; } - - /** - * Full name of the customer. - */ - public Builder customerName(String customerName) { - Utils.checkNotNull(customerName, "customerName"); - this.customerName = Optional.ofNullable(customerName); - return this; - } - /** * Full name of the customer. */ - public Builder customerName(Optional customerName) { - Utils.checkNotNull(customerName, "customerName"); + public Builder customerName(@Nullable String customerName) { this.customerName = customerName; return this; } - - public Builder outstandingBalancesByCurrency(List outstandingBalancesByCurrency) { - Utils.checkNotNull(outstandingBalancesByCurrency, "outstandingBalancesByCurrency"); - this.outstandingBalancesByCurrency = Optional.ofNullable(outstandingBalancesByCurrency); - return this; - } - - public Builder outstandingBalancesByCurrency(Optional> outstandingBalancesByCurrency) { - Utils.checkNotNull(outstandingBalancesByCurrency, "outstandingBalancesByCurrency"); + public Builder outstandingBalancesByCurrency(@Nullable List outstandingBalancesByCurrency) { this.outstandingBalancesByCurrency = outstandingBalancesByCurrency; return this; } public OutstandingBalanceByCustomer build() { - return new OutstandingBalanceByCustomer( customerId, customerName, outstandingBalancesByCurrency); } diff --git a/src/main/java/com/apideck/unify/models/components/OutstandingBalanceBySupplier.java b/src/main/java/com/apideck/unify/models/components/OutstandingBalanceBySupplier.java index 7804b45d..f4aea86c 100644 --- a/src/main/java/com/apideck/unify/models/components/OutstandingBalanceBySupplier.java +++ b/src/main/java/com/apideck/unify/models/components/OutstandingBalanceBySupplier.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -22,57 +21,50 @@ public class OutstandingBalanceBySupplier { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier_id") - private Optional supplierId; + private String supplierId; /** * Full name of the supplier. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier_name") - private Optional supplierName; + private String supplierName; @JsonInclude(Include.NON_ABSENT) @JsonProperty("outstanding_balances_by_currency") - private Optional> outstandingBalancesByCurrency; + private List outstandingBalancesByCurrency; @JsonCreator public OutstandingBalanceBySupplier( - @JsonProperty("supplier_id") Optional supplierId, - @JsonProperty("supplier_name") Optional supplierName, - @JsonProperty("outstanding_balances_by_currency") Optional> outstandingBalancesByCurrency) { - Utils.checkNotNull(supplierId, "supplierId"); - Utils.checkNotNull(supplierName, "supplierName"); - Utils.checkNotNull(outstandingBalancesByCurrency, "outstandingBalancesByCurrency"); + @JsonProperty("supplier_id") @Nullable String supplierId, + @JsonProperty("supplier_name") @Nullable String supplierName, + @JsonProperty("outstanding_balances_by_currency") @Nullable List outstandingBalancesByCurrency) { this.supplierId = supplierId; this.supplierName = supplierName; this.outstandingBalancesByCurrency = outstandingBalancesByCurrency; } public OutstandingBalanceBySupplier() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } /** * Unique identifier for the supplier. */ - @JsonIgnore public Optional supplierId() { - return supplierId; + return Optional.ofNullable(this.supplierId); } /** * Full name of the supplier. */ - @JsonIgnore public Optional supplierName() { - return supplierName; + return Optional.ofNullable(this.supplierName); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> outstandingBalancesByCurrency() { - return (Optional>) outstandingBalancesByCurrency; + return Optional.ofNullable(this.outstandingBalancesByCurrency); } public static Builder builder() { @@ -83,54 +75,27 @@ public static Builder builder() { /** * Unique identifier for the supplier. */ - public OutstandingBalanceBySupplier withSupplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - - - /** - * Unique identifier for the supplier. - */ - public OutstandingBalanceBySupplier withSupplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public OutstandingBalanceBySupplier withSupplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } - /** - * Full name of the supplier. - */ - public OutstandingBalanceBySupplier withSupplierName(String supplierName) { - Utils.checkNotNull(supplierName, "supplierName"); - this.supplierName = Optional.ofNullable(supplierName); - return this; - } - /** * Full name of the supplier. */ - public OutstandingBalanceBySupplier withSupplierName(Optional supplierName) { - Utils.checkNotNull(supplierName, "supplierName"); + public OutstandingBalanceBySupplier withSupplierName(@Nullable String supplierName) { this.supplierName = supplierName; return this; } - public OutstandingBalanceBySupplier withOutstandingBalancesByCurrency(List outstandingBalancesByCurrency) { - Utils.checkNotNull(outstandingBalancesByCurrency, "outstandingBalancesByCurrency"); - this.outstandingBalancesByCurrency = Optional.ofNullable(outstandingBalancesByCurrency); - return this; - } - - public OutstandingBalanceBySupplier withOutstandingBalancesByCurrency(Optional> outstandingBalancesByCurrency) { - Utils.checkNotNull(outstandingBalancesByCurrency, "outstandingBalancesByCurrency"); + public OutstandingBalanceBySupplier withOutstandingBalancesByCurrency(@Nullable List outstandingBalancesByCurrency) { this.outstandingBalancesByCurrency = outstandingBalancesByCurrency; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -163,69 +128,38 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional supplierId = Optional.empty(); + private String supplierId; - private Optional supplierName = Optional.empty(); + private String supplierName; - private Optional> outstandingBalancesByCurrency = Optional.empty(); + private List outstandingBalancesByCurrency; private Builder() { // force use of static builder() method } - - /** - * Unique identifier for the supplier. - */ - public Builder supplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - /** * Unique identifier for the supplier. */ - public Builder supplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public Builder supplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } - - /** - * Full name of the supplier. - */ - public Builder supplierName(String supplierName) { - Utils.checkNotNull(supplierName, "supplierName"); - this.supplierName = Optional.ofNullable(supplierName); - return this; - } - /** * Full name of the supplier. */ - public Builder supplierName(Optional supplierName) { - Utils.checkNotNull(supplierName, "supplierName"); + public Builder supplierName(@Nullable String supplierName) { this.supplierName = supplierName; return this; } - - public Builder outstandingBalancesByCurrency(List outstandingBalancesByCurrency) { - Utils.checkNotNull(outstandingBalancesByCurrency, "outstandingBalancesByCurrency"); - this.outstandingBalancesByCurrency = Optional.ofNullable(outstandingBalancesByCurrency); - return this; - } - - public Builder outstandingBalancesByCurrency(Optional> outstandingBalancesByCurrency) { - Utils.checkNotNull(outstandingBalancesByCurrency, "outstandingBalancesByCurrency"); + public Builder outstandingBalancesByCurrency(@Nullable List outstandingBalancesByCurrency) { this.outstandingBalancesByCurrency = outstandingBalancesByCurrency; return this; } public OutstandingBalanceBySupplier build() { - return new OutstandingBalanceBySupplier( supplierId, supplierName, outstandingBalancesByCurrency); } diff --git a/src/main/java/com/apideck/unify/models/components/Owner.java b/src/main/java/com/apideck/unify/models/components/Owner.java index 68a77132..aedd4f77 100644 --- a/src/main/java/com/apideck/unify/models/components/Owner.java +++ b/src/main/java/com/apideck/unify/models/components/Owner.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -21,7 +21,7 @@ public class Owner { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Email of the owner @@ -39,43 +39,39 @@ public class Owner { @JsonCreator public Owner( - @JsonProperty("id") Optional id, - @JsonProperty("email") JsonNullable email, - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(name, "name"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("email") @Nullable JsonNullable email, + @JsonProperty("name") @Nullable JsonNullable name) { this.id = id; - this.email = email; - this.name = name; + this.email = Optional.ofNullable(email) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public Owner() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * ID of the owner */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Email of the owner */ - @JsonIgnore public JsonNullable email() { - return email; + return this.email; } /** * Name of the owner */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -86,57 +82,29 @@ public static Builder builder() { /** * ID of the owner */ - public Owner withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the owner - */ - public Owner withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Owner withId(@Nullable String id) { this.id = id; return this; } + /** * Email of the owner */ - public Owner withEmail(String email) { - Utils.checkNotNull(email, "email"); + public Owner withEmail(@Nullable String email) { this.email = JsonNullable.of(email); return this; } - /** - * Email of the owner - */ - public Owner withEmail(JsonNullable email) { - Utils.checkNotNull(email, "email"); - this.email = email; - return this; - } /** * Name of the owner */ - public Owner withName(String name) { - Utils.checkNotNull(name, "name"); + public Owner withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Name of the owner - */ - public Owner withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -170,75 +138,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable email = JsonNullable.undefined(); + private JsonNullable email; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - - /** - * ID of the owner - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * ID of the owner */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Email of the owner */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = JsonNullable.of(email); return this; } - /** - * Email of the owner - */ - public Builder email(JsonNullable email) { - Utils.checkNotNull(email, "email"); - this.email = email; - return this; - } - - /** * Name of the owner */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * Name of the owner - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public Owner build() { - return new Owner( id, email, name); } diff --git a/src/main/java/com/apideck/unify/models/components/PaginationCoverage.java b/src/main/java/com/apideck/unify/models/components/PaginationCoverage.java index 8a458aa5..088c4ffe 100644 --- a/src/main/java/com/apideck/unify/models/components/PaginationCoverage.java +++ b/src/main/java/com/apideck/unify/models/components/PaginationCoverage.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -22,62 +21,55 @@ public class PaginationCoverage { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("mode") - private Optional mode; + private PaginationCoverageMode mode; /** * Indicates whether the connector supports paging through results using the cursor parameter. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("paging_support") - private Optional pagingSupport; + private Boolean pagingSupport; /** * Indicates whether the connector supports changing the page size by using the limit parameter. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("limit_support") - private Optional limitSupport; + private Boolean limitSupport; @JsonCreator public PaginationCoverage( - @JsonProperty("mode") Optional mode, - @JsonProperty("paging_support") Optional pagingSupport, - @JsonProperty("limit_support") Optional limitSupport) { - Utils.checkNotNull(mode, "mode"); - Utils.checkNotNull(pagingSupport, "pagingSupport"); - Utils.checkNotNull(limitSupport, "limitSupport"); + @JsonProperty("mode") @Nullable PaginationCoverageMode mode, + @JsonProperty("paging_support") @Nullable Boolean pagingSupport, + @JsonProperty("limit_support") @Nullable Boolean limitSupport) { this.mode = mode; this.pagingSupport = pagingSupport; this.limitSupport = limitSupport; } public PaginationCoverage() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } /** * How pagination is implemented on this connector. Native mode means Apideck is using the pagination parameters of the connector. With virtual pagination, the connector does not support pagination, but Apideck emulates it. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional mode() { - return (Optional) mode; + return Optional.ofNullable(this.mode); } /** * Indicates whether the connector supports paging through results using the cursor parameter. */ - @JsonIgnore public Optional pagingSupport() { - return pagingSupport; + return Optional.ofNullable(this.pagingSupport); } /** * Indicates whether the connector supports changing the page size by using the limit parameter. */ - @JsonIgnore public Optional limitSupport() { - return limitSupport; + return Optional.ofNullable(this.limitSupport); } public static Builder builder() { @@ -88,60 +80,30 @@ public static Builder builder() { /** * How pagination is implemented on this connector. Native mode means Apideck is using the pagination parameters of the connector. With virtual pagination, the connector does not support pagination, but Apideck emulates it. */ - public PaginationCoverage withMode(PaginationCoverageMode mode) { - Utils.checkNotNull(mode, "mode"); - this.mode = Optional.ofNullable(mode); - return this; - } - - - /** - * How pagination is implemented on this connector. Native mode means Apideck is using the pagination parameters of the connector. With virtual pagination, the connector does not support pagination, but Apideck emulates it. - */ - public PaginationCoverage withMode(Optional mode) { - Utils.checkNotNull(mode, "mode"); + public PaginationCoverage withMode(@Nullable PaginationCoverageMode mode) { this.mode = mode; return this; } - /** - * Indicates whether the connector supports paging through results using the cursor parameter. - */ - public PaginationCoverage withPagingSupport(boolean pagingSupport) { - Utils.checkNotNull(pagingSupport, "pagingSupport"); - this.pagingSupport = Optional.ofNullable(pagingSupport); - return this; - } - /** * Indicates whether the connector supports paging through results using the cursor parameter. */ - public PaginationCoverage withPagingSupport(Optional pagingSupport) { - Utils.checkNotNull(pagingSupport, "pagingSupport"); + public PaginationCoverage withPagingSupport(@Nullable Boolean pagingSupport) { this.pagingSupport = pagingSupport; return this; } - /** - * Indicates whether the connector supports changing the page size by using the limit parameter. - */ - public PaginationCoverage withLimitSupport(boolean limitSupport) { - Utils.checkNotNull(limitSupport, "limitSupport"); - this.limitSupport = Optional.ofNullable(limitSupport); - return this; - } - /** * Indicates whether the connector supports changing the page size by using the limit parameter. */ - public PaginationCoverage withLimitSupport(Optional limitSupport) { - Utils.checkNotNull(limitSupport, "limitSupport"); + public PaginationCoverage withLimitSupport(@Nullable Boolean limitSupport) { this.limitSupport = limitSupport; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -174,75 +136,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional mode = Optional.empty(); + private PaginationCoverageMode mode; - private Optional pagingSupport = Optional.empty(); + private Boolean pagingSupport; - private Optional limitSupport = Optional.empty(); + private Boolean limitSupport; private Builder() { // force use of static builder() method } - - /** - * How pagination is implemented on this connector. Native mode means Apideck is using the pagination parameters of the connector. With virtual pagination, the connector does not support pagination, but Apideck emulates it. - */ - public Builder mode(PaginationCoverageMode mode) { - Utils.checkNotNull(mode, "mode"); - this.mode = Optional.ofNullable(mode); - return this; - } - /** * How pagination is implemented on this connector. Native mode means Apideck is using the pagination parameters of the connector. With virtual pagination, the connector does not support pagination, but Apideck emulates it. */ - public Builder mode(Optional mode) { - Utils.checkNotNull(mode, "mode"); + public Builder mode(@Nullable PaginationCoverageMode mode) { this.mode = mode; return this; } - /** * Indicates whether the connector supports paging through results using the cursor parameter. */ - public Builder pagingSupport(boolean pagingSupport) { - Utils.checkNotNull(pagingSupport, "pagingSupport"); - this.pagingSupport = Optional.ofNullable(pagingSupport); - return this; - } - - /** - * Indicates whether the connector supports paging through results using the cursor parameter. - */ - public Builder pagingSupport(Optional pagingSupport) { - Utils.checkNotNull(pagingSupport, "pagingSupport"); + public Builder pagingSupport(@Nullable Boolean pagingSupport) { this.pagingSupport = pagingSupport; return this; } - - /** - * Indicates whether the connector supports changing the page size by using the limit parameter. - */ - public Builder limitSupport(boolean limitSupport) { - Utils.checkNotNull(limitSupport, "limitSupport"); - this.limitSupport = Optional.ofNullable(limitSupport); - return this; - } - /** * Indicates whether the connector supports changing the page size by using the limit parameter. */ - public Builder limitSupport(Optional limitSupport) { - Utils.checkNotNull(limitSupport, "limitSupport"); + public Builder limitSupport(@Nullable Boolean limitSupport) { this.limitSupport = limitSupport; return this; } public PaginationCoverage build() { - return new PaginationCoverage( mode, pagingSupport, limitSupport); } diff --git a/src/main/java/com/apideck/unify/models/components/ParentAccount.java b/src/main/java/com/apideck/unify/models/components/ParentAccount.java index 3c3ca7ac..0d42bb47 100644 --- a/src/main/java/com/apideck/unify/models/components/ParentAccount.java +++ b/src/main/java/com/apideck/unify/models/components/ParentAccount.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -20,61 +20,55 @@ public class ParentAccount { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the parent account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * The human readable display ID used when displaying the parent account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("display_id") - private Optional displayId; + private String displayId; @JsonCreator public ParentAccount( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("display_id") Optional displayId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(displayId, "displayId"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("display_id") @Nullable String displayId) { this.id = id; this.name = name; this.displayId = displayId; } public ParentAccount() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } /** * The ID of the parent account. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the parent account. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The human readable display ID used when displaying the parent account */ - @JsonIgnore public Optional displayId() { - return displayId; + return Optional.ofNullable(this.displayId); } public static Builder builder() { @@ -85,60 +79,30 @@ public static Builder builder() { /** * The ID of the parent account. */ - public ParentAccount withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The ID of the parent account. - */ - public ParentAccount withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ParentAccount withId(@Nullable String id) { this.id = id; return this; } - /** - * The name of the parent account. - */ - public ParentAccount withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the parent account. */ - public ParentAccount withName(Optional name) { - Utils.checkNotNull(name, "name"); + public ParentAccount withName(@Nullable String name) { this.name = name; return this; } - /** - * The human readable display ID used when displaying the parent account - */ - public ParentAccount withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = Optional.ofNullable(displayId); - return this; - } - /** * The human readable display ID used when displaying the parent account */ - public ParentAccount withDisplayId(Optional displayId) { - Utils.checkNotNull(displayId, "displayId"); + public ParentAccount withDisplayId(@Nullable String displayId) { this.displayId = displayId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -171,75 +135,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private Optional displayId = Optional.empty(); + private String displayId; private Builder() { // force use of static builder() method } - - /** - * The ID of the parent account. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The ID of the parent account. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the parent account. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * The name of the parent account. - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * The human readable display ID used when displaying the parent account - */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = Optional.ofNullable(displayId); - return this; - } - /** * The human readable display ID used when displaying the parent account */ - public Builder displayId(Optional displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = displayId; return this; } public ParentAccount build() { - return new ParentAccount( id, name, displayId); } diff --git a/src/main/java/com/apideck/unify/models/components/PassThroughBody.java b/src/main/java/com/apideck/unify/models/components/PassThroughBody.java index 40a00d4a..15446acf 100644 --- a/src/main/java/com/apideck/unify/models/components/PassThroughBody.java +++ b/src/main/java/com/apideck/unify/models/components/PassThroughBody.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -30,76 +30,67 @@ public class PassThroughBody { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("operation_id") - private Optional operationId; + private String operationId; /** * Simple object allowing any properties for direct extension. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("extend_object") - private Optional> extendObject; + private Map extendObject; /** * Array of objects for structured data modifications via paths. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("extend_paths") - private Optional> extendPaths; + private List extendPaths; @JsonCreator public PassThroughBody( - @JsonProperty("service_id") String serviceId, - @JsonProperty("operation_id") Optional operationId, - @JsonProperty("extend_object") Optional> extendObject, - @JsonProperty("extend_paths") Optional> extendPaths) { - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(operationId, "operationId"); - Utils.checkNotNull(extendObject, "extendObject"); - Utils.checkNotNull(extendPaths, "extendPaths"); - this.serviceId = serviceId; + @JsonProperty("service_id") @Nonnull String serviceId, + @JsonProperty("operation_id") @Nullable String operationId, + @JsonProperty("extend_object") @Nullable Map extendObject, + @JsonProperty("extend_paths") @Nullable List extendPaths) { + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); this.operationId = operationId; this.extendObject = extendObject; this.extendPaths = extendPaths; } public PassThroughBody( - String serviceId) { - this(serviceId, Optional.empty(), Optional.empty(), - Optional.empty()); + @Nonnull String serviceId) { + this(serviceId, null, null, + null); } /** * Identifier for the service to which this pass_through should be applied. */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Optional identifier for a workflow operation to which this pass_through should be applied. This is useful for Unify calls that are making more than one downstream request. */ - @JsonIgnore public Optional operationId() { - return operationId; + return Optional.ofNullable(this.operationId); } /** * Simple object allowing any properties for direct extension. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> extendObject() { - return (Optional>) extendObject; + return Optional.ofNullable(this.extendObject); } /** * Array of objects for structured data modifications via paths. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> extendPaths() { - return (Optional>) extendPaths; + return Optional.ofNullable(this.extendPaths); } public static Builder builder() { @@ -110,18 +101,8 @@ public static Builder builder() { /** * Identifier for the service to which this pass_through should be applied. */ - public PassThroughBody withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; - return this; - } - - /** - * Optional identifier for a workflow operation to which this pass_through should be applied. This is useful for Unify calls that are making more than one downstream request. - */ - public PassThroughBody withOperationId(String operationId) { - Utils.checkNotNull(operationId, "operationId"); - this.operationId = Optional.ofNullable(operationId); + public PassThroughBody withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } @@ -129,50 +110,30 @@ public PassThroughBody withOperationId(String operationId) { /** * Optional identifier for a workflow operation to which this pass_through should be applied. This is useful for Unify calls that are making more than one downstream request. */ - public PassThroughBody withOperationId(Optional operationId) { - Utils.checkNotNull(operationId, "operationId"); + public PassThroughBody withOperationId(@Nullable String operationId) { this.operationId = operationId; return this; } - /** - * Simple object allowing any properties for direct extension. - */ - public PassThroughBody withExtendObject(Map extendObject) { - Utils.checkNotNull(extendObject, "extendObject"); - this.extendObject = Optional.ofNullable(extendObject); - return this; - } - /** * Simple object allowing any properties for direct extension. */ - public PassThroughBody withExtendObject(Optional> extendObject) { - Utils.checkNotNull(extendObject, "extendObject"); + public PassThroughBody withExtendObject(@Nullable Map extendObject) { this.extendObject = extendObject; return this; } - /** - * Array of objects for structured data modifications via paths. - */ - public PassThroughBody withExtendPaths(List extendPaths) { - Utils.checkNotNull(extendPaths, "extendPaths"); - this.extendPaths = Optional.ofNullable(extendPaths); - return this; - } - /** * Array of objects for structured data modifications via paths. */ - public PassThroughBody withExtendPaths(Optional> extendPaths) { - Utils.checkNotNull(extendPaths, "extendPaths"); + public PassThroughBody withExtendPaths(@Nullable List extendPaths) { this.extendPaths = extendPaths; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -210,85 +171,49 @@ public final static class Builder { private String serviceId; - private Optional operationId = Optional.empty(); + private String operationId; - private Optional> extendObject = Optional.empty(); + private Map extendObject; - private Optional> extendPaths = Optional.empty(); + private List extendPaths; private Builder() { // force use of static builder() method } - /** * Identifier for the service to which this pass_through should be applied. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; - return this; - } - - - /** - * Optional identifier for a workflow operation to which this pass_through should be applied. This is useful for Unify calls that are making more than one downstream request. - */ - public Builder operationId(String operationId) { - Utils.checkNotNull(operationId, "operationId"); - this.operationId = Optional.ofNullable(operationId); + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } /** * Optional identifier for a workflow operation to which this pass_through should be applied. This is useful for Unify calls that are making more than one downstream request. */ - public Builder operationId(Optional operationId) { - Utils.checkNotNull(operationId, "operationId"); + public Builder operationId(@Nullable String operationId) { this.operationId = operationId; return this; } - /** * Simple object allowing any properties for direct extension. */ - public Builder extendObject(Map extendObject) { - Utils.checkNotNull(extendObject, "extendObject"); - this.extendObject = Optional.ofNullable(extendObject); - return this; - } - - /** - * Simple object allowing any properties for direct extension. - */ - public Builder extendObject(Optional> extendObject) { - Utils.checkNotNull(extendObject, "extendObject"); + public Builder extendObject(@Nullable Map extendObject) { this.extendObject = extendObject; return this; } - - /** - * Array of objects for structured data modifications via paths. - */ - public Builder extendPaths(List extendPaths) { - Utils.checkNotNull(extendPaths, "extendPaths"); - this.extendPaths = Optional.ofNullable(extendPaths); - return this; - } - /** * Array of objects for structured data modifications via paths. */ - public Builder extendPaths(Optional> extendPaths) { - Utils.checkNotNull(extendPaths, "extendPaths"); + public Builder extendPaths(@Nullable List extendPaths) { this.extendPaths = extendPaths; return this; } public PassThroughBody build() { - return new PassThroughBody( serviceId, operationId, extendObject, extendPaths); diff --git a/src/main/java/com/apideck/unify/models/components/Payment.java b/src/main/java/com/apideck/unify/models/components/Payment.java index 83ff5a3e..48bf2e98 100644 --- a/src/main/java/com/apideck/unify/models/components/Payment.java +++ b/src/main/java/com/apideck/unify/models/components/Payment.java @@ -5,17 +5,17 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -42,7 +42,7 @@ public class Payment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -56,7 +56,7 @@ public class Payment { */ @JsonInclude(Include.ALWAYS) @JsonProperty("total_amount") - private Optional totalAmount; + private JsonNullable totalAmount; /** * Optional transaction reference message ie: Debit remittance detail. @@ -109,21 +109,21 @@ public class Payment { @JsonInclude(Include.NON_ABSENT) @JsonProperty("account") - private JsonNullable account; + private JsonNullable account; /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ @JsonInclude(Include.ALWAYS) @JsonProperty("transaction_date") - private Optional transactionDate; + private JsonNullable transactionDate; /** * The customer this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer") - private JsonNullable customer; + private JsonNullable customer; /** * The supplier this entity is linked to. @@ -133,7 +133,7 @@ public class Payment { @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier") @Deprecated - private JsonNullable supplier; + private JsonNullable supplier; /** * The company or subsidiary id the transaction belongs to @@ -154,19 +154,19 @@ public class Payment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private PaymentStatus status; /** * Type of payment */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private PaymentType type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("allocations") - private Optional> allocations; + private List allocations; /** * Note associated with the transaction @@ -187,12 +187,12 @@ public class Payment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -213,7 +213,7 @@ public class Payment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -248,194 +248,177 @@ public class Payment { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Payment( - @JsonProperty("id") String id, - @JsonProperty("downstream_id") JsonNullable downstreamId, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("total_amount") Optional totalAmount, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("payment_method_reference") JsonNullable paymentMethodReference, - @JsonProperty("payment_method_id") JsonNullable paymentMethodId, - @JsonProperty("accounts_receivable_account_type") JsonNullable accountsReceivableAccountType, - @JsonProperty("accounts_receivable_account_id") JsonNullable accountsReceivableAccountId, - @JsonProperty("account") JsonNullable account, - @JsonProperty("transaction_date") Optional transactionDate, - @JsonProperty("customer") JsonNullable customer, - @JsonProperty("supplier") JsonNullable supplier, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("reconciled") JsonNullable reconciled, - @JsonProperty("status") Optional status, - @JsonProperty("type") Optional type, - @JsonProperty("allocations") Optional> allocations, - @JsonProperty("note") JsonNullable note, - @JsonProperty("number") JsonNullable number, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - Utils.checkNotNull(accountsReceivableAccountType, "accountsReceivableAccountType"); - Utils.checkNotNull(accountsReceivableAccountId, "accountsReceivableAccountId"); - Utils.checkNotNull(account, "account"); - Utils.checkNotNull(transactionDate, "transactionDate"); - Utils.checkNotNull(customer, "customer"); - Utils.checkNotNull(supplier, "supplier"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(reconciled, "reconciled"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(allocations, "allocations"); - Utils.checkNotNull(note, "note"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(passThrough, "passThrough"); - this.id = id; - this.downstreamId = downstreamId; - this.currency = currency; - this.currencyRate = currencyRate; - this.totalAmount = totalAmount; - this.reference = reference; - this.paymentMethod = paymentMethod; - this.paymentMethodReference = paymentMethodReference; - this.paymentMethodId = paymentMethodId; - this.accountsReceivableAccountType = accountsReceivableAccountType; - this.accountsReceivableAccountId = accountsReceivableAccountId; - this.account = account; - this.transactionDate = transactionDate; - this.customer = customer; - this.supplier = supplier; - this.companyId = companyId; - this.reconciled = reconciled; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("total_amount") @Nullable Double totalAmount, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("payment_method_reference") @Nullable JsonNullable paymentMethodReference, + @JsonProperty("payment_method_id") @Nullable JsonNullable paymentMethodId, + @JsonProperty("accounts_receivable_account_type") @Nullable JsonNullable accountsReceivableAccountType, + @JsonProperty("accounts_receivable_account_id") @Nullable JsonNullable accountsReceivableAccountId, + @JsonProperty("account") @Nullable JsonNullable account, + @JsonProperty("transaction_date") @Nullable OffsetDateTime transactionDate, + @JsonProperty("customer") @Nullable JsonNullable customer, + @JsonProperty("supplier") @Nullable JsonNullable supplier, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("reconciled") @Nullable JsonNullable reconciled, + @JsonProperty("status") @Nullable PaymentStatus status, + @JsonProperty("type") @Nullable PaymentType type, + @JsonProperty("allocations") @Nullable List allocations, + @JsonProperty("note") @Nullable JsonNullable note, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.totalAmount = JsonNullable.of(totalAmount); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.paymentMethodReference = Optional.ofNullable(paymentMethodReference) + .orElse(JsonNullable.undefined()); + this.paymentMethodId = Optional.ofNullable(paymentMethodId) + .orElse(JsonNullable.undefined()); + this.accountsReceivableAccountType = Optional.ofNullable(accountsReceivableAccountType) + .orElse(JsonNullable.undefined()); + this.accountsReceivableAccountId = Optional.ofNullable(accountsReceivableAccountId) + .orElse(JsonNullable.undefined()); + this.account = Optional.ofNullable(account) + .orElse(JsonNullable.undefined()); + this.transactionDate = JsonNullable.of(transactionDate); + this.customer = Optional.ofNullable(customer) + .orElse(JsonNullable.undefined()); + this.supplier = Optional.ofNullable(supplier) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.reconciled = Optional.ofNullable(reconciled) + .orElse(JsonNullable.undefined()); this.status = status; this.type = type; this.allocations = allocations; - this.note = note; - this.number = number; - this.trackingCategories = trackingCategories; + this.note = Optional.ofNullable(note) + .orElse(JsonNullable.undefined()); + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; - this.displayId = displayId; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.createdAt = createdAt; - this.updatedAt = updatedAt; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Payment( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * The total amount of the transaction or record */ - @JsonIgnore - public Optional totalAmount() { - return totalAmount; + public JsonNullable totalAmount() { + return this.totalAmount; } /** * Optional transaction reference message ie: Debit remittance detail. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * Optional reference message returned by payment method on processing */ - @JsonIgnore public JsonNullable paymentMethodReference() { - return paymentMethodReference; + return this.paymentMethodReference; } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable paymentMethodId() { - return paymentMethodId; + return this.paymentMethodId; } /** @@ -444,9 +427,8 @@ public JsonNullable paymentMethodId() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable accountsReceivableAccountType() { - return accountsReceivableAccountType; + return this.accountsReceivableAccountType; } /** @@ -455,32 +437,26 @@ public JsonNullable accountsReceivableAccountType() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable accountsReceivableAccountId() { - return accountsReceivableAccountId; + return this.accountsReceivableAccountId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable account() { - return (JsonNullable) account; + return this.account; } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore - public Optional transactionDate() { - return transactionDate; + public JsonNullable transactionDate() { + return this.transactionDate; } /** * The customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable customer() { - return (JsonNullable) customer; + return this.customer; } /** @@ -489,147 +465,121 @@ public JsonNullable customer() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable supplier() { - return (JsonNullable) supplier; + return this.supplier; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Indicates if the transaction has been reconciled. */ - @JsonIgnore public JsonNullable reconciled() { - return reconciled; + return this.reconciled; } /** * Status of payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Type of payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> allocations() { - return (Optional>) allocations; + return Optional.ofNullable(this.allocations); } /** * Note associated with the transaction */ - @JsonIgnore public JsonNullable note() { - return note; + return this.note; } /** * Number associated with the transaction */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * Id to be displayed. */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -640,156 +590,83 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Payment withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Payment withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The third-party API ID of original entity */ - public Payment withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Payment withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Payment withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Payment withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Payment withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Payment withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Payment withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Payment withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Payment withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * The total amount of the transaction or record */ - public Payment withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); + public Payment withTotalAmount(@Nullable Double totalAmount) { + this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * The total amount of the transaction or record - */ - public Payment withTotalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - /** * Optional transaction reference message ie: Debit remittance detail. */ - public Payment withReference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Payment withReference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional transaction reference message ie: Debit remittance detail. - */ - public Payment withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Payment withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Payment withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Payment withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * Optional reference message returned by payment method on processing */ - public Payment withPaymentMethodReference(String paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); + public Payment withPaymentMethodReference(@Nullable String paymentMethodReference) { this.paymentMethodReference = JsonNullable.of(paymentMethodReference); return this; } - /** - * Optional reference message returned by payment method on processing - */ - public Payment withPaymentMethodReference(JsonNullable paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - this.paymentMethodReference = paymentMethodReference; - return this; - } /** * A unique identifier for an object. */ - public Payment withPaymentMethodId(String paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + public Payment withPaymentMethodId(@Nullable String paymentMethodId) { this.paymentMethodId = JsonNullable.of(paymentMethodId); return this; } - /** - * A unique identifier for an object. - */ - public Payment withPaymentMethodId(JsonNullable paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - this.paymentMethodId = paymentMethodId; - return this; - } /** * Type of accounts receivable account. @@ -797,23 +674,11 @@ public Payment withPaymentMethodId(JsonNullable paymentMethodId) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Payment withAccountsReceivableAccountType(String accountsReceivableAccountType) { - Utils.checkNotNull(accountsReceivableAccountType, "accountsReceivableAccountType"); + public Payment withAccountsReceivableAccountType(@Nullable String accountsReceivableAccountType) { this.accountsReceivableAccountType = JsonNullable.of(accountsReceivableAccountType); return this; } - /** - * Type of accounts receivable account. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Payment withAccountsReceivableAccountType(JsonNullable accountsReceivableAccountType) { - Utils.checkNotNull(accountsReceivableAccountType, "accountsReceivableAccountType"); - this.accountsReceivableAccountType = accountsReceivableAccountType; - return this; - } /** * Unique identifier for the account to allocate payment to. @@ -821,72 +686,35 @@ public Payment withAccountsReceivableAccountType(JsonNullable accountsRe * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Payment withAccountsReceivableAccountId(String accountsReceivableAccountId) { - Utils.checkNotNull(accountsReceivableAccountId, "accountsReceivableAccountId"); + public Payment withAccountsReceivableAccountId(@Nullable String accountsReceivableAccountId) { this.accountsReceivableAccountId = JsonNullable.of(accountsReceivableAccountId); return this; } - /** - * Unique identifier for the account to allocate payment to. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Payment withAccountsReceivableAccountId(JsonNullable accountsReceivableAccountId) { - Utils.checkNotNull(accountsReceivableAccountId, "accountsReceivableAccountId"); - this.accountsReceivableAccountId = accountsReceivableAccountId; - return this; - } - public Payment withAccount(LinkedLedgerAccount account) { - Utils.checkNotNull(account, "account"); + public Payment withAccount(@Nullable LinkedLedgerAccount account) { this.account = JsonNullable.of(account); return this; } - public Payment withAccount(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public Payment withTransactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); + public Payment withTransactionDate(@Nullable OffsetDateTime transactionDate) { + this.transactionDate = JsonNullable.of(transactionDate); return this; } - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Payment withTransactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = transactionDate; - return this; - } - /** * The customer this entity is linked to. */ - public Payment withCustomer(LinkedCustomer customer) { - Utils.checkNotNull(customer, "customer"); + public Payment withCustomer(@Nullable LinkedCustomer customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public Payment withCustomer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } /** * The supplier this entity is linked to. @@ -894,323 +722,159 @@ public Payment withCustomer(JsonNullable customer) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Payment withSupplier(DeprecatedLinkedSupplier supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Payment withSupplier(@Nullable DeprecatedLinkedSupplier supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Payment withSupplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public Payment withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Payment withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Payment withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Indicates if the transaction has been reconciled. */ - public Payment withReconciled(boolean reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); + public Payment withReconciled(@Nullable Boolean reconciled) { this.reconciled = JsonNullable.of(reconciled); return this; } - /** - * Indicates if the transaction has been reconciled. - */ - public Payment withReconciled(JsonNullable reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); - this.reconciled = reconciled; - return this; - } - - /** - * Status of payment - */ - public Payment withStatus(PaymentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of payment */ - public Payment withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public Payment withStatus(@Nullable PaymentStatus status) { this.status = status; return this; } - /** - * Type of payment - */ - public Payment withType(PaymentType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of payment */ - public Payment withType(Optional type) { - Utils.checkNotNull(type, "type"); + public Payment withType(@Nullable PaymentType type) { this.type = type; return this; } - public Payment withAllocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public Payment withAllocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public Payment withAllocations(@Nullable List allocations) { this.allocations = allocations; return this; } + /** * Note associated with the transaction */ - public Payment withNote(String note) { - Utils.checkNotNull(note, "note"); + public Payment withNote(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Note associated with the transaction - */ - public Payment withNote(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } /** * Number associated with the transaction */ - public Payment withNumber(String number) { - Utils.checkNotNull(number, "number"); + public Payment withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number associated with the transaction - */ - public Payment withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * A list of linked tracking categories. */ - public Payment withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Payment withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Payment withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - public Payment withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - - public Payment withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Payment withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Payment withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Payment withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Payment withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * Id to be displayed. */ - public Payment withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Payment withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Id to be displayed. - */ - public Payment withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Payment withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Payment withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Payment withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public Payment withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Payment withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Payment withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Payment withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Payment withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Payment withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was created. */ - public Payment withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Payment withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Payment withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The date and time when the object was last updated. */ - public Payment withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Payment withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Payment withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Payment withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Payment withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Payment withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1313,676 +977,332 @@ public final static class Builder { private String id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private Optional totalAmount = Optional.empty(); + private Double totalAmount; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable paymentMethodReference = JsonNullable.undefined(); + private JsonNullable paymentMethodReference; - private JsonNullable paymentMethodId = JsonNullable.undefined(); + private JsonNullable paymentMethodId; @Deprecated - private JsonNullable accountsReceivableAccountType = JsonNullable.undefined(); + private JsonNullable accountsReceivableAccountType; @Deprecated - private JsonNullable accountsReceivableAccountId = JsonNullable.undefined(); + private JsonNullable accountsReceivableAccountId; - private JsonNullable account = JsonNullable.undefined(); + private JsonNullable account; - private Optional transactionDate = Optional.empty(); + private OffsetDateTime transactionDate; - private JsonNullable customer = JsonNullable.undefined(); + private JsonNullable customer; @Deprecated - private JsonNullable supplier = JsonNullable.undefined(); + private JsonNullable supplier; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable reconciled = JsonNullable.undefined(); + private JsonNullable reconciled; - private Optional status = Optional.empty(); + private PaymentStatus status; - private Optional type = Optional.empty(); + private PaymentType type; - private Optional> allocations = Optional.empty(); + private List allocations; - private JsonNullable note = JsonNullable.undefined(); + private JsonNullable note; - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - - /** - * The total amount of the transaction or record - */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - /** * The total amount of the transaction or record */ - public Builder totalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = totalAmount; return this; } - /** * Optional transaction reference message ie: Debit remittance detail. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional transaction reference message ie: Debit remittance detail. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * Optional reference message returned by payment method on processing */ - public Builder paymentMethodReference(String paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); + public Builder paymentMethodReference(@Nullable String paymentMethodReference) { this.paymentMethodReference = JsonNullable.of(paymentMethodReference); return this; } - /** - * Optional reference message returned by payment method on processing - */ - public Builder paymentMethodReference(JsonNullable paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - this.paymentMethodReference = paymentMethodReference; - return this; - } - - /** * A unique identifier for an object. */ - public Builder paymentMethodId(String paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + public Builder paymentMethodId(@Nullable String paymentMethodId) { this.paymentMethodId = JsonNullable.of(paymentMethodId); return this; } - /** - * A unique identifier for an object. - */ - public Builder paymentMethodId(JsonNullable paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - this.paymentMethodId = paymentMethodId; - return this; - } - - /** * Type of accounts receivable account. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder accountsReceivableAccountType(String accountsReceivableAccountType) { - Utils.checkNotNull(accountsReceivableAccountType, "accountsReceivableAccountType"); + public Builder accountsReceivableAccountType(@Nullable String accountsReceivableAccountType) { this.accountsReceivableAccountType = JsonNullable.of(accountsReceivableAccountType); return this; } - /** - * Type of accounts receivable account. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder accountsReceivableAccountType(JsonNullable accountsReceivableAccountType) { - Utils.checkNotNull(accountsReceivableAccountType, "accountsReceivableAccountType"); - this.accountsReceivableAccountType = accountsReceivableAccountType; - return this; - } - - /** * Unique identifier for the account to allocate payment to. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder accountsReceivableAccountId(String accountsReceivableAccountId) { - Utils.checkNotNull(accountsReceivableAccountId, "accountsReceivableAccountId"); + public Builder accountsReceivableAccountId(@Nullable String accountsReceivableAccountId) { this.accountsReceivableAccountId = JsonNullable.of(accountsReceivableAccountId); return this; } - /** - * Unique identifier for the account to allocate payment to. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder accountsReceivableAccountId(JsonNullable accountsReceivableAccountId) { - Utils.checkNotNull(accountsReceivableAccountId, "accountsReceivableAccountId"); - this.accountsReceivableAccountId = accountsReceivableAccountId; - return this; - } - - - public Builder account(LinkedLedgerAccount account) { - Utils.checkNotNull(account, "account"); + public Builder account(@Nullable LinkedLedgerAccount account) { this.account = JsonNullable.of(account); return this; } - public Builder account(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - - - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Builder transactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); - return this; - } - /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder transactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); + public Builder transactionDate(@Nullable OffsetDateTime transactionDate) { this.transactionDate = transactionDate; return this; } - /** * The customer this entity is linked to. */ - public Builder customer(LinkedCustomer customer) { - Utils.checkNotNull(customer, "customer"); + public Builder customer(@Nullable LinkedCustomer customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public Builder customer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } - - /** * The supplier this entity is linked to. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder supplier(DeprecatedLinkedSupplier supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Builder supplier(@Nullable DeprecatedLinkedSupplier supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder supplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Indicates if the transaction has been reconciled. */ - public Builder reconciled(boolean reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); + public Builder reconciled(@Nullable Boolean reconciled) { this.reconciled = JsonNullable.of(reconciled); return this; } - /** - * Indicates if the transaction has been reconciled. - */ - public Builder reconciled(JsonNullable reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); - this.reconciled = reconciled; - return this; - } - - - /** - * Status of payment - */ - public Builder status(PaymentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of payment */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable PaymentStatus status) { this.status = status; return this; } - /** * Type of payment */ - public Builder type(PaymentType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - /** - * Type of payment - */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable PaymentType type) { this.type = type; return this; } - - public Builder allocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public Builder allocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public Builder allocations(@Nullable List allocations) { this.allocations = allocations; return this; } - /** * Note associated with the transaction */ - public Builder note(String note) { - Utils.checkNotNull(note, "note"); + public Builder note(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Note associated with the transaction - */ - public Builder note(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } - - /** * Number associated with the transaction */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number associated with the transaction - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * Id to be displayed. */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Id to be displayed. - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Payment build() { - return new Payment( id, downstreamId, currency, currencyRate, totalAmount, reference, diff --git a/src/main/java/com/apideck/unify/models/components/PaymentAllocations.java b/src/main/java/com/apideck/unify/models/components/PaymentAllocations.java index e6ff6904..83625bd3 100644 --- a/src/main/java/com/apideck/unify/models/components/PaymentAllocations.java +++ b/src/main/java/com/apideck/unify/models/components/PaymentAllocations.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; @@ -23,7 +23,7 @@ public class PaymentAllocations { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Amount of the payment allocated to the invoice @@ -41,43 +41,39 @@ public class PaymentAllocations { @JsonCreator public PaymentAllocations( - @JsonProperty("id") Optional id, - @JsonProperty("allocated_amount") JsonNullable allocatedAmount, - @JsonProperty("date") JsonNullable date) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(allocatedAmount, "allocatedAmount"); - Utils.checkNotNull(date, "date"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("allocated_amount") @Nullable JsonNullable allocatedAmount, + @JsonProperty("date") @Nullable JsonNullable date) { this.id = id; - this.allocatedAmount = allocatedAmount; - this.date = date; + this.allocatedAmount = Optional.ofNullable(allocatedAmount) + .orElse(JsonNullable.undefined()); + this.date = Optional.ofNullable(date) + .orElse(JsonNullable.undefined()); } public PaymentAllocations() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * ID of the payment */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Amount of the payment allocated to the invoice */ - @JsonIgnore public JsonNullable allocatedAmount() { - return allocatedAmount; + return this.allocatedAmount; } /** * Date of the payment */ - @JsonIgnore public JsonNullable date() { - return date; + return this.date; } public static Builder builder() { @@ -88,57 +84,29 @@ public static Builder builder() { /** * ID of the payment */ - public PaymentAllocations withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the payment - */ - public PaymentAllocations withId(Optional id) { - Utils.checkNotNull(id, "id"); + public PaymentAllocations withId(@Nullable String id) { this.id = id; return this; } + /** * Amount of the payment allocated to the invoice */ - public PaymentAllocations withAllocatedAmount(double allocatedAmount) { - Utils.checkNotNull(allocatedAmount, "allocatedAmount"); + public PaymentAllocations withAllocatedAmount(@Nullable Double allocatedAmount) { this.allocatedAmount = JsonNullable.of(allocatedAmount); return this; } - /** - * Amount of the payment allocated to the invoice - */ - public PaymentAllocations withAllocatedAmount(JsonNullable allocatedAmount) { - Utils.checkNotNull(allocatedAmount, "allocatedAmount"); - this.allocatedAmount = allocatedAmount; - return this; - } /** * Date of the payment */ - public PaymentAllocations withDate(OffsetDateTime date) { - Utils.checkNotNull(date, "date"); + public PaymentAllocations withDate(@Nullable OffsetDateTime date) { this.date = JsonNullable.of(date); return this; } - /** - * Date of the payment - */ - public PaymentAllocations withDate(JsonNullable date) { - Utils.checkNotNull(date, "date"); - this.date = date; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -172,75 +140,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable allocatedAmount = JsonNullable.undefined(); + private JsonNullable allocatedAmount; - private JsonNullable date = JsonNullable.undefined(); + private JsonNullable date; private Builder() { // force use of static builder() method } - - /** - * ID of the payment - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * ID of the payment */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Amount of the payment allocated to the invoice */ - public Builder allocatedAmount(double allocatedAmount) { - Utils.checkNotNull(allocatedAmount, "allocatedAmount"); + public Builder allocatedAmount(@Nullable Double allocatedAmount) { this.allocatedAmount = JsonNullable.of(allocatedAmount); return this; } - /** - * Amount of the payment allocated to the invoice - */ - public Builder allocatedAmount(JsonNullable allocatedAmount) { - Utils.checkNotNull(allocatedAmount, "allocatedAmount"); - this.allocatedAmount = allocatedAmount; - return this; - } - - /** * Date of the payment */ - public Builder date(OffsetDateTime date) { - Utils.checkNotNull(date, "date"); + public Builder date(@Nullable OffsetDateTime date) { this.date = JsonNullable.of(date); return this; } - /** - * Date of the payment - */ - public Builder date(JsonNullable date) { - Utils.checkNotNull(date, "date"); - this.date = date; - return this; - } - public PaymentAllocations build() { - return new PaymentAllocations( id, allocatedAmount, date); } diff --git a/src/main/java/com/apideck/unify/models/components/PaymentInput.java b/src/main/java/com/apideck/unify/models/components/PaymentInput.java index 13b73ace..d5be4231 100644 --- a/src/main/java/com/apideck/unify/models/components/PaymentInput.java +++ b/src/main/java/com/apideck/unify/models/components/PaymentInput.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Deprecated; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -27,7 +26,7 @@ public class PaymentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -41,7 +40,7 @@ public class PaymentInput { */ @JsonInclude(Include.ALWAYS) @JsonProperty("total_amount") - private Optional totalAmount; + private JsonNullable totalAmount; /** * Optional transaction reference message ie: Debit remittance detail. @@ -94,21 +93,21 @@ public class PaymentInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("account") - private JsonNullable account; + private JsonNullable account; /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ @JsonInclude(Include.ALWAYS) @JsonProperty("transaction_date") - private Optional transactionDate; + private JsonNullable transactionDate; /** * The customer this entity is linked to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer") - private JsonNullable customer; + private JsonNullable customer; /** * The supplier this entity is linked to. @@ -118,7 +117,7 @@ public class PaymentInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier") @Deprecated - private JsonNullable supplier; + private JsonNullable supplier; /** * The company or subsidiary id the transaction belongs to @@ -139,19 +138,19 @@ public class PaymentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private PaymentStatus status; /** * Type of payment */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private PaymentType type; @JsonInclude(Include.NON_ABSENT) @JsonProperty("allocations") - private Optional> allocations; + private List allocations; /** * Note associated with the transaction @@ -172,12 +171,12 @@ public class PaymentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -198,154 +197,139 @@ public class PaymentInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public PaymentInput( - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("total_amount") Optional totalAmount, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("payment_method_reference") JsonNullable paymentMethodReference, - @JsonProperty("payment_method_id") JsonNullable paymentMethodId, - @JsonProperty("accounts_receivable_account_type") JsonNullable accountsReceivableAccountType, - @JsonProperty("accounts_receivable_account_id") JsonNullable accountsReceivableAccountId, - @JsonProperty("account") JsonNullable account, - @JsonProperty("transaction_date") Optional transactionDate, - @JsonProperty("customer") JsonNullable customer, - @JsonProperty("supplier") JsonNullable supplier, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("reconciled") JsonNullable reconciled, - @JsonProperty("status") Optional status, - @JsonProperty("type") Optional type, - @JsonProperty("allocations") Optional> allocations, - @JsonProperty("note") JsonNullable note, - @JsonProperty("number") JsonNullable number, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - Utils.checkNotNull(accountsReceivableAccountType, "accountsReceivableAccountType"); - Utils.checkNotNull(accountsReceivableAccountId, "accountsReceivableAccountId"); - Utils.checkNotNull(account, "account"); - Utils.checkNotNull(transactionDate, "transactionDate"); - Utils.checkNotNull(customer, "customer"); - Utils.checkNotNull(supplier, "supplier"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(reconciled, "reconciled"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(allocations, "allocations"); - Utils.checkNotNull(note, "note"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(passThrough, "passThrough"); - this.currency = currency; - this.currencyRate = currencyRate; - this.totalAmount = totalAmount; - this.reference = reference; - this.paymentMethod = paymentMethod; - this.paymentMethodReference = paymentMethodReference; - this.paymentMethodId = paymentMethodId; - this.accountsReceivableAccountType = accountsReceivableAccountType; - this.accountsReceivableAccountId = accountsReceivableAccountId; - this.account = account; - this.transactionDate = transactionDate; - this.customer = customer; - this.supplier = supplier; - this.companyId = companyId; - this.reconciled = reconciled; + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("total_amount") @Nullable Double totalAmount, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("payment_method_reference") @Nullable JsonNullable paymentMethodReference, + @JsonProperty("payment_method_id") @Nullable JsonNullable paymentMethodId, + @JsonProperty("accounts_receivable_account_type") @Nullable JsonNullable accountsReceivableAccountType, + @JsonProperty("accounts_receivable_account_id") @Nullable JsonNullable accountsReceivableAccountId, + @JsonProperty("account") @Nullable JsonNullable account, + @JsonProperty("transaction_date") @Nullable OffsetDateTime transactionDate, + @JsonProperty("customer") @Nullable JsonNullable customer, + @JsonProperty("supplier") @Nullable JsonNullable supplier, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("reconciled") @Nullable JsonNullable reconciled, + @JsonProperty("status") @Nullable PaymentStatus status, + @JsonProperty("type") @Nullable PaymentType type, + @JsonProperty("allocations") @Nullable List allocations, + @JsonProperty("note") @Nullable JsonNullable note, + @JsonProperty("number") @Nullable JsonNullable number, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.totalAmount = JsonNullable.of(totalAmount); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.paymentMethodReference = Optional.ofNullable(paymentMethodReference) + .orElse(JsonNullable.undefined()); + this.paymentMethodId = Optional.ofNullable(paymentMethodId) + .orElse(JsonNullable.undefined()); + this.accountsReceivableAccountType = Optional.ofNullable(accountsReceivableAccountType) + .orElse(JsonNullable.undefined()); + this.accountsReceivableAccountId = Optional.ofNullable(accountsReceivableAccountId) + .orElse(JsonNullable.undefined()); + this.account = Optional.ofNullable(account) + .orElse(JsonNullable.undefined()); + this.transactionDate = JsonNullable.of(transactionDate); + this.customer = Optional.ofNullable(customer) + .orElse(JsonNullable.undefined()); + this.supplier = Optional.ofNullable(supplier) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.reconciled = Optional.ofNullable(reconciled) + .orElse(JsonNullable.undefined()); this.status = status; this.type = type; this.allocations = allocations; - this.note = note; - this.number = number; - this.trackingCategories = trackingCategories; + this.note = Optional.ofNullable(note) + .orElse(JsonNullable.undefined()); + this.number = Optional.ofNullable(number) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; - this.displayId = displayId; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public PaymentInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * The total amount of the transaction or record */ - @JsonIgnore - public Optional totalAmount() { - return totalAmount; + public JsonNullable totalAmount() { + return this.totalAmount; } /** * Optional transaction reference message ie: Debit remittance detail. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * Optional reference message returned by payment method on processing */ - @JsonIgnore public JsonNullable paymentMethodReference() { - return paymentMethodReference; + return this.paymentMethodReference; } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable paymentMethodId() { - return paymentMethodId; + return this.paymentMethodId; } /** @@ -354,9 +338,8 @@ public JsonNullable paymentMethodId() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable accountsReceivableAccountType() { - return accountsReceivableAccountType; + return this.accountsReceivableAccountType; } /** @@ -365,32 +348,26 @@ public JsonNullable accountsReceivableAccountType() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable accountsReceivableAccountId() { - return accountsReceivableAccountId; + return this.accountsReceivableAccountId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable account() { - return (JsonNullable) account; + return this.account; } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore - public Optional transactionDate() { - return transactionDate; + public JsonNullable transactionDate() { + return this.transactionDate; } /** * The customer this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable customer() { - return (JsonNullable) customer; + return this.customer; } /** @@ -399,106 +376,86 @@ public JsonNullable customer() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable supplier() { - return (JsonNullable) supplier; + return this.supplier; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Indicates if the transaction has been reconciled. */ - @JsonIgnore public JsonNullable reconciled() { - return reconciled; + return this.reconciled; } /** * Status of payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Type of payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional type() { - return (Optional) type; + return Optional.ofNullable(this.type); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> allocations() { - return (Optional>) allocations; + return Optional.ofNullable(this.allocations); } /** * Note associated with the transaction */ - @JsonIgnore public JsonNullable note() { - return note; + return this.note; } /** * Number associated with the transaction */ - @JsonIgnore public JsonNullable number() { - return number; + return this.number; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * Id to be displayed. */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -509,129 +466,65 @@ public static Builder builder() { /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public PaymentInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public PaymentInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public PaymentInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public PaymentInput withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public PaymentInput withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public PaymentInput withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * The total amount of the transaction or record */ - public PaymentInput withTotalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); + public PaymentInput withTotalAmount(@Nullable Double totalAmount) { + this.totalAmount = JsonNullable.of(totalAmount); return this; } - /** - * The total amount of the transaction or record - */ - public PaymentInput withTotalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = totalAmount; - return this; - } - /** * Optional transaction reference message ie: Debit remittance detail. */ - public PaymentInput withReference(String reference) { - Utils.checkNotNull(reference, "reference"); + public PaymentInput withReference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional transaction reference message ie: Debit remittance detail. - */ - public PaymentInput withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public PaymentInput withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public PaymentInput withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public PaymentInput withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * Optional reference message returned by payment method on processing */ - public PaymentInput withPaymentMethodReference(String paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); + public PaymentInput withPaymentMethodReference(@Nullable String paymentMethodReference) { this.paymentMethodReference = JsonNullable.of(paymentMethodReference); return this; } - /** - * Optional reference message returned by payment method on processing - */ - public PaymentInput withPaymentMethodReference(JsonNullable paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - this.paymentMethodReference = paymentMethodReference; - return this; - } /** * A unique identifier for an object. */ - public PaymentInput withPaymentMethodId(String paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + public PaymentInput withPaymentMethodId(@Nullable String paymentMethodId) { this.paymentMethodId = JsonNullable.of(paymentMethodId); return this; } - /** - * A unique identifier for an object. - */ - public PaymentInput withPaymentMethodId(JsonNullable paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - this.paymentMethodId = paymentMethodId; - return this; - } /** * Type of accounts receivable account. @@ -639,23 +532,11 @@ public PaymentInput withPaymentMethodId(JsonNullable paymentMethodId) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public PaymentInput withAccountsReceivableAccountType(String accountsReceivableAccountType) { - Utils.checkNotNull(accountsReceivableAccountType, "accountsReceivableAccountType"); + public PaymentInput withAccountsReceivableAccountType(@Nullable String accountsReceivableAccountType) { this.accountsReceivableAccountType = JsonNullable.of(accountsReceivableAccountType); return this; } - /** - * Type of accounts receivable account. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public PaymentInput withAccountsReceivableAccountType(JsonNullable accountsReceivableAccountType) { - Utils.checkNotNull(accountsReceivableAccountType, "accountsReceivableAccountType"); - this.accountsReceivableAccountType = accountsReceivableAccountType; - return this; - } /** * Unique identifier for the account to allocate payment to. @@ -663,72 +544,35 @@ public PaymentInput withAccountsReceivableAccountType(JsonNullable accou * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public PaymentInput withAccountsReceivableAccountId(String accountsReceivableAccountId) { - Utils.checkNotNull(accountsReceivableAccountId, "accountsReceivableAccountId"); + public PaymentInput withAccountsReceivableAccountId(@Nullable String accountsReceivableAccountId) { this.accountsReceivableAccountId = JsonNullable.of(accountsReceivableAccountId); return this; } - /** - * Unique identifier for the account to allocate payment to. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public PaymentInput withAccountsReceivableAccountId(JsonNullable accountsReceivableAccountId) { - Utils.checkNotNull(accountsReceivableAccountId, "accountsReceivableAccountId"); - this.accountsReceivableAccountId = accountsReceivableAccountId; - return this; - } - public PaymentInput withAccount(LinkedLedgerAccountInput account) { - Utils.checkNotNull(account, "account"); + public PaymentInput withAccount(@Nullable LinkedLedgerAccountInput account) { this.account = JsonNullable.of(account); return this; } - public PaymentInput withAccount(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public PaymentInput withTransactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); + public PaymentInput withTransactionDate(@Nullable OffsetDateTime transactionDate) { + this.transactionDate = JsonNullable.of(transactionDate); return this; } - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public PaymentInput withTransactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = transactionDate; - return this; - } - /** * The customer this entity is linked to. */ - public PaymentInput withCustomer(LinkedCustomerInput customer) { - Utils.checkNotNull(customer, "customer"); + public PaymentInput withCustomer(@Nullable LinkedCustomerInput customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public PaymentInput withCustomer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } /** * The supplier this entity is linked to. @@ -736,233 +580,114 @@ public PaymentInput withCustomer(JsonNullable cus * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public PaymentInput withSupplier(DeprecatedLinkedSupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); + public PaymentInput withSupplier(@Nullable DeprecatedLinkedSupplierInput supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public PaymentInput withSupplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public PaymentInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public PaymentInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public PaymentInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Indicates if the transaction has been reconciled. */ - public PaymentInput withReconciled(boolean reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); + public PaymentInput withReconciled(@Nullable Boolean reconciled) { this.reconciled = JsonNullable.of(reconciled); return this; } - /** - * Indicates if the transaction has been reconciled. - */ - public PaymentInput withReconciled(JsonNullable reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); - this.reconciled = reconciled; - return this; - } - - /** - * Status of payment - */ - public PaymentInput withStatus(PaymentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of payment */ - public PaymentInput withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public PaymentInput withStatus(@Nullable PaymentStatus status) { this.status = status; return this; } - /** - * Type of payment - */ - public PaymentInput withType(PaymentType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of payment */ - public PaymentInput withType(Optional type) { - Utils.checkNotNull(type, "type"); + public PaymentInput withType(@Nullable PaymentType type) { this.type = type; return this; } - public PaymentInput withAllocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public PaymentInput withAllocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public PaymentInput withAllocations(@Nullable List allocations) { this.allocations = allocations; return this; } + /** * Note associated with the transaction */ - public PaymentInput withNote(String note) { - Utils.checkNotNull(note, "note"); + public PaymentInput withNote(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Note associated with the transaction - */ - public PaymentInput withNote(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } /** * Number associated with the transaction */ - public PaymentInput withNumber(String number) { - Utils.checkNotNull(number, "number"); + public PaymentInput withNumber(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number associated with the transaction - */ - public PaymentInput withNumber(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } /** * A list of linked tracking categories. */ - public PaymentInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public PaymentInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public PaymentInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - public PaymentInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public PaymentInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public PaymentInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public PaymentInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public PaymentInput withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public PaymentInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * Id to be displayed. */ - public PaymentInput withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public PaymentInput withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Id to be displayed. - */ - public PaymentInput withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public PaymentInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public PaymentInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public PaymentInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1047,540 +772,264 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private Optional totalAmount = Optional.empty(); + private Double totalAmount; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable paymentMethodReference = JsonNullable.undefined(); + private JsonNullable paymentMethodReference; - private JsonNullable paymentMethodId = JsonNullable.undefined(); + private JsonNullable paymentMethodId; @Deprecated - private JsonNullable accountsReceivableAccountType = JsonNullable.undefined(); + private JsonNullable accountsReceivableAccountType; @Deprecated - private JsonNullable accountsReceivableAccountId = JsonNullable.undefined(); + private JsonNullable accountsReceivableAccountId; - private JsonNullable account = JsonNullable.undefined(); + private JsonNullable account; - private Optional transactionDate = Optional.empty(); + private OffsetDateTime transactionDate; - private JsonNullable customer = JsonNullable.undefined(); + private JsonNullable customer; @Deprecated - private JsonNullable supplier = JsonNullable.undefined(); + private JsonNullable supplier; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable reconciled = JsonNullable.undefined(); + private JsonNullable reconciled; - private Optional status = Optional.empty(); + private PaymentStatus status; - private Optional type = Optional.empty(); + private PaymentType type; - private Optional> allocations = Optional.empty(); + private List allocations; - private JsonNullable note = JsonNullable.undefined(); + private JsonNullable note; - private JsonNullable number = JsonNullable.undefined(); + private JsonNullable number; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - - /** - * The total amount of the transaction or record - */ - public Builder totalAmount(double totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - /** * The total amount of the transaction or record */ - public Builder totalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable Double totalAmount) { this.totalAmount = totalAmount; return this; } - /** * Optional transaction reference message ie: Debit remittance detail. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional transaction reference message ie: Debit remittance detail. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * Optional reference message returned by payment method on processing */ - public Builder paymentMethodReference(String paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); + public Builder paymentMethodReference(@Nullable String paymentMethodReference) { this.paymentMethodReference = JsonNullable.of(paymentMethodReference); return this; } - /** - * Optional reference message returned by payment method on processing - */ - public Builder paymentMethodReference(JsonNullable paymentMethodReference) { - Utils.checkNotNull(paymentMethodReference, "paymentMethodReference"); - this.paymentMethodReference = paymentMethodReference; - return this; - } - - /** * A unique identifier for an object. */ - public Builder paymentMethodId(String paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); + public Builder paymentMethodId(@Nullable String paymentMethodId) { this.paymentMethodId = JsonNullable.of(paymentMethodId); return this; } - /** - * A unique identifier for an object. - */ - public Builder paymentMethodId(JsonNullable paymentMethodId) { - Utils.checkNotNull(paymentMethodId, "paymentMethodId"); - this.paymentMethodId = paymentMethodId; - return this; - } - - /** * Type of accounts receivable account. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder accountsReceivableAccountType(String accountsReceivableAccountType) { - Utils.checkNotNull(accountsReceivableAccountType, "accountsReceivableAccountType"); + public Builder accountsReceivableAccountType(@Nullable String accountsReceivableAccountType) { this.accountsReceivableAccountType = JsonNullable.of(accountsReceivableAccountType); return this; } - /** - * Type of accounts receivable account. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder accountsReceivableAccountType(JsonNullable accountsReceivableAccountType) { - Utils.checkNotNull(accountsReceivableAccountType, "accountsReceivableAccountType"); - this.accountsReceivableAccountType = accountsReceivableAccountType; - return this; - } - - /** * Unique identifier for the account to allocate payment to. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder accountsReceivableAccountId(String accountsReceivableAccountId) { - Utils.checkNotNull(accountsReceivableAccountId, "accountsReceivableAccountId"); + public Builder accountsReceivableAccountId(@Nullable String accountsReceivableAccountId) { this.accountsReceivableAccountId = JsonNullable.of(accountsReceivableAccountId); return this; } - /** - * Unique identifier for the account to allocate payment to. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder accountsReceivableAccountId(JsonNullable accountsReceivableAccountId) { - Utils.checkNotNull(accountsReceivableAccountId, "accountsReceivableAccountId"); - this.accountsReceivableAccountId = accountsReceivableAccountId; - return this; - } - - - public Builder account(LinkedLedgerAccountInput account) { - Utils.checkNotNull(account, "account"); + public Builder account(@Nullable LinkedLedgerAccountInput account) { this.account = JsonNullable.of(account); return this; } - public Builder account(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - - /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder transactionDate(OffsetDateTime transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); - this.transactionDate = Optional.ofNullable(transactionDate); - return this; - } - - /** - * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD - */ - public Builder transactionDate(Optional transactionDate) { - Utils.checkNotNull(transactionDate, "transactionDate"); + public Builder transactionDate(@Nullable OffsetDateTime transactionDate) { this.transactionDate = transactionDate; return this; } - /** * The customer this entity is linked to. */ - public Builder customer(LinkedCustomerInput customer) { - Utils.checkNotNull(customer, "customer"); + public Builder customer(@Nullable LinkedCustomerInput customer) { this.customer = JsonNullable.of(customer); return this; } - /** - * The customer this entity is linked to. - */ - public Builder customer(JsonNullable customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; - return this; - } - - /** * The supplier this entity is linked to. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder supplier(DeprecatedLinkedSupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Builder supplier(@Nullable DeprecatedLinkedSupplierInput supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder supplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Indicates if the transaction has been reconciled. */ - public Builder reconciled(boolean reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); + public Builder reconciled(@Nullable Boolean reconciled) { this.reconciled = JsonNullable.of(reconciled); return this; } - /** - * Indicates if the transaction has been reconciled. - */ - public Builder reconciled(JsonNullable reconciled) { - Utils.checkNotNull(reconciled, "reconciled"); - this.reconciled = reconciled; - return this; - } - - - /** - * Status of payment - */ - public Builder status(PaymentStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of payment */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable PaymentStatus status) { this.status = status; return this; } - - /** - * Type of payment - */ - public Builder type(PaymentType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * Type of payment */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable PaymentType type) { this.type = type; return this; } - - public Builder allocations(List allocations) { - Utils.checkNotNull(allocations, "allocations"); - this.allocations = Optional.ofNullable(allocations); - return this; - } - - public Builder allocations(Optional> allocations) { - Utils.checkNotNull(allocations, "allocations"); + public Builder allocations(@Nullable List allocations) { this.allocations = allocations; return this; } - /** * Note associated with the transaction */ - public Builder note(String note) { - Utils.checkNotNull(note, "note"); + public Builder note(@Nullable String note) { this.note = JsonNullable.of(note); return this; } - /** - * Note associated with the transaction - */ - public Builder note(JsonNullable note) { - Utils.checkNotNull(note, "note"); - this.note = note; - return this; - } - - /** * Number associated with the transaction */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = JsonNullable.of(number); return this; } - /** - * Number associated with the transaction - */ - public Builder number(JsonNullable number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * Id to be displayed. */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Id to be displayed. - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public PaymentInput build() { - return new PaymentInput( currency, currencyRate, totalAmount, reference, paymentMethod, paymentMethodReference, diff --git a/src/main/java/com/apideck/unify/models/components/PaymentsFilter.java b/src/main/java/com/apideck/unify/models/components/PaymentsFilter.java index 0793803d..ca0a04fc 100644 --- a/src/main/java/com/apideck/unify/models/components/PaymentsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/PaymentsFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; @@ -16,34 +16,30 @@ public class PaymentsFilter { @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private OffsetDateTime updatedSince; @SpeakeasyMetadata("queryParam:name=invoice_id") - private Optional invoiceId; + private String invoiceId; @JsonCreator public PaymentsFilter( - Optional updatedSince, - Optional invoiceId) { - Utils.checkNotNull(updatedSince, "updatedSince"); - Utils.checkNotNull(invoiceId, "invoiceId"); + @Nullable OffsetDateTime updatedSince, + @Nullable String invoiceId) { this.updatedSince = updatedSince; this.invoiceId = invoiceId; } public PaymentsFilter() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } - @JsonIgnore public Optional invoiceId() { - return invoiceId; + return Optional.ofNullable(this.invoiceId); } public static Builder builder() { @@ -51,32 +47,18 @@ public static Builder builder() { } - public PaymentsFilter withUpdatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - - public PaymentsFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public PaymentsFilter withUpdatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - public PaymentsFilter withInvoiceId(String invoiceId) { - Utils.checkNotNull(invoiceId, "invoiceId"); - this.invoiceId = Optional.ofNullable(invoiceId); - return this; - } - - public PaymentsFilter withInvoiceId(Optional invoiceId) { - Utils.checkNotNull(invoiceId, "invoiceId"); + public PaymentsFilter withInvoiceId(@Nullable String invoiceId) { this.invoiceId = invoiceId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,42 +89,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional updatedSince = Optional.empty(); + private OffsetDateTime updatedSince; - private Optional invoiceId = Optional.empty(); + private String invoiceId; private Builder() { // force use of static builder() method } - - public Builder updatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - - public Builder invoiceId(String invoiceId) { - Utils.checkNotNull(invoiceId, "invoiceId"); - this.invoiceId = Optional.ofNullable(invoiceId); - return this; - } - - public Builder invoiceId(Optional invoiceId) { - Utils.checkNotNull(invoiceId, "invoiceId"); + public Builder invoiceId(@Nullable String invoiceId) { this.invoiceId = invoiceId; return this; } public PaymentsFilter build() { - return new PaymentsFilter( updatedSince, invoiceId); } diff --git a/src/main/java/com/apideck/unify/models/components/PaymentsSort.java b/src/main/java/com/apideck/unify/models/components/PaymentsSort.java index ece70af7..0d0d25f1 100644 --- a/src/main/java/com/apideck/unify/models/components/PaymentsSort.java +++ b/src/main/java/com/apideck/unify/models/components/PaymentsSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class PaymentsSort { * The field on which to sort the Payments */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private PaymentsSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public PaymentsSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable PaymentsSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public PaymentsSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Payments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Payments */ - public PaymentsSort withBy(PaymentsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Payments - */ - public PaymentsSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public PaymentsSort withBy(@Nullable PaymentsSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public PaymentsSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public PaymentsSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public PaymentsSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private PaymentsSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Payments - */ - public Builder by(PaymentsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Payments */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable PaymentsSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public PaymentsSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new PaymentsSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/Payroll.java b/src/main/java/com/apideck/unify/models/components/Payroll.java index 141e69d2..51605544 100644 --- a/src/main/java/com/apideck/unify/models/components/Payroll.java +++ b/src/main/java/com/apideck/unify/models/components/Payroll.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -26,7 +25,7 @@ public class Payroll { */ @JsonInclude(Include.ALWAYS) @JsonProperty("id") - private Optional id; + private JsonNullable id; /** * The unique identifier of the company. @@ -40,7 +39,7 @@ public class Payroll { */ @JsonInclude(Include.ALWAYS) @JsonProperty("processed") - private Optional processed; + private JsonNullable processed; /** * The date the payroll was processed. @@ -54,165 +53,145 @@ public class Payroll { */ @JsonInclude(Include.ALWAYS) @JsonProperty("check_date") - private Optional checkDate; + private JsonNullable checkDate; /** * The start date, inclusive, of the pay period. */ @JsonInclude(Include.ALWAYS) @JsonProperty("start_date") - private Optional startDate; + private JsonNullable startDate; /** * The end date, inclusive, of the pay period. */ @JsonInclude(Include.ALWAYS) @JsonProperty("end_date") - private Optional endDate; + private JsonNullable endDate; /** * The overview of the payroll totals. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("totals") - private Optional totals; + private PayrollTotals totals; /** * An array of compensations for the payroll. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("compensations") - private Optional> compensations; + private List compensations; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; @JsonCreator public Payroll( - @JsonProperty("id") Optional id, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("processed") Optional processed, - @JsonProperty("processed_date") JsonNullable processedDate, - @JsonProperty("check_date") Optional checkDate, - @JsonProperty("start_date") Optional startDate, - @JsonProperty("end_date") Optional endDate, - @JsonProperty("totals") Optional totals, - @JsonProperty("compensations") Optional> compensations, - @JsonProperty("custom_mappings") JsonNullable> customMappings) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(processed, "processed"); - Utils.checkNotNull(processedDate, "processedDate"); - Utils.checkNotNull(checkDate, "checkDate"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(totals, "totals"); - Utils.checkNotNull(compensations, "compensations"); - Utils.checkNotNull(customMappings, "customMappings"); - this.id = id; - this.companyId = companyId; - this.processed = processed; - this.processedDate = processedDate; - this.checkDate = checkDate; - this.startDate = startDate; - this.endDate = endDate; + @JsonProperty("id") @Nullable String id, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("processed") @Nullable Boolean processed, + @JsonProperty("processed_date") @Nullable JsonNullable processedDate, + @JsonProperty("check_date") @Nullable String checkDate, + @JsonProperty("start_date") @Nullable String startDate, + @JsonProperty("end_date") @Nullable String endDate, + @JsonProperty("totals") @Nullable PayrollTotals totals, + @JsonProperty("compensations") @Nullable List compensations, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings) { + this.id = JsonNullable.of(id); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.processed = JsonNullable.of(processed); + this.processedDate = Optional.ofNullable(processedDate) + .orElse(JsonNullable.undefined()); + this.checkDate = JsonNullable.of(checkDate); + this.startDate = JsonNullable.of(startDate); + this.endDate = JsonNullable.of(endDate); this.totals = totals; this.compensations = compensations; - this.customMappings = customMappings; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); } public Payroll() { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore - public Optional id() { - return id; + public JsonNullable id() { + return this.id; } /** * The unique identifier of the company. */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. */ - @JsonIgnore - public Optional processed() { - return processed; + public JsonNullable processed() { + return this.processed; } /** * The date the payroll was processed. */ - @JsonIgnore public JsonNullable processedDate() { - return processedDate; + return this.processedDate; } /** * The date on which employees will be paid for the payroll. */ - @JsonIgnore - public Optional checkDate() { - return checkDate; + public JsonNullable checkDate() { + return this.checkDate; } /** * The start date, inclusive, of the pay period. */ - @JsonIgnore - public Optional startDate() { - return startDate; + public JsonNullable startDate() { + return this.startDate; } /** * The end date, inclusive, of the pay period. */ - @JsonIgnore - public Optional endDate() { - return endDate; + public JsonNullable endDate() { + return this.endDate; } /** * The overview of the payroll totals. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional totals() { - return (Optional) totals; + return Optional.ofNullable(this.totals); } /** * An array of compensations for the payroll. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> compensations() { - return (Optional>) compensations; + return Optional.ofNullable(this.compensations); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } public static Builder builder() { @@ -223,121 +202,53 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Payroll withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); + public Payroll withId(@Nullable String id) { + this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Payroll withId(Optional id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - /** * The unique identifier of the company. */ - public Payroll withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Payroll withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company. - */ - public Payroll withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. */ - public Payroll withProcessed(boolean processed) { - Utils.checkNotNull(processed, "processed"); - this.processed = Optional.ofNullable(processed); + public Payroll withProcessed(@Nullable Boolean processed) { + this.processed = JsonNullable.of(processed); return this; } - /** - * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. - */ - public Payroll withProcessed(Optional processed) { - Utils.checkNotNull(processed, "processed"); - this.processed = processed; - return this; - } - /** * The date the payroll was processed. */ - public Payroll withProcessedDate(String processedDate) { - Utils.checkNotNull(processedDate, "processedDate"); + public Payroll withProcessedDate(@Nullable String processedDate) { this.processedDate = JsonNullable.of(processedDate); return this; } - /** - * The date the payroll was processed. - */ - public Payroll withProcessedDate(JsonNullable processedDate) { - Utils.checkNotNull(processedDate, "processedDate"); - this.processedDate = processedDate; - return this; - } /** * The date on which employees will be paid for the payroll. */ - public Payroll withCheckDate(String checkDate) { - Utils.checkNotNull(checkDate, "checkDate"); - this.checkDate = Optional.ofNullable(checkDate); + public Payroll withCheckDate(@Nullable String checkDate) { + this.checkDate = JsonNullable.of(checkDate); return this; } - /** - * The date on which employees will be paid for the payroll. - */ - public Payroll withCheckDate(Optional checkDate) { - Utils.checkNotNull(checkDate, "checkDate"); - this.checkDate = checkDate; - return this; - } - /** * The start date, inclusive, of the pay period. */ - public Payroll withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - - - /** - * The start date, inclusive, of the pay period. - */ - public Payroll withStartDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } - - /** - * The end date, inclusive, of the pay period. - */ - public Payroll withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); + public Payroll withStartDate(@Nullable String startDate) { + this.startDate = JsonNullable.of(startDate); return this; } @@ -345,18 +256,8 @@ public Payroll withEndDate(String endDate) { /** * The end date, inclusive, of the pay period. */ - public Payroll withEndDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** - * The overview of the payroll totals. - */ - public Payroll withTotals(PayrollTotals totals) { - Utils.checkNotNull(totals, "totals"); - this.totals = Optional.ofNullable(totals); + public Payroll withEndDate(@Nullable String endDate) { + this.endDate = JsonNullable.of(endDate); return this; } @@ -364,48 +265,29 @@ public Payroll withTotals(PayrollTotals totals) { /** * The overview of the payroll totals. */ - public Payroll withTotals(Optional totals) { - Utils.checkNotNull(totals, "totals"); + public Payroll withTotals(@Nullable PayrollTotals totals) { this.totals = totals; return this; } - /** - * An array of compensations for the payroll. - */ - public Payroll withCompensations(List compensations) { - Utils.checkNotNull(compensations, "compensations"); - this.compensations = Optional.ofNullable(compensations); - return this; - } - /** * An array of compensations for the payroll. */ - public Payroll withCompensations(Optional> compensations) { - Utils.checkNotNull(compensations, "compensations"); + public Payroll withCompensations(@Nullable List compensations) { this.compensations = compensations; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public Payroll withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Payroll withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Payroll withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -456,222 +338,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private Optional processed = Optional.empty(); + private Boolean processed; - private JsonNullable processedDate = JsonNullable.undefined(); + private JsonNullable processedDate; - private Optional checkDate = Optional.empty(); + private String checkDate; - private Optional startDate = Optional.empty(); + private String startDate; - private Optional endDate = Optional.empty(); + private String endDate; - private Optional totals = Optional.empty(); + private PayrollTotals totals; - private Optional> compensations = Optional.empty(); + private List compensations; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The unique identifier of the company. */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The unique identifier of the company. - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. */ - public Builder processed(boolean processed) { - Utils.checkNotNull(processed, "processed"); - this.processed = Optional.ofNullable(processed); - return this; - } - - /** - * Whether or not the payroll has been successfully processed. Note that processed payrolls cannot be updated. - */ - public Builder processed(Optional processed) { - Utils.checkNotNull(processed, "processed"); + public Builder processed(@Nullable Boolean processed) { this.processed = processed; return this; } - /** * The date the payroll was processed. */ - public Builder processedDate(String processedDate) { - Utils.checkNotNull(processedDate, "processedDate"); + public Builder processedDate(@Nullable String processedDate) { this.processedDate = JsonNullable.of(processedDate); return this; } - /** - * The date the payroll was processed. - */ - public Builder processedDate(JsonNullable processedDate) { - Utils.checkNotNull(processedDate, "processedDate"); - this.processedDate = processedDate; - return this; - } - - - /** - * The date on which employees will be paid for the payroll. - */ - public Builder checkDate(String checkDate) { - Utils.checkNotNull(checkDate, "checkDate"); - this.checkDate = Optional.ofNullable(checkDate); - return this; - } - /** * The date on which employees will be paid for the payroll. */ - public Builder checkDate(Optional checkDate) { - Utils.checkNotNull(checkDate, "checkDate"); + public Builder checkDate(@Nullable String checkDate) { this.checkDate = checkDate; return this; } - /** * The start date, inclusive, of the pay period. */ - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - - /** - * The start date, inclusive, of the pay period. - */ - public Builder startDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable String startDate) { this.startDate = startDate; return this; } - - /** - * The end date, inclusive, of the pay period. - */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * The end date, inclusive, of the pay period. */ - public Builder endDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable String endDate) { this.endDate = endDate; return this; } - - /** - * The overview of the payroll totals. - */ - public Builder totals(PayrollTotals totals) { - Utils.checkNotNull(totals, "totals"); - this.totals = Optional.ofNullable(totals); - return this; - } - /** * The overview of the payroll totals. */ - public Builder totals(Optional totals) { - Utils.checkNotNull(totals, "totals"); + public Builder totals(@Nullable PayrollTotals totals) { this.totals = totals; return this; } - - /** - * An array of compensations for the payroll. - */ - public Builder compensations(List compensations) { - Utils.checkNotNull(compensations, "compensations"); - this.compensations = Optional.ofNullable(compensations); - return this; - } - /** * An array of compensations for the payroll. */ - public Builder compensations(Optional> compensations) { - Utils.checkNotNull(compensations, "compensations"); + public Builder compensations(@Nullable List compensations) { this.compensations = compensations; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - public Payroll build() { - return new Payroll( id, companyId, processed, processedDate, checkDate, startDate, diff --git a/src/main/java/com/apideck/unify/models/components/PayrollTotals.java b/src/main/java/com/apideck/unify/models/components/PayrollTotals.java index 2a559a84..1841ca37 100644 --- a/src/main/java/com/apideck/unify/models/components/PayrollTotals.java +++ b/src/main/java/com/apideck/unify/models/components/PayrollTotals.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -85,111 +86,102 @@ public class PayrollTotals { @JsonCreator public PayrollTotals( - @JsonProperty("company_debit") JsonNullable companyDebit, - @JsonProperty("tax_debit") JsonNullable taxDebit, - @JsonProperty("check_amount") JsonNullable checkAmount, - @JsonProperty("net_pay") JsonNullable netPay, - @JsonProperty("gross_pay") JsonNullable grossPay, - @JsonProperty("employer_taxes") JsonNullable employerTaxes, - @JsonProperty("employee_taxes") JsonNullable employeeTaxes, - @JsonProperty("employer_benefit_contributions") JsonNullable employerBenefitContributions, - @JsonProperty("employee_benefit_deductions") JsonNullable employeeBenefitDeductions) { - Utils.checkNotNull(companyDebit, "companyDebit"); - Utils.checkNotNull(taxDebit, "taxDebit"); - Utils.checkNotNull(checkAmount, "checkAmount"); - Utils.checkNotNull(netPay, "netPay"); - Utils.checkNotNull(grossPay, "grossPay"); - Utils.checkNotNull(employerTaxes, "employerTaxes"); - Utils.checkNotNull(employeeTaxes, "employeeTaxes"); - Utils.checkNotNull(employerBenefitContributions, "employerBenefitContributions"); - Utils.checkNotNull(employeeBenefitDeductions, "employeeBenefitDeductions"); - this.companyDebit = companyDebit; - this.taxDebit = taxDebit; - this.checkAmount = checkAmount; - this.netPay = netPay; - this.grossPay = grossPay; - this.employerTaxes = employerTaxes; - this.employeeTaxes = employeeTaxes; - this.employerBenefitContributions = employerBenefitContributions; - this.employeeBenefitDeductions = employeeBenefitDeductions; + @JsonProperty("company_debit") @Nullable JsonNullable companyDebit, + @JsonProperty("tax_debit") @Nullable JsonNullable taxDebit, + @JsonProperty("check_amount") @Nullable JsonNullable checkAmount, + @JsonProperty("net_pay") @Nullable JsonNullable netPay, + @JsonProperty("gross_pay") @Nullable JsonNullable grossPay, + @JsonProperty("employer_taxes") @Nullable JsonNullable employerTaxes, + @JsonProperty("employee_taxes") @Nullable JsonNullable employeeTaxes, + @JsonProperty("employer_benefit_contributions") @Nullable JsonNullable employerBenefitContributions, + @JsonProperty("employee_benefit_deductions") @Nullable JsonNullable employeeBenefitDeductions) { + this.companyDebit = Optional.ofNullable(companyDebit) + .orElse(JsonNullable.undefined()); + this.taxDebit = Optional.ofNullable(taxDebit) + .orElse(JsonNullable.undefined()); + this.checkAmount = Optional.ofNullable(checkAmount) + .orElse(JsonNullable.undefined()); + this.netPay = Optional.ofNullable(netPay) + .orElse(JsonNullable.undefined()); + this.grossPay = Optional.ofNullable(grossPay) + .orElse(JsonNullable.undefined()); + this.employerTaxes = Optional.ofNullable(employerTaxes) + .orElse(JsonNullable.undefined()); + this.employeeTaxes = Optional.ofNullable(employeeTaxes) + .orElse(JsonNullable.undefined()); + this.employerBenefitContributions = Optional.ofNullable(employerBenefitContributions) + .orElse(JsonNullable.undefined()); + this.employeeBenefitDeductions = Optional.ofNullable(employeeBenefitDeductions) + .orElse(JsonNullable.undefined()); } public PayrollTotals() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * The total company debit for the payroll. */ - @JsonIgnore public JsonNullable companyDebit() { - return companyDebit; + return this.companyDebit; } /** * The total tax debit for the payroll. */ - @JsonIgnore public JsonNullable taxDebit() { - return taxDebit; + return this.taxDebit; } /** * The total check amount for the payroll. */ - @JsonIgnore public JsonNullable checkAmount() { - return checkAmount; + return this.checkAmount; } /** * The net pay amount for the payroll. */ - @JsonIgnore public JsonNullable netPay() { - return netPay; + return this.netPay; } /** * The gross pay amount for the payroll. */ - @JsonIgnore public JsonNullable grossPay() { - return grossPay; + return this.grossPay; } /** * The total amount of employer paid taxes for the payroll. */ - @JsonIgnore public JsonNullable employerTaxes() { - return employerTaxes; + return this.employerTaxes; } /** * The total amount of employee paid taxes for the payroll. */ - @JsonIgnore public JsonNullable employeeTaxes() { - return employeeTaxes; + return this.employeeTaxes; } /** * The total amount of company contributed benefits for the payroll. */ - @JsonIgnore public JsonNullable employerBenefitContributions() { - return employerBenefitContributions; + return this.employerBenefitContributions; } /** * The total amount of employee deducted benefits for the payroll. */ - @JsonIgnore public JsonNullable employeeBenefitDeductions() { - return employeeBenefitDeductions; + return this.employeeBenefitDeductions; } public static Builder builder() { @@ -200,164 +192,83 @@ public static Builder builder() { /** * The total company debit for the payroll. */ - public PayrollTotals withCompanyDebit(double companyDebit) { - Utils.checkNotNull(companyDebit, "companyDebit"); + public PayrollTotals withCompanyDebit(@Nullable Double companyDebit) { this.companyDebit = JsonNullable.of(companyDebit); return this; } - /** - * The total company debit for the payroll. - */ - public PayrollTotals withCompanyDebit(JsonNullable companyDebit) { - Utils.checkNotNull(companyDebit, "companyDebit"); - this.companyDebit = companyDebit; - return this; - } /** * The total tax debit for the payroll. */ - public PayrollTotals withTaxDebit(double taxDebit) { - Utils.checkNotNull(taxDebit, "taxDebit"); + public PayrollTotals withTaxDebit(@Nullable Double taxDebit) { this.taxDebit = JsonNullable.of(taxDebit); return this; } - /** - * The total tax debit for the payroll. - */ - public PayrollTotals withTaxDebit(JsonNullable taxDebit) { - Utils.checkNotNull(taxDebit, "taxDebit"); - this.taxDebit = taxDebit; - return this; - } /** * The total check amount for the payroll. */ - public PayrollTotals withCheckAmount(double checkAmount) { - Utils.checkNotNull(checkAmount, "checkAmount"); + public PayrollTotals withCheckAmount(@Nullable Double checkAmount) { this.checkAmount = JsonNullable.of(checkAmount); return this; } - /** - * The total check amount for the payroll. - */ - public PayrollTotals withCheckAmount(JsonNullable checkAmount) { - Utils.checkNotNull(checkAmount, "checkAmount"); - this.checkAmount = checkAmount; - return this; - } /** * The net pay amount for the payroll. */ - public PayrollTotals withNetPay(double netPay) { - Utils.checkNotNull(netPay, "netPay"); + public PayrollTotals withNetPay(@Nullable Double netPay) { this.netPay = JsonNullable.of(netPay); return this; } - /** - * The net pay amount for the payroll. - */ - public PayrollTotals withNetPay(JsonNullable netPay) { - Utils.checkNotNull(netPay, "netPay"); - this.netPay = netPay; - return this; - } /** * The gross pay amount for the payroll. */ - public PayrollTotals withGrossPay(double grossPay) { - Utils.checkNotNull(grossPay, "grossPay"); + public PayrollTotals withGrossPay(@Nullable Double grossPay) { this.grossPay = JsonNullable.of(grossPay); return this; } - /** - * The gross pay amount for the payroll. - */ - public PayrollTotals withGrossPay(JsonNullable grossPay) { - Utils.checkNotNull(grossPay, "grossPay"); - this.grossPay = grossPay; - return this; - } /** * The total amount of employer paid taxes for the payroll. */ - public PayrollTotals withEmployerTaxes(double employerTaxes) { - Utils.checkNotNull(employerTaxes, "employerTaxes"); + public PayrollTotals withEmployerTaxes(@Nullable Double employerTaxes) { this.employerTaxes = JsonNullable.of(employerTaxes); return this; } - /** - * The total amount of employer paid taxes for the payroll. - */ - public PayrollTotals withEmployerTaxes(JsonNullable employerTaxes) { - Utils.checkNotNull(employerTaxes, "employerTaxes"); - this.employerTaxes = employerTaxes; - return this; - } /** * The total amount of employee paid taxes for the payroll. */ - public PayrollTotals withEmployeeTaxes(double employeeTaxes) { - Utils.checkNotNull(employeeTaxes, "employeeTaxes"); + public PayrollTotals withEmployeeTaxes(@Nullable Double employeeTaxes) { this.employeeTaxes = JsonNullable.of(employeeTaxes); return this; } - /** - * The total amount of employee paid taxes for the payroll. - */ - public PayrollTotals withEmployeeTaxes(JsonNullable employeeTaxes) { - Utils.checkNotNull(employeeTaxes, "employeeTaxes"); - this.employeeTaxes = employeeTaxes; - return this; - } /** * The total amount of company contributed benefits for the payroll. */ - public PayrollTotals withEmployerBenefitContributions(double employerBenefitContributions) { - Utils.checkNotNull(employerBenefitContributions, "employerBenefitContributions"); + public PayrollTotals withEmployerBenefitContributions(@Nullable Double employerBenefitContributions) { this.employerBenefitContributions = JsonNullable.of(employerBenefitContributions); return this; } - /** - * The total amount of company contributed benefits for the payroll. - */ - public PayrollTotals withEmployerBenefitContributions(JsonNullable employerBenefitContributions) { - Utils.checkNotNull(employerBenefitContributions, "employerBenefitContributions"); - this.employerBenefitContributions = employerBenefitContributions; - return this; - } /** * The total amount of employee deducted benefits for the payroll. */ - public PayrollTotals withEmployeeBenefitDeductions(double employeeBenefitDeductions) { - Utils.checkNotNull(employeeBenefitDeductions, "employeeBenefitDeductions"); + public PayrollTotals withEmployeeBenefitDeductions(@Nullable Double employeeBenefitDeductions) { this.employeeBenefitDeductions = JsonNullable.of(employeeBenefitDeductions); return this; } - /** - * The total amount of employee deducted benefits for the payroll. - */ - public PayrollTotals withEmployeeBenefitDeductions(JsonNullable employeeBenefitDeductions) { - Utils.checkNotNull(employeeBenefitDeductions, "employeeBenefitDeductions"); - this.employeeBenefitDeductions = employeeBenefitDeductions; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -405,201 +316,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable companyDebit = JsonNullable.undefined(); + private JsonNullable companyDebit; - private JsonNullable taxDebit = JsonNullable.undefined(); + private JsonNullable taxDebit; - private JsonNullable checkAmount = JsonNullable.undefined(); + private JsonNullable checkAmount; - private JsonNullable netPay = JsonNullable.undefined(); + private JsonNullable netPay; - private JsonNullable grossPay = JsonNullable.undefined(); + private JsonNullable grossPay; - private JsonNullable employerTaxes = JsonNullable.undefined(); + private JsonNullable employerTaxes; - private JsonNullable employeeTaxes = JsonNullable.undefined(); + private JsonNullable employeeTaxes; - private JsonNullable employerBenefitContributions = JsonNullable.undefined(); + private JsonNullable employerBenefitContributions; - private JsonNullable employeeBenefitDeductions = JsonNullable.undefined(); + private JsonNullable employeeBenefitDeductions; private Builder() { // force use of static builder() method } - /** * The total company debit for the payroll. */ - public Builder companyDebit(double companyDebit) { - Utils.checkNotNull(companyDebit, "companyDebit"); + public Builder companyDebit(@Nullable Double companyDebit) { this.companyDebit = JsonNullable.of(companyDebit); return this; } - /** - * The total company debit for the payroll. - */ - public Builder companyDebit(JsonNullable companyDebit) { - Utils.checkNotNull(companyDebit, "companyDebit"); - this.companyDebit = companyDebit; - return this; - } - - /** * The total tax debit for the payroll. */ - public Builder taxDebit(double taxDebit) { - Utils.checkNotNull(taxDebit, "taxDebit"); + public Builder taxDebit(@Nullable Double taxDebit) { this.taxDebit = JsonNullable.of(taxDebit); return this; } - /** - * The total tax debit for the payroll. - */ - public Builder taxDebit(JsonNullable taxDebit) { - Utils.checkNotNull(taxDebit, "taxDebit"); - this.taxDebit = taxDebit; - return this; - } - - /** * The total check amount for the payroll. */ - public Builder checkAmount(double checkAmount) { - Utils.checkNotNull(checkAmount, "checkAmount"); + public Builder checkAmount(@Nullable Double checkAmount) { this.checkAmount = JsonNullable.of(checkAmount); return this; } - /** - * The total check amount for the payroll. - */ - public Builder checkAmount(JsonNullable checkAmount) { - Utils.checkNotNull(checkAmount, "checkAmount"); - this.checkAmount = checkAmount; - return this; - } - - /** * The net pay amount for the payroll. */ - public Builder netPay(double netPay) { - Utils.checkNotNull(netPay, "netPay"); + public Builder netPay(@Nullable Double netPay) { this.netPay = JsonNullable.of(netPay); return this; } - /** - * The net pay amount for the payroll. - */ - public Builder netPay(JsonNullable netPay) { - Utils.checkNotNull(netPay, "netPay"); - this.netPay = netPay; - return this; - } - - /** * The gross pay amount for the payroll. */ - public Builder grossPay(double grossPay) { - Utils.checkNotNull(grossPay, "grossPay"); + public Builder grossPay(@Nullable Double grossPay) { this.grossPay = JsonNullable.of(grossPay); return this; } - /** - * The gross pay amount for the payroll. - */ - public Builder grossPay(JsonNullable grossPay) { - Utils.checkNotNull(grossPay, "grossPay"); - this.grossPay = grossPay; - return this; - } - - /** * The total amount of employer paid taxes for the payroll. */ - public Builder employerTaxes(double employerTaxes) { - Utils.checkNotNull(employerTaxes, "employerTaxes"); + public Builder employerTaxes(@Nullable Double employerTaxes) { this.employerTaxes = JsonNullable.of(employerTaxes); return this; } - /** - * The total amount of employer paid taxes for the payroll. - */ - public Builder employerTaxes(JsonNullable employerTaxes) { - Utils.checkNotNull(employerTaxes, "employerTaxes"); - this.employerTaxes = employerTaxes; - return this; - } - - /** * The total amount of employee paid taxes for the payroll. */ - public Builder employeeTaxes(double employeeTaxes) { - Utils.checkNotNull(employeeTaxes, "employeeTaxes"); + public Builder employeeTaxes(@Nullable Double employeeTaxes) { this.employeeTaxes = JsonNullable.of(employeeTaxes); return this; } - /** - * The total amount of employee paid taxes for the payroll. - */ - public Builder employeeTaxes(JsonNullable employeeTaxes) { - Utils.checkNotNull(employeeTaxes, "employeeTaxes"); - this.employeeTaxes = employeeTaxes; - return this; - } - - /** * The total amount of company contributed benefits for the payroll. */ - public Builder employerBenefitContributions(double employerBenefitContributions) { - Utils.checkNotNull(employerBenefitContributions, "employerBenefitContributions"); + public Builder employerBenefitContributions(@Nullable Double employerBenefitContributions) { this.employerBenefitContributions = JsonNullable.of(employerBenefitContributions); return this; } - /** - * The total amount of company contributed benefits for the payroll. - */ - public Builder employerBenefitContributions(JsonNullable employerBenefitContributions) { - Utils.checkNotNull(employerBenefitContributions, "employerBenefitContributions"); - this.employerBenefitContributions = employerBenefitContributions; - return this; - } - - /** * The total amount of employee deducted benefits for the payroll. */ - public Builder employeeBenefitDeductions(double employeeBenefitDeductions) { - Utils.checkNotNull(employeeBenefitDeductions, "employeeBenefitDeductions"); + public Builder employeeBenefitDeductions(@Nullable Double employeeBenefitDeductions) { this.employeeBenefitDeductions = JsonNullable.of(employeeBenefitDeductions); return this; } - /** - * The total amount of employee deducted benefits for the payroll. - */ - public Builder employeeBenefitDeductions(JsonNullable employeeBenefitDeductions) { - Utils.checkNotNull(employeeBenefitDeductions, "employeeBenefitDeductions"); - this.employeeBenefitDeductions = employeeBenefitDeductions; - return this; - } - public PayrollTotals build() { - return new PayrollTotals( companyDebit, taxDebit, checkAmount, netPay, grossPay, employerTaxes, diff --git a/src/main/java/com/apideck/unify/models/components/PayrollsFilter.java b/src/main/java/com/apideck/unify/models/components/PayrollsFilter.java index 4bd76bb9..d4af94c3 100644 --- a/src/main/java/com/apideck/unify/models/components/PayrollsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/PayrollsFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,42 +17,38 @@ public class PayrollsFilter { * Return payrolls whose pay period is after the start date */ @SpeakeasyMetadata("queryParam:name=start_date") - private Optional startDate; + private String startDate; /** * Return payrolls whose pay period is before the end date */ @SpeakeasyMetadata("queryParam:name=end_date") - private Optional endDate; + private String endDate; @JsonCreator public PayrollsFilter( - Optional startDate, - Optional endDate) { - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); + @Nullable String startDate, + @Nullable String endDate) { this.startDate = startDate; this.endDate = endDate; } public PayrollsFilter() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * Return payrolls whose pay period is after the start date */ - @JsonIgnore public Optional startDate() { - return startDate; + return Optional.ofNullable(this.startDate); } /** * Return payrolls whose pay period is before the end date */ - @JsonIgnore public Optional endDate() { - return endDate; + return Optional.ofNullable(this.endDate); } public static Builder builder() { @@ -63,41 +59,21 @@ public static Builder builder() { /** * Return payrolls whose pay period is after the start date */ - public PayrollsFilter withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - - - /** - * Return payrolls whose pay period is after the start date - */ - public PayrollsFilter withStartDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public PayrollsFilter withStartDate(@Nullable String startDate) { this.startDate = startDate; return this; } - /** - * Return payrolls whose pay period is before the end date - */ - public PayrollsFilter withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * Return payrolls whose pay period is before the end date */ - public PayrollsFilter withEndDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public PayrollsFilter withEndDate(@Nullable String endDate) { this.endDate = endDate; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -128,54 +104,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional startDate = Optional.empty(); + private String startDate; - private Optional endDate = Optional.empty(); + private String endDate; private Builder() { // force use of static builder() method } - /** * Return payrolls whose pay period is after the start date */ - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - - /** - * Return payrolls whose pay period is after the start date - */ - public Builder startDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable String startDate) { this.startDate = startDate; return this; } - - /** - * Return payrolls whose pay period is before the end date - */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * Return payrolls whose pay period is before the end date */ - public Builder endDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable String endDate) { this.endDate = endDate; return this; } public PayrollsFilter build() { - return new PayrollsFilter( startDate, endDate); } diff --git a/src/main/java/com/apideck/unify/models/components/Permissions.java b/src/main/java/com/apideck/unify/models/components/Permissions.java index 84f13f4d..28c79710 100644 --- a/src/main/java/com/apideck/unify/models/components/Permissions.java +++ b/src/main/java/com/apideck/unify/models/components/Permissions.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -25,25 +25,23 @@ public class Permissions { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("download") - private Optional download; + private Boolean download; @JsonCreator public Permissions( - @JsonProperty("download") Optional download) { - Utils.checkNotNull(download, "download"); + @JsonProperty("download") @Nullable Boolean download) { this.download = download; } public Permissions() { - this(Optional.empty()); + this(null); } /** * Whether the current user can download this file. */ - @JsonIgnore public Optional download() { - return download; + return Optional.ofNullable(this.download); } public static Builder builder() { @@ -54,22 +52,12 @@ public static Builder builder() { /** * Whether the current user can download this file. */ - public Permissions withDownload(boolean download) { - Utils.checkNotNull(download, "download"); - this.download = Optional.ofNullable(download); - return this; - } - - - /** - * Whether the current user can download this file. - */ - public Permissions withDownload(Optional download) { - Utils.checkNotNull(download, "download"); + public Permissions withDownload(@Nullable Boolean download) { this.download = download; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -98,33 +86,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional download = Optional.empty(); + private Boolean download; private Builder() { // force use of static builder() method } - - /** - * Whether the current user can download this file. - */ - public Builder download(boolean download) { - Utils.checkNotNull(download, "download"); - this.download = Optional.ofNullable(download); - return this; - } - /** * Whether the current user can download this file. */ - public Builder download(Optional download) { - Utils.checkNotNull(download, "download"); + public Builder download(@Nullable Boolean download) { this.download = download; return this; } public Permissions build() { - return new Permissions( download); } diff --git a/src/main/java/com/apideck/unify/models/components/Person.java b/src/main/java/com/apideck/unify/models/components/Person.java index dcaaba40..5843817b 100644 --- a/src/main/java/com/apideck/unify/models/components/Person.java +++ b/src/main/java/com/apideck/unify/models/components/Person.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -52,7 +52,7 @@ public class Person { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("gender") - private JsonNullable gender; + private JsonNullable gender; /** * Initials of the person @@ -80,117 +80,106 @@ public class Person { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; @JsonCreator public Person( - @JsonProperty("id") JsonNullable id, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("gender") JsonNullable gender, - @JsonProperty("initials") JsonNullable initials, - @JsonProperty("birthday") JsonNullable birthday, - @JsonProperty("deceased_on") JsonNullable deceasedOn, - @JsonProperty("custom_mappings") JsonNullable> customMappings) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(gender, "gender"); - Utils.checkNotNull(initials, "initials"); - Utils.checkNotNull(birthday, "birthday"); - Utils.checkNotNull(deceasedOn, "deceasedOn"); - Utils.checkNotNull(customMappings, "customMappings"); - this.id = id; - this.firstName = firstName; - this.lastName = lastName; - this.middleName = middleName; - this.gender = gender; - this.initials = initials; - this.birthday = birthday; - this.deceasedOn = deceasedOn; - this.customMappings = customMappings; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("gender") @Nullable JsonNullable gender, + @JsonProperty("initials") @Nullable JsonNullable initials, + @JsonProperty("birthday") @Nullable JsonNullable birthday, + @JsonProperty("deceased_on") @Nullable JsonNullable deceasedOn, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.gender = Optional.ofNullable(gender) + .orElse(JsonNullable.undefined()); + this.initials = Optional.ofNullable(initials) + .orElse(JsonNullable.undefined()); + this.birthday = Optional.ofNullable(birthday) + .orElse(JsonNullable.undefined()); + this.deceasedOn = Optional.ofNullable(deceasedOn) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); } public Person() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Middle name of the person. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The gender represents the gender identity of a person. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable gender() { - return (JsonNullable) gender; + return this.gender; } /** * Initials of the person */ - @JsonIgnore public JsonNullable initials() { - return initials; + return this.initials; } /** * Date of birth */ - @JsonIgnore public JsonNullable birthday() { - return birthday; + return this.birthday; } /** * Date of death */ - @JsonIgnore public JsonNullable deceasedOn() { - return deceasedOn; + return this.deceasedOn; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } public static Builder builder() { @@ -201,164 +190,83 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Person withId(String id) { - Utils.checkNotNull(id, "id"); + public Person withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Person withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The first name of the person. */ - public Person withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Person withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Person withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public Person withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Person withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Person withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Middle name of the person. */ - public Person withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Person withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Person withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The gender represents the gender identity of a person. */ - public Person withGender(Gender gender) { - Utils.checkNotNull(gender, "gender"); + public Person withGender(@Nullable Gender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender represents the gender identity of a person. - */ - public Person withGender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } /** * Initials of the person */ - public Person withInitials(String initials) { - Utils.checkNotNull(initials, "initials"); + public Person withInitials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * Initials of the person - */ - public Person withInitials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } /** * Date of birth */ - public Person withBirthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Person withBirthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * Date of birth - */ - public Person withBirthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } /** * Date of death */ - public Person withDeceasedOn(LocalDate deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); + public Person withDeceasedOn(@Nullable LocalDate deceasedOn) { this.deceasedOn = JsonNullable.of(deceasedOn); return this; } - /** - * Date of death - */ - public Person withDeceasedOn(JsonNullable deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); - this.deceasedOn = deceasedOn; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Person withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Person withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Person withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -406,201 +314,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable gender = JsonNullable.undefined(); + private JsonNullable gender; - private JsonNullable initials = JsonNullable.undefined(); + private JsonNullable initials; - private JsonNullable birthday = JsonNullable.undefined(); + private JsonNullable birthday; - private JsonNullable deceasedOn = JsonNullable.undefined(); + private JsonNullable deceasedOn; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for an object. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Middle name of the person. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The gender represents the gender identity of a person. */ - public Builder gender(Gender gender) { - Utils.checkNotNull(gender, "gender"); + public Builder gender(@Nullable Gender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender represents the gender identity of a person. - */ - public Builder gender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } - - /** * Initials of the person */ - public Builder initials(String initials) { - Utils.checkNotNull(initials, "initials"); + public Builder initials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * Initials of the person - */ - public Builder initials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } - - /** * Date of birth */ - public Builder birthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Builder birthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * Date of birth - */ - public Builder birthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - /** * Date of death */ - public Builder deceasedOn(LocalDate deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); + public Builder deceasedOn(@Nullable LocalDate deceasedOn) { this.deceasedOn = JsonNullable.of(deceasedOn); return this; } - /** - * Date of death - */ - public Builder deceasedOn(JsonNullable deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); - this.deceasedOn = deceasedOn; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - public Person build() { - return new Person( id, firstName, lastName, middleName, gender, initials, diff --git a/src/main/java/com/apideck/unify/models/components/PersonInput.java b/src/main/java/com/apideck/unify/models/components/PersonInput.java index c4d5a132..3d32b1e7 100644 --- a/src/main/java/com/apideck/unify/models/components/PersonInput.java +++ b/src/main/java/com/apideck/unify/models/components/PersonInput.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -43,7 +43,7 @@ public class PersonInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("gender") - private JsonNullable gender; + private JsonNullable gender; /** * Initials of the person @@ -68,90 +68,82 @@ public class PersonInput { @JsonCreator public PersonInput( - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("gender") JsonNullable gender, - @JsonProperty("initials") JsonNullable initials, - @JsonProperty("birthday") JsonNullable birthday, - @JsonProperty("deceased_on") JsonNullable deceasedOn) { - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(gender, "gender"); - Utils.checkNotNull(initials, "initials"); - Utils.checkNotNull(birthday, "birthday"); - Utils.checkNotNull(deceasedOn, "deceasedOn"); - this.firstName = firstName; - this.lastName = lastName; - this.middleName = middleName; - this.gender = gender; - this.initials = initials; - this.birthday = birthday; - this.deceasedOn = deceasedOn; + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("gender") @Nullable JsonNullable gender, + @JsonProperty("initials") @Nullable JsonNullable initials, + @JsonProperty("birthday") @Nullable JsonNullable birthday, + @JsonProperty("deceased_on") @Nullable JsonNullable deceasedOn) { + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.gender = Optional.ofNullable(gender) + .orElse(JsonNullable.undefined()); + this.initials = Optional.ofNullable(initials) + .orElse(JsonNullable.undefined()); + this.birthday = Optional.ofNullable(birthday) + .orElse(JsonNullable.undefined()); + this.deceasedOn = Optional.ofNullable(deceasedOn) + .orElse(JsonNullable.undefined()); } public PersonInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null); } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * Middle name of the person. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The gender represents the gender identity of a person. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable gender() { - return (JsonNullable) gender; + return this.gender; } /** * Initials of the person */ - @JsonIgnore public JsonNullable initials() { - return initials; + return this.initials; } /** * Date of birth */ - @JsonIgnore public JsonNullable birthday() { - return birthday; + return this.birthday; } /** * Date of death */ - @JsonIgnore public JsonNullable deceasedOn() { - return deceasedOn; + return this.deceasedOn; } public static Builder builder() { @@ -162,128 +154,65 @@ public static Builder builder() { /** * The first name of the person. */ - public PersonInput withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public PersonInput withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public PersonInput withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public PersonInput withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public PersonInput withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public PersonInput withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * Middle name of the person. */ - public PersonInput withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public PersonInput withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public PersonInput withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The gender represents the gender identity of a person. */ - public PersonInput withGender(Gender gender) { - Utils.checkNotNull(gender, "gender"); + public PersonInput withGender(@Nullable Gender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender represents the gender identity of a person. - */ - public PersonInput withGender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } /** * Initials of the person */ - public PersonInput withInitials(String initials) { - Utils.checkNotNull(initials, "initials"); + public PersonInput withInitials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * Initials of the person - */ - public PersonInput withInitials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } /** * Date of birth */ - public PersonInput withBirthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public PersonInput withBirthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * Date of birth - */ - public PersonInput withBirthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } /** * Date of death */ - public PersonInput withDeceasedOn(LocalDate deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); + public PersonInput withDeceasedOn(@Nullable LocalDate deceasedOn) { this.deceasedOn = JsonNullable.of(deceasedOn); return this; } - /** - * Date of death - */ - public PersonInput withDeceasedOn(JsonNullable deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); - this.deceasedOn = deceasedOn; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -327,159 +256,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable gender = JsonNullable.undefined(); + private JsonNullable gender; - private JsonNullable initials = JsonNullable.undefined(); + private JsonNullable initials; - private JsonNullable birthday = JsonNullable.undefined(); + private JsonNullable birthday; - private JsonNullable deceasedOn = JsonNullable.undefined(); + private JsonNullable deceasedOn; private Builder() { // force use of static builder() method } - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * Middle name of the person. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The gender represents the gender identity of a person. */ - public Builder gender(Gender gender) { - Utils.checkNotNull(gender, "gender"); + public Builder gender(@Nullable Gender gender) { this.gender = JsonNullable.of(gender); return this; } - /** - * The gender represents the gender identity of a person. - */ - public Builder gender(JsonNullable gender) { - Utils.checkNotNull(gender, "gender"); - this.gender = gender; - return this; - } - - /** * Initials of the person */ - public Builder initials(String initials) { - Utils.checkNotNull(initials, "initials"); + public Builder initials(@Nullable String initials) { this.initials = JsonNullable.of(initials); return this; } - /** - * Initials of the person - */ - public Builder initials(JsonNullable initials) { - Utils.checkNotNull(initials, "initials"); - this.initials = initials; - return this; - } - - /** * Date of birth */ - public Builder birthday(LocalDate birthday) { - Utils.checkNotNull(birthday, "birthday"); + public Builder birthday(@Nullable LocalDate birthday) { this.birthday = JsonNullable.of(birthday); return this; } - /** - * Date of birth - */ - public Builder birthday(JsonNullable birthday) { - Utils.checkNotNull(birthday, "birthday"); - this.birthday = birthday; - return this; - } - - /** * Date of death */ - public Builder deceasedOn(LocalDate deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); + public Builder deceasedOn(@Nullable LocalDate deceasedOn) { this.deceasedOn = JsonNullable.of(deceasedOn); return this; } - /** - * Date of death - */ - public Builder deceasedOn(JsonNullable deceasedOn) { - Utils.checkNotNull(deceasedOn, "deceasedOn"); - this.deceasedOn = deceasedOn; - return this; - } - public PersonInput build() { - return new PersonInput( firstName, lastName, middleName, gender, initials, birthday, diff --git a/src/main/java/com/apideck/unify/models/components/PhoneNumber.java b/src/main/java/com/apideck/unify/models/components/PhoneNumber.java index c662d5b6..588eb2b3 100644 --- a/src/main/java/com/apideck/unify/models/components/PhoneNumber.java +++ b/src/main/java/com/apideck/unify/models/components/PhoneNumber.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -55,83 +56,76 @@ public class PhoneNumber { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; @JsonCreator public PhoneNumber( - @JsonProperty("id") JsonNullable id, - @JsonProperty("country_code") JsonNullable countryCode, - @JsonProperty("area_code") JsonNullable areaCode, - @JsonProperty("number") String number, - @JsonProperty("extension") JsonNullable extension, - @JsonProperty("type") JsonNullable type) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(countryCode, "countryCode"); - Utils.checkNotNull(areaCode, "areaCode"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(extension, "extension"); - Utils.checkNotNull(type, "type"); - this.id = id; - this.countryCode = countryCode; - this.areaCode = areaCode; - this.number = number; - this.extension = extension; - this.type = type; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("country_code") @Nullable JsonNullable countryCode, + @JsonProperty("area_code") @Nullable JsonNullable areaCode, + @JsonProperty("number") @Nonnull String number, + @JsonProperty("extension") @Nullable JsonNullable extension, + @JsonProperty("type") @Nullable JsonNullable type) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.countryCode = Optional.ofNullable(countryCode) + .orElse(JsonNullable.undefined()); + this.areaCode = Optional.ofNullable(areaCode) + .orElse(JsonNullable.undefined()); + this.number = Optional.ofNullable(number) + .orElseThrow(() -> new IllegalArgumentException("number cannot be null")); + this.extension = Optional.ofNullable(extension) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); } public PhoneNumber( - String number) { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - number, JsonNullable.undefined(), JsonNullable.undefined()); + @Nonnull String number) { + this(null, null, null, + number, null, null); } /** * Unique identifier of the phone number */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The country code of the phone number, e.g. +1 */ - @JsonIgnore public JsonNullable countryCode() { - return countryCode; + return this.countryCode; } /** * The area code of the phone number, e.g. 323 */ - @JsonIgnore public JsonNullable areaCode() { - return areaCode; + return this.areaCode; } /** * The phone number */ - @JsonIgnore public String number() { - return number; + return this.number; } /** * The extension of the phone number */ - @JsonIgnore public JsonNullable extension() { - return extension; + return this.extension; } /** * The type of phone number */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } public static Builder builder() { @@ -142,101 +136,56 @@ public static Builder builder() { /** * Unique identifier of the phone number */ - public PhoneNumber withId(String id) { - Utils.checkNotNull(id, "id"); + public PhoneNumber withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier of the phone number - */ - public PhoneNumber withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The country code of the phone number, e.g. +1 */ - public PhoneNumber withCountryCode(String countryCode) { - Utils.checkNotNull(countryCode, "countryCode"); + public PhoneNumber withCountryCode(@Nullable String countryCode) { this.countryCode = JsonNullable.of(countryCode); return this; } - /** - * The country code of the phone number, e.g. +1 - */ - public PhoneNumber withCountryCode(JsonNullable countryCode) { - Utils.checkNotNull(countryCode, "countryCode"); - this.countryCode = countryCode; - return this; - } /** * The area code of the phone number, e.g. 323 */ - public PhoneNumber withAreaCode(String areaCode) { - Utils.checkNotNull(areaCode, "areaCode"); + public PhoneNumber withAreaCode(@Nullable String areaCode) { this.areaCode = JsonNullable.of(areaCode); return this; } - /** - * The area code of the phone number, e.g. 323 - */ - public PhoneNumber withAreaCode(JsonNullable areaCode) { - Utils.checkNotNull(areaCode, "areaCode"); - this.areaCode = areaCode; - return this; - } /** * The phone number */ - public PhoneNumber withNumber(String number) { - Utils.checkNotNull(number, "number"); - this.number = number; + public PhoneNumber withNumber(@Nonnull String number) { + this.number = Utils.checkNotNull(number, "number"); return this; } + /** * The extension of the phone number */ - public PhoneNumber withExtension(String extension) { - Utils.checkNotNull(extension, "extension"); + public PhoneNumber withExtension(@Nullable String extension) { this.extension = JsonNullable.of(extension); return this; } - /** - * The extension of the phone number - */ - public PhoneNumber withExtension(JsonNullable extension) { - Utils.checkNotNull(extension, "extension"); - this.extension = extension; - return this; - } /** * The type of phone number */ - public PhoneNumber withType(PhoneNumberType type) { - Utils.checkNotNull(type, "type"); + public PhoneNumber withType(@Nullable PhoneNumberType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of phone number - */ - public PhoneNumber withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -277,129 +226,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable countryCode = JsonNullable.undefined(); + private JsonNullable countryCode; - private JsonNullable areaCode = JsonNullable.undefined(); + private JsonNullable areaCode; private String number; - private JsonNullable extension = JsonNullable.undefined(); + private JsonNullable extension; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; private Builder() { // force use of static builder() method } - /** * Unique identifier of the phone number */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier of the phone number - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The country code of the phone number, e.g. +1 */ - public Builder countryCode(String countryCode) { - Utils.checkNotNull(countryCode, "countryCode"); + public Builder countryCode(@Nullable String countryCode) { this.countryCode = JsonNullable.of(countryCode); return this; } - /** - * The country code of the phone number, e.g. +1 - */ - public Builder countryCode(JsonNullable countryCode) { - Utils.checkNotNull(countryCode, "countryCode"); - this.countryCode = countryCode; - return this; - } - - /** * The area code of the phone number, e.g. 323 */ - public Builder areaCode(String areaCode) { - Utils.checkNotNull(areaCode, "areaCode"); + public Builder areaCode(@Nullable String areaCode) { this.areaCode = JsonNullable.of(areaCode); return this; } - /** - * The area code of the phone number, e.g. 323 - */ - public Builder areaCode(JsonNullable areaCode) { - Utils.checkNotNull(areaCode, "areaCode"); - this.areaCode = areaCode; - return this; - } - - /** * The phone number */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); - this.number = number; + public Builder number(@Nonnull String number) { + this.number = Utils.checkNotNull(number, "number"); return this; } - /** * The extension of the phone number */ - public Builder extension(String extension) { - Utils.checkNotNull(extension, "extension"); + public Builder extension(@Nullable String extension) { this.extension = JsonNullable.of(extension); return this; } - /** - * The extension of the phone number - */ - public Builder extension(JsonNullable extension) { - Utils.checkNotNull(extension, "extension"); - this.extension = extension; - return this; - } - - /** * The type of phone number */ - public Builder type(PhoneNumberType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable PhoneNumberType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of phone number - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - public PhoneNumber build() { - return new PhoneNumber( id, countryCode, areaCode, number, extension, type); diff --git a/src/main/java/com/apideck/unify/models/components/Pipeline.java b/src/main/java/com/apideck/unify/models/components/Pipeline.java index 206370bb..02ce35f6 100644 --- a/src/main/java/com/apideck/unify/models/components/Pipeline.java +++ b/src/main/java/com/apideck/unify/models/components/Pipeline.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -26,7 +26,7 @@ public class Pipeline { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the Pipeline. @@ -39,21 +39,21 @@ public class Pipeline { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Whether the Pipeline is archived or not. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("archived") - private Optional archived; + private Boolean archived; /** * Whether the Pipeline is active or not. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("active") - private Optional active; + private Boolean active; /** * The order in which the Pipeline is displayed in the UI. @@ -67,14 +67,14 @@ public class Pipeline { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("win_probability_enabled") - private Optional winProbabilityEnabled; + private Boolean winProbabilityEnabled; /** * The Pipeline Stages. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("stages") - private Optional> stages; + private List stages; /** * The date and time when the object was last updated. @@ -95,142 +95,122 @@ public class Pipeline { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Pipeline( - @JsonProperty("id") Optional id, - @JsonProperty("name") String name, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("archived") Optional archived, - @JsonProperty("active") Optional active, - @JsonProperty("display_order") JsonNullable displayOrder, - @JsonProperty("win_probability_enabled") Optional winProbabilityEnabled, - @JsonProperty("stages") Optional> stages, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(archived, "archived"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(displayOrder, "displayOrder"); - Utils.checkNotNull(winProbabilityEnabled, "winProbabilityEnabled"); - Utils.checkNotNull(stages, "stages"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nonnull String name, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("archived") @Nullable Boolean archived, + @JsonProperty("active") @Nullable Boolean active, + @JsonProperty("display_order") @Nullable JsonNullable displayOrder, + @JsonProperty("win_probability_enabled") @Nullable Boolean winProbabilityEnabled, + @JsonProperty("stages") @Nullable List stages, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.name = name; - this.currency = currency; + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); this.archived = archived; this.active = active; - this.displayOrder = displayOrder; + this.displayOrder = Optional.ofNullable(displayOrder) + .orElse(JsonNullable.undefined()); this.winProbabilityEnabled = winProbabilityEnabled; this.stages = stages; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Pipeline( - String name) { - this(Optional.empty(), name, JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + @Nonnull String name) { + this(null, name, null, + null, null, null, + null, null, null, + null, null); } /** * The unique identifier of the Pipeline. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the Pipeline. */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Whether the Pipeline is archived or not. */ - @JsonIgnore public Optional archived() { - return archived; + return Optional.ofNullable(this.archived); } /** * Whether the Pipeline is active or not. */ - @JsonIgnore public Optional active() { - return active; + return Optional.ofNullable(this.active); } /** * The order in which the Pipeline is displayed in the UI. */ - @JsonIgnore public JsonNullable displayOrder() { - return displayOrder; + return this.displayOrder; } /** * Whether the Pipeline has win probability enabled or not. */ - @JsonIgnore public Optional winProbabilityEnabled() { - return winProbabilityEnabled; + return Optional.ofNullable(this.winProbabilityEnabled); } /** * The Pipeline Stages. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> stages() { - return (Optional>) stages; + return Optional.ofNullable(this.stages); } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -241,55 +221,26 @@ public static Builder builder() { /** * The unique identifier of the Pipeline. */ - public Pipeline withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier of the Pipeline. - */ - public Pipeline withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Pipeline withId(@Nullable String id) { this.id = id; return this; } + /** * The name of the Pipeline. */ - public Pipeline withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Pipeline withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Pipeline withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = JsonNullable.of(currency); - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Pipeline withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** - * Whether the Pipeline is archived or not. - */ - public Pipeline withArchived(boolean archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = Optional.ofNullable(archived); + public Pipeline withCurrency(@Nullable Currency currency) { + this.currency = JsonNullable.of(currency); return this; } @@ -297,55 +248,26 @@ public Pipeline withArchived(boolean archived) { /** * Whether the Pipeline is archived or not. */ - public Pipeline withArchived(Optional archived) { - Utils.checkNotNull(archived, "archived"); + public Pipeline withArchived(@Nullable Boolean archived) { this.archived = archived; return this; } - /** - * Whether the Pipeline is active or not. - */ - public Pipeline withActive(boolean active) { - Utils.checkNotNull(active, "active"); - this.active = Optional.ofNullable(active); - return this; - } - /** * Whether the Pipeline is active or not. */ - public Pipeline withActive(Optional active) { - Utils.checkNotNull(active, "active"); + public Pipeline withActive(@Nullable Boolean active) { this.active = active; return this; } - /** - * The order in which the Pipeline is displayed in the UI. - */ - public Pipeline withDisplayOrder(long displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); - this.displayOrder = JsonNullable.of(displayOrder); - return this; - } /** * The order in which the Pipeline is displayed in the UI. */ - public Pipeline withDisplayOrder(JsonNullable displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); - this.displayOrder = displayOrder; - return this; - } - - /** - * Whether the Pipeline has win probability enabled or not. - */ - public Pipeline withWinProbabilityEnabled(boolean winProbabilityEnabled) { - Utils.checkNotNull(winProbabilityEnabled, "winProbabilityEnabled"); - this.winProbabilityEnabled = Optional.ofNullable(winProbabilityEnabled); + public Pipeline withDisplayOrder(@Nullable Long displayOrder) { + this.displayOrder = JsonNullable.of(displayOrder); return this; } @@ -353,86 +275,48 @@ public Pipeline withWinProbabilityEnabled(boolean winProbabilityEnabled) { /** * Whether the Pipeline has win probability enabled or not. */ - public Pipeline withWinProbabilityEnabled(Optional winProbabilityEnabled) { - Utils.checkNotNull(winProbabilityEnabled, "winProbabilityEnabled"); + public Pipeline withWinProbabilityEnabled(@Nullable Boolean winProbabilityEnabled) { this.winProbabilityEnabled = winProbabilityEnabled; return this; } - /** - * The Pipeline Stages. - */ - public Pipeline withStages(List stages) { - Utils.checkNotNull(stages, "stages"); - this.stages = Optional.ofNullable(stages); - return this; - } - /** * The Pipeline Stages. */ - public Pipeline withStages(Optional> stages) { - Utils.checkNotNull(stages, "stages"); + public Pipeline withStages(@Nullable List stages) { this.stages = stages; return this; } + /** * The date and time when the object was last updated. */ - public Pipeline withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Pipeline withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Pipeline withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Pipeline withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Pipeline withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Pipeline withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Pipeline withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Pipeline withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Pipeline withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -484,234 +368,121 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private String name; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private Optional archived = Optional.empty(); + private Boolean archived; - private Optional active = Optional.empty(); + private Boolean active; - private JsonNullable displayOrder = JsonNullable.undefined(); + private JsonNullable displayOrder; - private Optional winProbabilityEnabled = Optional.empty(); + private Boolean winProbabilityEnabled; - private Optional> stages = Optional.empty(); + private List stages; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The unique identifier of the Pipeline. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * The unique identifier of the Pipeline. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the Pipeline. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - /** - * Whether the Pipeline is archived or not. - */ - public Builder archived(boolean archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = Optional.ofNullable(archived); - return this; - } - /** * Whether the Pipeline is archived or not. */ - public Builder archived(Optional archived) { - Utils.checkNotNull(archived, "archived"); + public Builder archived(@Nullable Boolean archived) { this.archived = archived; return this; } - /** * Whether the Pipeline is active or not. */ - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); - this.active = Optional.ofNullable(active); - return this; - } - - /** - * Whether the Pipeline is active or not. - */ - public Builder active(Optional active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = active; return this; } - /** * The order in which the Pipeline is displayed in the UI. */ - public Builder displayOrder(long displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); + public Builder displayOrder(@Nullable Long displayOrder) { this.displayOrder = JsonNullable.of(displayOrder); return this; } - /** - * The order in which the Pipeline is displayed in the UI. - */ - public Builder displayOrder(JsonNullable displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); - this.displayOrder = displayOrder; - return this; - } - - - /** - * Whether the Pipeline has win probability enabled or not. - */ - public Builder winProbabilityEnabled(boolean winProbabilityEnabled) { - Utils.checkNotNull(winProbabilityEnabled, "winProbabilityEnabled"); - this.winProbabilityEnabled = Optional.ofNullable(winProbabilityEnabled); - return this; - } - /** * Whether the Pipeline has win probability enabled or not. */ - public Builder winProbabilityEnabled(Optional winProbabilityEnabled) { - Utils.checkNotNull(winProbabilityEnabled, "winProbabilityEnabled"); + public Builder winProbabilityEnabled(@Nullable Boolean winProbabilityEnabled) { this.winProbabilityEnabled = winProbabilityEnabled; return this; } - /** * The Pipeline Stages. */ - public Builder stages(List stages) { - Utils.checkNotNull(stages, "stages"); - this.stages = Optional.ofNullable(stages); - return this; - } - - /** - * The Pipeline Stages. - */ - public Builder stages(Optional> stages) { - Utils.checkNotNull(stages, "stages"); + public Builder stages(@Nullable List stages) { this.stages = stages; return this; } - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Pipeline build() { - return new Pipeline( id, name, currency, archived, active, displayOrder, diff --git a/src/main/java/com/apideck/unify/models/components/PipelineInput.java b/src/main/java/com/apideck/unify/models/components/PipelineInput.java index ce6f1b3a..043f000c 100644 --- a/src/main/java/com/apideck/unify/models/components/PipelineInput.java +++ b/src/main/java/com/apideck/unify/models/components/PipelineInput.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,7 +25,7 @@ public class PipelineInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the Pipeline. @@ -38,21 +38,21 @@ public class PipelineInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Whether the Pipeline is archived or not. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("archived") - private Optional archived; + private Boolean archived; /** * Whether the Pipeline is active or not. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("active") - private Optional active; + private Boolean active; /** * The order in which the Pipeline is displayed in the UI. @@ -66,133 +66,115 @@ public class PipelineInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("win_probability_enabled") - private Optional winProbabilityEnabled; + private Boolean winProbabilityEnabled; /** * The Pipeline Stages. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("stages") - private Optional> stages; + private List stages; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public PipelineInput( - @JsonProperty("id") Optional id, - @JsonProperty("name") String name, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("archived") Optional archived, - @JsonProperty("active") Optional active, - @JsonProperty("display_order") JsonNullable displayOrder, - @JsonProperty("win_probability_enabled") Optional winProbabilityEnabled, - @JsonProperty("stages") Optional> stages, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(archived, "archived"); - Utils.checkNotNull(active, "active"); - Utils.checkNotNull(displayOrder, "displayOrder"); - Utils.checkNotNull(winProbabilityEnabled, "winProbabilityEnabled"); - Utils.checkNotNull(stages, "stages"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nonnull String name, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("archived") @Nullable Boolean archived, + @JsonProperty("active") @Nullable Boolean active, + @JsonProperty("display_order") @Nullable JsonNullable displayOrder, + @JsonProperty("win_probability_enabled") @Nullable Boolean winProbabilityEnabled, + @JsonProperty("stages") @Nullable List stages, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.name = name; - this.currency = currency; + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); this.archived = archived; this.active = active; - this.displayOrder = displayOrder; + this.displayOrder = Optional.ofNullable(displayOrder) + .orElse(JsonNullable.undefined()); this.winProbabilityEnabled = winProbabilityEnabled; this.stages = stages; this.passThrough = passThrough; } public PipelineInput( - String name) { - this(Optional.empty(), name, JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty()); + @Nonnull String name) { + this(null, name, null, + null, null, null, + null, null, null); } /** * The unique identifier of the Pipeline. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the Pipeline. */ - @JsonIgnore public String name() { - return name; + return this.name; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Whether the Pipeline is archived or not. */ - @JsonIgnore public Optional archived() { - return archived; + return Optional.ofNullable(this.archived); } /** * Whether the Pipeline is active or not. */ - @JsonIgnore public Optional active() { - return active; + return Optional.ofNullable(this.active); } /** * The order in which the Pipeline is displayed in the UI. */ - @JsonIgnore public JsonNullable displayOrder() { - return displayOrder; + return this.displayOrder; } /** * Whether the Pipeline has win probability enabled or not. */ - @JsonIgnore public Optional winProbabilityEnabled() { - return winProbabilityEnabled; + return Optional.ofNullable(this.winProbabilityEnabled); } /** * The Pipeline Stages. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> stages() { - return (Optional>) stages; + return Optional.ofNullable(this.stages); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -203,55 +185,26 @@ public static Builder builder() { /** * The unique identifier of the Pipeline. */ - public PipelineInput withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier of the Pipeline. - */ - public PipelineInput withId(Optional id) { - Utils.checkNotNull(id, "id"); + public PipelineInput withId(@Nullable String id) { this.id = id; return this; } + /** * The name of the Pipeline. */ - public PipelineInput withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public PipelineInput withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public PipelineInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = JsonNullable.of(currency); - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public PipelineInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** - * Whether the Pipeline is archived or not. - */ - public PipelineInput withArchived(boolean archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = Optional.ofNullable(archived); + public PipelineInput withCurrency(@Nullable Currency currency) { + this.currency = JsonNullable.of(currency); return this; } @@ -259,55 +212,26 @@ public PipelineInput withArchived(boolean archived) { /** * Whether the Pipeline is archived or not. */ - public PipelineInput withArchived(Optional archived) { - Utils.checkNotNull(archived, "archived"); + public PipelineInput withArchived(@Nullable Boolean archived) { this.archived = archived; return this; } - /** - * Whether the Pipeline is active or not. - */ - public PipelineInput withActive(boolean active) { - Utils.checkNotNull(active, "active"); - this.active = Optional.ofNullable(active); - return this; - } - /** * Whether the Pipeline is active or not. */ - public PipelineInput withActive(Optional active) { - Utils.checkNotNull(active, "active"); + public PipelineInput withActive(@Nullable Boolean active) { this.active = active; return this; } - /** - * The order in which the Pipeline is displayed in the UI. - */ - public PipelineInput withDisplayOrder(long displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); - this.displayOrder = JsonNullable.of(displayOrder); - return this; - } /** * The order in which the Pipeline is displayed in the UI. */ - public PipelineInput withDisplayOrder(JsonNullable displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); - this.displayOrder = displayOrder; - return this; - } - - /** - * Whether the Pipeline has win probability enabled or not. - */ - public PipelineInput withWinProbabilityEnabled(boolean winProbabilityEnabled) { - Utils.checkNotNull(winProbabilityEnabled, "winProbabilityEnabled"); - this.winProbabilityEnabled = Optional.ofNullable(winProbabilityEnabled); + public PipelineInput withDisplayOrder(@Nullable Long displayOrder) { + this.displayOrder = JsonNullable.of(displayOrder); return this; } @@ -315,50 +239,30 @@ public PipelineInput withWinProbabilityEnabled(boolean winProbabilityEnabled) { /** * Whether the Pipeline has win probability enabled or not. */ - public PipelineInput withWinProbabilityEnabled(Optional winProbabilityEnabled) { - Utils.checkNotNull(winProbabilityEnabled, "winProbabilityEnabled"); + public PipelineInput withWinProbabilityEnabled(@Nullable Boolean winProbabilityEnabled) { this.winProbabilityEnabled = winProbabilityEnabled; return this; } - /** - * The Pipeline Stages. - */ - public PipelineInput withStages(List stages) { - Utils.checkNotNull(stages, "stages"); - this.stages = Optional.ofNullable(stages); - return this; - } - /** * The Pipeline Stages. */ - public PipelineInput withStages(Optional> stages) { - Utils.checkNotNull(stages, "stages"); + public PipelineInput withStages(@Nullable List stages) { this.stages = stages; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public PipelineInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public PipelineInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public PipelineInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -405,192 +309,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private String name; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private Optional archived = Optional.empty(); + private Boolean archived; - private Optional active = Optional.empty(); + private Boolean active; - private JsonNullable displayOrder = JsonNullable.undefined(); + private JsonNullable displayOrder; - private Optional winProbabilityEnabled = Optional.empty(); + private Boolean winProbabilityEnabled; - private Optional> stages = Optional.empty(); + private List stages; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The unique identifier of the Pipeline. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * The unique identifier of the Pipeline. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the Pipeline. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - /** - * Whether the Pipeline is archived or not. - */ - public Builder archived(boolean archived) { - Utils.checkNotNull(archived, "archived"); - this.archived = Optional.ofNullable(archived); - return this; - } - /** * Whether the Pipeline is archived or not. */ - public Builder archived(Optional archived) { - Utils.checkNotNull(archived, "archived"); + public Builder archived(@Nullable Boolean archived) { this.archived = archived; return this; } - - /** - * Whether the Pipeline is active or not. - */ - public Builder active(boolean active) { - Utils.checkNotNull(active, "active"); - this.active = Optional.ofNullable(active); - return this; - } - /** * Whether the Pipeline is active or not. */ - public Builder active(Optional active) { - Utils.checkNotNull(active, "active"); + public Builder active(@Nullable Boolean active) { this.active = active; return this; } - /** * The order in which the Pipeline is displayed in the UI. */ - public Builder displayOrder(long displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); + public Builder displayOrder(@Nullable Long displayOrder) { this.displayOrder = JsonNullable.of(displayOrder); return this; } - /** - * The order in which the Pipeline is displayed in the UI. - */ - public Builder displayOrder(JsonNullable displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); - this.displayOrder = displayOrder; - return this; - } - - - /** - * Whether the Pipeline has win probability enabled or not. - */ - public Builder winProbabilityEnabled(boolean winProbabilityEnabled) { - Utils.checkNotNull(winProbabilityEnabled, "winProbabilityEnabled"); - this.winProbabilityEnabled = Optional.ofNullable(winProbabilityEnabled); - return this; - } - /** * Whether the Pipeline has win probability enabled or not. */ - public Builder winProbabilityEnabled(Optional winProbabilityEnabled) { - Utils.checkNotNull(winProbabilityEnabled, "winProbabilityEnabled"); + public Builder winProbabilityEnabled(@Nullable Boolean winProbabilityEnabled) { this.winProbabilityEnabled = winProbabilityEnabled; return this; } - /** * The Pipeline Stages. */ - public Builder stages(List stages) { - Utils.checkNotNull(stages, "stages"); - this.stages = Optional.ofNullable(stages); - return this; - } - - /** - * The Pipeline Stages. - */ - public Builder stages(Optional> stages) { - Utils.checkNotNull(stages, "stages"); + public Builder stages(@Nullable List stages) { this.stages = stages; return this; } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public PipelineInput build() { - return new PipelineInput( id, name, currency, archived, active, displayOrder, diff --git a/src/main/java/com/apideck/unify/models/components/PipelineStages.java b/src/main/java/com/apideck/unify/models/components/PipelineStages.java index 7c0e7b6e..106ba5b5 100644 --- a/src/main/java/com/apideck/unify/models/components/PipelineStages.java +++ b/src/main/java/com/apideck/unify/models/components/PipelineStages.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -46,55 +47,51 @@ public class PipelineStages { @JsonCreator public PipelineStages( - @JsonProperty("name") JsonNullable name, - @JsonProperty("value") JsonNullable value, - @JsonProperty("win_probability") JsonNullable winProbability, - @JsonProperty("display_order") JsonNullable displayOrder) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(value, "value"); - Utils.checkNotNull(winProbability, "winProbability"); - Utils.checkNotNull(displayOrder, "displayOrder"); - this.name = name; - this.value = value; - this.winProbability = winProbability; - this.displayOrder = displayOrder; + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("value") @Nullable JsonNullable value, + @JsonProperty("win_probability") @Nullable JsonNullable winProbability, + @JsonProperty("display_order") @Nullable JsonNullable displayOrder) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.value = Optional.ofNullable(value) + .orElse(JsonNullable.undefined()); + this.winProbability = Optional.ofNullable(winProbability) + .orElse(JsonNullable.undefined()); + this.displayOrder = Optional.ofNullable(displayOrder) + .orElse(JsonNullable.undefined()); } public PipelineStages() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null); } /** * The name of the Pipeline Stage. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The value of the Pipeline Stage. */ - @JsonIgnore public JsonNullable value() { - return value; + return this.value; } /** * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. */ - @JsonIgnore public JsonNullable winProbability() { - return winProbability; + return this.winProbability; } /** * The order in which the Pipeline Stage is displayed in the UI. */ - @JsonIgnore public JsonNullable displayOrder() { - return displayOrder; + return this.displayOrder; } public static Builder builder() { @@ -105,74 +102,38 @@ public static Builder builder() { /** * The name of the Pipeline Stage. */ - public PipelineStages withName(String name) { - Utils.checkNotNull(name, "name"); + public PipelineStages withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the Pipeline Stage. - */ - public PipelineStages withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The value of the Pipeline Stage. */ - public PipelineStages withValue(String value) { - Utils.checkNotNull(value, "value"); + public PipelineStages withValue(@Nullable String value) { this.value = JsonNullable.of(value); return this; } - /** - * The value of the Pipeline Stage. - */ - public PipelineStages withValue(JsonNullable value) { - Utils.checkNotNull(value, "value"); - this.value = value; - return this; - } /** * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. */ - public PipelineStages withWinProbability(long winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); + public PipelineStages withWinProbability(@Nullable Long winProbability) { this.winProbability = JsonNullable.of(winProbability); return this; } - /** - * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. - */ - public PipelineStages withWinProbability(JsonNullable winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); - this.winProbability = winProbability; - return this; - } /** * The order in which the Pipeline Stage is displayed in the UI. */ - public PipelineStages withDisplayOrder(long displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); + public PipelineStages withDisplayOrder(@Nullable Long displayOrder) { this.displayOrder = JsonNullable.of(displayOrder); return this; } - /** - * The order in which the Pipeline Stage is displayed in the UI. - */ - public PipelineStages withDisplayOrder(JsonNullable displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); - this.displayOrder = displayOrder; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -209,96 +170,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable value = JsonNullable.undefined(); + private JsonNullable value; - private JsonNullable winProbability = JsonNullable.undefined(); + private JsonNullable winProbability; - private JsonNullable displayOrder = JsonNullable.undefined(); + private JsonNullable displayOrder; private Builder() { // force use of static builder() method } - /** * The name of the Pipeline Stage. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the Pipeline Stage. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The value of the Pipeline Stage. */ - public Builder value(String value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable String value) { this.value = JsonNullable.of(value); return this; } - /** - * The value of the Pipeline Stage. - */ - public Builder value(JsonNullable value) { - Utils.checkNotNull(value, "value"); - this.value = value; - return this; - } - - /** * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. */ - public Builder winProbability(long winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); + public Builder winProbability(@Nullable Long winProbability) { this.winProbability = JsonNullable.of(winProbability); return this; } - /** - * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. - */ - public Builder winProbability(JsonNullable winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); - this.winProbability = winProbability; - return this; - } - - /** * The order in which the Pipeline Stage is displayed in the UI. */ - public Builder displayOrder(long displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); + public Builder displayOrder(@Nullable Long displayOrder) { this.displayOrder = JsonNullable.of(displayOrder); return this; } - /** - * The order in which the Pipeline Stage is displayed in the UI. - */ - public Builder displayOrder(JsonNullable displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); - this.displayOrder = displayOrder; - return this; - } - public PipelineStages build() { - return new PipelineStages( name, value, winProbability, displayOrder); diff --git a/src/main/java/com/apideck/unify/models/components/Price.java b/src/main/java/com/apideck/unify/models/components/Price.java index 9e56957c..6bd33442 100644 --- a/src/main/java/com/apideck/unify/models/components/Price.java +++ b/src/main/java/com/apideck/unify/models/components/Price.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,54 +23,48 @@ public class Price { @JsonInclude(Include.NON_ABSENT) @JsonProperty("per_unit") - private Optional perUnit; + private String perUnit; @JsonInclude(Include.NON_ABSENT) @JsonProperty("total_amount") - private Optional totalAmount; + private String totalAmount; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; @JsonCreator public Price( - @JsonProperty("per_unit") Optional perUnit, - @JsonProperty("total_amount") Optional totalAmount, - @JsonProperty("currency") JsonNullable currency) { - Utils.checkNotNull(perUnit, "perUnit"); - Utils.checkNotNull(totalAmount, "totalAmount"); - Utils.checkNotNull(currency, "currency"); + @JsonProperty("per_unit") @Nullable String perUnit, + @JsonProperty("total_amount") @Nullable String totalAmount, + @JsonProperty("currency") @Nullable JsonNullable currency) { this.perUnit = perUnit; this.totalAmount = totalAmount; - this.currency = currency; + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); } public Price() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null); } - @JsonIgnore public Optional perUnit() { - return perUnit; + return Optional.ofNullable(this.perUnit); } - @JsonIgnore public Optional totalAmount() { - return totalAmount; + return Optional.ofNullable(this.totalAmount); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } public static Builder builder() { @@ -79,49 +72,26 @@ public static Builder builder() { } - public Price withPerUnit(String perUnit) { - Utils.checkNotNull(perUnit, "perUnit"); - this.perUnit = Optional.ofNullable(perUnit); - return this; - } - - - public Price withPerUnit(Optional perUnit) { - Utils.checkNotNull(perUnit, "perUnit"); + public Price withPerUnit(@Nullable String perUnit) { this.perUnit = perUnit; return this; } - public Price withTotalAmount(String totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - - public Price withTotalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Price withTotalAmount(@Nullable String totalAmount) { this.totalAmount = totalAmount; return this; } + /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Price withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Price withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Price withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -155,63 +125,35 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional perUnit = Optional.empty(); + private String perUnit; - private Optional totalAmount = Optional.empty(); + private String totalAmount; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; private Builder() { // force use of static builder() method } - - public Builder perUnit(String perUnit) { - Utils.checkNotNull(perUnit, "perUnit"); - this.perUnit = Optional.ofNullable(perUnit); - return this; - } - - public Builder perUnit(Optional perUnit) { - Utils.checkNotNull(perUnit, "perUnit"); + public Builder perUnit(@Nullable String perUnit) { this.perUnit = perUnit; return this; } - - public Builder totalAmount(String totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); - this.totalAmount = Optional.ofNullable(totalAmount); - return this; - } - - public Builder totalAmount(Optional totalAmount) { - Utils.checkNotNull(totalAmount, "totalAmount"); + public Builder totalAmount(@Nullable String totalAmount) { this.totalAmount = totalAmount; return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - public Price build() { - return new Price( perUnit, totalAmount, currency); } diff --git a/src/main/java/com/apideck/unify/models/components/ProbationPeriod.java b/src/main/java/com/apideck/unify/models/components/ProbationPeriod.java index 61bc3b80..64389ec5 100644 --- a/src/main/java/com/apideck/unify/models/components/ProbationPeriod.java +++ b/src/main/java/com/apideck/unify/models/components/ProbationPeriod.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.time.LocalDate; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -32,32 +33,30 @@ public class ProbationPeriod { @JsonCreator public ProbationPeriod( - @JsonProperty("start_date") JsonNullable startDate, - @JsonProperty("end_date") JsonNullable endDate) { - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - this.startDate = startDate; - this.endDate = endDate; + @JsonProperty("start_date") @Nullable JsonNullable startDate, + @JsonProperty("end_date") @Nullable JsonNullable endDate) { + this.startDate = Optional.ofNullable(startDate) + .orElse(JsonNullable.undefined()); + this.endDate = Optional.ofNullable(endDate) + .orElse(JsonNullable.undefined()); } public ProbationPeriod() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } /** * The date that the employee started their probation period at the company. */ - @JsonIgnore public JsonNullable startDate() { - return startDate; + return this.startDate; } /** * The date that the employee ended their probation period at the company. */ - @JsonIgnore public JsonNullable endDate() { - return endDate; + return this.endDate; } public static Builder builder() { @@ -68,38 +67,20 @@ public static Builder builder() { /** * The date that the employee started their probation period at the company. */ - public ProbationPeriod withStartDate(LocalDate startDate) { - Utils.checkNotNull(startDate, "startDate"); + public ProbationPeriod withStartDate(@Nullable LocalDate startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The date that the employee started their probation period at the company. - */ - public ProbationPeriod withStartDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } /** * The date that the employee ended their probation period at the company. */ - public ProbationPeriod withEndDate(LocalDate endDate) { - Utils.checkNotNull(endDate, "endDate"); + public ProbationPeriod withEndDate(@Nullable LocalDate endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The date that the employee ended their probation period at the company. - */ - public ProbationPeriod withEndDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -131,54 +112,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable startDate = JsonNullable.undefined(); + private JsonNullable startDate; - private JsonNullable endDate = JsonNullable.undefined(); + private JsonNullable endDate; private Builder() { // force use of static builder() method } - /** * The date that the employee started their probation period at the company. */ - public Builder startDate(LocalDate startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable LocalDate startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The date that the employee started their probation period at the company. - */ - public Builder startDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } - - /** * The date that the employee ended their probation period at the company. */ - public Builder endDate(LocalDate endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable LocalDate endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The date that the employee ended their probation period at the company. - */ - public Builder endDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - public ProbationPeriod build() { - return new ProbationPeriod( startDate, endDate); } diff --git a/src/main/java/com/apideck/unify/models/components/ProfitAndLoss.java b/src/main/java/com/apideck/unify/models/components/ProfitAndLoss.java index 70ecbcfa..8ee3951c 100644 --- a/src/main/java/com/apideck/unify/models/components/ProfitAndLoss.java +++ b/src/main/java/com/apideck/unify/models/components/ProfitAndLoss.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,7 +24,7 @@ public class ProfitAndLoss { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the report @@ -37,21 +37,21 @@ public class ProfitAndLoss { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("start_date") - private Optional startDate; + private String startDate; /** * The end date of the report */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("end_date") - private Optional endDate; + private String endDate; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * The operating income accounts @@ -64,7 +64,7 @@ public class ProfitAndLoss { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("cost_of_goods_sold") - private Optional costOfGoodsSold; + private CostOfGoodsSold costOfGoodsSold; /** * The operating expenses accounts @@ -77,241 +77,205 @@ public class ProfitAndLoss { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("other_income") - private Optional otherIncome; + private OtherIncome otherIncome; /** * The other expenses accounts */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("other_expenses") - private Optional otherExpenses; + private OtherExpenses otherExpenses; /** * The accounts not categorized in the other sections */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("uncategorized_accounts") - private Optional uncategorizedAccounts; + private UncategorizedAccounts uncategorizedAccounts; @JsonInclude(Include.NON_ABSENT) @JsonProperty("gross_profit") - private Optional grossProfit; + private ProfitAndLossIndicator grossProfit; @JsonInclude(Include.NON_ABSENT) @JsonProperty("net_operating_income") - private Optional netOperatingIncome; + private ProfitAndLossIndicator netOperatingIncome; @JsonInclude(Include.NON_ABSENT) @JsonProperty("net_income") - private Optional netIncome; + private ProfitAndLossIndicator netIncome; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The customer id */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("customer") - private Optional customer; + private String customer; @JsonCreator public ProfitAndLoss( - @JsonProperty("id") Optional id, - @JsonProperty("report_name") String reportName, - @JsonProperty("start_date") Optional startDate, - @JsonProperty("end_date") Optional endDate, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("income") Income income, - @JsonProperty("cost_of_goods_sold") Optional costOfGoodsSold, - @JsonProperty("expenses") Expenses expenses, - @JsonProperty("other_income") Optional otherIncome, - @JsonProperty("other_expenses") Optional otherExpenses, - @JsonProperty("uncategorized_accounts") Optional uncategorizedAccounts, - @JsonProperty("gross_profit") Optional grossProfit, - @JsonProperty("net_operating_income") Optional netOperatingIncome, - @JsonProperty("net_income") Optional netIncome, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("customer") Optional customer) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(reportName, "reportName"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(income, "income"); - Utils.checkNotNull(costOfGoodsSold, "costOfGoodsSold"); - Utils.checkNotNull(expenses, "expenses"); - Utils.checkNotNull(otherIncome, "otherIncome"); - Utils.checkNotNull(otherExpenses, "otherExpenses"); - Utils.checkNotNull(uncategorizedAccounts, "uncategorizedAccounts"); - Utils.checkNotNull(grossProfit, "grossProfit"); - Utils.checkNotNull(netOperatingIncome, "netOperatingIncome"); - Utils.checkNotNull(netIncome, "netIncome"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(customer, "customer"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("report_name") @Nonnull String reportName, + @JsonProperty("start_date") @Nullable String startDate, + @JsonProperty("end_date") @Nullable String endDate, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("income") @Nonnull Income income, + @JsonProperty("cost_of_goods_sold") @Nullable CostOfGoodsSold costOfGoodsSold, + @JsonProperty("expenses") @Nonnull Expenses expenses, + @JsonProperty("other_income") @Nullable OtherIncome otherIncome, + @JsonProperty("other_expenses") @Nullable OtherExpenses otherExpenses, + @JsonProperty("uncategorized_accounts") @Nullable UncategorizedAccounts uncategorizedAccounts, + @JsonProperty("gross_profit") @Nullable ProfitAndLossIndicator grossProfit, + @JsonProperty("net_operating_income") @Nullable ProfitAndLossIndicator netOperatingIncome, + @JsonProperty("net_income") @Nullable ProfitAndLossIndicator netIncome, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("customer") @Nullable String customer) { this.id = id; - this.reportName = reportName; + this.reportName = Optional.ofNullable(reportName) + .orElseThrow(() -> new IllegalArgumentException("reportName cannot be null")); this.startDate = startDate; this.endDate = endDate; - this.currency = currency; - this.income = income; + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.income = Optional.ofNullable(income) + .orElseThrow(() -> new IllegalArgumentException("income cannot be null")); this.costOfGoodsSold = costOfGoodsSold; - this.expenses = expenses; + this.expenses = Optional.ofNullable(expenses) + .orElseThrow(() -> new IllegalArgumentException("expenses cannot be null")); this.otherIncome = otherIncome; this.otherExpenses = otherExpenses; this.uncategorizedAccounts = uncategorizedAccounts; this.grossProfit = grossProfit; this.netOperatingIncome = netOperatingIncome; this.netIncome = netIncome; - this.customMappings = customMappings; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); this.customer = customer; } public ProfitAndLoss( - String reportName, - Income income, - Expenses expenses) { - this(Optional.empty(), reportName, Optional.empty(), - Optional.empty(), JsonNullable.undefined(), income, - Optional.empty(), expenses, Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + @Nonnull String reportName, + @Nonnull Income income, + @Nonnull Expenses expenses) { + this(null, reportName, null, + null, null, income, + null, expenses, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the report */ - @JsonIgnore public String reportName() { - return reportName; + return this.reportName; } /** * The start date of the report */ - @JsonIgnore public Optional startDate() { - return startDate; + return Optional.ofNullable(this.startDate); } /** * The end date of the report */ - @JsonIgnore public Optional endDate() { - return endDate; + return Optional.ofNullable(this.endDate); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * The operating income accounts */ - @JsonIgnore public Income income() { - return income; + return this.income; } /** * The cost of goods sold accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional costOfGoodsSold() { - return (Optional) costOfGoodsSold; + return Optional.ofNullable(this.costOfGoodsSold); } /** * The operating expenses accounts */ - @JsonIgnore public Expenses expenses() { - return expenses; + return this.expenses; } /** * The other income accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional otherIncome() { - return (Optional) otherIncome; + return Optional.ofNullable(this.otherIncome); } /** * The other expenses accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional otherExpenses() { - return (Optional) otherExpenses; + return Optional.ofNullable(this.otherExpenses); } /** * The accounts not categorized in the other sections */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional uncategorizedAccounts() { - return (Optional) uncategorizedAccounts; + return Optional.ofNullable(this.uncategorizedAccounts); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional grossProfit() { - return (Optional) grossProfit; + return Optional.ofNullable(this.grossProfit); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional netOperatingIncome() { - return (Optional) netOperatingIncome; + return Optional.ofNullable(this.netOperatingIncome); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional netIncome() { - return (Optional) netIncome; + return Optional.ofNullable(this.netIncome); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The customer id */ - @JsonIgnore public Optional customer() { - return customer; + return Optional.ofNullable(this.customer); } public static Builder builder() { @@ -322,37 +286,17 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public ProfitAndLoss withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public ProfitAndLoss withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ProfitAndLoss withId(@Nullable String id) { this.id = id; return this; } - /** - * The name of the report - */ - public ProfitAndLoss withReportName(String reportName) { - Utils.checkNotNull(reportName, "reportName"); - this.reportName = reportName; - return this; - } /** - * The start date of the report + * The name of the report */ - public ProfitAndLoss withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); + public ProfitAndLoss withReportName(@Nonnull String reportName) { + this.reportName = Utils.checkNotNull(reportName, "reportName"); return this; } @@ -360,64 +304,35 @@ public ProfitAndLoss withStartDate(String startDate) { /** * The start date of the report */ - public ProfitAndLoss withStartDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public ProfitAndLoss withStartDate(@Nullable String startDate) { this.startDate = startDate; return this; } - /** - * The end date of the report - */ - public ProfitAndLoss withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * The end date of the report */ - public ProfitAndLoss withEndDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public ProfitAndLoss withEndDate(@Nullable String endDate) { this.endDate = endDate; return this; } + /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public ProfitAndLoss withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public ProfitAndLoss withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public ProfitAndLoss withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * The operating income accounts */ - public ProfitAndLoss withIncome(Income income) { - Utils.checkNotNull(income, "income"); - this.income = income; - return this; - } - - /** - * The cost of goods sold accounts - */ - public ProfitAndLoss withCostOfGoodsSold(CostOfGoodsSold costOfGoodsSold) { - Utils.checkNotNull(costOfGoodsSold, "costOfGoodsSold"); - this.costOfGoodsSold = Optional.ofNullable(costOfGoodsSold); + public ProfitAndLoss withIncome(@Nonnull Income income) { + this.income = Utils.checkNotNull(income, "income"); return this; } @@ -425,27 +340,17 @@ public ProfitAndLoss withCostOfGoodsSold(CostOfGoodsSold costOfGoodsSold) { /** * The cost of goods sold accounts */ - public ProfitAndLoss withCostOfGoodsSold(Optional costOfGoodsSold) { - Utils.checkNotNull(costOfGoodsSold, "costOfGoodsSold"); + public ProfitAndLoss withCostOfGoodsSold(@Nullable CostOfGoodsSold costOfGoodsSold) { this.costOfGoodsSold = costOfGoodsSold; return this; } - /** - * The operating expenses accounts - */ - public ProfitAndLoss withExpenses(Expenses expenses) { - Utils.checkNotNull(expenses, "expenses"); - this.expenses = expenses; - return this; - } /** - * The other income accounts + * The operating expenses accounts */ - public ProfitAndLoss withOtherIncome(OtherIncome otherIncome) { - Utils.checkNotNull(otherIncome, "otherIncome"); - this.otherIncome = Optional.ofNullable(otherIncome); + public ProfitAndLoss withExpenses(@Nonnull Expenses expenses) { + this.expenses = Utils.checkNotNull(expenses, "expenses"); return this; } @@ -453,113 +358,53 @@ public ProfitAndLoss withOtherIncome(OtherIncome otherIncome) { /** * The other income accounts */ - public ProfitAndLoss withOtherIncome(Optional otherIncome) { - Utils.checkNotNull(otherIncome, "otherIncome"); + public ProfitAndLoss withOtherIncome(@Nullable OtherIncome otherIncome) { this.otherIncome = otherIncome; return this; } - /** - * The other expenses accounts - */ - public ProfitAndLoss withOtherExpenses(OtherExpenses otherExpenses) { - Utils.checkNotNull(otherExpenses, "otherExpenses"); - this.otherExpenses = Optional.ofNullable(otherExpenses); - return this; - } - /** * The other expenses accounts */ - public ProfitAndLoss withOtherExpenses(Optional otherExpenses) { - Utils.checkNotNull(otherExpenses, "otherExpenses"); + public ProfitAndLoss withOtherExpenses(@Nullable OtherExpenses otherExpenses) { this.otherExpenses = otherExpenses; return this; } - /** - * The accounts not categorized in the other sections - */ - public ProfitAndLoss withUncategorizedAccounts(UncategorizedAccounts uncategorizedAccounts) { - Utils.checkNotNull(uncategorizedAccounts, "uncategorizedAccounts"); - this.uncategorizedAccounts = Optional.ofNullable(uncategorizedAccounts); - return this; - } - /** * The accounts not categorized in the other sections */ - public ProfitAndLoss withUncategorizedAccounts(Optional uncategorizedAccounts) { - Utils.checkNotNull(uncategorizedAccounts, "uncategorizedAccounts"); + public ProfitAndLoss withUncategorizedAccounts(@Nullable UncategorizedAccounts uncategorizedAccounts) { this.uncategorizedAccounts = uncategorizedAccounts; return this; } - public ProfitAndLoss withGrossProfit(ProfitAndLossIndicator grossProfit) { - Utils.checkNotNull(grossProfit, "grossProfit"); - this.grossProfit = Optional.ofNullable(grossProfit); - return this; - } - - public ProfitAndLoss withGrossProfit(Optional grossProfit) { - Utils.checkNotNull(grossProfit, "grossProfit"); + public ProfitAndLoss withGrossProfit(@Nullable ProfitAndLossIndicator grossProfit) { this.grossProfit = grossProfit; return this; } - public ProfitAndLoss withNetOperatingIncome(ProfitAndLossIndicator netOperatingIncome) { - Utils.checkNotNull(netOperatingIncome, "netOperatingIncome"); - this.netOperatingIncome = Optional.ofNullable(netOperatingIncome); - return this; - } - - public ProfitAndLoss withNetOperatingIncome(Optional netOperatingIncome) { - Utils.checkNotNull(netOperatingIncome, "netOperatingIncome"); + public ProfitAndLoss withNetOperatingIncome(@Nullable ProfitAndLossIndicator netOperatingIncome) { this.netOperatingIncome = netOperatingIncome; return this; } - public ProfitAndLoss withNetIncome(ProfitAndLossIndicator netIncome) { - Utils.checkNotNull(netIncome, "netIncome"); - this.netIncome = Optional.ofNullable(netIncome); - return this; - } - - public ProfitAndLoss withNetIncome(Optional netIncome) { - Utils.checkNotNull(netIncome, "netIncome"); + public ProfitAndLoss withNetIncome(@Nullable ProfitAndLossIndicator netIncome) { this.netIncome = netIncome; return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public ProfitAndLoss withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = JsonNullable.of(customMappings); - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public ProfitAndLoss withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** - * The customer id - */ - public ProfitAndLoss withCustomer(String customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = Optional.ofNullable(customer); + public ProfitAndLoss withCustomMappings(@Nullable Map customMappings) { + this.customMappings = JsonNullable.of(customMappings); return this; } @@ -567,12 +412,12 @@ public ProfitAndLoss withCustomer(String customer) { /** * The customer id */ - public ProfitAndLoss withCustomer(Optional customer) { - Utils.checkNotNull(customer, "customer"); + public ProfitAndLoss withCustomer(@Nullable String customer) { this.customer = customer; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -636,303 +481,162 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private String reportName; - private Optional startDate = Optional.empty(); + private String startDate; - private Optional endDate = Optional.empty(); + private String endDate; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; private Income income; - private Optional costOfGoodsSold = Optional.empty(); + private CostOfGoodsSold costOfGoodsSold; private Expenses expenses; - private Optional otherIncome = Optional.empty(); + private OtherIncome otherIncome; - private Optional otherExpenses = Optional.empty(); + private OtherExpenses otherExpenses; - private Optional uncategorizedAccounts = Optional.empty(); + private UncategorizedAccounts uncategorizedAccounts; - private Optional grossProfit = Optional.empty(); + private ProfitAndLossIndicator grossProfit; - private Optional netOperatingIncome = Optional.empty(); + private ProfitAndLossIndicator netOperatingIncome; - private Optional netIncome = Optional.empty(); + private ProfitAndLossIndicator netIncome; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private Optional customer = Optional.empty(); + private String customer; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the report */ - public Builder reportName(String reportName) { - Utils.checkNotNull(reportName, "reportName"); - this.reportName = reportName; - return this; - } - - - /** - * The start date of the report - */ - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); + public Builder reportName(@Nonnull String reportName) { + this.reportName = Utils.checkNotNull(reportName, "reportName"); return this; } /** * The start date of the report */ - public Builder startDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable String startDate) { this.startDate = startDate; return this; } - - /** - * The end date of the report - */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * The end date of the report */ - public Builder endDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable String endDate) { this.endDate = endDate; return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * The operating income accounts */ - public Builder income(Income income) { - Utils.checkNotNull(income, "income"); - this.income = income; - return this; - } - - - /** - * The cost of goods sold accounts - */ - public Builder costOfGoodsSold(CostOfGoodsSold costOfGoodsSold) { - Utils.checkNotNull(costOfGoodsSold, "costOfGoodsSold"); - this.costOfGoodsSold = Optional.ofNullable(costOfGoodsSold); + public Builder income(@Nonnull Income income) { + this.income = Utils.checkNotNull(income, "income"); return this; } /** * The cost of goods sold accounts */ - public Builder costOfGoodsSold(Optional costOfGoodsSold) { - Utils.checkNotNull(costOfGoodsSold, "costOfGoodsSold"); + public Builder costOfGoodsSold(@Nullable CostOfGoodsSold costOfGoodsSold) { this.costOfGoodsSold = costOfGoodsSold; return this; } - /** * The operating expenses accounts */ - public Builder expenses(Expenses expenses) { - Utils.checkNotNull(expenses, "expenses"); - this.expenses = expenses; - return this; - } - - - /** - * The other income accounts - */ - public Builder otherIncome(OtherIncome otherIncome) { - Utils.checkNotNull(otherIncome, "otherIncome"); - this.otherIncome = Optional.ofNullable(otherIncome); + public Builder expenses(@Nonnull Expenses expenses) { + this.expenses = Utils.checkNotNull(expenses, "expenses"); return this; } /** * The other income accounts */ - public Builder otherIncome(Optional otherIncome) { - Utils.checkNotNull(otherIncome, "otherIncome"); + public Builder otherIncome(@Nullable OtherIncome otherIncome) { this.otherIncome = otherIncome; return this; } - - /** - * The other expenses accounts - */ - public Builder otherExpenses(OtherExpenses otherExpenses) { - Utils.checkNotNull(otherExpenses, "otherExpenses"); - this.otherExpenses = Optional.ofNullable(otherExpenses); - return this; - } - /** * The other expenses accounts */ - public Builder otherExpenses(Optional otherExpenses) { - Utils.checkNotNull(otherExpenses, "otherExpenses"); + public Builder otherExpenses(@Nullable OtherExpenses otherExpenses) { this.otherExpenses = otherExpenses; return this; } - - /** - * The accounts not categorized in the other sections - */ - public Builder uncategorizedAccounts(UncategorizedAccounts uncategorizedAccounts) { - Utils.checkNotNull(uncategorizedAccounts, "uncategorizedAccounts"); - this.uncategorizedAccounts = Optional.ofNullable(uncategorizedAccounts); - return this; - } - /** * The accounts not categorized in the other sections */ - public Builder uncategorizedAccounts(Optional uncategorizedAccounts) { - Utils.checkNotNull(uncategorizedAccounts, "uncategorizedAccounts"); + public Builder uncategorizedAccounts(@Nullable UncategorizedAccounts uncategorizedAccounts) { this.uncategorizedAccounts = uncategorizedAccounts; return this; } - - public Builder grossProfit(ProfitAndLossIndicator grossProfit) { - Utils.checkNotNull(grossProfit, "grossProfit"); - this.grossProfit = Optional.ofNullable(grossProfit); - return this; - } - - public Builder grossProfit(Optional grossProfit) { - Utils.checkNotNull(grossProfit, "grossProfit"); + public Builder grossProfit(@Nullable ProfitAndLossIndicator grossProfit) { this.grossProfit = grossProfit; return this; } - - public Builder netOperatingIncome(ProfitAndLossIndicator netOperatingIncome) { - Utils.checkNotNull(netOperatingIncome, "netOperatingIncome"); - this.netOperatingIncome = Optional.ofNullable(netOperatingIncome); - return this; - } - - public Builder netOperatingIncome(Optional netOperatingIncome) { - Utils.checkNotNull(netOperatingIncome, "netOperatingIncome"); + public Builder netOperatingIncome(@Nullable ProfitAndLossIndicator netOperatingIncome) { this.netOperatingIncome = netOperatingIncome; return this; } - - public Builder netIncome(ProfitAndLossIndicator netIncome) { - Utils.checkNotNull(netIncome, "netIncome"); - this.netIncome = Optional.ofNullable(netIncome); - return this; - } - - public Builder netIncome(Optional netIncome) { - Utils.checkNotNull(netIncome, "netIncome"); + public Builder netIncome(@Nullable ProfitAndLossIndicator netIncome) { this.netIncome = netIncome; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - - /** - * The customer id - */ - public Builder customer(String customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = Optional.ofNullable(customer); - return this; - } - /** * The customer id */ - public Builder customer(Optional customer) { - Utils.checkNotNull(customer, "customer"); + public Builder customer(@Nullable String customer) { this.customer = customer; return this; } public ProfitAndLoss build() { - return new ProfitAndLoss( id, reportName, startDate, endDate, currency, income, diff --git a/src/main/java/com/apideck/unify/models/components/ProfitAndLossFilter.java b/src/main/java/com/apideck/unify/models/components/ProfitAndLossFilter.java index a5403ce4..776cf636 100644 --- a/src/main/java/com/apideck/unify/models/components/ProfitAndLossFilter.java +++ b/src/main/java/com/apideck/unify/models/components/ProfitAndLossFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,123 +17,112 @@ public class ProfitAndLossFilter { * Filter by customer id */ @SpeakeasyMetadata("queryParam:name=customer_id") - private Optional customerId; + private String customerId; /** * Filter by start date. If start date is given, end date is required. */ @SpeakeasyMetadata("queryParam:name=start_date") - private Optional startDate; + private String startDate; /** * Filter by end date. If end date is given, start date is required. */ @SpeakeasyMetadata("queryParam:name=end_date") - private Optional endDate; + private String endDate; + + /** + * Filter by location id + */ + @SpeakeasyMetadata("queryParam:name=location_id") + private String locationId; @JsonCreator public ProfitAndLossFilter( - Optional customerId, - Optional startDate, - Optional endDate) { - Utils.checkNotNull(customerId, "customerId"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); + @Nullable String customerId, + @Nullable String startDate, + @Nullable String endDate, + @Nullable String locationId) { this.customerId = customerId; this.startDate = startDate; this.endDate = endDate; + this.locationId = locationId; } public ProfitAndLossFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null); } /** * Filter by customer id */ - @JsonIgnore public Optional customerId() { - return customerId; + return Optional.ofNullable(this.customerId); } /** * Filter by start date. If start date is given, end date is required. */ - @JsonIgnore public Optional startDate() { - return startDate; + return Optional.ofNullable(this.startDate); } /** * Filter by end date. If end date is given, start date is required. */ - @JsonIgnore public Optional endDate() { - return endDate; - } - - public static Builder builder() { - return new Builder(); + return Optional.ofNullable(this.endDate); } - /** - * Filter by customer id + * Filter by location id */ - public ProfitAndLossFilter withCustomerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; + public Optional locationId() { + return Optional.ofNullable(this.locationId); + } + + public static Builder builder() { + return new Builder(); } /** * Filter by customer id */ - public ProfitAndLossFilter withCustomerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public ProfitAndLossFilter withCustomerId(@Nullable String customerId) { this.customerId = customerId; return this; } - /** - * Filter by start date. If start date is given, end date is required. - */ - public ProfitAndLossFilter withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - /** * Filter by start date. If start date is given, end date is required. */ - public ProfitAndLossFilter withStartDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public ProfitAndLossFilter withStartDate(@Nullable String startDate) { this.startDate = startDate; return this; } + /** * Filter by end date. If end date is given, start date is required. */ - public ProfitAndLossFilter withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); + public ProfitAndLossFilter withEndDate(@Nullable String endDate) { + this.endDate = endDate; return this; } /** - * Filter by end date. If end date is given, start date is required. + * Filter by location id */ - public ProfitAndLossFilter withEndDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; + public ProfitAndLossFilter withLocationId(@Nullable String locationId) { + this.locationId = locationId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -146,13 +135,15 @@ public boolean equals(java.lang.Object o) { return Utils.enhancedDeepEquals(this.customerId, other.customerId) && Utils.enhancedDeepEquals(this.startDate, other.startDate) && - Utils.enhancedDeepEquals(this.endDate, other.endDate); + Utils.enhancedDeepEquals(this.endDate, other.endDate) && + Utils.enhancedDeepEquals(this.locationId, other.locationId); } @Override public int hashCode() { return Utils.enhancedHash( - customerId, startDate, endDate); + customerId, startDate, endDate, + locationId); } @Override @@ -160,83 +151,61 @@ public String toString() { return Utils.toString(ProfitAndLossFilter.class, "customerId", customerId, "startDate", startDate, - "endDate", endDate); + "endDate", endDate, + "locationId", locationId); } @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional customerId = Optional.empty(); + private String customerId; + + private String startDate; - private Optional startDate = Optional.empty(); + private String endDate; - private Optional endDate = Optional.empty(); + private String locationId; private Builder() { // force use of static builder() method } - /** * Filter by customer id */ - public Builder customerId(String customerId) { - Utils.checkNotNull(customerId, "customerId"); - this.customerId = Optional.ofNullable(customerId); - return this; - } - - /** - * Filter by customer id - */ - public Builder customerId(Optional customerId) { - Utils.checkNotNull(customerId, "customerId"); + public Builder customerId(@Nullable String customerId) { this.customerId = customerId; return this; } - - /** - * Filter by start date. If start date is given, end date is required. - */ - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - /** * Filter by start date. If start date is given, end date is required. */ - public Builder startDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable String startDate) { this.startDate = startDate; return this; } - /** * Filter by end date. If end date is given, start date is required. */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); + public Builder endDate(@Nullable String endDate) { + this.endDate = endDate; return this; } /** - * Filter by end date. If end date is given, start date is required. + * Filter by location id */ - public Builder endDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; + public Builder locationId(@Nullable String locationId) { + this.locationId = locationId; return this; } public ProfitAndLossFilter build() { - return new ProfitAndLossFilter( - customerId, startDate, endDate); + customerId, startDate, endDate, + locationId); } } diff --git a/src/main/java/com/apideck/unify/models/components/ProfitAndLossIndicator.java b/src/main/java/com/apideck/unify/models/components/ProfitAndLossIndicator.java index defc1523..df651fb4 100644 --- a/src/main/java/com/apideck/unify/models/components/ProfitAndLossIndicator.java +++ b/src/main/java/com/apideck/unify/models/components/ProfitAndLossIndicator.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,21 +26,20 @@ public class ProfitAndLossIndicator { @JsonCreator public ProfitAndLossIndicator( - @JsonProperty("total") JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; + @JsonProperty("total") @Nullable JsonNullable total) { + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); } public ProfitAndLossIndicator() { - this(JsonNullable.undefined()); + this(null); } /** * The total amount of the transaction or record */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } public static Builder builder() { @@ -50,20 +50,11 @@ public static Builder builder() { /** * The total amount of the transaction or record */ - public ProfitAndLossIndicator withTotal(double total) { - Utils.checkNotNull(total, "total"); + public ProfitAndLossIndicator withTotal(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * The total amount of the transaction or record - */ - public ProfitAndLossIndicator withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -93,33 +84,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; private Builder() { // force use of static builder() method } - /** * The total amount of the transaction or record */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * The total amount of the transaction or record - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - public ProfitAndLossIndicator build() { - return new ProfitAndLossIndicator( total); } diff --git a/src/main/java/com/apideck/unify/models/components/PurchaseDetails.java b/src/main/java/com/apideck/unify/models/components/PurchaseDetails.java index 1daddc2b..b1d4bed0 100644 --- a/src/main/java/com/apideck/unify/models/components/PurchaseDetails.java +++ b/src/main/java/com/apideck/unify/models/components/PurchaseDetails.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -41,54 +40,48 @@ public class PurchaseDetails { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRate taxRate; @JsonCreator public PurchaseDetails( - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("unit_of_measure") JsonNullable unitOfMeasure, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("tax_rate") Optional taxRate) { - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(taxRate, "taxRate"); - this.unitPrice = unitPrice; - this.unitOfMeasure = unitOfMeasure; - this.taxInclusive = taxInclusive; + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("unit_of_measure") @Nullable JsonNullable unitOfMeasure, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("tax_rate") @Nullable LinkedTaxRate taxRate) { + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.unitOfMeasure = Optional.ofNullable(unitOfMeasure) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; } public PurchaseDetails() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null); } - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - @JsonIgnore public JsonNullable unitOfMeasure() { - return unitOfMeasure; + return this.unitOfMeasure; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } public static Builder builder() { @@ -96,67 +89,36 @@ public static Builder builder() { } - public PurchaseDetails withUnitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public PurchaseDetails withUnitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public PurchaseDetails withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public PurchaseDetails withUnitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public PurchaseDetails withUnitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public PurchaseDetails withUnitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } /** * Amounts are including tax */ - public PurchaseDetails withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public PurchaseDetails withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public PurchaseDetails withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - public PurchaseDetails withTaxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public PurchaseDetails withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public PurchaseDetails withTaxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -192,84 +154,45 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable unitOfMeasure = JsonNullable.undefined(); + private JsonNullable unitOfMeasure; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private Optional taxRate = Optional.empty(); + private LinkedTaxRate taxRate; private Builder() { // force use of static builder() method } - - public Builder unitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public Builder unitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public Builder unitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public Builder unitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - - public Builder taxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } public PurchaseDetails build() { - return new PurchaseDetails( unitPrice, unitOfMeasure, taxInclusive, taxRate); diff --git a/src/main/java/com/apideck/unify/models/components/PurchaseOrder.java b/src/main/java/com/apideck/unify/models/components/PurchaseOrder.java index 33cb32c6..124b17ef 100644 --- a/src/main/java/com/apideck/unify/models/components/PurchaseOrder.java +++ b/src/main/java/com/apideck/unify/models/components/PurchaseOrder.java @@ -5,16 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.List; @@ -29,7 +28,7 @@ public class PurchaseOrder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The third-party API ID of original entity @@ -57,7 +56,7 @@ public class PurchaseOrder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier") - private JsonNullable supplier; + private JsonNullable supplier; /** * The ID of the subsidiary @@ -76,7 +75,7 @@ public class PurchaseOrder { @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Date purchase order was issued - YYYY-MM-DD. @@ -104,7 +103,7 @@ public class PurchaseOrder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -144,17 +143,17 @@ public class PurchaseOrder { @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; @JsonInclude(Include.NON_ABSENT) @JsonProperty("shipping_address") - private Optional shippingAddress; + private Address shippingAddress; @JsonInclude(Include.NON_ABSENT) @JsonProperty("ledger_account") - private JsonNullable ledgerAccount; + private JsonNullable ledgerAccount; /** * Optional purchase order template @@ -173,7 +172,7 @@ public class PurchaseOrder { @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_account") - private Optional bankAccount; + private BankAccount bankAccount; /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. @@ -222,19 +221,19 @@ public class PurchaseOrder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -276,437 +275,382 @@ public class PurchaseOrder { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public PurchaseOrder( - @JsonProperty("id") Optional id, - @JsonProperty("downstream_id") JsonNullable downstreamId, - @JsonProperty("po_number") JsonNullable poNumber, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("supplier") JsonNullable supplier, - @JsonProperty("subsidiary_id") JsonNullable subsidiaryId, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("status") JsonNullable status, - @JsonProperty("issued_date") JsonNullable issuedDate, - @JsonProperty("delivery_date") JsonNullable deliveryDate, - @JsonProperty("expected_arrival_date") JsonNullable expectedArrivalDate, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("sub_total") JsonNullable subTotal, - @JsonProperty("total_tax") JsonNullable totalTax, - @JsonProperty("total") JsonNullable total, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("shipping_address") Optional shippingAddress, - @JsonProperty("ledger_account") JsonNullable ledgerAccount, - @JsonProperty("template_id") JsonNullable templateId, - @JsonProperty("discount_percentage") JsonNullable discountPercentage, - @JsonProperty("bank_account") Optional bankAccount, - @JsonProperty("accounting_by_row") JsonNullable accountingByRow, - @JsonProperty("due_date") JsonNullable dueDate, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("channel") JsonNullable channel, - @JsonProperty("memo") JsonNullable memo, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(poNumber, "poNumber"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(supplier, "supplier"); - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(issuedDate, "issuedDate"); - Utils.checkNotNull(deliveryDate, "deliveryDate"); - Utils.checkNotNull(expectedArrivalDate, "expectedArrivalDate"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalTax, "totalTax"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(shippingAddress, "shippingAddress"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(templateId, "templateId"); - Utils.checkNotNull(discountPercentage, "discountPercentage"); - Utils.checkNotNull(bankAccount, "bankAccount"); - Utils.checkNotNull(accountingByRow, "accountingByRow"); - Utils.checkNotNull(dueDate, "dueDate"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(channel, "channel"); - Utils.checkNotNull(memo, "memo"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId, + @JsonProperty("po_number") @Nullable JsonNullable poNumber, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("supplier") @Nullable JsonNullable supplier, + @JsonProperty("subsidiary_id") @Nullable JsonNullable subsidiaryId, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("issued_date") @Nullable JsonNullable issuedDate, + @JsonProperty("delivery_date") @Nullable JsonNullable deliveryDate, + @JsonProperty("expected_arrival_date") @Nullable JsonNullable expectedArrivalDate, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, + @JsonProperty("total_tax") @Nullable JsonNullable totalTax, + @JsonProperty("total") @Nullable JsonNullable total, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("shipping_address") @Nullable Address shippingAddress, + @JsonProperty("ledger_account") @Nullable JsonNullable ledgerAccount, + @JsonProperty("template_id") @Nullable JsonNullable templateId, + @JsonProperty("discount_percentage") @Nullable JsonNullable discountPercentage, + @JsonProperty("bank_account") @Nullable BankAccount bankAccount, + @JsonProperty("accounting_by_row") @Nullable JsonNullable accountingByRow, + @JsonProperty("due_date") @Nullable JsonNullable dueDate, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("channel") @Nullable JsonNullable channel, + @JsonProperty("memo") @Nullable JsonNullable memo, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.downstreamId = downstreamId; - this.poNumber = poNumber; - this.reference = reference; - this.supplier = supplier; - this.subsidiaryId = subsidiaryId; - this.companyId = companyId; - this.status = status; - this.issuedDate = issuedDate; - this.deliveryDate = deliveryDate; - this.expectedArrivalDate = expectedArrivalDate; - this.currency = currency; - this.currencyRate = currencyRate; - this.subTotal = subTotal; - this.totalTax = totalTax; - this.total = total; - this.taxInclusive = taxInclusive; + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); + this.poNumber = Optional.ofNullable(poNumber) + .orElse(JsonNullable.undefined()); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); + this.supplier = Optional.ofNullable(supplier) + .orElse(JsonNullable.undefined()); + this.subsidiaryId = Optional.ofNullable(subsidiaryId) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.issuedDate = Optional.ofNullable(issuedDate) + .orElse(JsonNullable.undefined()); + this.deliveryDate = Optional.ofNullable(deliveryDate) + .orElse(JsonNullable.undefined()); + this.expectedArrivalDate = Optional.ofNullable(expectedArrivalDate) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); + this.totalTax = Optional.ofNullable(totalTax) + .orElse(JsonNullable.undefined()); + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); this.lineItems = lineItems; this.shippingAddress = shippingAddress; - this.ledgerAccount = ledgerAccount; - this.templateId = templateId; - this.discountPercentage = discountPercentage; + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElse(JsonNullable.undefined()); + this.templateId = Optional.ofNullable(templateId) + .orElse(JsonNullable.undefined()); + this.discountPercentage = Optional.ofNullable(discountPercentage) + .orElse(JsonNullable.undefined()); this.bankAccount = bankAccount; - this.accountingByRow = accountingByRow; - this.dueDate = dueDate; - this.paymentMethod = paymentMethod; - this.taxCode = taxCode; - this.channel = channel; - this.memo = memo; - this.trackingCategories = trackingCategories; - this.customMappings = customMappings; + this.accountingByRow = Optional.ofNullable(accountingByRow) + .orElse(JsonNullable.undefined()); + this.dueDate = Optional.ofNullable(dueDate) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.channel = Optional.ofNullable(channel) + .orElse(JsonNullable.undefined()); + this.memo = Optional.ofNullable(memo) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public PurchaseOrder() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. */ - @JsonIgnore public JsonNullable poNumber() { - return poNumber; + return this.poNumber; } /** * Optional purchase order reference. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } /** * The supplier this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable supplier() { - return (JsonNullable) supplier; + return this.supplier; } /** * The ID of the subsidiary */ - @JsonIgnore public JsonNullable subsidiaryId() { - return subsidiaryId; + return this.subsidiaryId; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Date purchase order was issued - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable issuedDate() { - return issuedDate; + return this.issuedDate; } /** * The date on which the purchase order is to be delivered - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable deliveryDate() { - return deliveryDate; + return this.deliveryDate; } /** * The date on which the order is expected to arrive - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable expectedArrivalDate() { - return expectedArrivalDate; + return this.expectedArrivalDate; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Total tax amount applied to this invoice. */ - @JsonIgnore public JsonNullable totalTax() { - return totalTax; + return this.totalTax; } /** * Total amount of invoice, including tax. */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
shippingAddress() { - return (Optional
) shippingAddress; + return Optional.ofNullable(this.shippingAddress); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable ledgerAccount() { - return (JsonNullable) ledgerAccount; + return this.ledgerAccount; } /** * Optional purchase order template */ - @JsonIgnore public JsonNullable templateId() { - return templateId; + return this.templateId; } /** * Discount percentage applied to this transaction. */ - @JsonIgnore public JsonNullable discountPercentage() { - return discountPercentage; + return this.discountPercentage; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional bankAccount() { - return (Optional) bankAccount; + return Optional.ofNullable(this.bankAccount); } /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - @JsonIgnore public JsonNullable accountingByRow() { - return accountingByRow; + return this.accountingByRow; } /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable dueDate() { - return dueDate; + return this.dueDate; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } /** * The channel through which the transaction is processed. */ - @JsonIgnore public JsonNullable channel() { - return channel; + return this.channel; } /** * Message for the supplier. This text appears on the Purchase Order. */ - @JsonIgnore public JsonNullable memo() { - return memo; + return this.memo; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -717,657 +661,327 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public PurchaseOrder withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public PurchaseOrder withId(Optional id) { - Utils.checkNotNull(id, "id"); + public PurchaseOrder withId(@Nullable String id) { this.id = id; return this; } + /** * The third-party API ID of original entity */ - public PurchaseOrder withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public PurchaseOrder withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public PurchaseOrder withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. */ - public PurchaseOrder withPoNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public PurchaseOrder withPoNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. - */ - public PurchaseOrder withPoNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } /** * Optional purchase order reference. */ - public PurchaseOrder withReference(String reference) { - Utils.checkNotNull(reference, "reference"); + public PurchaseOrder withReference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional purchase order reference. - */ - public PurchaseOrder withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } /** * The supplier this entity is linked to. */ - public PurchaseOrder withSupplier(LinkedSupplier supplier) { - Utils.checkNotNull(supplier, "supplier"); + public PurchaseOrder withSupplier(@Nullable LinkedSupplier supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public PurchaseOrder withSupplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } /** * The ID of the subsidiary */ - public PurchaseOrder withSubsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public PurchaseOrder withSubsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public PurchaseOrder withSubsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public PurchaseOrder withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public PurchaseOrder withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public PurchaseOrder withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - public PurchaseOrder withStatus(PurchaseOrderStatus status) { - Utils.checkNotNull(status, "status"); + public PurchaseOrder withStatus(@Nullable PurchaseOrderStatus status) { this.status = JsonNullable.of(status); return this; } - public PurchaseOrder withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Date purchase order was issued - YYYY-MM-DD. */ - public PurchaseOrder withIssuedDate(LocalDate issuedDate) { - Utils.checkNotNull(issuedDate, "issuedDate"); + public PurchaseOrder withIssuedDate(@Nullable LocalDate issuedDate) { this.issuedDate = JsonNullable.of(issuedDate); return this; } - /** - * Date purchase order was issued - YYYY-MM-DD. - */ - public PurchaseOrder withIssuedDate(JsonNullable issuedDate) { - Utils.checkNotNull(issuedDate, "issuedDate"); - this.issuedDate = issuedDate; - return this; - } /** * The date on which the purchase order is to be delivered - YYYY-MM-DD. */ - public PurchaseOrder withDeliveryDate(LocalDate deliveryDate) { - Utils.checkNotNull(deliveryDate, "deliveryDate"); + public PurchaseOrder withDeliveryDate(@Nullable LocalDate deliveryDate) { this.deliveryDate = JsonNullable.of(deliveryDate); return this; } - /** - * The date on which the purchase order is to be delivered - YYYY-MM-DD. - */ - public PurchaseOrder withDeliveryDate(JsonNullable deliveryDate) { - Utils.checkNotNull(deliveryDate, "deliveryDate"); - this.deliveryDate = deliveryDate; - return this; - } /** * The date on which the order is expected to arrive - YYYY-MM-DD. */ - public PurchaseOrder withExpectedArrivalDate(LocalDate expectedArrivalDate) { - Utils.checkNotNull(expectedArrivalDate, "expectedArrivalDate"); + public PurchaseOrder withExpectedArrivalDate(@Nullable LocalDate expectedArrivalDate) { this.expectedArrivalDate = JsonNullable.of(expectedArrivalDate); return this; } - /** - * The date on which the order is expected to arrive - YYYY-MM-DD. - */ - public PurchaseOrder withExpectedArrivalDate(JsonNullable expectedArrivalDate) { - Utils.checkNotNull(expectedArrivalDate, "expectedArrivalDate"); - this.expectedArrivalDate = expectedArrivalDate; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public PurchaseOrder withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public PurchaseOrder withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public PurchaseOrder withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public PurchaseOrder withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public PurchaseOrder withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public PurchaseOrder withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * Sub-total amount, normally before tax. */ - public PurchaseOrder withSubTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public PurchaseOrder withSubTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public PurchaseOrder withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Total tax amount applied to this invoice. */ - public PurchaseOrder withTotalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public PurchaseOrder withTotalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public PurchaseOrder withTotalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } /** * Total amount of invoice, including tax. */ - public PurchaseOrder withTotal(double total) { - Utils.checkNotNull(total, "total"); + public PurchaseOrder withTotal(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of invoice, including tax. - */ - public PurchaseOrder withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } /** * Amounts are including tax */ - public PurchaseOrder withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public PurchaseOrder withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public PurchaseOrder withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - public PurchaseOrder withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - - public PurchaseOrder withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public PurchaseOrder withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - public PurchaseOrder withShippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public PurchaseOrder withShippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public PurchaseOrder withShippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } - public PurchaseOrder withLedgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + + public PurchaseOrder withLedgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public PurchaseOrder withLedgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } /** * Optional purchase order template */ - public PurchaseOrder withTemplateId(String templateId) { - Utils.checkNotNull(templateId, "templateId"); + public PurchaseOrder withTemplateId(@Nullable String templateId) { this.templateId = JsonNullable.of(templateId); return this; } - /** - * Optional purchase order template - */ - public PurchaseOrder withTemplateId(JsonNullable templateId) { - Utils.checkNotNull(templateId, "templateId"); - this.templateId = templateId; - return this; - } /** * Discount percentage applied to this transaction. */ - public PurchaseOrder withDiscountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public PurchaseOrder withDiscountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this transaction. - */ - public PurchaseOrder withDiscountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - public PurchaseOrder withBankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public PurchaseOrder withBankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public PurchaseOrder withBankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } + /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public PurchaseOrder withAccountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public PurchaseOrder withAccountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public PurchaseOrder withAccountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - public PurchaseOrder withDueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public PurchaseOrder withDueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - */ - public PurchaseOrder withDueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public PurchaseOrder withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public PurchaseOrder withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public PurchaseOrder withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public PurchaseOrder withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public PurchaseOrder withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public PurchaseOrder withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } /** * The channel through which the transaction is processed. */ - public PurchaseOrder withChannel(String channel) { - Utils.checkNotNull(channel, "channel"); + public PurchaseOrder withChannel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public PurchaseOrder withChannel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } /** * Message for the supplier. This text appears on the Purchase Order. */ - public PurchaseOrder withMemo(String memo) { - Utils.checkNotNull(memo, "memo"); + public PurchaseOrder withMemo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * Message for the supplier. This text appears on the Purchase Order. - */ - public PurchaseOrder withMemo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } /** * A list of linked tracking categories. */ - public PurchaseOrder withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public PurchaseOrder withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public PurchaseOrder withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public PurchaseOrder withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public PurchaseOrder withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public PurchaseOrder withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - public PurchaseOrder withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - - public PurchaseOrder withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public PurchaseOrder withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public PurchaseOrder withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public PurchaseOrder withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public PurchaseOrder withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public PurchaseOrder withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public PurchaseOrder withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public PurchaseOrder withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public PurchaseOrder withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public PurchaseOrder withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public PurchaseOrder withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public PurchaseOrder withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public PurchaseOrder withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public PurchaseOrder withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public PurchaseOrder withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public PurchaseOrder withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public PurchaseOrder withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public PurchaseOrder withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public PurchaseOrder withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public PurchaseOrder withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1482,774 +1096,373 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; - private JsonNullable poNumber = JsonNullable.undefined(); + private JsonNullable poNumber; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private JsonNullable supplier = JsonNullable.undefined(); + private JsonNullable supplier; - private JsonNullable subsidiaryId = JsonNullable.undefined(); + private JsonNullable subsidiaryId; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable issuedDate = JsonNullable.undefined(); + private JsonNullable issuedDate; - private JsonNullable deliveryDate = JsonNullable.undefined(); + private JsonNullable deliveryDate; - private JsonNullable expectedArrivalDate = JsonNullable.undefined(); + private JsonNullable expectedArrivalDate; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private JsonNullable totalTax = JsonNullable.undefined(); + private JsonNullable totalTax; - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private Optional shippingAddress = Optional.empty(); + private Address shippingAddress; - private JsonNullable ledgerAccount = JsonNullable.undefined(); + private JsonNullable ledgerAccount; - private JsonNullable templateId = JsonNullable.undefined(); + private JsonNullable templateId; - private JsonNullable discountPercentage = JsonNullable.undefined(); + private JsonNullable discountPercentage; - private Optional bankAccount = Optional.empty(); + private BankAccount bankAccount; - private JsonNullable accountingByRow = JsonNullable.undefined(); + private JsonNullable accountingByRow; - private JsonNullable dueDate = JsonNullable.undefined(); + private JsonNullable dueDate; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable channel = JsonNullable.undefined(); + private JsonNullable channel; - private JsonNullable memo = JsonNullable.undefined(); + private JsonNullable memo; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } - - /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. */ - public Builder poNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public Builder poNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. - */ - public Builder poNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } - - /** * Optional purchase order reference. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional purchase order reference. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** * The supplier this entity is linked to. */ - public Builder supplier(LinkedSupplier supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Builder supplier(@Nullable LinkedSupplier supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public Builder supplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } - - /** * The ID of the subsidiary */ - public Builder subsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public Builder subsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public Builder subsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - - public Builder status(PurchaseOrderStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable PurchaseOrderStatus status) { this.status = JsonNullable.of(status); return this; } - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Date purchase order was issued - YYYY-MM-DD. */ - public Builder issuedDate(LocalDate issuedDate) { - Utils.checkNotNull(issuedDate, "issuedDate"); + public Builder issuedDate(@Nullable LocalDate issuedDate) { this.issuedDate = JsonNullable.of(issuedDate); return this; } - /** - * Date purchase order was issued - YYYY-MM-DD. - */ - public Builder issuedDate(JsonNullable issuedDate) { - Utils.checkNotNull(issuedDate, "issuedDate"); - this.issuedDate = issuedDate; - return this; - } - - /** * The date on which the purchase order is to be delivered - YYYY-MM-DD. */ - public Builder deliveryDate(LocalDate deliveryDate) { - Utils.checkNotNull(deliveryDate, "deliveryDate"); + public Builder deliveryDate(@Nullable LocalDate deliveryDate) { this.deliveryDate = JsonNullable.of(deliveryDate); return this; } - /** - * The date on which the purchase order is to be delivered - YYYY-MM-DD. - */ - public Builder deliveryDate(JsonNullable deliveryDate) { - Utils.checkNotNull(deliveryDate, "deliveryDate"); - this.deliveryDate = deliveryDate; - return this; - } - - /** * The date on which the order is expected to arrive - YYYY-MM-DD. */ - public Builder expectedArrivalDate(LocalDate expectedArrivalDate) { - Utils.checkNotNull(expectedArrivalDate, "expectedArrivalDate"); + public Builder expectedArrivalDate(@Nullable LocalDate expectedArrivalDate) { this.expectedArrivalDate = JsonNullable.of(expectedArrivalDate); return this; } - /** - * The date on which the order is expected to arrive - YYYY-MM-DD. - */ - public Builder expectedArrivalDate(JsonNullable expectedArrivalDate) { - Utils.checkNotNull(expectedArrivalDate, "expectedArrivalDate"); - this.expectedArrivalDate = expectedArrivalDate; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Total tax amount applied to this invoice. */ - public Builder totalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Builder totalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public Builder totalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } - - /** * Total amount of invoice, including tax. */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of invoice, including tax. - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - - public Builder shippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public Builder shippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public Builder shippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } - - public Builder ledgerAccount(LinkedLedgerAccount ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccount ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Builder ledgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - /** * Optional purchase order template */ - public Builder templateId(String templateId) { - Utils.checkNotNull(templateId, "templateId"); + public Builder templateId(@Nullable String templateId) { this.templateId = JsonNullable.of(templateId); return this; } - /** - * Optional purchase order template - */ - public Builder templateId(JsonNullable templateId) { - Utils.checkNotNull(templateId, "templateId"); - this.templateId = templateId; - return this; - } - - /** * Discount percentage applied to this transaction. */ - public Builder discountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Builder discountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this transaction. - */ - public Builder discountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - - public Builder bankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public Builder bankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public Builder bankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public Builder accountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public Builder accountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public Builder accountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } - - /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - public Builder dueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Builder dueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - */ - public Builder dueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - /** * The channel through which the transaction is processed. */ - public Builder channel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Builder channel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Builder channel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - /** * Message for the supplier. This text appears on the Purchase Order. */ - public Builder memo(String memo) { - Utils.checkNotNull(memo, "memo"); + public Builder memo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * Message for the supplier. This text appears on the Purchase Order. - */ - public Builder memo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public PurchaseOrder build() { - return new PurchaseOrder( id, downstreamId, poNumber, reference, supplier, subsidiaryId, diff --git a/src/main/java/com/apideck/unify/models/components/PurchaseOrderInput.java b/src/main/java/com/apideck/unify/models/components/PurchaseOrderInput.java index e10402ef..bfa99752 100644 --- a/src/main/java/com/apideck/unify/models/components/PurchaseOrderInput.java +++ b/src/main/java/com/apideck/unify/models/components/PurchaseOrderInput.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.LocalDate; import java.util.List; import java.util.Optional; @@ -40,7 +39,7 @@ public class PurchaseOrderInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supplier") - private JsonNullable supplier; + private JsonNullable supplier; /** * The ID of the subsidiary @@ -59,7 +58,7 @@ public class PurchaseOrderInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Date purchase order was issued - YYYY-MM-DD. @@ -87,7 +86,7 @@ public class PurchaseOrderInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * Currency Exchange Rate at the time entity was recorded/generated. @@ -127,17 +126,17 @@ public class PurchaseOrderInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("line_items") - private Optional> lineItems; + private List lineItems; @JsonInclude(Include.NON_ABSENT) @JsonProperty("shipping_address") - private Optional shippingAddress; + private Address shippingAddress; @JsonInclude(Include.NON_ABSENT) @JsonProperty("ledger_account") - private JsonNullable ledgerAccount; + private JsonNullable ledgerAccount; /** * Optional purchase order template @@ -156,7 +155,7 @@ public class PurchaseOrderInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_account") - private Optional bankAccount; + private BankAccount bankAccount; /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. @@ -205,12 +204,12 @@ public class PurchaseOrderInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("tracking_categories") - private JsonNullable> trackingCategories; + private JsonNullable> trackingCategories; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -224,357 +223,311 @@ public class PurchaseOrderInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public PurchaseOrderInput( - @JsonProperty("po_number") JsonNullable poNumber, - @JsonProperty("reference") JsonNullable reference, - @JsonProperty("supplier") JsonNullable supplier, - @JsonProperty("subsidiary_id") JsonNullable subsidiaryId, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("status") JsonNullable status, - @JsonProperty("issued_date") JsonNullable issuedDate, - @JsonProperty("delivery_date") JsonNullable deliveryDate, - @JsonProperty("expected_arrival_date") JsonNullable expectedArrivalDate, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("currency_rate") JsonNullable currencyRate, - @JsonProperty("sub_total") JsonNullable subTotal, - @JsonProperty("total_tax") JsonNullable totalTax, - @JsonProperty("total") JsonNullable total, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("line_items") Optional> lineItems, - @JsonProperty("shipping_address") Optional shippingAddress, - @JsonProperty("ledger_account") JsonNullable ledgerAccount, - @JsonProperty("template_id") JsonNullable templateId, - @JsonProperty("discount_percentage") JsonNullable discountPercentage, - @JsonProperty("bank_account") Optional bankAccount, - @JsonProperty("accounting_by_row") JsonNullable accountingByRow, - @JsonProperty("due_date") JsonNullable dueDate, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("tax_code") JsonNullable taxCode, - @JsonProperty("channel") JsonNullable channel, - @JsonProperty("memo") JsonNullable memo, - @JsonProperty("tracking_categories") JsonNullable> trackingCategories, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(poNumber, "poNumber"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(supplier, "supplier"); - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(issuedDate, "issuedDate"); - Utils.checkNotNull(deliveryDate, "deliveryDate"); - Utils.checkNotNull(expectedArrivalDate, "expectedArrivalDate"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(currencyRate, "currencyRate"); - Utils.checkNotNull(subTotal, "subTotal"); - Utils.checkNotNull(totalTax, "totalTax"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(lineItems, "lineItems"); - Utils.checkNotNull(shippingAddress, "shippingAddress"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - Utils.checkNotNull(templateId, "templateId"); - Utils.checkNotNull(discountPercentage, "discountPercentage"); - Utils.checkNotNull(bankAccount, "bankAccount"); - Utils.checkNotNull(accountingByRow, "accountingByRow"); - Utils.checkNotNull(dueDate, "dueDate"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(taxCode, "taxCode"); - Utils.checkNotNull(channel, "channel"); - Utils.checkNotNull(memo, "memo"); - Utils.checkNotNull(trackingCategories, "trackingCategories"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - this.poNumber = poNumber; - this.reference = reference; - this.supplier = supplier; - this.subsidiaryId = subsidiaryId; - this.companyId = companyId; - this.status = status; - this.issuedDate = issuedDate; - this.deliveryDate = deliveryDate; - this.expectedArrivalDate = expectedArrivalDate; - this.currency = currency; - this.currencyRate = currencyRate; - this.subTotal = subTotal; - this.totalTax = totalTax; - this.total = total; - this.taxInclusive = taxInclusive; + @JsonProperty("po_number") @Nullable JsonNullable poNumber, + @JsonProperty("reference") @Nullable JsonNullable reference, + @JsonProperty("supplier") @Nullable JsonNullable supplier, + @JsonProperty("subsidiary_id") @Nullable JsonNullable subsidiaryId, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("issued_date") @Nullable JsonNullable issuedDate, + @JsonProperty("delivery_date") @Nullable JsonNullable deliveryDate, + @JsonProperty("expected_arrival_date") @Nullable JsonNullable expectedArrivalDate, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("currency_rate") @Nullable JsonNullable currencyRate, + @JsonProperty("sub_total") @Nullable JsonNullable subTotal, + @JsonProperty("total_tax") @Nullable JsonNullable totalTax, + @JsonProperty("total") @Nullable JsonNullable total, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("line_items") @Nullable List lineItems, + @JsonProperty("shipping_address") @Nullable Address shippingAddress, + @JsonProperty("ledger_account") @Nullable JsonNullable ledgerAccount, + @JsonProperty("template_id") @Nullable JsonNullable templateId, + @JsonProperty("discount_percentage") @Nullable JsonNullable discountPercentage, + @JsonProperty("bank_account") @Nullable BankAccount bankAccount, + @JsonProperty("accounting_by_row") @Nullable JsonNullable accountingByRow, + @JsonProperty("due_date") @Nullable JsonNullable dueDate, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("tax_code") @Nullable JsonNullable taxCode, + @JsonProperty("channel") @Nullable JsonNullable channel, + @JsonProperty("memo") @Nullable JsonNullable memo, + @JsonProperty("tracking_categories") @Nullable JsonNullable> trackingCategories, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.poNumber = Optional.ofNullable(poNumber) + .orElse(JsonNullable.undefined()); + this.reference = Optional.ofNullable(reference) + .orElse(JsonNullable.undefined()); + this.supplier = Optional.ofNullable(supplier) + .orElse(JsonNullable.undefined()); + this.subsidiaryId = Optional.ofNullable(subsidiaryId) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.issuedDate = Optional.ofNullable(issuedDate) + .orElse(JsonNullable.undefined()); + this.deliveryDate = Optional.ofNullable(deliveryDate) + .orElse(JsonNullable.undefined()); + this.expectedArrivalDate = Optional.ofNullable(expectedArrivalDate) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.currencyRate = Optional.ofNullable(currencyRate) + .orElse(JsonNullable.undefined()); + this.subTotal = Optional.ofNullable(subTotal) + .orElse(JsonNullable.undefined()); + this.totalTax = Optional.ofNullable(totalTax) + .orElse(JsonNullable.undefined()); + this.total = Optional.ofNullable(total) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); this.lineItems = lineItems; this.shippingAddress = shippingAddress; - this.ledgerAccount = ledgerAccount; - this.templateId = templateId; - this.discountPercentage = discountPercentage; + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElse(JsonNullable.undefined()); + this.templateId = Optional.ofNullable(templateId) + .orElse(JsonNullable.undefined()); + this.discountPercentage = Optional.ofNullable(discountPercentage) + .orElse(JsonNullable.undefined()); this.bankAccount = bankAccount; - this.accountingByRow = accountingByRow; - this.dueDate = dueDate; - this.paymentMethod = paymentMethod; - this.taxCode = taxCode; - this.channel = channel; - this.memo = memo; - this.trackingCategories = trackingCategories; + this.accountingByRow = Optional.ofNullable(accountingByRow) + .orElse(JsonNullable.undefined()); + this.dueDate = Optional.ofNullable(dueDate) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.taxCode = Optional.ofNullable(taxCode) + .orElse(JsonNullable.undefined()); + this.channel = Optional.ofNullable(channel) + .orElse(JsonNullable.undefined()); + this.memo = Optional.ofNullable(memo) + .orElse(JsonNullable.undefined()); + this.trackingCategories = Optional.ofNullable(trackingCategories) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public PurchaseOrderInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. */ - @JsonIgnore public JsonNullable poNumber() { - return poNumber; + return this.poNumber; } /** * Optional purchase order reference. */ - @JsonIgnore public JsonNullable reference() { - return reference; + return this.reference; } /** * The supplier this entity is linked to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable supplier() { - return (JsonNullable) supplier; + return this.supplier; } /** * The ID of the subsidiary */ - @JsonIgnore public JsonNullable subsidiaryId() { - return subsidiaryId; + return this.subsidiaryId; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Date purchase order was issued - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable issuedDate() { - return issuedDate; + return this.issuedDate; } /** * The date on which the purchase order is to be delivered - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable deliveryDate() { - return deliveryDate; + return this.deliveryDate; } /** * The date on which the order is expected to arrive - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable expectedArrivalDate() { - return expectedArrivalDate; + return this.expectedArrivalDate; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - @JsonIgnore public JsonNullable currencyRate() { - return currencyRate; + return this.currencyRate; } /** * Sub-total amount, normally before tax. */ - @JsonIgnore public JsonNullable subTotal() { - return subTotal; + return this.subTotal; } /** * Total tax amount applied to this invoice. */ - @JsonIgnore public JsonNullable totalTax() { - return totalTax; + return this.totalTax; } /** * Total amount of invoice, including tax. */ - @JsonIgnore public JsonNullable total() { - return total; + return this.total; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> lineItems() { - return (Optional>) lineItems; + return Optional.ofNullable(this.lineItems); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional
shippingAddress() { - return (Optional
) shippingAddress; + return Optional.ofNullable(this.shippingAddress); } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable ledgerAccount() { - return (JsonNullable) ledgerAccount; + return this.ledgerAccount; } /** * Optional purchase order template */ - @JsonIgnore public JsonNullable templateId() { - return templateId; + return this.templateId; } /** * Discount percentage applied to this transaction. */ - @JsonIgnore public JsonNullable discountPercentage() { - return discountPercentage; + return this.discountPercentage; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional bankAccount() { - return (Optional) bankAccount; + return Optional.ofNullable(this.bankAccount); } /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - @JsonIgnore public JsonNullable accountingByRow() { - return accountingByRow; + return this.accountingByRow; } /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - @JsonIgnore public JsonNullable dueDate() { - return dueDate; + return this.dueDate; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - @JsonIgnore public JsonNullable taxCode() { - return taxCode; + return this.taxCode; } /** * The channel through which the transaction is processed. */ - @JsonIgnore public JsonNullable channel() { - return channel; + return this.channel; } /** * Message for the supplier. This text appears on the Purchase Order. */ - @JsonIgnore public JsonNullable memo() { - return memo; + return this.memo; } /** * A list of linked tracking categories. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> trackingCategories() { - return (JsonNullable>) trackingCategories; + return this.trackingCategories; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -585,517 +538,251 @@ public static Builder builder() { /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. */ - public PurchaseOrderInput withPoNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public PurchaseOrderInput withPoNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. - */ - public PurchaseOrderInput withPoNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } /** * Optional purchase order reference. */ - public PurchaseOrderInput withReference(String reference) { - Utils.checkNotNull(reference, "reference"); + public PurchaseOrderInput withReference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional purchase order reference. - */ - public PurchaseOrderInput withReference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } /** * The supplier this entity is linked to. */ - public PurchaseOrderInput withSupplier(LinkedSupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); + public PurchaseOrderInput withSupplier(@Nullable LinkedSupplierInput supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public PurchaseOrderInput withSupplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } /** * The ID of the subsidiary */ - public PurchaseOrderInput withSubsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public PurchaseOrderInput withSubsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public PurchaseOrderInput withSubsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public PurchaseOrderInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public PurchaseOrderInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public PurchaseOrderInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - public PurchaseOrderInput withStatus(PurchaseOrderStatus status) { - Utils.checkNotNull(status, "status"); + public PurchaseOrderInput withStatus(@Nullable PurchaseOrderStatus status) { this.status = JsonNullable.of(status); return this; } - public PurchaseOrderInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Date purchase order was issued - YYYY-MM-DD. */ - public PurchaseOrderInput withIssuedDate(LocalDate issuedDate) { - Utils.checkNotNull(issuedDate, "issuedDate"); + public PurchaseOrderInput withIssuedDate(@Nullable LocalDate issuedDate) { this.issuedDate = JsonNullable.of(issuedDate); return this; } - /** - * Date purchase order was issued - YYYY-MM-DD. - */ - public PurchaseOrderInput withIssuedDate(JsonNullable issuedDate) { - Utils.checkNotNull(issuedDate, "issuedDate"); - this.issuedDate = issuedDate; - return this; - } /** * The date on which the purchase order is to be delivered - YYYY-MM-DD. */ - public PurchaseOrderInput withDeliveryDate(LocalDate deliveryDate) { - Utils.checkNotNull(deliveryDate, "deliveryDate"); + public PurchaseOrderInput withDeliveryDate(@Nullable LocalDate deliveryDate) { this.deliveryDate = JsonNullable.of(deliveryDate); return this; } - /** - * The date on which the purchase order is to be delivered - YYYY-MM-DD. - */ - public PurchaseOrderInput withDeliveryDate(JsonNullable deliveryDate) { - Utils.checkNotNull(deliveryDate, "deliveryDate"); - this.deliveryDate = deliveryDate; - return this; - } /** * The date on which the order is expected to arrive - YYYY-MM-DD. */ - public PurchaseOrderInput withExpectedArrivalDate(LocalDate expectedArrivalDate) { - Utils.checkNotNull(expectedArrivalDate, "expectedArrivalDate"); + public PurchaseOrderInput withExpectedArrivalDate(@Nullable LocalDate expectedArrivalDate) { this.expectedArrivalDate = JsonNullable.of(expectedArrivalDate); return this; } - /** - * The date on which the order is expected to arrive - YYYY-MM-DD. - */ - public PurchaseOrderInput withExpectedArrivalDate(JsonNullable expectedArrivalDate) { - Utils.checkNotNull(expectedArrivalDate, "expectedArrivalDate"); - this.expectedArrivalDate = expectedArrivalDate; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public PurchaseOrderInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public PurchaseOrderInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public PurchaseOrderInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public PurchaseOrderInput withCurrencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public PurchaseOrderInput withCurrencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public PurchaseOrderInput withCurrencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } /** * Sub-total amount, normally before tax. */ - public PurchaseOrderInput withSubTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public PurchaseOrderInput withSubTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public PurchaseOrderInput withSubTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } /** * Total tax amount applied to this invoice. */ - public PurchaseOrderInput withTotalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public PurchaseOrderInput withTotalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public PurchaseOrderInput withTotalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } /** * Total amount of invoice, including tax. */ - public PurchaseOrderInput withTotal(double total) { - Utils.checkNotNull(total, "total"); + public PurchaseOrderInput withTotal(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of invoice, including tax. - */ - public PurchaseOrderInput withTotal(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } /** * Amounts are including tax */ - public PurchaseOrderInput withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public PurchaseOrderInput withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public PurchaseOrderInput withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - public PurchaseOrderInput withLineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - - public PurchaseOrderInput withLineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public PurchaseOrderInput withLineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - public PurchaseOrderInput withShippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public PurchaseOrderInput withShippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public PurchaseOrderInput withShippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } - public PurchaseOrderInput withLedgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + + public PurchaseOrderInput withLedgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public PurchaseOrderInput withLedgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } /** * Optional purchase order template */ - public PurchaseOrderInput withTemplateId(String templateId) { - Utils.checkNotNull(templateId, "templateId"); + public PurchaseOrderInput withTemplateId(@Nullable String templateId) { this.templateId = JsonNullable.of(templateId); return this; } - /** - * Optional purchase order template - */ - public PurchaseOrderInput withTemplateId(JsonNullable templateId) { - Utils.checkNotNull(templateId, "templateId"); - this.templateId = templateId; - return this; - } /** * Discount percentage applied to this transaction. */ - public PurchaseOrderInput withDiscountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public PurchaseOrderInput withDiscountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this transaction. - */ - public PurchaseOrderInput withDiscountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - public PurchaseOrderInput withBankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - - public PurchaseOrderInput withBankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public PurchaseOrderInput withBankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } + /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public PurchaseOrderInput withAccountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public PurchaseOrderInput withAccountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public PurchaseOrderInput withAccountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - public PurchaseOrderInput withDueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public PurchaseOrderInput withDueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - */ - public PurchaseOrderInput withDueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public PurchaseOrderInput withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public PurchaseOrderInput withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public PurchaseOrderInput withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public PurchaseOrderInput withTaxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public PurchaseOrderInput withTaxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public PurchaseOrderInput withTaxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } /** * The channel through which the transaction is processed. */ - public PurchaseOrderInput withChannel(String channel) { - Utils.checkNotNull(channel, "channel"); + public PurchaseOrderInput withChannel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public PurchaseOrderInput withChannel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } /** * Message for the supplier. This text appears on the Purchase Order. */ - public PurchaseOrderInput withMemo(String memo) { - Utils.checkNotNull(memo, "memo"); + public PurchaseOrderInput withMemo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * Message for the supplier. This text appears on the Purchase Order. - */ - public PurchaseOrderInput withMemo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } /** * A list of linked tracking categories. */ - public PurchaseOrderInput withTrackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public PurchaseOrderInput withTrackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public PurchaseOrderInput withTrackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - public PurchaseOrderInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - - public PurchaseOrderInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public PurchaseOrderInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public PurchaseOrderInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public PurchaseOrderInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public PurchaseOrderInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public PurchaseOrderInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -1103,12 +790,12 @@ public PurchaseOrderInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public PurchaseOrderInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public PurchaseOrderInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1207,627 +894,303 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable poNumber = JsonNullable.undefined(); + private JsonNullable poNumber; - private JsonNullable reference = JsonNullable.undefined(); + private JsonNullable reference; - private JsonNullable supplier = JsonNullable.undefined(); + private JsonNullable supplier; - private JsonNullable subsidiaryId = JsonNullable.undefined(); + private JsonNullable subsidiaryId; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable issuedDate = JsonNullable.undefined(); + private JsonNullable issuedDate; - private JsonNullable deliveryDate = JsonNullable.undefined(); + private JsonNullable deliveryDate; - private JsonNullable expectedArrivalDate = JsonNullable.undefined(); + private JsonNullable expectedArrivalDate; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable currencyRate = JsonNullable.undefined(); + private JsonNullable currencyRate; - private JsonNullable subTotal = JsonNullable.undefined(); + private JsonNullable subTotal; - private JsonNullable totalTax = JsonNullable.undefined(); + private JsonNullable totalTax; - private JsonNullable total = JsonNullable.undefined(); + private JsonNullable total; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private Optional> lineItems = Optional.empty(); + private List lineItems; - private Optional shippingAddress = Optional.empty(); + private Address shippingAddress; - private JsonNullable ledgerAccount = JsonNullable.undefined(); + private JsonNullable ledgerAccount; - private JsonNullable templateId = JsonNullable.undefined(); + private JsonNullable templateId; - private JsonNullable discountPercentage = JsonNullable.undefined(); + private JsonNullable discountPercentage; - private Optional bankAccount = Optional.empty(); + private BankAccount bankAccount; - private JsonNullable accountingByRow = JsonNullable.undefined(); + private JsonNullable accountingByRow; - private JsonNullable dueDate = JsonNullable.undefined(); + private JsonNullable dueDate; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable taxCode = JsonNullable.undefined(); + private JsonNullable taxCode; - private JsonNullable channel = JsonNullable.undefined(); + private JsonNullable channel; - private JsonNullable memo = JsonNullable.undefined(); + private JsonNullable memo; - private JsonNullable> trackingCategories = JsonNullable.undefined(); + private JsonNullable> trackingCategories; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. */ - public Builder poNumber(String poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); + public Builder poNumber(@Nullable String poNumber) { this.poNumber = JsonNullable.of(poNumber); return this; } - /** - * A PO Number uniquely identifies a purchase order and is generally defined by the buyer. - */ - public Builder poNumber(JsonNullable poNumber) { - Utils.checkNotNull(poNumber, "poNumber"); - this.poNumber = poNumber; - return this; - } - - /** * Optional purchase order reference. */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = JsonNullable.of(reference); return this; } - /** - * Optional purchase order reference. - */ - public Builder reference(JsonNullable reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = reference; - return this; - } - - /** * The supplier this entity is linked to. */ - public Builder supplier(LinkedSupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); + public Builder supplier(@Nullable LinkedSupplierInput supplier) { this.supplier = JsonNullable.of(supplier); return this; } - /** - * The supplier this entity is linked to. - */ - public Builder supplier(JsonNullable supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; - return this; - } - - /** * The ID of the subsidiary */ - public Builder subsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public Builder subsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = JsonNullable.of(subsidiaryId); return this; } - /** - * The ID of the subsidiary - */ - public Builder subsidiaryId(JsonNullable subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = subsidiaryId; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - - public Builder status(PurchaseOrderStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable PurchaseOrderStatus status) { this.status = JsonNullable.of(status); return this; } - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Date purchase order was issued - YYYY-MM-DD. */ - public Builder issuedDate(LocalDate issuedDate) { - Utils.checkNotNull(issuedDate, "issuedDate"); + public Builder issuedDate(@Nullable LocalDate issuedDate) { this.issuedDate = JsonNullable.of(issuedDate); return this; } - /** - * Date purchase order was issued - YYYY-MM-DD. - */ - public Builder issuedDate(JsonNullable issuedDate) { - Utils.checkNotNull(issuedDate, "issuedDate"); - this.issuedDate = issuedDate; - return this; - } - - /** * The date on which the purchase order is to be delivered - YYYY-MM-DD. */ - public Builder deliveryDate(LocalDate deliveryDate) { - Utils.checkNotNull(deliveryDate, "deliveryDate"); + public Builder deliveryDate(@Nullable LocalDate deliveryDate) { this.deliveryDate = JsonNullable.of(deliveryDate); return this; } - /** - * The date on which the purchase order is to be delivered - YYYY-MM-DD. - */ - public Builder deliveryDate(JsonNullable deliveryDate) { - Utils.checkNotNull(deliveryDate, "deliveryDate"); - this.deliveryDate = deliveryDate; - return this; - } - - /** * The date on which the order is expected to arrive - YYYY-MM-DD. */ - public Builder expectedArrivalDate(LocalDate expectedArrivalDate) { - Utils.checkNotNull(expectedArrivalDate, "expectedArrivalDate"); + public Builder expectedArrivalDate(@Nullable LocalDate expectedArrivalDate) { this.expectedArrivalDate = JsonNullable.of(expectedArrivalDate); return this; } - /** - * The date on which the order is expected to arrive - YYYY-MM-DD. - */ - public Builder expectedArrivalDate(JsonNullable expectedArrivalDate) { - Utils.checkNotNull(expectedArrivalDate, "expectedArrivalDate"); - this.expectedArrivalDate = expectedArrivalDate; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * Currency Exchange Rate at the time entity was recorded/generated. */ - public Builder currencyRate(double currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); + public Builder currencyRate(@Nullable Double currencyRate) { this.currencyRate = JsonNullable.of(currencyRate); return this; } - /** - * Currency Exchange Rate at the time entity was recorded/generated. - */ - public Builder currencyRate(JsonNullable currencyRate) { - Utils.checkNotNull(currencyRate, "currencyRate"); - this.currencyRate = currencyRate; - return this; - } - - /** * Sub-total amount, normally before tax. */ - public Builder subTotal(double subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); + public Builder subTotal(@Nullable Double subTotal) { this.subTotal = JsonNullable.of(subTotal); return this; } - /** - * Sub-total amount, normally before tax. - */ - public Builder subTotal(JsonNullable subTotal) { - Utils.checkNotNull(subTotal, "subTotal"); - this.subTotal = subTotal; - return this; - } - - /** * Total tax amount applied to this invoice. */ - public Builder totalTax(double totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); + public Builder totalTax(@Nullable Double totalTax) { this.totalTax = JsonNullable.of(totalTax); return this; } - /** - * Total tax amount applied to this invoice. - */ - public Builder totalTax(JsonNullable totalTax) { - Utils.checkNotNull(totalTax, "totalTax"); - this.totalTax = totalTax; - return this; - } - - /** * Total amount of invoice, including tax. */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = JsonNullable.of(total); return this; } - /** - * Total amount of invoice, including tax. - */ - public Builder total(JsonNullable total) { - Utils.checkNotNull(total, "total"); - this.total = total; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - - public Builder lineItems(List lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); - this.lineItems = Optional.ofNullable(lineItems); - return this; - } - - public Builder lineItems(Optional> lineItems) { - Utils.checkNotNull(lineItems, "lineItems"); + public Builder lineItems(@Nullable List lineItems) { this.lineItems = lineItems; return this; } - - public Builder shippingAddress(Address shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); - this.shippingAddress = Optional.ofNullable(shippingAddress); - return this; - } - - public Builder shippingAddress(Optional shippingAddress) { - Utils.checkNotNull(shippingAddress, "shippingAddress"); + public Builder shippingAddress(@Nullable Address shippingAddress) { this.shippingAddress = shippingAddress; return this; } - - public Builder ledgerAccount(LinkedLedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); + public Builder ledgerAccount(@Nullable LinkedLedgerAccountInput ledgerAccount) { this.ledgerAccount = JsonNullable.of(ledgerAccount); return this; } - public Builder ledgerAccount(JsonNullable ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; - return this; - } - - /** * Optional purchase order template */ - public Builder templateId(String templateId) { - Utils.checkNotNull(templateId, "templateId"); + public Builder templateId(@Nullable String templateId) { this.templateId = JsonNullable.of(templateId); return this; } - /** - * Optional purchase order template - */ - public Builder templateId(JsonNullable templateId) { - Utils.checkNotNull(templateId, "templateId"); - this.templateId = templateId; - return this; - } - - /** * Discount percentage applied to this transaction. */ - public Builder discountPercentage(double discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); + public Builder discountPercentage(@Nullable Double discountPercentage) { this.discountPercentage = JsonNullable.of(discountPercentage); return this; } - /** - * Discount percentage applied to this transaction. - */ - public Builder discountPercentage(JsonNullable discountPercentage) { - Utils.checkNotNull(discountPercentage, "discountPercentage"); - this.discountPercentage = discountPercentage; - return this; - } - - - public Builder bankAccount(BankAccount bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); - this.bankAccount = Optional.ofNullable(bankAccount); - return this; - } - - public Builder bankAccount(Optional bankAccount) { - Utils.checkNotNull(bankAccount, "bankAccount"); + public Builder bankAccount(@Nullable BankAccount bankAccount) { this.bankAccount = bankAccount; return this; } - /** * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. */ - public Builder accountingByRow(boolean accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); + public Builder accountingByRow(@Nullable Boolean accountingByRow) { this.accountingByRow = JsonNullable.of(accountingByRow); return this; } - /** - * Indicates if accounting by row is used (true) or not (false). Accounting by row means that a separate ledger transaction is created for each row. - */ - public Builder accountingByRow(JsonNullable accountingByRow) { - Utils.checkNotNull(accountingByRow, "accountingByRow"); - this.accountingByRow = accountingByRow; - return this; - } - - /** * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. */ - public Builder dueDate(LocalDate dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Builder dueDate(@Nullable LocalDate dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * The due date is the date on which a payment is scheduled to be received - YYYY-MM-DD. - */ - public Builder dueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * Applicable tax id/code override if tax is not supplied on a line item basis. */ - public Builder taxCode(String taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); + public Builder taxCode(@Nullable String taxCode) { this.taxCode = JsonNullable.of(taxCode); return this; } - /** - * Applicable tax id/code override if tax is not supplied on a line item basis. - */ - public Builder taxCode(JsonNullable taxCode) { - Utils.checkNotNull(taxCode, "taxCode"); - this.taxCode = taxCode; - return this; - } - - /** * The channel through which the transaction is processed. */ - public Builder channel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Builder channel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Builder channel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - /** * Message for the supplier. This text appears on the Purchase Order. */ - public Builder memo(String memo) { - Utils.checkNotNull(memo, "memo"); + public Builder memo(@Nullable String memo) { this.memo = JsonNullable.of(memo); return this; } - /** - * Message for the supplier. This text appears on the Purchase Order. - */ - public Builder memo(JsonNullable memo) { - Utils.checkNotNull(memo, "memo"); - this.memo = memo; - return this; - } - - /** * A list of linked tracking categories. */ - public Builder trackingCategories(List trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); + public Builder trackingCategories(@Nullable List trackingCategories) { this.trackingCategories = JsonNullable.of(trackingCategories); return this; } - /** - * A list of linked tracking categories. - */ - public Builder trackingCategories(JsonNullable> trackingCategories) { - Utils.checkNotNull(trackingCategories, "trackingCategories"); - this.trackingCategories = trackingCategories; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public PurchaseOrderInput build() { - return new PurchaseOrderInput( poNumber, reference, supplier, subsidiaryId, companyId, status, diff --git a/src/main/java/com/apideck/unify/models/components/PurchaseOrdersFilter.java b/src/main/java/com/apideck/unify/models/components/PurchaseOrdersFilter.java index 532277cc..66336d7d 100644 --- a/src/main/java/com/apideck/unify/models/components/PurchaseOrdersFilter.java +++ b/src/main/java/com/apideck/unify/models/components/PurchaseOrdersFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; @@ -16,34 +16,30 @@ public class PurchaseOrdersFilter { @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private OffsetDateTime updatedSince; @SpeakeasyMetadata("queryParam:name=supplier_id") - private Optional supplierId; + private String supplierId; @JsonCreator public PurchaseOrdersFilter( - Optional updatedSince, - Optional supplierId) { - Utils.checkNotNull(updatedSince, "updatedSince"); - Utils.checkNotNull(supplierId, "supplierId"); + @Nullable OffsetDateTime updatedSince, + @Nullable String supplierId) { this.updatedSince = updatedSince; this.supplierId = supplierId; } public PurchaseOrdersFilter() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } - @JsonIgnore public Optional supplierId() { - return supplierId; + return Optional.ofNullable(this.supplierId); } public static Builder builder() { @@ -51,32 +47,18 @@ public static Builder builder() { } - public PurchaseOrdersFilter withUpdatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - - public PurchaseOrdersFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public PurchaseOrdersFilter withUpdatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - public PurchaseOrdersFilter withSupplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - - public PurchaseOrdersFilter withSupplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public PurchaseOrdersFilter withSupplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,42 +89,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional updatedSince = Optional.empty(); + private OffsetDateTime updatedSince; - private Optional supplierId = Optional.empty(); + private String supplierId; private Builder() { // force use of static builder() method } - - public Builder updatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } - - public Builder supplierId(String supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); - this.supplierId = Optional.ofNullable(supplierId); - return this; - } - - public Builder supplierId(Optional supplierId) { - Utils.checkNotNull(supplierId, "supplierId"); + public Builder supplierId(@Nullable String supplierId) { this.supplierId = supplierId; return this; } public PurchaseOrdersFilter build() { - return new PurchaseOrdersFilter( updatedSince, supplierId); } diff --git a/src/main/java/com/apideck/unify/models/components/PurchaseOrdersSort.java b/src/main/java/com/apideck/unify/models/components/PurchaseOrdersSort.java index c0593b20..3ae5b70f 100644 --- a/src/main/java/com/apideck/unify/models/components/PurchaseOrdersSort.java +++ b/src/main/java/com/apideck/unify/models/components/PurchaseOrdersSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class PurchaseOrdersSort { * The field on which to sort the Purchase Orders */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private PurchaseOrdersSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public PurchaseOrdersSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable PurchaseOrdersSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public PurchaseOrdersSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Purchase Orders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Purchase Orders */ - public PurchaseOrdersSort withBy(PurchaseOrdersSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Purchase Orders - */ - public PurchaseOrdersSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public PurchaseOrdersSort withBy(@Nullable PurchaseOrdersSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public PurchaseOrdersSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public PurchaseOrdersSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public PurchaseOrdersSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private PurchaseOrdersSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Purchase Orders - */ - public Builder by(PurchaseOrdersSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Purchase Orders */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable PurchaseOrdersSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public PurchaseOrdersSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new PurchaseOrdersSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/Reports.java b/src/main/java/com/apideck/unify/models/components/Reports.java index 29416add..0c71478a 100644 --- a/src/main/java/com/apideck/unify/models/components/Reports.java +++ b/src/main/java/com/apideck/unify/models/components/Reports.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.Map; import java.util.Optional; @@ -26,21 +26,21 @@ public class Reports { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the report */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("report_name") - private Optional reportName; + private String reportName; /** * The start date of the report */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("start_date") - private Optional startDate; + private String startDate; /** * The start date of the report @@ -53,7 +53,7 @@ public class Reports { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; /** * A balance sheet assets account represents the financial position of a company at a specific point in time. @@ -78,14 +78,14 @@ public class Reports { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("net_assets") - private Optional netAssets; + private Double netAssets; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -120,190 +120,167 @@ public class Reports { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("uncategorized_items") - private Optional uncategorizedItems; + private BalanceSheetUncategorizedItemsAccount uncategorizedItems; @JsonCreator public Reports( - @JsonProperty("id") Optional id, - @JsonProperty("report_name") Optional reportName, - @JsonProperty("start_date") Optional startDate, - @JsonProperty("end_date") String endDate, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("assets") BalanceSheetAssetsAccount assets, - @JsonProperty("liabilities") BalanceSheetLiabilitiesAccount liabilities, - @JsonProperty("equity") BalanceSheetEquityAccount equity, - @JsonProperty("net_assets") Optional netAssets, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("uncategorized_items") Optional uncategorizedItems) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(reportName, "reportName"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(assets, "assets"); - Utils.checkNotNull(liabilities, "liabilities"); - Utils.checkNotNull(equity, "equity"); - Utils.checkNotNull(netAssets, "netAssets"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(uncategorizedItems, "uncategorizedItems"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("report_name") @Nullable String reportName, + @JsonProperty("start_date") @Nullable String startDate, + @JsonProperty("end_date") @Nonnull String endDate, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("assets") @Nonnull BalanceSheetAssetsAccount assets, + @JsonProperty("liabilities") @Nonnull BalanceSheetLiabilitiesAccount liabilities, + @JsonProperty("equity") @Nonnull BalanceSheetEquityAccount equity, + @JsonProperty("net_assets") @Nullable Double netAssets, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("uncategorized_items") @Nullable BalanceSheetUncategorizedItemsAccount uncategorizedItems) { this.id = id; this.reportName = reportName; this.startDate = startDate; - this.endDate = endDate; - this.currency = currency; - this.assets = assets; - this.liabilities = liabilities; - this.equity = equity; + this.endDate = Optional.ofNullable(endDate) + .orElseThrow(() -> new IllegalArgumentException("endDate cannot be null")); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.assets = Optional.ofNullable(assets) + .orElseThrow(() -> new IllegalArgumentException("assets cannot be null")); + this.liabilities = Optional.ofNullable(liabilities) + .orElseThrow(() -> new IllegalArgumentException("liabilities cannot be null")); + this.equity = Optional.ofNullable(equity) + .orElseThrow(() -> new IllegalArgumentException("equity cannot be null")); this.netAssets = netAssets; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.uncategorizedItems = uncategorizedItems; } public Reports( - String endDate, - BalanceSheetAssetsAccount assets, - BalanceSheetLiabilitiesAccount liabilities, - BalanceSheetEquityAccount equity) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - endDate, JsonNullable.undefined(), assets, - liabilities, equity, Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + @Nonnull String endDate, + @Nonnull BalanceSheetAssetsAccount assets, + @Nonnull BalanceSheetLiabilitiesAccount liabilities, + @Nonnull BalanceSheetEquityAccount equity) { + this(null, null, null, + endDate, null, assets, + liabilities, equity, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the report */ - @JsonIgnore public Optional reportName() { - return reportName; + return Optional.ofNullable(this.reportName); } /** * The start date of the report */ - @JsonIgnore public Optional startDate() { - return startDate; + return Optional.ofNullable(this.startDate); } /** * The start date of the report */ - @JsonIgnore public String endDate() { - return endDate; + return this.endDate; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } /** * A balance sheet assets account represents the financial position of a company at a specific point in time. */ - @JsonIgnore public BalanceSheetAssetsAccount assets() { - return assets; + return this.assets; } /** * A balance sheet liabilities account represents the financial position of a company at a specific point in time. */ - @JsonIgnore public BalanceSheetLiabilitiesAccount liabilities() { - return liabilities; + return this.liabilities; } /** * A balance sheet equity account represents the financial position of a company at a specific point in time. */ - @JsonIgnore public BalanceSheetEquityAccount equity() { - return equity; + return this.equity; } /** * The net assets of the balance sheet */ - @JsonIgnore public Optional netAssets() { - return netAssets; + return Optional.ofNullable(this.netAssets); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * A balance sheet uncategorized items account represents the financial position of a company at a specific point in time. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional uncategorizedItems() { - return (Optional) uncategorizedItems; + return Optional.ofNullable(this.uncategorizedItems); } public static Builder builder() { @@ -314,120 +291,71 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Reports withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Reports withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Reports withId(@Nullable String id) { this.id = id; return this; } - /** - * The name of the report - */ - public Reports withReportName(String reportName) { - Utils.checkNotNull(reportName, "reportName"); - this.reportName = Optional.ofNullable(reportName); - return this; - } - /** * The name of the report */ - public Reports withReportName(Optional reportName) { - Utils.checkNotNull(reportName, "reportName"); + public Reports withReportName(@Nullable String reportName) { this.reportName = reportName; return this; } - /** - * The start date of the report - */ - public Reports withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - /** * The start date of the report */ - public Reports withStartDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Reports withStartDate(@Nullable String startDate) { this.startDate = startDate; return this; } + /** * The start date of the report */ - public Reports withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; + public Reports withEndDate(@Nonnull String endDate) { + this.endDate = Utils.checkNotNull(endDate, "endDate"); return this; } + /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Reports withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Reports withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Reports withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } /** * A balance sheet assets account represents the financial position of a company at a specific point in time. */ - public Reports withAssets(BalanceSheetAssetsAccount assets) { - Utils.checkNotNull(assets, "assets"); - this.assets = assets; + public Reports withAssets(@Nonnull BalanceSheetAssetsAccount assets) { + this.assets = Utils.checkNotNull(assets, "assets"); return this; } + /** * A balance sheet liabilities account represents the financial position of a company at a specific point in time. */ - public Reports withLiabilities(BalanceSheetLiabilitiesAccount liabilities) { - Utils.checkNotNull(liabilities, "liabilities"); - this.liabilities = liabilities; + public Reports withLiabilities(@Nonnull BalanceSheetLiabilitiesAccount liabilities) { + this.liabilities = Utils.checkNotNull(liabilities, "liabilities"); return this; } - /** - * A balance sheet equity account represents the financial position of a company at a specific point in time. - */ - public Reports withEquity(BalanceSheetEquityAccount equity) { - Utils.checkNotNull(equity, "equity"); - this.equity = equity; - return this; - } /** - * The net assets of the balance sheet + * A balance sheet equity account represents the financial position of a company at a specific point in time. */ - public Reports withNetAssets(double netAssets) { - Utils.checkNotNull(netAssets, "netAssets"); - this.netAssets = Optional.ofNullable(netAssets); + public Reports withEquity(@Nonnull BalanceSheetEquityAccount equity) { + this.equity = Utils.checkNotNull(equity, "equity"); return this; } @@ -435,121 +363,66 @@ public Reports withNetAssets(double netAssets) { /** * The net assets of the balance sheet */ - public Reports withNetAssets(Optional netAssets) { - Utils.checkNotNull(netAssets, "netAssets"); + public Reports withNetAssets(@Nullable Double netAssets) { this.netAssets = netAssets; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public Reports withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Reports withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Reports withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public Reports withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Reports withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Reports withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Reports withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Reports withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Reports withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Reports withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Reports withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Reports withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Reports withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Reports withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Reports withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * A balance sheet uncategorized items account represents the financial position of a company at a specific point in time. - */ - public Reports withUncategorizedItems(BalanceSheetUncategorizedItemsAccount uncategorizedItems) { - Utils.checkNotNull(uncategorizedItems, "uncategorizedItems"); - this.uncategorizedItems = Optional.ofNullable(uncategorizedItems); - return this; - } - /** * A balance sheet uncategorized items account represents the financial position of a company at a specific point in time. */ - public Reports withUncategorizedItems(Optional uncategorizedItems) { - Utils.checkNotNull(uncategorizedItems, "uncategorizedItems"); + public Reports withUncategorizedItems(@Nullable BalanceSheetUncategorizedItemsAccount uncategorizedItems) { this.uncategorizedItems = uncategorizedItems; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -610,15 +483,15 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional reportName = Optional.empty(); + private String reportName; - private Optional startDate = Optional.empty(); + private String startDate; private String endDate; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; private BalanceSheetAssetsAccount assets; @@ -626,275 +499,145 @@ public final static class Builder { private BalanceSheetEquityAccount equity; - private Optional netAssets = Optional.empty(); + private Double netAssets; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional uncategorizedItems = Optional.empty(); + private BalanceSheetUncategorizedItemsAccount uncategorizedItems; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * The name of the report - */ - public Builder reportName(String reportName) { - Utils.checkNotNull(reportName, "reportName"); - this.reportName = Optional.ofNullable(reportName); - return this; - } - /** * The name of the report */ - public Builder reportName(Optional reportName) { - Utils.checkNotNull(reportName, "reportName"); + public Builder reportName(@Nullable String reportName) { this.reportName = reportName; return this; } - /** * The start date of the report */ - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - - /** - * The start date of the report - */ - public Builder startDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable String startDate) { this.startDate = startDate; return this; } - /** * The start date of the report */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; + public Builder endDate(@Nonnull String endDate) { + this.endDate = Utils.checkNotNull(endDate, "endDate"); return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - /** * A balance sheet assets account represents the financial position of a company at a specific point in time. */ - public Builder assets(BalanceSheetAssetsAccount assets) { - Utils.checkNotNull(assets, "assets"); - this.assets = assets; + public Builder assets(@Nonnull BalanceSheetAssetsAccount assets) { + this.assets = Utils.checkNotNull(assets, "assets"); return this; } - /** * A balance sheet liabilities account represents the financial position of a company at a specific point in time. */ - public Builder liabilities(BalanceSheetLiabilitiesAccount liabilities) { - Utils.checkNotNull(liabilities, "liabilities"); - this.liabilities = liabilities; + public Builder liabilities(@Nonnull BalanceSheetLiabilitiesAccount liabilities) { + this.liabilities = Utils.checkNotNull(liabilities, "liabilities"); return this; } - /** * A balance sheet equity account represents the financial position of a company at a specific point in time. */ - public Builder equity(BalanceSheetEquityAccount equity) { - Utils.checkNotNull(equity, "equity"); - this.equity = equity; + public Builder equity(@Nonnull BalanceSheetEquityAccount equity) { + this.equity = Utils.checkNotNull(equity, "equity"); return this; } - /** * The net assets of the balance sheet */ - public Builder netAssets(double netAssets) { - Utils.checkNotNull(netAssets, "netAssets"); - this.netAssets = Optional.ofNullable(netAssets); - return this; - } - - /** - * The net assets of the balance sheet - */ - public Builder netAssets(Optional netAssets) { - Utils.checkNotNull(netAssets, "netAssets"); + public Builder netAssets(@Nullable Double netAssets) { this.netAssets = netAssets; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * A balance sheet uncategorized items account represents the financial position of a company at a specific point in time. */ - public Builder uncategorizedItems(BalanceSheetUncategorizedItemsAccount uncategorizedItems) { - Utils.checkNotNull(uncategorizedItems, "uncategorizedItems"); - this.uncategorizedItems = Optional.ofNullable(uncategorizedItems); - return this; - } - - /** - * A balance sheet uncategorized items account represents the financial position of a company at a specific point in time. - */ - public Builder uncategorizedItems(Optional uncategorizedItems) { - Utils.checkNotNull(uncategorizedItems, "uncategorizedItems"); + public Builder uncategorizedItems(@Nullable BalanceSheetUncategorizedItemsAccount uncategorizedItems) { this.uncategorizedItems = uncategorizedItems; return this; } public Reports build() { - return new Reports( id, reportName, startDate, endDate, currency, assets, diff --git a/src/main/java/com/apideck/unify/models/components/RequestCountAllocation.java b/src/main/java/com/apideck/unify/models/components/RequestCountAllocation.java index 77a5c15b..78a9c40c 100644 --- a/src/main/java/com/apideck/unify/models/components/RequestCountAllocation.java +++ b/src/main/java/com/apideck/unify/models/components/RequestCountAllocation.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; @@ -19,48 +19,42 @@ public class RequestCountAllocation { @JsonInclude(Include.NON_ABSENT) @JsonProperty("unify") - private Optional unify; + private Double unify; @JsonInclude(Include.NON_ABSENT) @JsonProperty("proxy") - private Optional proxy; + private Double proxy; @JsonInclude(Include.NON_ABSENT) @JsonProperty("vault") - private Optional vault; + private Double vault; @JsonCreator public RequestCountAllocation( - @JsonProperty("unify") Optional unify, - @JsonProperty("proxy") Optional proxy, - @JsonProperty("vault") Optional vault) { - Utils.checkNotNull(unify, "unify"); - Utils.checkNotNull(proxy, "proxy"); - Utils.checkNotNull(vault, "vault"); + @JsonProperty("unify") @Nullable Double unify, + @JsonProperty("proxy") @Nullable Double proxy, + @JsonProperty("vault") @Nullable Double vault) { this.unify = unify; this.proxy = proxy; this.vault = vault; } public RequestCountAllocation() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } - @JsonIgnore public Optional unify() { - return unify; + return Optional.ofNullable(this.unify); } - @JsonIgnore public Optional proxy() { - return proxy; + return Optional.ofNullable(this.proxy); } - @JsonIgnore public Optional vault() { - return vault; + return Optional.ofNullable(this.vault); } public static Builder builder() { @@ -68,45 +62,24 @@ public static Builder builder() { } - public RequestCountAllocation withUnify(double unify) { - Utils.checkNotNull(unify, "unify"); - this.unify = Optional.ofNullable(unify); - return this; - } - - - public RequestCountAllocation withUnify(Optional unify) { - Utils.checkNotNull(unify, "unify"); + public RequestCountAllocation withUnify(@Nullable Double unify) { this.unify = unify; return this; } - public RequestCountAllocation withProxy(double proxy) { - Utils.checkNotNull(proxy, "proxy"); - this.proxy = Optional.ofNullable(proxy); - return this; - } - - public RequestCountAllocation withProxy(Optional proxy) { - Utils.checkNotNull(proxy, "proxy"); + public RequestCountAllocation withProxy(@Nullable Double proxy) { this.proxy = proxy; return this; } - public RequestCountAllocation withVault(double vault) { - Utils.checkNotNull(vault, "vault"); - this.vault = Optional.ofNullable(vault); - return this; - } - - public RequestCountAllocation withVault(Optional vault) { - Utils.checkNotNull(vault, "vault"); + public RequestCountAllocation withVault(@Nullable Double vault) { this.vault = vault; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -139,57 +112,32 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional unify = Optional.empty(); + private Double unify; - private Optional proxy = Optional.empty(); + private Double proxy; - private Optional vault = Optional.empty(); + private Double vault; private Builder() { // force use of static builder() method } - - public Builder unify(double unify) { - Utils.checkNotNull(unify, "unify"); - this.unify = Optional.ofNullable(unify); - return this; - } - - public Builder unify(Optional unify) { - Utils.checkNotNull(unify, "unify"); + public Builder unify(@Nullable Double unify) { this.unify = unify; return this; } - - public Builder proxy(double proxy) { - Utils.checkNotNull(proxy, "proxy"); - this.proxy = Optional.ofNullable(proxy); - return this; - } - - public Builder proxy(Optional proxy) { - Utils.checkNotNull(proxy, "proxy"); + public Builder proxy(@Nullable Double proxy) { this.proxy = proxy; return this; } - - public Builder vault(double vault) { - Utils.checkNotNull(vault, "vault"); - this.vault = Optional.ofNullable(vault); - return this; - } - - public Builder vault(Optional vault) { - Utils.checkNotNull(vault, "vault"); + public Builder vault(@Nullable Double vault) { this.vault = vault; return this; } public RequestCountAllocation build() { - return new RequestCountAllocation( unify, proxy, vault); } diff --git a/src/main/java/com/apideck/unify/models/components/RequestRate.java b/src/main/java/com/apideck/unify/models/components/RequestRate.java index 71ab25fa..464cd6c0 100644 --- a/src/main/java/com/apideck/unify/models/components/RequestRate.java +++ b/src/main/java/com/apideck/unify/models/components/RequestRate.java @@ -5,11 +5,11 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; import java.lang.Override; import java.lang.String; +import java.util.Optional; /** * RequestRate @@ -39,37 +39,32 @@ public class RequestRate { public RequestRate( @JsonProperty("rate") long rate, @JsonProperty("size") long size, - @JsonProperty("unit") Unit unit) { - Utils.checkNotNull(rate, "rate"); - Utils.checkNotNull(size, "size"); - Utils.checkNotNull(unit, "unit"); + @JsonProperty("unit") @Nonnull Unit unit) { this.rate = rate; this.size = size; - this.unit = unit; + this.unit = Optional.ofNullable(unit) + .orElseThrow(() -> new IllegalArgumentException("unit cannot be null")); } /** * The number of requests per window unit. */ - @JsonIgnore public long rate() { - return rate; + return this.rate; } /** * Size of request window. */ - @JsonIgnore public long size() { - return size; + return this.size; } /** * The window unit for the rate. */ - @JsonIgnore public Unit unit() { - return unit; + return this.unit; } public static Builder builder() { @@ -81,29 +76,29 @@ public static Builder builder() { * The number of requests per window unit. */ public RequestRate withRate(long rate) { - Utils.checkNotNull(rate, "rate"); this.rate = rate; return this; } + /** * Size of request window. */ public RequestRate withSize(long size) { - Utils.checkNotNull(size, "size"); this.size = size; return this; } + /** * The window unit for the rate. */ - public RequestRate withUnit(Unit unit) { - Utils.checkNotNull(unit, "unit"); - this.unit = unit; + public RequestRate withUnit(@Nonnull Unit unit) { + this.unit = Utils.checkNotNull(unit, "unit"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -136,9 +131,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long rate; + private long rate; - private Long size; + private long size; private Unit unit; @@ -146,38 +141,31 @@ private Builder() { // force use of static builder() method } - /** * The number of requests per window unit. */ public Builder rate(long rate) { - Utils.checkNotNull(rate, "rate"); this.rate = rate; return this; } - /** * Size of request window. */ public Builder size(long size) { - Utils.checkNotNull(size, "size"); this.size = size; return this; } - /** * The window unit for the rate. */ - public Builder unit(Unit unit) { - Utils.checkNotNull(unit, "unit"); - this.unit = unit; + public Builder unit(@Nonnull Unit unit) { + this.unit = Utils.checkNotNull(unit, "unit"); return this; } public RequestRate build() { - return new RequestRate( rate, size, unit); } diff --git a/src/main/java/com/apideck/unify/models/components/Resources.java b/src/main/java/com/apideck/unify/models/components/Resources.java index aa17d2de..caa83ade 100644 --- a/src/main/java/com/apideck/unify/models/components/Resources.java +++ b/src/main/java/com/apideck/unify/models/components/Resources.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -22,39 +21,35 @@ public class Resources { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Name of the resource (plural) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Status of the resource. Resources with status live or beta are callable. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private ResourceStatus status; /** * Exclude from mapping coverage */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("excluded_from_coverage") - private Optional excludedFromCoverage; + private Boolean excludedFromCoverage; @JsonCreator public Resources( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("status") Optional status, - @JsonProperty("excluded_from_coverage") Optional excludedFromCoverage) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(excludedFromCoverage, "excludedFromCoverage"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("status") @Nullable ResourceStatus status, + @JsonProperty("excluded_from_coverage") @Nullable Boolean excludedFromCoverage) { this.id = id; this.name = name; this.status = status; @@ -62,41 +57,36 @@ public Resources( } public Resources() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * ID of the resource, typically a lowercased version of its name. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Name of the resource (plural) */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Status of the resource. Resources with status live or beta are callable. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * Exclude from mapping coverage */ - @JsonIgnore public Optional excludedFromCoverage() { - return excludedFromCoverage; + return Optional.ofNullable(this.excludedFromCoverage); } public static Builder builder() { @@ -107,79 +97,39 @@ public static Builder builder() { /** * ID of the resource, typically a lowercased version of its name. */ - public Resources withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * ID of the resource, typically a lowercased version of its name. - */ - public Resources withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Resources withId(@Nullable String id) { this.id = id; return this; } - /** - * Name of the resource (plural) - */ - public Resources withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the resource (plural) */ - public Resources withName(Optional name) { - Utils.checkNotNull(name, "name"); + public Resources withName(@Nullable String name) { this.name = name; return this; } - /** - * Status of the resource. Resources with status live or beta are callable. - */ - public Resources withStatus(ResourceStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Status of the resource. Resources with status live or beta are callable. */ - public Resources withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public Resources withStatus(@Nullable ResourceStatus status) { this.status = status; return this; } - /** - * Exclude from mapping coverage - */ - public Resources withExcludedFromCoverage(boolean excludedFromCoverage) { - Utils.checkNotNull(excludedFromCoverage, "excludedFromCoverage"); - this.excludedFromCoverage = Optional.ofNullable(excludedFromCoverage); - return this; - } - /** * Exclude from mapping coverage */ - public Resources withExcludedFromCoverage(Optional excludedFromCoverage) { - Utils.checkNotNull(excludedFromCoverage, "excludedFromCoverage"); + public Resources withExcludedFromCoverage(@Nullable Boolean excludedFromCoverage) { this.excludedFromCoverage = excludedFromCoverage; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -215,96 +165,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional name = Optional.empty(); + private String name; - private Optional status = Optional.empty(); + private ResourceStatus status; - private Optional excludedFromCoverage = Optional.empty(); + private Boolean excludedFromCoverage; private Builder() { // force use of static builder() method } - /** * ID of the resource, typically a lowercased version of its name. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * ID of the resource, typically a lowercased version of its name. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * Name of the resource (plural) - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the resource (plural) */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * Status of the resource. Resources with status live or beta are callable. */ - public Builder status(ResourceStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * Status of the resource. Resources with status live or beta are callable. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable ResourceStatus status) { this.status = status; return this; } - /** * Exclude from mapping coverage */ - public Builder excludedFromCoverage(boolean excludedFromCoverage) { - Utils.checkNotNull(excludedFromCoverage, "excludedFromCoverage"); - this.excludedFromCoverage = Optional.ofNullable(excludedFromCoverage); - return this; - } - - /** - * Exclude from mapping coverage - */ - public Builder excludedFromCoverage(Optional excludedFromCoverage) { - Utils.checkNotNull(excludedFromCoverage, "excludedFromCoverage"); + public Builder excludedFromCoverage(@Nullable Boolean excludedFromCoverage) { this.excludedFromCoverage = excludedFromCoverage; return this; } public Resources build() { - return new Resources( id, name, status, excludedFromCoverage); diff --git a/src/main/java/com/apideck/unify/models/components/Salary.java b/src/main/java/com/apideck/unify/models/components/Salary.java index 3726f956..15bef8b7 100644 --- a/src/main/java/com/apideck/unify/models/components/Salary.java +++ b/src/main/java/com/apideck/unify/models/components/Salary.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,21 +22,21 @@ public class Salary { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("min") - private Optional min; + private Long min; /** * Maximum salary payable for the job role. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("max") - private Optional max; + private Long max; /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; @JsonInclude(Include.NON_ABSENT) @@ -46,53 +45,46 @@ public class Salary { @JsonCreator public Salary( - @JsonProperty("min") Optional min, - @JsonProperty("max") Optional max, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("interval") JsonNullable interval) { - Utils.checkNotNull(min, "min"); - Utils.checkNotNull(max, "max"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(interval, "interval"); + @JsonProperty("min") @Nullable Long min, + @JsonProperty("max") @Nullable Long max, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("interval") @Nullable JsonNullable interval) { this.min = min; this.max = max; - this.currency = currency; - this.interval = interval; + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.interval = Optional.ofNullable(interval) + .orElse(JsonNullable.undefined()); } public Salary() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null); } /** * Minimum salary payable for the job role. */ - @JsonIgnore public Optional min() { - return min; + return Optional.ofNullable(this.min); } /** * Maximum salary payable for the job role. */ - @JsonIgnore public Optional max() { - return max; + return Optional.ofNullable(this.max); } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } - @JsonIgnore public JsonNullable interval() { - return interval; + return this.interval; } public static Builder builder() { @@ -103,70 +95,35 @@ public static Builder builder() { /** * Minimum salary payable for the job role. */ - public Salary withMin(long min) { - Utils.checkNotNull(min, "min"); - this.min = Optional.ofNullable(min); - return this; - } - - - /** - * Minimum salary payable for the job role. - */ - public Salary withMin(Optional min) { - Utils.checkNotNull(min, "min"); + public Salary withMin(@Nullable Long min) { this.min = min; return this; } - /** - * Maximum salary payable for the job role. - */ - public Salary withMax(long max) { - Utils.checkNotNull(max, "max"); - this.max = Optional.ofNullable(max); - return this; - } - /** * Maximum salary payable for the job role. */ - public Salary withMax(Optional max) { - Utils.checkNotNull(max, "max"); + public Salary withMax(@Nullable Long max) { this.max = max; return this; } + /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Salary withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Salary withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Salary withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - public Salary withInterval(String interval) { - Utils.checkNotNull(interval, "interval"); + public Salary withInterval(@Nullable String interval) { this.interval = JsonNullable.of(interval); return this; } - public Salary withInterval(JsonNullable interval) { - Utils.checkNotNull(interval, "interval"); - this.interval = interval; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -203,90 +160,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional min = Optional.empty(); + private Long min; - private Optional max = Optional.empty(); + private Long max; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable interval = JsonNullable.undefined(); + private JsonNullable interval; private Builder() { // force use of static builder() method } - /** * Minimum salary payable for the job role. */ - public Builder min(long min) { - Utils.checkNotNull(min, "min"); - this.min = Optional.ofNullable(min); - return this; - } - - /** - * Minimum salary payable for the job role. - */ - public Builder min(Optional min) { - Utils.checkNotNull(min, "min"); + public Builder min(@Nullable Long min) { this.min = min; return this; } - - /** - * Maximum salary payable for the job role. - */ - public Builder max(long max) { - Utils.checkNotNull(max, "max"); - this.max = Optional.ofNullable(max); - return this; - } - /** * Maximum salary payable for the job role. */ - public Builder max(Optional max) { - Utils.checkNotNull(max, "max"); + public Builder max(@Nullable Long max) { this.max = max; return this; } - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - public Builder interval(String interval) { - Utils.checkNotNull(interval, "interval"); + public Builder interval(@Nullable String interval) { this.interval = JsonNullable.of(interval); return this; } - public Builder interval(JsonNullable interval) { - Utils.checkNotNull(interval, "interval"); - this.interval = interval; - return this; - } - public Salary build() { - return new Salary( min, max, currency, interval); diff --git a/src/main/java/com/apideck/unify/models/components/SalesDetails.java b/src/main/java/com/apideck/unify/models/components/SalesDetails.java index d754c22a..959efe28 100644 --- a/src/main/java/com/apideck/unify/models/components/SalesDetails.java +++ b/src/main/java/com/apideck/unify/models/components/SalesDetails.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -41,54 +40,48 @@ public class SalesDetails { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRate taxRate; @JsonCreator public SalesDetails( - @JsonProperty("unit_price") JsonNullable unitPrice, - @JsonProperty("unit_of_measure") JsonNullable unitOfMeasure, - @JsonProperty("tax_inclusive") JsonNullable taxInclusive, - @JsonProperty("tax_rate") Optional taxRate) { - Utils.checkNotNull(unitPrice, "unitPrice"); - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - Utils.checkNotNull(taxInclusive, "taxInclusive"); - Utils.checkNotNull(taxRate, "taxRate"); - this.unitPrice = unitPrice; - this.unitOfMeasure = unitOfMeasure; - this.taxInclusive = taxInclusive; + @JsonProperty("unit_price") @Nullable JsonNullable unitPrice, + @JsonProperty("unit_of_measure") @Nullable JsonNullable unitOfMeasure, + @JsonProperty("tax_inclusive") @Nullable JsonNullable taxInclusive, + @JsonProperty("tax_rate") @Nullable LinkedTaxRate taxRate) { + this.unitPrice = Optional.ofNullable(unitPrice) + .orElse(JsonNullable.undefined()); + this.unitOfMeasure = Optional.ofNullable(unitOfMeasure) + .orElse(JsonNullable.undefined()); + this.taxInclusive = Optional.ofNullable(taxInclusive) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; } public SalesDetails() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty()); + this(null, null, null, + null); } - @JsonIgnore public JsonNullable unitPrice() { - return unitPrice; + return this.unitPrice; } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - @JsonIgnore public JsonNullable unitOfMeasure() { - return unitOfMeasure; + return this.unitOfMeasure; } /** * Amounts are including tax */ - @JsonIgnore public JsonNullable taxInclusive() { - return taxInclusive; + return this.taxInclusive; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } public static Builder builder() { @@ -96,67 +89,36 @@ public static Builder builder() { } - public SalesDetails withUnitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public SalesDetails withUnitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public SalesDetails withUnitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public SalesDetails withUnitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public SalesDetails withUnitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public SalesDetails withUnitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } /** * Amounts are including tax */ - public SalesDetails withTaxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public SalesDetails withTaxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public SalesDetails withTaxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - public SalesDetails withTaxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public SalesDetails withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public SalesDetails withTaxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -192,84 +154,45 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable unitPrice = JsonNullable.undefined(); + private JsonNullable unitPrice; - private JsonNullable unitOfMeasure = JsonNullable.undefined(); + private JsonNullable unitOfMeasure; - private JsonNullable taxInclusive = JsonNullable.undefined(); + private JsonNullable taxInclusive; - private Optional taxRate = Optional.empty(); + private LinkedTaxRate taxRate; private Builder() { // force use of static builder() method } - - public Builder unitPrice(double unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); + public Builder unitPrice(@Nullable Double unitPrice) { this.unitPrice = JsonNullable.of(unitPrice); return this; } - public Builder unitPrice(JsonNullable unitPrice) { - Utils.checkNotNull(unitPrice, "unitPrice"); - this.unitPrice = unitPrice; - return this; - } - - /** * Description of the unit type the item is sold as, ie: kg, hour. */ - public Builder unitOfMeasure(String unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); + public Builder unitOfMeasure(@Nullable String unitOfMeasure) { this.unitOfMeasure = JsonNullable.of(unitOfMeasure); return this; } - /** - * Description of the unit type the item is sold as, ie: kg, hour. - */ - public Builder unitOfMeasure(JsonNullable unitOfMeasure) { - Utils.checkNotNull(unitOfMeasure, "unitOfMeasure"); - this.unitOfMeasure = unitOfMeasure; - return this; - } - - /** * Amounts are including tax */ - public Builder taxInclusive(boolean taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); + public Builder taxInclusive(@Nullable Boolean taxInclusive) { this.taxInclusive = JsonNullable.of(taxInclusive); return this; } - /** - * Amounts are including tax - */ - public Builder taxInclusive(JsonNullable taxInclusive) { - Utils.checkNotNull(taxInclusive, "taxInclusive"); - this.taxInclusive = taxInclusive; - return this; - } - - - public Builder taxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } public SalesDetails build() { - return new SalesDetails( unitPrice, unitOfMeasure, taxInclusive, taxRate); diff --git a/src/main/java/com/apideck/unify/models/components/Schedule.java b/src/main/java/com/apideck/unify/models/components/Schedule.java index 27bfea8f..d526fe42 100644 --- a/src/main/java/com/apideck/unify/models/components/Schedule.java +++ b/src/main/java/com/apideck/unify/models/components/Schedule.java @@ -5,10 +5,11 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; import java.lang.Override; import java.lang.String; +import java.util.Optional; public class Schedule { @@ -36,47 +37,43 @@ public class Schedule { @JsonCreator public Schedule( - @JsonProperty("id") String id, - @JsonProperty("start_date") String startDate, - @JsonProperty("end_date") String endDate, - @JsonProperty("work_pattern") WorkPattern workPattern) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(workPattern, "workPattern"); - this.id = id; - this.startDate = startDate; - this.endDate = endDate; - this.workPattern = workPattern; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("start_date") @Nonnull String startDate, + @JsonProperty("end_date") @Nonnull String endDate, + @JsonProperty("work_pattern") @Nonnull WorkPattern workPattern) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.startDate = Optional.ofNullable(startDate) + .orElseThrow(() -> new IllegalArgumentException("startDate cannot be null")); + this.endDate = Optional.ofNullable(endDate) + .orElseThrow(() -> new IllegalArgumentException("endDate cannot be null")); + this.workPattern = Optional.ofNullable(workPattern) + .orElseThrow(() -> new IllegalArgumentException("workPattern cannot be null")); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The start date, inclusive, of the schedule period. */ - @JsonIgnore public String startDate() { - return startDate; + return this.startDate; } /** * The end date, inclusive, of the schedule period. */ - @JsonIgnore public String endDate() { - return endDate; + return this.endDate; } - @JsonIgnore public WorkPattern workPattern() { - return workPattern; + return this.workPattern; } public static Builder builder() { @@ -87,36 +84,36 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Schedule withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Schedule withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The start date, inclusive, of the schedule period. */ - public Schedule withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; + public Schedule withStartDate(@Nonnull String startDate) { + this.startDate = Utils.checkNotNull(startDate, "startDate"); return this; } + /** * The end date, inclusive, of the schedule period. */ - public Schedule withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; + public Schedule withEndDate(@Nonnull String endDate) { + this.endDate = Utils.checkNotNull(endDate, "endDate"); return this; } - public Schedule withWorkPattern(WorkPattern workPattern) { - Utils.checkNotNull(workPattern, "workPattern"); - this.workPattern = workPattern; + + public Schedule withWorkPattern(@Nonnull WorkPattern workPattern) { + this.workPattern = Utils.checkNotNull(workPattern, "workPattern"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -164,45 +161,36 @@ private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The start date, inclusive, of the schedule period. */ - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; + public Builder startDate(@Nonnull String startDate) { + this.startDate = Utils.checkNotNull(startDate, "startDate"); return this; } - /** * The end date, inclusive, of the schedule period. */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; + public Builder endDate(@Nonnull String endDate) { + this.endDate = Utils.checkNotNull(endDate, "endDate"); return this; } - - public Builder workPattern(WorkPattern workPattern) { - Utils.checkNotNull(workPattern, "workPattern"); - this.workPattern = workPattern; + public Builder workPattern(@Nonnull WorkPattern workPattern) { + this.workPattern = Utils.checkNotNull(workPattern, "workPattern"); return this; } public Schedule build() { - return new Schedule( id, startDate, endDate, workPattern); diff --git a/src/main/java/com/apideck/unify/models/components/Schema.java b/src/main/java/com/apideck/unify/models/components/Schema.java index 34c5d072..1e97f9ca 100644 --- a/src/main/java/com/apideck/unify/models/components/Schema.java +++ b/src/main/java/com/apideck/unify/models/components/Schema.java @@ -53,7 +53,6 @@ private Builder() { } public Schema build() { - return new Schema( ); } diff --git a/src/main/java/com/apideck/unify/models/components/SchemaSupport.java b/src/main/java/com/apideck/unify/models/components/SchemaSupport.java index dfd58d45..365eca8b 100644 --- a/src/main/java/com/apideck/unify/models/components/SchemaSupport.java +++ b/src/main/java/com/apideck/unify/models/components/SchemaSupport.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -25,25 +25,23 @@ public class SchemaSupport { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported") - private Optional supported; + private Boolean supported; @JsonCreator public SchemaSupport( - @JsonProperty("supported") Optional supported) { - Utils.checkNotNull(supported, "supported"); + @JsonProperty("supported") @Nullable Boolean supported) { this.supported = supported; } public SchemaSupport() { - this(Optional.empty()); + this(null); } /** * Can a resource schema be retrieved for this connector? */ - @JsonIgnore public Optional supported() { - return supported; + return Optional.ofNullable(this.supported); } public static Builder builder() { @@ -54,22 +52,12 @@ public static Builder builder() { /** * Can a resource schema be retrieved for this connector? */ - public SchemaSupport withSupported(boolean supported) { - Utils.checkNotNull(supported, "supported"); - this.supported = Optional.ofNullable(supported); - return this; - } - - - /** - * Can a resource schema be retrieved for this connector? - */ - public SchemaSupport withSupported(Optional supported) { - Utils.checkNotNull(supported, "supported"); + public SchemaSupport withSupported(@Nullable Boolean supported) { this.supported = supported; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -98,33 +86,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional supported = Optional.empty(); + private Boolean supported; private Builder() { // force use of static builder() method } - - /** - * Can a resource schema be retrieved for this connector? - */ - public Builder supported(boolean supported) { - Utils.checkNotNull(supported, "supported"); - this.supported = Optional.ofNullable(supported); - return this; - } - /** * Can a resource schema be retrieved for this connector? */ - public Builder supported(Optional supported) { - Utils.checkNotNull(supported, "supported"); + public Builder supported(@Nullable Boolean supported) { this.supported = supported; return this; } public SchemaSupport build() { - return new SchemaSupport( supported); } diff --git a/src/main/java/com/apideck/unify/models/components/Security.java b/src/main/java/com/apideck/unify/models/components/Security.java index 2b177834..0deceb3a 100644 --- a/src/main/java/com/apideck/unify/models/components/Security.java +++ b/src/main/java/com/apideck/unify/models/components/Security.java @@ -7,9 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; import java.lang.Override; import java.lang.String; +import java.util.Optional; public class Security implements HasSecurity { @@ -19,14 +20,13 @@ public class Security implements HasSecurity { @JsonCreator public Security( - String apiKey) { - Utils.checkNotNull(apiKey, "apiKey"); - this.apiKey = apiKey; + @Nonnull String apiKey) { + this.apiKey = Optional.ofNullable(apiKey) + .orElseThrow(() -> new IllegalArgumentException("apiKey cannot be null")); } - @JsonIgnore public String apiKey() { - return apiKey; + return this.apiKey; } public static Builder builder() { @@ -34,12 +34,12 @@ public static Builder builder() { } - public Security withApiKey(String apiKey) { - Utils.checkNotNull(apiKey, "apiKey"); - this.apiKey = apiKey; + public Security withApiKey(@Nonnull String apiKey) { + this.apiKey = Utils.checkNotNull(apiKey, "apiKey"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,15 +74,12 @@ private Builder() { // force use of static builder() method } - - public Builder apiKey(String apiKey) { - Utils.checkNotNull(apiKey, "apiKey"); - this.apiKey = apiKey; + public Builder apiKey(@Nonnull String apiKey) { + this.apiKey = Utils.checkNotNull(apiKey, "apiKey"); return this; } public Security build() { - return new Security( apiKey); } diff --git a/src/main/java/com/apideck/unify/models/components/Service.java b/src/main/java/com/apideck/unify/models/components/Service.java index 2ace550c..09bce02f 100644 --- a/src/main/java/com/apideck/unify/models/components/Service.java +++ b/src/main/java/com/apideck/unify/models/components/Service.java @@ -5,10 +5,11 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; import java.lang.Override; import java.lang.String; +import java.util.Optional; /** * Service @@ -30,28 +31,26 @@ public class Service { @JsonCreator public Service( - @JsonProperty("id") String id, - @JsonProperty("name") String name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - this.id = id; - this.name = name; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("name") @Nonnull String name) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.name = Optional.ofNullable(name) + .orElseThrow(() -> new IllegalArgumentException("name cannot be null")); } /** * Apideck service provider id. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Apideck service provider name. */ - @JsonIgnore public String name() { - return name; + return this.name; } public static Builder builder() { @@ -62,21 +61,21 @@ public static Builder builder() { /** * Apideck service provider id. */ - public Service withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Service withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * Apideck service provider name. */ - public Service withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Service withName(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -115,28 +114,23 @@ private Builder() { // force use of static builder() method } - /** * Apideck service provider id. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * Apideck service provider name. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = name; + public Builder name(@Nonnull String name) { + this.name = Utils.checkNotNull(name, "name"); return this; } public Service build() { - return new Service( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/Session.java b/src/main/java/com/apideck/unify/models/components/Session.java index 3bf47ad8..1cc331e1 100644 --- a/src/main/java/com/apideck/unify/models/components/Session.java +++ b/src/main/java/com/apideck/unify/models/components/Session.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; @@ -23,48 +22,43 @@ public class Session { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("consumer_metadata") - private Optional consumerMetadata; + private ConsumerMetadata consumerMetadata; /** * The URL to redirect the user to after the session has been configured. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("redirect_uri") - private Optional redirectUri; + private String redirectUri; /** * Settings to change the way the Vault is displayed. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("settings") - private Optional settings; + private Settings settings; /** * Theming options to change the look and feel of Vault. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("theme") - private Optional theme; + private Theme theme; /** * Custom consumer settings that are passed as part of the session. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_consumer_settings") - private Optional> customConsumerSettings; + private Map customConsumerSettings; @JsonCreator public Session( - @JsonProperty("consumer_metadata") Optional consumerMetadata, - @JsonProperty("redirect_uri") Optional redirectUri, - @JsonProperty("settings") Optional settings, - @JsonProperty("theme") Optional theme, - @JsonProperty("custom_consumer_settings") Optional> customConsumerSettings) { - Utils.checkNotNull(consumerMetadata, "consumerMetadata"); - Utils.checkNotNull(redirectUri, "redirectUri"); - Utils.checkNotNull(settings, "settings"); - Utils.checkNotNull(theme, "theme"); - Utils.checkNotNull(customConsumerSettings, "customConsumerSettings"); + @JsonProperty("consumer_metadata") @Nullable ConsumerMetadata consumerMetadata, + @JsonProperty("redirect_uri") @Nullable String redirectUri, + @JsonProperty("settings") @Nullable Settings settings, + @JsonProperty("theme") @Nullable Theme theme, + @JsonProperty("custom_consumer_settings") @Nullable Map customConsumerSettings) { this.consumerMetadata = consumerMetadata; this.redirectUri = redirectUri; this.settings = settings; @@ -73,52 +67,43 @@ public Session( } public Session() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional consumerMetadata() { - return (Optional) consumerMetadata; + return Optional.ofNullable(this.consumerMetadata); } /** * The URL to redirect the user to after the session has been configured. */ - @JsonIgnore public Optional redirectUri() { - return redirectUri; + return Optional.ofNullable(this.redirectUri); } /** * Settings to change the way the Vault is displayed. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional settings() { - return (Optional) settings; + return Optional.ofNullable(this.settings); } /** * Theming options to change the look and feel of Vault. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional theme() { - return (Optional) theme; + return Optional.ofNullable(this.theme); } /** * Custom consumer settings that are passed as part of the session. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customConsumerSettings() { - return (Optional>) customConsumerSettings; + return Optional.ofNullable(this.customConsumerSettings); } public static Builder builder() { @@ -129,98 +114,48 @@ public static Builder builder() { /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - public Session withConsumerMetadata(ConsumerMetadata consumerMetadata) { - Utils.checkNotNull(consumerMetadata, "consumerMetadata"); - this.consumerMetadata = Optional.ofNullable(consumerMetadata); - return this; - } - - - /** - * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - */ - public Session withConsumerMetadata(Optional consumerMetadata) { - Utils.checkNotNull(consumerMetadata, "consumerMetadata"); + public Session withConsumerMetadata(@Nullable ConsumerMetadata consumerMetadata) { this.consumerMetadata = consumerMetadata; return this; } - /** - * The URL to redirect the user to after the session has been configured. - */ - public Session withRedirectUri(String redirectUri) { - Utils.checkNotNull(redirectUri, "redirectUri"); - this.redirectUri = Optional.ofNullable(redirectUri); - return this; - } - /** * The URL to redirect the user to after the session has been configured. */ - public Session withRedirectUri(Optional redirectUri) { - Utils.checkNotNull(redirectUri, "redirectUri"); + public Session withRedirectUri(@Nullable String redirectUri) { this.redirectUri = redirectUri; return this; } - /** - * Settings to change the way the Vault is displayed. - */ - public Session withSettings(Settings settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = Optional.ofNullable(settings); - return this; - } - /** * Settings to change the way the Vault is displayed. */ - public Session withSettings(Optional settings) { - Utils.checkNotNull(settings, "settings"); + public Session withSettings(@Nullable Settings settings) { this.settings = settings; return this; } - /** - * Theming options to change the look and feel of Vault. - */ - public Session withTheme(Theme theme) { - Utils.checkNotNull(theme, "theme"); - this.theme = Optional.ofNullable(theme); - return this; - } - /** * Theming options to change the look and feel of Vault. */ - public Session withTheme(Optional theme) { - Utils.checkNotNull(theme, "theme"); + public Session withTheme(@Nullable Theme theme) { this.theme = theme; return this; } - /** - * Custom consumer settings that are passed as part of the session. - */ - public Session withCustomConsumerSettings(Map customConsumerSettings) { - Utils.checkNotNull(customConsumerSettings, "customConsumerSettings"); - this.customConsumerSettings = Optional.ofNullable(customConsumerSettings); - return this; - } - /** * Custom consumer settings that are passed as part of the session. */ - public Session withCustomConsumerSettings(Optional> customConsumerSettings) { - Utils.checkNotNull(customConsumerSettings, "customConsumerSettings"); + public Session withCustomConsumerSettings(@Nullable Map customConsumerSettings) { this.customConsumerSettings = customConsumerSettings; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -258,117 +193,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerMetadata = Optional.empty(); + private ConsumerMetadata consumerMetadata; - private Optional redirectUri = Optional.empty(); + private String redirectUri; - private Optional settings = Optional.empty(); + private Settings settings; - private Optional theme = Optional.empty(); + private Theme theme; - private Optional> customConsumerSettings = Optional.empty(); + private Map customConsumerSettings; private Builder() { // force use of static builder() method } - - /** - * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - */ - public Builder consumerMetadata(ConsumerMetadata consumerMetadata) { - Utils.checkNotNull(consumerMetadata, "consumerMetadata"); - this.consumerMetadata = Optional.ofNullable(consumerMetadata); - return this; - } - /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - public Builder consumerMetadata(Optional consumerMetadata) { - Utils.checkNotNull(consumerMetadata, "consumerMetadata"); + public Builder consumerMetadata(@Nullable ConsumerMetadata consumerMetadata) { this.consumerMetadata = consumerMetadata; return this; } - /** * The URL to redirect the user to after the session has been configured. */ - public Builder redirectUri(String redirectUri) { - Utils.checkNotNull(redirectUri, "redirectUri"); - this.redirectUri = Optional.ofNullable(redirectUri); - return this; - } - - /** - * The URL to redirect the user to after the session has been configured. - */ - public Builder redirectUri(Optional redirectUri) { - Utils.checkNotNull(redirectUri, "redirectUri"); + public Builder redirectUri(@Nullable String redirectUri) { this.redirectUri = redirectUri; return this; } - - /** - * Settings to change the way the Vault is displayed. - */ - public Builder settings(Settings settings) { - Utils.checkNotNull(settings, "settings"); - this.settings = Optional.ofNullable(settings); - return this; - } - /** * Settings to change the way the Vault is displayed. */ - public Builder settings(Optional settings) { - Utils.checkNotNull(settings, "settings"); + public Builder settings(@Nullable Settings settings) { this.settings = settings; return this; } - - /** - * Theming options to change the look and feel of Vault. - */ - public Builder theme(Theme theme) { - Utils.checkNotNull(theme, "theme"); - this.theme = Optional.ofNullable(theme); - return this; - } - /** * Theming options to change the look and feel of Vault. */ - public Builder theme(Optional theme) { - Utils.checkNotNull(theme, "theme"); + public Builder theme(@Nullable Theme theme) { this.theme = theme; return this; } - - /** - * Custom consumer settings that are passed as part of the session. - */ - public Builder customConsumerSettings(Map customConsumerSettings) { - Utils.checkNotNull(customConsumerSettings, "customConsumerSettings"); - this.customConsumerSettings = Optional.ofNullable(customConsumerSettings); - return this; - } - /** * Custom consumer settings that are passed as part of the session. */ - public Builder customConsumerSettings(Optional> customConsumerSettings) { - Utils.checkNotNull(customConsumerSettings, "customConsumerSettings"); + public Builder customConsumerSettings(@Nullable Map customConsumerSettings) { this.customConsumerSettings = customConsumerSettings; return this; } public Session build() { - return new Session( consumerMetadata, redirectUri, settings, theme, customConsumerSettings); diff --git a/src/main/java/com/apideck/unify/models/components/Settings.java b/src/main/java/com/apideck/unify/models/components/Settings.java index 897c5aa7..e9d9ab56 100644 --- a/src/main/java/com/apideck/unify/models/components/Settings.java +++ b/src/main/java/com/apideck/unify/models/components/Settings.java @@ -6,15 +6,14 @@ import com.apideck.unify.utils.LazySingletonValue; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -29,70 +28,70 @@ public class Settings { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("unified_apis") - private Optional> unifiedApis; + private List unifiedApis; /** * A boolean that controls the display of the configurable resources for an integration. When set to true, the resource configuration options will be hidden and not shown to the user. When set to false, the resource configuration options will be displayed to the user. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("hide_resource_settings") - private Optional hideResourceSettings; + private Boolean hideResourceSettings; /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show a banner informing the logged in user is in a test environment. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("sandbox_mode") - private Optional sandboxMode; + private Boolean sandboxMode; /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to run in isolation mode, meaning it only shows the connection settings and hides the navigation items. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("isolation_mode") - private Optional isolationMode; + private Boolean isolationMode; /** * The duration of time the session is valid for (maximum 1 week). */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("session_length") - private Optional sessionLength; + private String sessionLength; /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the logs page. Defaults to `true`. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("show_logs") - private Optional showLogs; + private Boolean showLogs; /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the suggestions page. Defaults to `false`. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("show_suggestions") - private Optional showSuggestions; + private Boolean showSuggestions; /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the sidebar. Defaults to `true`. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("show_sidebar") - private Optional showSidebar; + private Boolean showSidebar; /** * Automatically redirect to redirect uri after the connection has been configured as callable. Defaults to `false`. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("auto_redirect") - private Optional autoRedirect; + private Boolean autoRedirect; /** * Hide Apideck connection guides in [Vault](/apis/vault/reference#section/Get-Started). Defaults to `false`. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("hide_guides") - private Optional hideGuides; + private Boolean hideGuides; /** * Hide actions from your users in [Vault](/apis/vault/reference#section/Get-Started). Actions in `allow_actions` will be shown on a connection in Vault. @@ -101,131 +100,118 @@ public class Settings { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("allow_actions") - private Optional> allowActions; + private List allowActions; @JsonCreator public Settings( - @JsonProperty("unified_apis") Optional> unifiedApis, - @JsonProperty("hide_resource_settings") Optional hideResourceSettings, - @JsonProperty("sandbox_mode") Optional sandboxMode, - @JsonProperty("isolation_mode") Optional isolationMode, - @JsonProperty("session_length") Optional sessionLength, - @JsonProperty("show_logs") Optional showLogs, - @JsonProperty("show_suggestions") Optional showSuggestions, - @JsonProperty("show_sidebar") Optional showSidebar, - @JsonProperty("auto_redirect") Optional autoRedirect, - @JsonProperty("hide_guides") Optional hideGuides, - @JsonProperty("allow_actions") Optional> allowActions) { - Utils.checkNotNull(unifiedApis, "unifiedApis"); - Utils.checkNotNull(hideResourceSettings, "hideResourceSettings"); - Utils.checkNotNull(sandboxMode, "sandboxMode"); - Utils.checkNotNull(isolationMode, "isolationMode"); - Utils.checkNotNull(sessionLength, "sessionLength"); - Utils.checkNotNull(showLogs, "showLogs"); - Utils.checkNotNull(showSuggestions, "showSuggestions"); - Utils.checkNotNull(showSidebar, "showSidebar"); - Utils.checkNotNull(autoRedirect, "autoRedirect"); - Utils.checkNotNull(hideGuides, "hideGuides"); - Utils.checkNotNull(allowActions, "allowActions"); + @JsonProperty("unified_apis") @Nullable List unifiedApis, + @JsonProperty("hide_resource_settings") @Nullable Boolean hideResourceSettings, + @JsonProperty("sandbox_mode") @Nullable Boolean sandboxMode, + @JsonProperty("isolation_mode") @Nullable Boolean isolationMode, + @JsonProperty("session_length") @Nullable String sessionLength, + @JsonProperty("show_logs") @Nullable Boolean showLogs, + @JsonProperty("show_suggestions") @Nullable Boolean showSuggestions, + @JsonProperty("show_sidebar") @Nullable Boolean showSidebar, + @JsonProperty("auto_redirect") @Nullable Boolean autoRedirect, + @JsonProperty("hide_guides") @Nullable Boolean hideGuides, + @JsonProperty("allow_actions") @Nullable List allowActions) { this.unifiedApis = unifiedApis; - this.hideResourceSettings = hideResourceSettings; - this.sandboxMode = sandboxMode; - this.isolationMode = isolationMode; - this.sessionLength = sessionLength; - this.showLogs = showLogs; - this.showSuggestions = showSuggestions; - this.showSidebar = showSidebar; - this.autoRedirect = autoRedirect; - this.hideGuides = hideGuides; + this.hideResourceSettings = Optional.ofNullable(hideResourceSettings) + .orElse(Builder._SINGLETON_VALUE_HideResourceSettings.value()); + this.sandboxMode = Optional.ofNullable(sandboxMode) + .orElse(Builder._SINGLETON_VALUE_SandboxMode.value()); + this.isolationMode = Optional.ofNullable(isolationMode) + .orElse(Builder._SINGLETON_VALUE_IsolationMode.value()); + this.sessionLength = Optional.ofNullable(sessionLength) + .orElse(Builder._SINGLETON_VALUE_SessionLength.value()); + this.showLogs = Optional.ofNullable(showLogs) + .orElse(Builder._SINGLETON_VALUE_ShowLogs.value()); + this.showSuggestions = Optional.ofNullable(showSuggestions) + .orElse(Builder._SINGLETON_VALUE_ShowSuggestions.value()); + this.showSidebar = Optional.ofNullable(showSidebar) + .orElse(Builder._SINGLETON_VALUE_ShowSidebar.value()); + this.autoRedirect = Optional.ofNullable(autoRedirect) + .orElse(Builder._SINGLETON_VALUE_AutoRedirect.value()); + this.hideGuides = Optional.ofNullable(hideGuides) + .orElse(Builder._SINGLETON_VALUE_HideGuides.value()); this.allowActions = allowActions; } public Settings() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null); } /** * Provide the IDs of the Unified APIs you want to be visible. Leaving it empty or omitting this field will show all Unified APIs. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> unifiedApis() { - return (Optional>) unifiedApis; + return Optional.ofNullable(this.unifiedApis); } /** * A boolean that controls the display of the configurable resources for an integration. When set to true, the resource configuration options will be hidden and not shown to the user. When set to false, the resource configuration options will be displayed to the user. */ - @JsonIgnore public Optional hideResourceSettings() { - return hideResourceSettings; + return Optional.ofNullable(this.hideResourceSettings); } /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show a banner informing the logged in user is in a test environment. */ - @JsonIgnore public Optional sandboxMode() { - return sandboxMode; + return Optional.ofNullable(this.sandboxMode); } /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to run in isolation mode, meaning it only shows the connection settings and hides the navigation items. */ - @JsonIgnore public Optional isolationMode() { - return isolationMode; + return Optional.ofNullable(this.isolationMode); } /** * The duration of time the session is valid for (maximum 1 week). */ - @JsonIgnore public Optional sessionLength() { - return sessionLength; + return Optional.ofNullable(this.sessionLength); } /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the logs page. Defaults to `true`. */ - @JsonIgnore public Optional showLogs() { - return showLogs; + return Optional.ofNullable(this.showLogs); } /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the suggestions page. Defaults to `false`. */ - @JsonIgnore public Optional showSuggestions() { - return showSuggestions; + return Optional.ofNullable(this.showSuggestions); } /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the sidebar. Defaults to `true`. */ - @JsonIgnore public Optional showSidebar() { - return showSidebar; + return Optional.ofNullable(this.showSidebar); } /** * Automatically redirect to redirect uri after the connection has been configured as callable. Defaults to `false`. */ - @JsonIgnore public Optional autoRedirect() { - return autoRedirect; + return Optional.ofNullable(this.autoRedirect); } /** * Hide Apideck connection guides in [Vault](/apis/vault/reference#section/Get-Started). Defaults to `false`. */ - @JsonIgnore public Optional hideGuides() { - return hideGuides; + return Optional.ofNullable(this.hideGuides); } /** @@ -233,10 +219,8 @@ public Optional hideGuides() { * Available actions are: `delete`, `disconnect`, `reauthorize` and `disable`. * Empty array will hide all actions. By default all actions are visible. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> allowActions() { - return (Optional>) allowActions; + return Optional.ofNullable(this.allowActions); } public static Builder builder() { @@ -247,216 +231,104 @@ public static Builder builder() { /** * Provide the IDs of the Unified APIs you want to be visible. Leaving it empty or omitting this field will show all Unified APIs. */ - public Settings withUnifiedApis(List unifiedApis) { - Utils.checkNotNull(unifiedApis, "unifiedApis"); - this.unifiedApis = Optional.ofNullable(unifiedApis); - return this; - } - - - /** - * Provide the IDs of the Unified APIs you want to be visible. Leaving it empty or omitting this field will show all Unified APIs. - */ - public Settings withUnifiedApis(Optional> unifiedApis) { - Utils.checkNotNull(unifiedApis, "unifiedApis"); + public Settings withUnifiedApis(@Nullable List unifiedApis) { this.unifiedApis = unifiedApis; return this; } - /** - * A boolean that controls the display of the configurable resources for an integration. When set to true, the resource configuration options will be hidden and not shown to the user. When set to false, the resource configuration options will be displayed to the user. - */ - public Settings withHideResourceSettings(boolean hideResourceSettings) { - Utils.checkNotNull(hideResourceSettings, "hideResourceSettings"); - this.hideResourceSettings = Optional.ofNullable(hideResourceSettings); - return this; - } - /** * A boolean that controls the display of the configurable resources for an integration. When set to true, the resource configuration options will be hidden and not shown to the user. When set to false, the resource configuration options will be displayed to the user. */ - public Settings withHideResourceSettings(Optional hideResourceSettings) { - Utils.checkNotNull(hideResourceSettings, "hideResourceSettings"); + public Settings withHideResourceSettings(@Nullable Boolean hideResourceSettings) { this.hideResourceSettings = hideResourceSettings; return this; } - /** - * Configure [Vault](/apis/vault/reference#section/Get-Started) to show a banner informing the logged in user is in a test environment. - */ - public Settings withSandboxMode(boolean sandboxMode) { - Utils.checkNotNull(sandboxMode, "sandboxMode"); - this.sandboxMode = Optional.ofNullable(sandboxMode); - return this; - } - /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show a banner informing the logged in user is in a test environment. */ - public Settings withSandboxMode(Optional sandboxMode) { - Utils.checkNotNull(sandboxMode, "sandboxMode"); + public Settings withSandboxMode(@Nullable Boolean sandboxMode) { this.sandboxMode = sandboxMode; return this; } - /** - * Configure [Vault](/apis/vault/reference#section/Get-Started) to run in isolation mode, meaning it only shows the connection settings and hides the navigation items. - */ - public Settings withIsolationMode(boolean isolationMode) { - Utils.checkNotNull(isolationMode, "isolationMode"); - this.isolationMode = Optional.ofNullable(isolationMode); - return this; - } - /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to run in isolation mode, meaning it only shows the connection settings and hides the navigation items. */ - public Settings withIsolationMode(Optional isolationMode) { - Utils.checkNotNull(isolationMode, "isolationMode"); + public Settings withIsolationMode(@Nullable Boolean isolationMode) { this.isolationMode = isolationMode; return this; } - /** - * The duration of time the session is valid for (maximum 1 week). - */ - public Settings withSessionLength(String sessionLength) { - Utils.checkNotNull(sessionLength, "sessionLength"); - this.sessionLength = Optional.ofNullable(sessionLength); - return this; - } - /** * The duration of time the session is valid for (maximum 1 week). */ - public Settings withSessionLength(Optional sessionLength) { - Utils.checkNotNull(sessionLength, "sessionLength"); + public Settings withSessionLength(@Nullable String sessionLength) { this.sessionLength = sessionLength; return this; } - /** - * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the logs page. Defaults to `true`. - */ - public Settings withShowLogs(boolean showLogs) { - Utils.checkNotNull(showLogs, "showLogs"); - this.showLogs = Optional.ofNullable(showLogs); - return this; - } - /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the logs page. Defaults to `true`. */ - public Settings withShowLogs(Optional showLogs) { - Utils.checkNotNull(showLogs, "showLogs"); + public Settings withShowLogs(@Nullable Boolean showLogs) { this.showLogs = showLogs; return this; } - /** - * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the suggestions page. Defaults to `false`. - */ - public Settings withShowSuggestions(boolean showSuggestions) { - Utils.checkNotNull(showSuggestions, "showSuggestions"); - this.showSuggestions = Optional.ofNullable(showSuggestions); - return this; - } - /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the suggestions page. Defaults to `false`. */ - public Settings withShowSuggestions(Optional showSuggestions) { - Utils.checkNotNull(showSuggestions, "showSuggestions"); + public Settings withShowSuggestions(@Nullable Boolean showSuggestions) { this.showSuggestions = showSuggestions; return this; } - /** - * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the sidebar. Defaults to `true`. - */ - public Settings withShowSidebar(boolean showSidebar) { - Utils.checkNotNull(showSidebar, "showSidebar"); - this.showSidebar = Optional.ofNullable(showSidebar); - return this; - } - /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the sidebar. Defaults to `true`. */ - public Settings withShowSidebar(Optional showSidebar) { - Utils.checkNotNull(showSidebar, "showSidebar"); + public Settings withShowSidebar(@Nullable Boolean showSidebar) { this.showSidebar = showSidebar; return this; } - /** - * Automatically redirect to redirect uri after the connection has been configured as callable. Defaults to `false`. - */ - public Settings withAutoRedirect(boolean autoRedirect) { - Utils.checkNotNull(autoRedirect, "autoRedirect"); - this.autoRedirect = Optional.ofNullable(autoRedirect); - return this; - } - /** * Automatically redirect to redirect uri after the connection has been configured as callable. Defaults to `false`. */ - public Settings withAutoRedirect(Optional autoRedirect) { - Utils.checkNotNull(autoRedirect, "autoRedirect"); + public Settings withAutoRedirect(@Nullable Boolean autoRedirect) { this.autoRedirect = autoRedirect; return this; } - /** - * Hide Apideck connection guides in [Vault](/apis/vault/reference#section/Get-Started). Defaults to `false`. - */ - public Settings withHideGuides(boolean hideGuides) { - Utils.checkNotNull(hideGuides, "hideGuides"); - this.hideGuides = Optional.ofNullable(hideGuides); - return this; - } - /** * Hide Apideck connection guides in [Vault](/apis/vault/reference#section/Get-Started). Defaults to `false`. */ - public Settings withHideGuides(Optional hideGuides) { - Utils.checkNotNull(hideGuides, "hideGuides"); + public Settings withHideGuides(@Nullable Boolean hideGuides) { this.hideGuides = hideGuides; return this; } - /** - * Hide actions from your users in [Vault](/apis/vault/reference#section/Get-Started). Actions in `allow_actions` will be shown on a connection in Vault. - * Available actions are: `delete`, `disconnect`, `reauthorize` and `disable`. - * Empty array will hide all actions. By default all actions are visible. - */ - public Settings withAllowActions(List allowActions) { - Utils.checkNotNull(allowActions, "allowActions"); - this.allowActions = Optional.ofNullable(allowActions); - return this; - } - /** * Hide actions from your users in [Vault](/apis/vault/reference#section/Get-Started). Actions in `allow_actions` will be shown on a connection in Vault. * Available actions are: `delete`, `disconnect`, `reauthorize` and `disable`. * Empty array will hide all actions. By default all actions are visible. */ - public Settings withAllowActions(Optional> allowActions) { - Utils.checkNotNull(allowActions, "allowActions"); + public Settings withAllowActions(@Nullable List allowActions) { this.allowActions = allowActions; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -508,274 +380,123 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional> unifiedApis = Optional.empty(); + private List unifiedApis; - private Optional hideResourceSettings; + private Boolean hideResourceSettings; - private Optional sandboxMode; + private Boolean sandboxMode; - private Optional isolationMode; + private Boolean isolationMode; - private Optional sessionLength; + private String sessionLength; - private Optional showLogs; + private Boolean showLogs; - private Optional showSuggestions; + private Boolean showSuggestions; - private Optional showSidebar; + private Boolean showSidebar; - private Optional autoRedirect; + private Boolean autoRedirect; - private Optional hideGuides; + private Boolean hideGuides; - private Optional> allowActions = Optional.empty(); + private List allowActions; private Builder() { // force use of static builder() method } - /** * Provide the IDs of the Unified APIs you want to be visible. Leaving it empty or omitting this field will show all Unified APIs. */ - public Builder unifiedApis(List unifiedApis) { - Utils.checkNotNull(unifiedApis, "unifiedApis"); - this.unifiedApis = Optional.ofNullable(unifiedApis); - return this; - } - - /** - * Provide the IDs of the Unified APIs you want to be visible. Leaving it empty or omitting this field will show all Unified APIs. - */ - public Builder unifiedApis(Optional> unifiedApis) { - Utils.checkNotNull(unifiedApis, "unifiedApis"); + public Builder unifiedApis(@Nullable List unifiedApis) { this.unifiedApis = unifiedApis; return this; } - - /** - * A boolean that controls the display of the configurable resources for an integration. When set to true, the resource configuration options will be hidden and not shown to the user. When set to false, the resource configuration options will be displayed to the user. - */ - public Builder hideResourceSettings(boolean hideResourceSettings) { - Utils.checkNotNull(hideResourceSettings, "hideResourceSettings"); - this.hideResourceSettings = Optional.ofNullable(hideResourceSettings); - return this; - } - /** * A boolean that controls the display of the configurable resources for an integration. When set to true, the resource configuration options will be hidden and not shown to the user. When set to false, the resource configuration options will be displayed to the user. */ - public Builder hideResourceSettings(Optional hideResourceSettings) { - Utils.checkNotNull(hideResourceSettings, "hideResourceSettings"); + public Builder hideResourceSettings(@Nullable Boolean hideResourceSettings) { this.hideResourceSettings = hideResourceSettings; return this; } - - /** - * Configure [Vault](/apis/vault/reference#section/Get-Started) to show a banner informing the logged in user is in a test environment. - */ - public Builder sandboxMode(boolean sandboxMode) { - Utils.checkNotNull(sandboxMode, "sandboxMode"); - this.sandboxMode = Optional.ofNullable(sandboxMode); - return this; - } - /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show a banner informing the logged in user is in a test environment. */ - public Builder sandboxMode(Optional sandboxMode) { - Utils.checkNotNull(sandboxMode, "sandboxMode"); + public Builder sandboxMode(@Nullable Boolean sandboxMode) { this.sandboxMode = sandboxMode; return this; } - - /** - * Configure [Vault](/apis/vault/reference#section/Get-Started) to run in isolation mode, meaning it only shows the connection settings and hides the navigation items. - */ - public Builder isolationMode(boolean isolationMode) { - Utils.checkNotNull(isolationMode, "isolationMode"); - this.isolationMode = Optional.ofNullable(isolationMode); - return this; - } - /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to run in isolation mode, meaning it only shows the connection settings and hides the navigation items. */ - public Builder isolationMode(Optional isolationMode) { - Utils.checkNotNull(isolationMode, "isolationMode"); + public Builder isolationMode(@Nullable Boolean isolationMode) { this.isolationMode = isolationMode; return this; } - - /** - * The duration of time the session is valid for (maximum 1 week). - */ - public Builder sessionLength(String sessionLength) { - Utils.checkNotNull(sessionLength, "sessionLength"); - this.sessionLength = Optional.ofNullable(sessionLength); - return this; - } - /** * The duration of time the session is valid for (maximum 1 week). */ - public Builder sessionLength(Optional sessionLength) { - Utils.checkNotNull(sessionLength, "sessionLength"); + public Builder sessionLength(@Nullable String sessionLength) { this.sessionLength = sessionLength; return this; } - /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the logs page. Defaults to `true`. */ - public Builder showLogs(boolean showLogs) { - Utils.checkNotNull(showLogs, "showLogs"); - this.showLogs = Optional.ofNullable(showLogs); - return this; - } - - /** - * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the logs page. Defaults to `true`. - */ - public Builder showLogs(Optional showLogs) { - Utils.checkNotNull(showLogs, "showLogs"); + public Builder showLogs(@Nullable Boolean showLogs) { this.showLogs = showLogs; return this; } - - /** - * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the suggestions page. Defaults to `false`. - */ - public Builder showSuggestions(boolean showSuggestions) { - Utils.checkNotNull(showSuggestions, "showSuggestions"); - this.showSuggestions = Optional.ofNullable(showSuggestions); - return this; - } - /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the suggestions page. Defaults to `false`. */ - public Builder showSuggestions(Optional showSuggestions) { - Utils.checkNotNull(showSuggestions, "showSuggestions"); + public Builder showSuggestions(@Nullable Boolean showSuggestions) { this.showSuggestions = showSuggestions; return this; } - - /** - * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the sidebar. Defaults to `true`. - */ - public Builder showSidebar(boolean showSidebar) { - Utils.checkNotNull(showSidebar, "showSidebar"); - this.showSidebar = Optional.ofNullable(showSidebar); - return this; - } - /** * Configure [Vault](/apis/vault/reference#section/Get-Started) to show the sidebar. Defaults to `true`. */ - public Builder showSidebar(Optional showSidebar) { - Utils.checkNotNull(showSidebar, "showSidebar"); + public Builder showSidebar(@Nullable Boolean showSidebar) { this.showSidebar = showSidebar; return this; } - /** * Automatically redirect to redirect uri after the connection has been configured as callable. Defaults to `false`. */ - public Builder autoRedirect(boolean autoRedirect) { - Utils.checkNotNull(autoRedirect, "autoRedirect"); - this.autoRedirect = Optional.ofNullable(autoRedirect); - return this; - } - - /** - * Automatically redirect to redirect uri after the connection has been configured as callable. Defaults to `false`. - */ - public Builder autoRedirect(Optional autoRedirect) { - Utils.checkNotNull(autoRedirect, "autoRedirect"); + public Builder autoRedirect(@Nullable Boolean autoRedirect) { this.autoRedirect = autoRedirect; return this; } - - /** - * Hide Apideck connection guides in [Vault](/apis/vault/reference#section/Get-Started). Defaults to `false`. - */ - public Builder hideGuides(boolean hideGuides) { - Utils.checkNotNull(hideGuides, "hideGuides"); - this.hideGuides = Optional.ofNullable(hideGuides); - return this; - } - /** * Hide Apideck connection guides in [Vault](/apis/vault/reference#section/Get-Started). Defaults to `false`. */ - public Builder hideGuides(Optional hideGuides) { - Utils.checkNotNull(hideGuides, "hideGuides"); + public Builder hideGuides(@Nullable Boolean hideGuides) { this.hideGuides = hideGuides; return this; } - /** * Hide actions from your users in [Vault](/apis/vault/reference#section/Get-Started). Actions in `allow_actions` will be shown on a connection in Vault. * Available actions are: `delete`, `disconnect`, `reauthorize` and `disable`. * Empty array will hide all actions. By default all actions are visible. */ - public Builder allowActions(List allowActions) { - Utils.checkNotNull(allowActions, "allowActions"); - this.allowActions = Optional.ofNullable(allowActions); - return this; - } - - /** - * Hide actions from your users in [Vault](/apis/vault/reference#section/Get-Started). Actions in `allow_actions` will be shown on a connection in Vault. - * Available actions are: `delete`, `disconnect`, `reauthorize` and `disable`. - * Empty array will hide all actions. By default all actions are visible. - */ - public Builder allowActions(Optional> allowActions) { - Utils.checkNotNull(allowActions, "allowActions"); + public Builder allowActions(@Nullable List allowActions) { this.allowActions = allowActions; return this; } public Settings build() { - if (hideResourceSettings == null) { - hideResourceSettings = _SINGLETON_VALUE_HideResourceSettings.value(); - } - if (sandboxMode == null) { - sandboxMode = _SINGLETON_VALUE_SandboxMode.value(); - } - if (isolationMode == null) { - isolationMode = _SINGLETON_VALUE_IsolationMode.value(); - } - if (sessionLength == null) { - sessionLength = _SINGLETON_VALUE_SessionLength.value(); - } - if (showLogs == null) { - showLogs = _SINGLETON_VALUE_ShowLogs.value(); - } - if (showSuggestions == null) { - showSuggestions = _SINGLETON_VALUE_ShowSuggestions.value(); - } - if (showSidebar == null) { - showSidebar = _SINGLETON_VALUE_ShowSidebar.value(); - } - if (autoRedirect == null) { - autoRedirect = _SINGLETON_VALUE_AutoRedirect.value(); - } - if (hideGuides == null) { - hideGuides = _SINGLETON_VALUE_HideGuides.value(); - } - return new Settings( unifiedApis, hideResourceSettings, sandboxMode, isolationMode, sessionLength, showLogs, @@ -784,58 +505,58 @@ public Settings build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_HideResourceSettings = + private static final LazySingletonValue _SINGLETON_VALUE_HideResourceSettings = new LazySingletonValue<>( "hide_resource_settings", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_SandboxMode = + private static final LazySingletonValue _SINGLETON_VALUE_SandboxMode = new LazySingletonValue<>( "sandbox_mode", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_IsolationMode = + private static final LazySingletonValue _SINGLETON_VALUE_IsolationMode = new LazySingletonValue<>( "isolation_mode", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_SessionLength = + private static final LazySingletonValue _SINGLETON_VALUE_SessionLength = new LazySingletonValue<>( "session_length", "\"1h\"", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_ShowLogs = + private static final LazySingletonValue _SINGLETON_VALUE_ShowLogs = new LazySingletonValue<>( "show_logs", "true", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_ShowSuggestions = + private static final LazySingletonValue _SINGLETON_VALUE_ShowSuggestions = new LazySingletonValue<>( "show_suggestions", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_ShowSidebar = + private static final LazySingletonValue _SINGLETON_VALUE_ShowSidebar = new LazySingletonValue<>( "show_sidebar", "true", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_AutoRedirect = + private static final LazySingletonValue _SINGLETON_VALUE_AutoRedirect = new LazySingletonValue<>( "auto_redirect", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_HideGuides = + private static final LazySingletonValue _SINGLETON_VALUE_HideGuides = new LazySingletonValue<>( "hide_guides", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/SharedLink.java b/src/main/java/com/apideck/unify/models/components/SharedLink.java index 9733952c..22e7f696 100644 --- a/src/main/java/com/apideck/unify/models/components/SharedLink.java +++ b/src/main/java/com/apideck/unify/models/components/SharedLink.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -37,14 +36,14 @@ public class SharedLink { @JsonInclude(Include.NON_ABSENT) @JsonProperty("target") - private Optional target; + private SharedLinkTarget target; /** * The scope of the shared link. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("scope") - private JsonNullable scope; + private JsonNullable scope; /** * Indicated if the shared link is password protected. @@ -77,112 +76,98 @@ public class SharedLink { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public SharedLink( - @JsonProperty("url") JsonNullable url, - @JsonProperty("download_url") JsonNullable downloadUrl, - @JsonProperty("target") Optional target, - @JsonProperty("scope") JsonNullable scope, - @JsonProperty("password_protected") JsonNullable passwordProtected, - @JsonProperty("expires_at") JsonNullable expiresAt, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(url, "url"); - Utils.checkNotNull(downloadUrl, "downloadUrl"); - Utils.checkNotNull(target, "target"); - Utils.checkNotNull(scope, "scope"); - Utils.checkNotNull(passwordProtected, "passwordProtected"); - Utils.checkNotNull(expiresAt, "expiresAt"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); - this.url = url; - this.downloadUrl = downloadUrl; + @JsonProperty("url") @Nullable JsonNullable url, + @JsonProperty("download_url") @Nullable JsonNullable downloadUrl, + @JsonProperty("target") @Nullable SharedLinkTarget target, + @JsonProperty("scope") @Nullable JsonNullable scope, + @JsonProperty("password_protected") @Nullable JsonNullable passwordProtected, + @JsonProperty("expires_at") @Nullable JsonNullable expiresAt, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.url = Optional.ofNullable(url) + .orElse(JsonNullable.undefined()); + this.downloadUrl = Optional.ofNullable(downloadUrl) + .orElse(JsonNullable.undefined()); this.target = target; - this.scope = scope; - this.passwordProtected = passwordProtected; - this.expiresAt = expiresAt; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.scope = Optional.ofNullable(scope) + .orElse(JsonNullable.undefined()); + this.passwordProtected = Optional.ofNullable(passwordProtected) + .orElse(JsonNullable.undefined()); + this.expiresAt = Optional.ofNullable(expiresAt) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public SharedLink() { - this(JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null); } /** * The URL that can be used to view the file. */ - @JsonIgnore public JsonNullable url() { - return url; + return this.url; } /** * The URL that can be used to download the file. */ - @JsonIgnore public JsonNullable downloadUrl() { - return downloadUrl; + return this.downloadUrl; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional target() { - return (Optional) target; + return Optional.ofNullable(this.target); } /** * The scope of the shared link. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable scope() { - return (JsonNullable) scope; + return this.scope; } /** * Indicated if the shared link is password protected. */ - @JsonIgnore public JsonNullable passwordProtected() { - return passwordProtected; + return this.passwordProtected; } - @JsonIgnore public JsonNullable expiresAt() { - return expiresAt; + return this.expiresAt; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -193,155 +178,78 @@ public static Builder builder() { /** * The URL that can be used to view the file. */ - public SharedLink withUrl(String url) { - Utils.checkNotNull(url, "url"); + public SharedLink withUrl(@Nullable String url) { this.url = JsonNullable.of(url); return this; } - /** - * The URL that can be used to view the file. - */ - public SharedLink withUrl(JsonNullable url) { - Utils.checkNotNull(url, "url"); - this.url = url; - return this; - } /** * The URL that can be used to download the file. */ - public SharedLink withDownloadUrl(String downloadUrl) { - Utils.checkNotNull(downloadUrl, "downloadUrl"); + public SharedLink withDownloadUrl(@Nullable String downloadUrl) { this.downloadUrl = JsonNullable.of(downloadUrl); return this; } - /** - * The URL that can be used to download the file. - */ - public SharedLink withDownloadUrl(JsonNullable downloadUrl) { - Utils.checkNotNull(downloadUrl, "downloadUrl"); - this.downloadUrl = downloadUrl; - return this; - } - - public SharedLink withTarget(SharedLinkTarget target) { - Utils.checkNotNull(target, "target"); - this.target = Optional.ofNullable(target); - return this; - } - - public SharedLink withTarget(Optional target) { - Utils.checkNotNull(target, "target"); + public SharedLink withTarget(@Nullable SharedLinkTarget target) { this.target = target; return this; } + /** * The scope of the shared link. */ - public SharedLink withScope(Scope scope) { - Utils.checkNotNull(scope, "scope"); + public SharedLink withScope(@Nullable Scope scope) { this.scope = JsonNullable.of(scope); return this; } - /** - * The scope of the shared link. - */ - public SharedLink withScope(JsonNullable scope) { - Utils.checkNotNull(scope, "scope"); - this.scope = scope; - return this; - } /** * Indicated if the shared link is password protected. */ - public SharedLink withPasswordProtected(boolean passwordProtected) { - Utils.checkNotNull(passwordProtected, "passwordProtected"); + public SharedLink withPasswordProtected(@Nullable Boolean passwordProtected) { this.passwordProtected = JsonNullable.of(passwordProtected); return this; } - /** - * Indicated if the shared link is password protected. - */ - public SharedLink withPasswordProtected(JsonNullable passwordProtected) { - Utils.checkNotNull(passwordProtected, "passwordProtected"); - this.passwordProtected = passwordProtected; - return this; - } - public SharedLink withExpiresAt(OffsetDateTime expiresAt) { - Utils.checkNotNull(expiresAt, "expiresAt"); + public SharedLink withExpiresAt(@Nullable OffsetDateTime expiresAt) { this.expiresAt = JsonNullable.of(expiresAt); return this; } - public SharedLink withExpiresAt(JsonNullable expiresAt) { - Utils.checkNotNull(expiresAt, "expiresAt"); - this.expiresAt = expiresAt; - return this; - } /** * The date and time when the object was last updated. */ - public SharedLink withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public SharedLink withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public SharedLink withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public SharedLink withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public SharedLink withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public SharedLink withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public SharedLink withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public SharedLink withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public SharedLink withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -388,189 +296,95 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable url = JsonNullable.undefined(); + private JsonNullable url; - private JsonNullable downloadUrl = JsonNullable.undefined(); + private JsonNullable downloadUrl; - private Optional target = Optional.empty(); + private SharedLinkTarget target; - private JsonNullable scope = JsonNullable.undefined(); + private JsonNullable scope; - private JsonNullable passwordProtected = JsonNullable.undefined(); + private JsonNullable passwordProtected; - private JsonNullable expiresAt = JsonNullable.undefined(); + private JsonNullable expiresAt; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The URL that can be used to view the file. */ - public Builder url(String url) { - Utils.checkNotNull(url, "url"); + public Builder url(@Nullable String url) { this.url = JsonNullable.of(url); return this; } - /** - * The URL that can be used to view the file. - */ - public Builder url(JsonNullable url) { - Utils.checkNotNull(url, "url"); - this.url = url; - return this; - } - - /** * The URL that can be used to download the file. */ - public Builder downloadUrl(String downloadUrl) { - Utils.checkNotNull(downloadUrl, "downloadUrl"); + public Builder downloadUrl(@Nullable String downloadUrl) { this.downloadUrl = JsonNullable.of(downloadUrl); return this; } - /** - * The URL that can be used to download the file. - */ - public Builder downloadUrl(JsonNullable downloadUrl) { - Utils.checkNotNull(downloadUrl, "downloadUrl"); - this.downloadUrl = downloadUrl; - return this; - } - - - public Builder target(SharedLinkTarget target) { - Utils.checkNotNull(target, "target"); - this.target = Optional.ofNullable(target); - return this; - } - - public Builder target(Optional target) { - Utils.checkNotNull(target, "target"); + public Builder target(@Nullable SharedLinkTarget target) { this.target = target; return this; } - /** * The scope of the shared link. */ - public Builder scope(Scope scope) { - Utils.checkNotNull(scope, "scope"); + public Builder scope(@Nullable Scope scope) { this.scope = JsonNullable.of(scope); return this; } - /** - * The scope of the shared link. - */ - public Builder scope(JsonNullable scope) { - Utils.checkNotNull(scope, "scope"); - this.scope = scope; - return this; - } - - /** * Indicated if the shared link is password protected. */ - public Builder passwordProtected(boolean passwordProtected) { - Utils.checkNotNull(passwordProtected, "passwordProtected"); + public Builder passwordProtected(@Nullable Boolean passwordProtected) { this.passwordProtected = JsonNullable.of(passwordProtected); return this; } - /** - * Indicated if the shared link is password protected. - */ - public Builder passwordProtected(JsonNullable passwordProtected) { - Utils.checkNotNull(passwordProtected, "passwordProtected"); - this.passwordProtected = passwordProtected; - return this; - } - - - public Builder expiresAt(OffsetDateTime expiresAt) { - Utils.checkNotNull(expiresAt, "expiresAt"); + public Builder expiresAt(@Nullable OffsetDateTime expiresAt) { this.expiresAt = JsonNullable.of(expiresAt); return this; } - public Builder expiresAt(JsonNullable expiresAt) { - Utils.checkNotNull(expiresAt, "expiresAt"); - this.expiresAt = expiresAt; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public SharedLink build() { - return new SharedLink( url, downloadUrl, target, scope, passwordProtected, expiresAt, diff --git a/src/main/java/com/apideck/unify/models/components/SharedLinkInput.java b/src/main/java/com/apideck/unify/models/components/SharedLinkInput.java index 704ebdb8..2f45cacf 100644 --- a/src/main/java/com/apideck/unify/models/components/SharedLinkInput.java +++ b/src/main/java/com/apideck/unify/models/components/SharedLinkInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,14 +29,14 @@ public class SharedLinkInput { */ @JsonInclude(Include.ALWAYS) @JsonProperty("target_id") - private Optional targetId; + private JsonNullable targetId; /** * The scope of the shared link. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("scope") - private JsonNullable scope; + private JsonNullable scope; /** * Optional password for the shared link. @@ -51,72 +50,63 @@ public class SharedLinkInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public SharedLinkInput( - @JsonProperty("download_url") JsonNullable downloadUrl, - @JsonProperty("target_id") Optional targetId, - @JsonProperty("scope") JsonNullable scope, - @JsonProperty("password") JsonNullable password, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(downloadUrl, "downloadUrl"); - Utils.checkNotNull(targetId, "targetId"); - Utils.checkNotNull(scope, "scope"); - Utils.checkNotNull(password, "password"); - Utils.checkNotNull(passThrough, "passThrough"); - this.downloadUrl = downloadUrl; - this.targetId = targetId; - this.scope = scope; - this.password = password; + @JsonProperty("download_url") @Nullable JsonNullable downloadUrl, + @JsonProperty("target_id") @Nullable String targetId, + @JsonProperty("scope") @Nullable JsonNullable scope, + @JsonProperty("password") @Nullable JsonNullable password, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.downloadUrl = Optional.ofNullable(downloadUrl) + .orElse(JsonNullable.undefined()); + this.targetId = JsonNullable.of(targetId); + this.scope = Optional.ofNullable(scope) + .orElse(JsonNullable.undefined()); + this.password = Optional.ofNullable(password) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public SharedLinkInput() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null); } /** * The URL that can be used to download the file. */ - @JsonIgnore public JsonNullable downloadUrl() { - return downloadUrl; + return this.downloadUrl; } /** * The ID of the file or folder to link. */ - @JsonIgnore - public Optional targetId() { - return targetId; + public JsonNullable targetId() { + return this.targetId; } /** * The scope of the shared link. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable scope() { - return (JsonNullable) scope; + return this.scope; } /** * Optional password for the shared link. */ - @JsonIgnore public JsonNullable password() { - return password; + return this.password; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -127,95 +117,48 @@ public static Builder builder() { /** * The URL that can be used to download the file. */ - public SharedLinkInput withDownloadUrl(String downloadUrl) { - Utils.checkNotNull(downloadUrl, "downloadUrl"); + public SharedLinkInput withDownloadUrl(@Nullable String downloadUrl) { this.downloadUrl = JsonNullable.of(downloadUrl); return this; } - /** - * The URL that can be used to download the file. - */ - public SharedLinkInput withDownloadUrl(JsonNullable downloadUrl) { - Utils.checkNotNull(downloadUrl, "downloadUrl"); - this.downloadUrl = downloadUrl; - return this; - } /** * The ID of the file or folder to link. */ - public SharedLinkInput withTargetId(String targetId) { - Utils.checkNotNull(targetId, "targetId"); - this.targetId = Optional.ofNullable(targetId); + public SharedLinkInput withTargetId(@Nullable String targetId) { + this.targetId = JsonNullable.of(targetId); return this; } - /** - * The ID of the file or folder to link. - */ - public SharedLinkInput withTargetId(Optional targetId) { - Utils.checkNotNull(targetId, "targetId"); - this.targetId = targetId; - return this; - } - /** * The scope of the shared link. */ - public SharedLinkInput withScope(Scope scope) { - Utils.checkNotNull(scope, "scope"); + public SharedLinkInput withScope(@Nullable Scope scope) { this.scope = JsonNullable.of(scope); return this; } - /** - * The scope of the shared link. - */ - public SharedLinkInput withScope(JsonNullable scope) { - Utils.checkNotNull(scope, "scope"); - this.scope = scope; - return this; - } /** * Optional password for the shared link. */ - public SharedLinkInput withPassword(String password) { - Utils.checkNotNull(password, "password"); + public SharedLinkInput withPassword(@Nullable String password) { this.password = JsonNullable.of(password); return this; } - /** - * Optional password for the shared link. - */ - public SharedLinkInput withPassword(JsonNullable password) { - Utils.checkNotNull(password, "password"); - this.password = password; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public SharedLinkInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public SharedLinkInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public SharedLinkInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -253,117 +196,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable downloadUrl = JsonNullable.undefined(); + private JsonNullable downloadUrl; - private Optional targetId = Optional.empty(); + private String targetId; - private JsonNullable scope = JsonNullable.undefined(); + private JsonNullable scope; - private JsonNullable password = JsonNullable.undefined(); + private JsonNullable password; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The URL that can be used to download the file. */ - public Builder downloadUrl(String downloadUrl) { - Utils.checkNotNull(downloadUrl, "downloadUrl"); + public Builder downloadUrl(@Nullable String downloadUrl) { this.downloadUrl = JsonNullable.of(downloadUrl); return this; } - /** - * The URL that can be used to download the file. - */ - public Builder downloadUrl(JsonNullable downloadUrl) { - Utils.checkNotNull(downloadUrl, "downloadUrl"); - this.downloadUrl = downloadUrl; - return this; - } - - - /** - * The ID of the file or folder to link. - */ - public Builder targetId(String targetId) { - Utils.checkNotNull(targetId, "targetId"); - this.targetId = Optional.ofNullable(targetId); - return this; - } - /** * The ID of the file or folder to link. */ - public Builder targetId(Optional targetId) { - Utils.checkNotNull(targetId, "targetId"); + public Builder targetId(@Nullable String targetId) { this.targetId = targetId; return this; } - /** * The scope of the shared link. */ - public Builder scope(Scope scope) { - Utils.checkNotNull(scope, "scope"); + public Builder scope(@Nullable Scope scope) { this.scope = JsonNullable.of(scope); return this; } - /** - * The scope of the shared link. - */ - public Builder scope(JsonNullable scope) { - Utils.checkNotNull(scope, "scope"); - this.scope = scope; - return this; - } - - /** * Optional password for the shared link. */ - public Builder password(String password) { - Utils.checkNotNull(password, "password"); + public Builder password(@Nullable String password) { this.password = JsonNullable.of(password); return this; } - /** - * Optional password for the shared link. - */ - public Builder password(JsonNullable password) { - Utils.checkNotNull(password, "password"); - this.password = password; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public SharedLinkInput build() { - return new SharedLinkInput( downloadUrl, targetId, scope, password, passThrough); diff --git a/src/main/java/com/apideck/unify/models/components/SharedLinkTarget.java b/src/main/java/com/apideck/unify/models/components/SharedLinkTarget.java index a95043b4..4450bc76 100644 --- a/src/main/java/com/apideck/unify/models/components/SharedLinkTarget.java +++ b/src/main/java/com/apideck/unify/models/components/SharedLinkTarget.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -34,49 +35,45 @@ public class SharedLinkTarget { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; @JsonCreator public SharedLinkTarget( - @JsonProperty("id") String id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("type") JsonNullable type) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(type, "type"); - this.id = id; - this.name = name; - this.type = type; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("type") @Nullable JsonNullable type) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); } public SharedLinkTarget( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The name of the file */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The type of resource. Could be file, folder or url */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } public static Builder builder() { @@ -87,47 +84,29 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public SharedLinkTarget withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public SharedLinkTarget withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The name of the file */ - public SharedLinkTarget withName(String name) { - Utils.checkNotNull(name, "name"); + public SharedLinkTarget withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the file - */ - public SharedLinkTarget withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The type of resource. Could be file, folder or url */ - public SharedLinkTarget withType(FileType type) { - Utils.checkNotNull(type, "type"); + public SharedLinkTarget withType(@Nullable FileType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of resource. Could be file, folder or url - */ - public SharedLinkTarget withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -163,64 +142,39 @@ public final static class Builder { private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The name of the file */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the file - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The type of resource. Could be file, folder or url */ - public Builder type(FileType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable FileType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of resource. Could be file, folder or url - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - public SharedLinkTarget build() { - return new SharedLinkTarget( id, name, type); } diff --git a/src/main/java/com/apideck/unify/models/components/SimpleFormFieldOption.java b/src/main/java/com/apideck/unify/models/components/SimpleFormFieldOption.java index ca21fc13..9e742d77 100644 --- a/src/main/java/com/apideck/unify/models/components/SimpleFormFieldOption.java +++ b/src/main/java/com/apideck/unify/models/components/SimpleFormFieldOption.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -23,7 +23,7 @@ public class SimpleFormFieldOption implements FormFieldOption { @JsonInclude(Include.NON_ABSENT) @JsonProperty("value") - private Optional value; + private SimpleFormFieldOptionValue value; @JsonProperty("option_type") @@ -31,35 +31,30 @@ public class SimpleFormFieldOption implements FormFieldOption { @JsonCreator public SimpleFormFieldOption( - @JsonProperty("label") String label, - @JsonProperty("value") Optional value, - @JsonProperty("option_type") OptionType optionType) { - Utils.checkNotNull(label, "label"); - Utils.checkNotNull(value, "value"); - Utils.checkNotNull(optionType, "optionType"); - this.label = label; + @JsonProperty("label") @Nonnull String label, + @JsonProperty("value") @Nullable SimpleFormFieldOptionValue value, + @JsonProperty("option_type") @Nonnull OptionType optionType) { + this.label = Optional.ofNullable(label) + .orElseThrow(() -> new IllegalArgumentException("label cannot be null")); this.value = value; - this.optionType = optionType; + this.optionType = Optional.ofNullable(optionType) + .orElseThrow(() -> new IllegalArgumentException("optionType cannot be null")); } public SimpleFormFieldOption( - String label, - OptionType optionType) { - this(label, Optional.empty(), optionType); + @Nonnull String label, + @Nonnull OptionType optionType) { + this(label, null, optionType); } - @JsonIgnore public String label() { - return label; + return this.label; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional value() { - return (Optional) value; + return Optional.ofNullable(this.value); } - @JsonIgnore @Override public String optionType() { return Utils.discriminatorToString(optionType); @@ -70,31 +65,24 @@ public static Builder builder() { } - public SimpleFormFieldOption withLabel(String label) { - Utils.checkNotNull(label, "label"); - this.label = label; - return this; - } - - public SimpleFormFieldOption withValue(SimpleFormFieldOptionValue value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); + public SimpleFormFieldOption withLabel(@Nonnull String label) { + this.label = Utils.checkNotNull(label, "label"); return this; } - public SimpleFormFieldOption withValue(Optional value) { - Utils.checkNotNull(value, "value"); + public SimpleFormFieldOption withValue(@Nullable SimpleFormFieldOptionValue value) { this.value = value; return this; } - public SimpleFormFieldOption withOptionType(OptionType optionType) { - Utils.checkNotNull(optionType, "optionType"); - this.optionType = optionType; + + public SimpleFormFieldOption withOptionType(@Nonnull OptionType optionType) { + this.optionType = Utils.checkNotNull(optionType, "optionType"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -129,7 +117,7 @@ public final static class Builder { private String label; - private Optional value = Optional.empty(); + private SimpleFormFieldOptionValue value; private OptionType optionType; @@ -137,35 +125,22 @@ private Builder() { // force use of static builder() method } - - public Builder label(String label) { - Utils.checkNotNull(label, "label"); - this.label = label; - return this; - } - - - public Builder value(SimpleFormFieldOptionValue value) { - Utils.checkNotNull(value, "value"); - this.value = Optional.ofNullable(value); + public Builder label(@Nonnull String label) { + this.label = Utils.checkNotNull(label, "label"); return this; } - public Builder value(Optional value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable SimpleFormFieldOptionValue value) { this.value = value; return this; } - - public Builder optionType(OptionType optionType) { - Utils.checkNotNull(optionType, "optionType"); - this.optionType = optionType; + public Builder optionType(@Nonnull OptionType optionType) { + this.optionType = Utils.checkNotNull(optionType, "optionType"); return this; } public SimpleFormFieldOption build() { - return new SimpleFormFieldOption( label, value, optionType); } diff --git a/src/main/java/com/apideck/unify/models/components/Six.java b/src/main/java/com/apideck/unify/models/components/Six.java index be769733..0fd619c7 100644 --- a/src/main/java/com/apideck/unify/models/components/Six.java +++ b/src/main/java/com/apideck/unify/models/components/Six.java @@ -49,7 +49,6 @@ private Builder() { } public Six build() { - return new Six( ); } diff --git a/src/main/java/com/apideck/unify/models/components/SocialLink.java b/src/main/java/com/apideck/unify/models/components/SocialLink.java index 3b0ea599..d585a47e 100644 --- a/src/main/java/com/apideck/unify/models/components/SocialLink.java +++ b/src/main/java/com/apideck/unify/models/components/SocialLink.java @@ -5,12 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -37,44 +39,41 @@ public class SocialLink { @JsonCreator public SocialLink( - @JsonProperty("id") JsonNullable id, - @JsonProperty("url") String url, - @JsonProperty("type") JsonNullable type) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(url, "url"); - Utils.checkNotNull(type, "type"); - this.id = id; - this.url = url; - this.type = type; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("url") @Nonnull String url, + @JsonProperty("type") @Nullable JsonNullable type) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.url = Optional.ofNullable(url) + .orElseThrow(() -> new IllegalArgumentException("url cannot be null")); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); } public SocialLink( - String url) { - this(JsonNullable.undefined(), url, JsonNullable.undefined()); + @Nonnull String url) { + this(null, url, null); } /** * Unique identifier of the social link */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * URL of the social link, e.g. https://www.twitter.com/apideck */ - @JsonIgnore public String url() { - return url; + return this.url; } /** * Type of the social link, e.g. twitter */ - @JsonIgnore public JsonNullable type() { - return type; + return this.type; } public static Builder builder() { @@ -85,47 +84,29 @@ public static Builder builder() { /** * Unique identifier of the social link */ - public SocialLink withId(String id) { - Utils.checkNotNull(id, "id"); + public SocialLink withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier of the social link - */ - public SocialLink withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * URL of the social link, e.g. https://www.twitter.com/apideck */ - public SocialLink withUrl(String url) { - Utils.checkNotNull(url, "url"); - this.url = url; + public SocialLink withUrl(@Nonnull String url) { + this.url = Utils.checkNotNull(url, "url"); return this; } + /** * Type of the social link, e.g. twitter */ - public SocialLink withType(String type) { - Utils.checkNotNull(type, "type"); + public SocialLink withType(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * Type of the social link, e.g. twitter - */ - public SocialLink withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -159,66 +140,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; private String url; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; private Builder() { // force use of static builder() method } - /** * Unique identifier of the social link */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier of the social link - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * URL of the social link, e.g. https://www.twitter.com/apideck */ - public Builder url(String url) { - Utils.checkNotNull(url, "url"); - this.url = url; + public Builder url(@Nonnull String url) { + this.url = Utils.checkNotNull(url, "url"); return this; } - /** * Type of the social link, e.g. twitter */ - public Builder type(String type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * Type of the social link, e.g. twitter - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - public SocialLink build() { - return new SocialLink( id, url, type); } diff --git a/src/main/java/com/apideck/unify/models/components/SocialLinks.java b/src/main/java/com/apideck/unify/models/components/SocialLinks.java index 64076066..3f127781 100644 --- a/src/main/java/com/apideck/unify/models/components/SocialLinks.java +++ b/src/main/java/com/apideck/unify/models/components/SocialLinks.java @@ -5,12 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -37,44 +39,41 @@ public class SocialLinks { @JsonCreator public SocialLinks( - @JsonProperty("id") JsonNullable id, - @JsonProperty("url") String url, - @JsonProperty("type") JsonNullable type) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(url, "url"); - Utils.checkNotNull(type, "type"); - this.id = id; - this.url = url; - this.type = type; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("url") @Nonnull String url, + @JsonProperty("type") @Nullable JsonNullable type) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.url = Optional.ofNullable(url) + .orElseThrow(() -> new IllegalArgumentException("url cannot be null")); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); } public SocialLinks( - String url) { - this(JsonNullable.undefined(), url, JsonNullable.undefined()); + @Nonnull String url) { + this(null, url, null); } /** * Unique identifier of the social link */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * URL of the social link, e.g. https://www.twitter.com/apideck */ - @JsonIgnore public String url() { - return url; + return this.url; } /** * Type of the social link, e.g. twitter */ - @JsonIgnore public JsonNullable type() { - return type; + return this.type; } public static Builder builder() { @@ -85,47 +84,29 @@ public static Builder builder() { /** * Unique identifier of the social link */ - public SocialLinks withId(String id) { - Utils.checkNotNull(id, "id"); + public SocialLinks withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier of the social link - */ - public SocialLinks withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * URL of the social link, e.g. https://www.twitter.com/apideck */ - public SocialLinks withUrl(String url) { - Utils.checkNotNull(url, "url"); - this.url = url; + public SocialLinks withUrl(@Nonnull String url) { + this.url = Utils.checkNotNull(url, "url"); return this; } + /** * Type of the social link, e.g. twitter */ - public SocialLinks withType(String type) { - Utils.checkNotNull(type, "type"); + public SocialLinks withType(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * Type of the social link, e.g. twitter - */ - public SocialLinks withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -159,66 +140,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; private String url; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; private Builder() { // force use of static builder() method } - /** * Unique identifier of the social link */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier of the social link - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * URL of the social link, e.g. https://www.twitter.com/apideck */ - public Builder url(String url) { - Utils.checkNotNull(url, "url"); - this.url = url; + public Builder url(@Nonnull String url) { + this.url = Utils.checkNotNull(url, "url"); return this; } - /** * Type of the social link, e.g. twitter */ - public Builder type(String type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * Type of the social link, e.g. twitter - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - public SocialLinks build() { - return new SocialLinks( id, url, type); } diff --git a/src/main/java/com/apideck/unify/models/components/Stage.java b/src/main/java/com/apideck/unify/models/components/Stage.java index 3c4131a8..c21c7795 100644 --- a/src/main/java/com/apideck/unify/models/components/Stage.java +++ b/src/main/java/com/apideck/unify/models/components/Stage.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -29,29 +30,27 @@ public class Stage { @JsonCreator public Stage( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - this.id = id; - this.name = name; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public Stage() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } /** * Stage the candidate should be in. If omitted, the default stage for this job will be used. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -62,32 +61,17 @@ public static Builder builder() { /** * Stage the candidate should be in. If omitted, the default stage for this job will be used. */ - public Stage withId(String id) { - Utils.checkNotNull(id, "id"); + public Stage withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Stage the candidate should be in. If omitted, the default stage for this job will be used. - */ - public Stage withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - public Stage withName(String name) { - Utils.checkNotNull(name, "name"); + public Stage withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - public Stage withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -119,48 +103,28 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - /** * Stage the candidate should be in. If omitted, the default stage for this job will be used. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Stage the candidate should be in. If omitted, the default stage for this job will be used. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public Stage build() { - return new Stage( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/Stages.java b/src/main/java/com/apideck/unify/models/components/Stages.java index 5a5eede5..0478156d 100644 --- a/src/main/java/com/apideck/unify/models/components/Stages.java +++ b/src/main/java/com/apideck/unify/models/components/Stages.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -53,66 +54,61 @@ public class Stages { @JsonCreator public Stages( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("value") JsonNullable value, - @JsonProperty("win_probability") JsonNullable winProbability, - @JsonProperty("display_order") JsonNullable displayOrder) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(value, "value"); - Utils.checkNotNull(winProbability, "winProbability"); - Utils.checkNotNull(displayOrder, "displayOrder"); - this.id = id; - this.name = name; - this.value = value; - this.winProbability = winProbability; - this.displayOrder = displayOrder; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("value") @Nullable JsonNullable value, + @JsonProperty("win_probability") @Nullable JsonNullable winProbability, + @JsonProperty("display_order") @Nullable JsonNullable displayOrder) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.value = Optional.ofNullable(value) + .orElse(JsonNullable.undefined()); + this.winProbability = Optional.ofNullable(winProbability) + .orElse(JsonNullable.undefined()); + this.displayOrder = Optional.ofNullable(displayOrder) + .orElse(JsonNullable.undefined()); } public Stages() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null, + null, null); } /** * The unique identifier of the Pipeline Stage. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The name of the Pipeline Stage. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The value of the Pipeline Stage. */ - @JsonIgnore public JsonNullable value() { - return value; + return this.value; } /** * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. */ - @JsonIgnore public JsonNullable winProbability() { - return winProbability; + return this.winProbability; } /** * The order in which the Pipeline Stage is displayed in the UI. */ - @JsonIgnore public JsonNullable displayOrder() { - return displayOrder; + return this.displayOrder; } public static Builder builder() { @@ -123,92 +119,47 @@ public static Builder builder() { /** * The unique identifier of the Pipeline Stage. */ - public Stages withId(String id) { - Utils.checkNotNull(id, "id"); + public Stages withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * The unique identifier of the Pipeline Stage. - */ - public Stages withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The name of the Pipeline Stage. */ - public Stages withName(String name) { - Utils.checkNotNull(name, "name"); + public Stages withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the Pipeline Stage. - */ - public Stages withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The value of the Pipeline Stage. */ - public Stages withValue(String value) { - Utils.checkNotNull(value, "value"); + public Stages withValue(@Nullable String value) { this.value = JsonNullable.of(value); return this; } - /** - * The value of the Pipeline Stage. - */ - public Stages withValue(JsonNullable value) { - Utils.checkNotNull(value, "value"); - this.value = value; - return this; - } /** * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. */ - public Stages withWinProbability(long winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); + public Stages withWinProbability(@Nullable Long winProbability) { this.winProbability = JsonNullable.of(winProbability); return this; } - /** - * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. - */ - public Stages withWinProbability(JsonNullable winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); - this.winProbability = winProbability; - return this; - } /** * The order in which the Pipeline Stage is displayed in the UI. */ - public Stages withDisplayOrder(long displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); + public Stages withDisplayOrder(@Nullable Long displayOrder) { this.displayOrder = JsonNullable.of(displayOrder); return this; } - /** - * The order in which the Pipeline Stage is displayed in the UI. - */ - public Stages withDisplayOrder(JsonNullable displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); - this.displayOrder = displayOrder; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -247,117 +198,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable value = JsonNullable.undefined(); + private JsonNullable value; - private JsonNullable winProbability = JsonNullable.undefined(); + private JsonNullable winProbability; - private JsonNullable displayOrder = JsonNullable.undefined(); + private JsonNullable displayOrder; private Builder() { // force use of static builder() method } - /** * The unique identifier of the Pipeline Stage. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * The unique identifier of the Pipeline Stage. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The name of the Pipeline Stage. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the Pipeline Stage. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The value of the Pipeline Stage. */ - public Builder value(String value) { - Utils.checkNotNull(value, "value"); + public Builder value(@Nullable String value) { this.value = JsonNullable.of(value); return this; } - /** - * The value of the Pipeline Stage. - */ - public Builder value(JsonNullable value) { - Utils.checkNotNull(value, "value"); - this.value = value; - return this; - } - - /** * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. */ - public Builder winProbability(long winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); + public Builder winProbability(@Nullable Long winProbability) { this.winProbability = JsonNullable.of(winProbability); return this; } - /** - * The expected probability of winning an Opportunity in this Pipeline Stage. Valid values are [0-100]. - */ - public Builder winProbability(JsonNullable winProbability) { - Utils.checkNotNull(winProbability, "winProbability"); - this.winProbability = winProbability; - return this; - } - - /** * The order in which the Pipeline Stage is displayed in the UI. */ - public Builder displayOrder(long displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); + public Builder displayOrder(@Nullable Long displayOrder) { this.displayOrder = JsonNullable.of(displayOrder); return this; } - /** - * The order in which the Pipeline Stage is displayed in the UI. - */ - public Builder displayOrder(JsonNullable displayOrder) { - Utils.checkNotNull(displayOrder, "displayOrder"); - this.displayOrder = displayOrder; - return this; - } - public Stages build() { - return new Stages( id, name, value, winProbability, displayOrder); diff --git a/src/main/java/com/apideck/unify/models/components/SubAccounts.java b/src/main/java/com/apideck/unify/models/components/SubAccounts.java index 1b3977e6..4c06f524 100644 --- a/src/main/java/com/apideck/unify/models/components/SubAccounts.java +++ b/src/main/java/com/apideck/unify/models/components/SubAccounts.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -20,43 +20,39 @@ public class SubAccounts { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the sub account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("account_sub_name") - private Optional accountSubName; + private String accountSubName; @JsonCreator public SubAccounts( - @JsonProperty("id") Optional id, - @JsonProperty("account_sub_name") Optional accountSubName) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(accountSubName, "accountSubName"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("account_sub_name") @Nullable String accountSubName) { this.id = id; this.accountSubName = accountSubName; } public SubAccounts() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The ID of the sub account. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the sub account. */ - @JsonIgnore public Optional accountSubName() { - return accountSubName; + return Optional.ofNullable(this.accountSubName); } public static Builder builder() { @@ -67,41 +63,21 @@ public static Builder builder() { /** * The ID of the sub account. */ - public SubAccounts withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The ID of the sub account. - */ - public SubAccounts withId(Optional id) { - Utils.checkNotNull(id, "id"); + public SubAccounts withId(@Nullable String id) { this.id = id; return this; } - /** - * The name of the sub account. - */ - public SubAccounts withAccountSubName(String accountSubName) { - Utils.checkNotNull(accountSubName, "accountSubName"); - this.accountSubName = Optional.ofNullable(accountSubName); - return this; - } - /** * The name of the sub account. */ - public SubAccounts withAccountSubName(Optional accountSubName) { - Utils.checkNotNull(accountSubName, "accountSubName"); + public SubAccounts withAccountSubName(@Nullable String accountSubName) { this.accountSubName = accountSubName; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -132,54 +108,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional accountSubName = Optional.empty(); + private String accountSubName; private Builder() { // force use of static builder() method } - /** * The ID of the sub account. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * The ID of the sub account. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * The name of the sub account. - */ - public Builder accountSubName(String accountSubName) { - Utils.checkNotNull(accountSubName, "accountSubName"); - this.accountSubName = Optional.ofNullable(accountSubName); - return this; - } - /** * The name of the sub account. */ - public Builder accountSubName(Optional accountSubName) { - Utils.checkNotNull(accountSubName, "accountSubName"); + public Builder accountSubName(@Nullable String accountSubName) { this.accountSubName = accountSubName; return this; } public SubAccounts build() { - return new SubAccounts( id, accountSubName); } diff --git a/src/main/java/com/apideck/unify/models/components/Subsidiaries.java b/src/main/java/com/apideck/unify/models/components/Subsidiaries.java index 5396363b..215dba74 100644 --- a/src/main/java/com/apideck/unify/models/components/Subsidiaries.java +++ b/src/main/java/com/apideck/unify/models/components/Subsidiaries.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -20,25 +20,23 @@ public class Subsidiaries { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonCreator public Subsidiaries( - @JsonProperty("id") Optional id) { - Utils.checkNotNull(id, "id"); + @JsonProperty("id") @Nullable String id) { this.id = id; } public Subsidiaries() { - this(Optional.empty()); + this(null); } /** * The ID of the subsidiary. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } public static Builder builder() { @@ -49,22 +47,12 @@ public static Builder builder() { /** * The ID of the subsidiary. */ - public Subsidiaries withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The ID of the subsidiary. - */ - public Subsidiaries withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Subsidiaries withId(@Nullable String id) { this.id = id; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -93,33 +81,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private Builder() { // force use of static builder() method } - - /** - * The ID of the subsidiary. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The ID of the subsidiary. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } public Subsidiaries build() { - return new Subsidiaries( id); } diff --git a/src/main/java/com/apideck/unify/models/components/Subsidiary.java b/src/main/java/com/apideck/unify/models/components/Subsidiary.java index 0190fdf1..db4656b2 100644 --- a/src/main/java/com/apideck/unify/models/components/Subsidiary.java +++ b/src/main/java/com/apideck/unify/models/components/Subsidiary.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -26,7 +25,7 @@ public class Subsidiary { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * A unique identifier for an object. @@ -47,14 +46,14 @@ public class Subsidiary { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private SubsidiaryStatus status; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -96,141 +95,124 @@ public class Subsidiary { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Subsidiary( - @JsonProperty("id") Optional id, - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("name") JsonNullable name, - @JsonProperty("status") Optional status, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("status") @Nullable SubsidiaryStatus status, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.parentId = parentId; - this.name = name; + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); this.status = status; - this.customMappings = customMappings; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Subsidiary() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The name of the company. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * Based on the status some functionality is enabled or disabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -241,204 +223,102 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Subsidiary withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public Subsidiary withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Subsidiary withId(@Nullable String id) { this.id = id; return this; } + /** * A unique identifier for an object. */ - public Subsidiary withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Subsidiary withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public Subsidiary withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The name of the company. */ - public Subsidiary withName(String name) { - Utils.checkNotNull(name, "name"); + public Subsidiary withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the company. - */ - public Subsidiary withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public Subsidiary withStatus(SubsidiaryStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Based on the status some functionality is enabled or disabled. */ - public Subsidiary withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public Subsidiary withStatus(@Nullable SubsidiaryStatus status) { this.status = status; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public Subsidiary withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Subsidiary withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Subsidiary withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Subsidiary withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Subsidiary withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Subsidiary withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public Subsidiary withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Subsidiary withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Subsidiary withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Subsidiary withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Subsidiary withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Subsidiary withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Subsidiary withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Subsidiary withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Subsidiary withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Subsidiary withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Subsidiary withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Subsidiary withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Subsidiary withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Subsidiary withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Subsidiary withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -490,243 +370,121 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private Optional status = Optional.empty(); + private SubsidiaryStatus status; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * A unique identifier for an object. */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The name of the company. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the company. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - - /** - * Based on the status some functionality is enabled or disabled. - */ - public Builder status(SubsidiaryStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Based on the status some functionality is enabled or disabled. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable SubsidiaryStatus status) { this.status = status; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Subsidiary build() { - return new Subsidiary( id, parentId, name, status, customMappings, rowVersion, diff --git a/src/main/java/com/apideck/unify/models/components/SubsidiaryInput.java b/src/main/java/com/apideck/unify/models/components/SubsidiaryInput.java index d076bee9..9c55bdde 100644 --- a/src/main/java/com/apideck/unify/models/components/SubsidiaryInput.java +++ b/src/main/java/com/apideck/unify/models/components/SubsidiaryInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -37,7 +36,7 @@ public class SubsidiaryInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private SubsidiaryStatus status; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -51,72 +50,63 @@ public class SubsidiaryInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public SubsidiaryInput( - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("name") JsonNullable name, - @JsonProperty("status") Optional status, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - this.parentId = parentId; - this.name = name; + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("status") @Nullable SubsidiaryStatus status, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); this.status = status; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public SubsidiaryInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The name of the company. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * Based on the status some functionality is enabled or disabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -127,82 +117,35 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public SubsidiaryInput withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public SubsidiaryInput withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public SubsidiaryInput withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The name of the company. */ - public SubsidiaryInput withName(String name) { - Utils.checkNotNull(name, "name"); + public SubsidiaryInput withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the company. - */ - public SubsidiaryInput withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public SubsidiaryInput withStatus(SubsidiaryStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * Based on the status some functionality is enabled or disabled. */ - public SubsidiaryInput withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public SubsidiaryInput withStatus(@Nullable SubsidiaryStatus status) { this.status = status; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public SubsidiaryInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public SubsidiaryInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public SubsidiaryInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public SubsidiaryInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -210,12 +153,12 @@ public SubsidiaryInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public SubsidiaryInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public SubsidiaryInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -253,117 +196,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private Optional status = Optional.empty(); + private SubsidiaryStatus status; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The name of the company. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the company. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * Based on the status some functionality is enabled or disabled. */ - public Builder status(SubsidiaryStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable SubsidiaryStatus status) { this.status = status; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public SubsidiaryInput build() { - return new SubsidiaryInput( parentId, name, status, rowVersion, passThrough); diff --git a/src/main/java/com/apideck/unify/models/components/SubsidiaryReference.java b/src/main/java/com/apideck/unify/models/components/SubsidiaryReference.java index ec1d9500..19ecb156 100644 --- a/src/main/java/com/apideck/unify/models/components/SubsidiaryReference.java +++ b/src/main/java/com/apideck/unify/models/components/SubsidiaryReference.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -21,7 +21,7 @@ public class SubsidiaryReference { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The name of the company. @@ -32,32 +32,29 @@ public class SubsidiaryReference { @JsonCreator public SubsidiaryReference( - @JsonProperty("id") Optional id, - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("name") @Nullable JsonNullable name) { this.id = id; - this.name = name; + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public SubsidiaryReference() { - this(Optional.empty(), JsonNullable.undefined()); + this(null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The name of the company. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -68,39 +65,20 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public SubsidiaryReference withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public SubsidiaryReference withId(Optional id) { - Utils.checkNotNull(id, "id"); + public SubsidiaryReference withId(@Nullable String id) { this.id = id; return this; } + /** * The name of the company. */ - public SubsidiaryReference withName(String name) { - Utils.checkNotNull(name, "name"); + public SubsidiaryReference withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the company. - */ - public SubsidiaryReference withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -132,54 +110,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The name of the company. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the company. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public SubsidiaryReference build() { - return new SubsidiaryReference( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/SubsidiaryReferenceInput.java b/src/main/java/com/apideck/unify/models/components/SubsidiaryReferenceInput.java index 820a0d14..02377078 100644 --- a/src/main/java/com/apideck/unify/models/components/SubsidiaryReferenceInput.java +++ b/src/main/java/com/apideck/unify/models/components/SubsidiaryReferenceInput.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,21 +25,20 @@ public class SubsidiaryReferenceInput { @JsonCreator public SubsidiaryReferenceInput( - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; + @JsonProperty("name") @Nullable JsonNullable name) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public SubsidiaryReferenceInput() { - this(JsonNullable.undefined()); + this(null); } /** * The name of the company. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -49,20 +49,11 @@ public static Builder builder() { /** * The name of the company. */ - public SubsidiaryReferenceInput withName(String name) { - Utils.checkNotNull(name, "name"); + public SubsidiaryReferenceInput withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the company. - */ - public SubsidiaryReferenceInput withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -92,33 +83,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - /** * The name of the company. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the company. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public SubsidiaryReferenceInput build() { - return new SubsidiaryReferenceInput( name); } diff --git a/src/main/java/com/apideck/unify/models/components/Supplier.java b/src/main/java/com/apideck/unify/models/components/Supplier.java index 64cbc7b4..2ad7b339 100644 --- a/src/main/java/com/apideck/unify/models/components/Supplier.java +++ b/src/main/java/com/apideck/unify/models/components/Supplier.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -113,27 +113,27 @@ public class Supplier { @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_accounts") - private Optional> bankAccounts; + private List bankAccounts; /** * Some notes about this supplier @@ -145,7 +145,7 @@ public class Supplier { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRate taxRate; @JsonInclude(Include.NON_ABSENT) @@ -157,19 +157,19 @@ public class Supplier { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; @JsonInclude(Include.NON_ABSENT) @JsonProperty("account") - private JsonNullable account; + private JsonNullable account; /** * Supplier status */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check @@ -197,12 +197,12 @@ public class Supplier { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * The user who last updated the object. @@ -244,411 +244,354 @@ public class Supplier { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; /** * The subsidiary the supplier belongs to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiary_id") - private Optional subsidiaryId; + private String subsidiaryId; @JsonCreator public Supplier( - @JsonProperty("id") String id, - @JsonProperty("downstream_id") JsonNullable downstreamId, - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("supplier_category") JsonNullable supplierCategory, - @JsonProperty("title") JsonNullable title, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("suffix") JsonNullable suffix, - @JsonProperty("individual") JsonNullable individual, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("websites") Optional> websites, - @JsonProperty("bank_accounts") Optional> bankAccounts, - @JsonProperty("notes") JsonNullable notes, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("tax_number") JsonNullable taxNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("account") JsonNullable account, - @JsonProperty("status") JsonNullable status, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("terms") JsonNullable terms, - @JsonProperty("channel") JsonNullable channel, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough, - @JsonProperty("subsidiary_id") Optional subsidiaryId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(supplierCategory, "supplierCategory"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(suffix, "suffix"); - Utils.checkNotNull(individual, "individual"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(bankAccounts, "bankAccounts"); - Utils.checkNotNull(notes, "notes"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(taxNumber, "taxNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(account, "account"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(terms, "terms"); - Utils.checkNotNull(channel, "channel"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.id = id; - this.downstreamId = downstreamId; - this.displayId = displayId; - this.displayName = displayName; - this.companyName = companyName; - this.companyId = companyId; - this.supplierCategory = supplierCategory; - this.title = title; - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.suffix = suffix; - this.individual = individual; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId, + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("supplier_category") @Nullable JsonNullable supplierCategory, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("suffix") @Nullable JsonNullable suffix, + @JsonProperty("individual") @Nullable JsonNullable individual, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("bank_accounts") @Nullable List bankAccounts, + @JsonProperty("notes") @Nullable JsonNullable notes, + @JsonProperty("tax_rate") @Nullable LinkedTaxRate taxRate, + @JsonProperty("tax_number") @Nullable JsonNullable taxNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("account") @Nullable JsonNullable account, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("terms") @Nullable JsonNullable terms, + @JsonProperty("channel") @Nullable JsonNullable channel, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough, + @JsonProperty("subsidiary_id") @Nullable String subsidiaryId) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.supplierCategory = Optional.ofNullable(supplierCategory) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.suffix = Optional.ofNullable(suffix) + .orElse(JsonNullable.undefined()); + this.individual = Optional.ofNullable(individual) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.phoneNumbers = phoneNumbers; this.emails = emails; this.websites = websites; this.bankAccounts = bankAccounts; - this.notes = notes; + this.notes = Optional.ofNullable(notes) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; - this.taxNumber = taxNumber; - this.currency = currency; - this.account = account; - this.status = status; - this.paymentMethod = paymentMethod; - this.terms = terms; - this.channel = channel; - this.customMappings = customMappings; + this.taxNumber = Optional.ofNullable(taxNumber) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.account = Optional.ofNullable(account) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.terms = Optional.ofNullable(terms) + .orElse(JsonNullable.undefined()); + this.channel = Optional.ofNullable(channel) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; - this.rowVersion = rowVersion; + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; this.subsidiaryId = subsidiaryId; } public Supplier( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } /** * Display ID */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * Display name */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The category/type of the supplier */ - @JsonIgnore public JsonNullable supplierCategory() { - return supplierCategory; + return this.supplierCategory; } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * Middle name of the person. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } - @JsonIgnore public JsonNullable suffix() { - return suffix; + return this.suffix; } /** * Is this an individual or business supplier */ - @JsonIgnore public JsonNullable individual() { - return individual; + return this.individual; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> bankAccounts() { - return (Optional>) bankAccounts; + return Optional.ofNullable(this.bankAccounts); } /** * Some notes about this supplier */ - @JsonIgnore public JsonNullable notes() { - return notes; + return this.notes; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } - @JsonIgnore public JsonNullable taxNumber() { - return taxNumber; + return this.taxNumber; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable account() { - return (JsonNullable) account; + return this.account; } /** * Supplier status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * Terms of payment. */ - @JsonIgnore public JsonNullable terms() { - return terms; + return this.terms; } /** * The channel through which the transaction is processed. */ - @JsonIgnore public JsonNullable channel() { - return channel; + return this.channel; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The subsidiary the supplier belongs to. */ - @JsonIgnore public Optional subsidiaryId() { - return subsidiaryId; + return Optional.ofNullable(this.subsidiaryId); } public static Builder builder() { @@ -659,591 +602,297 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Supplier withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Supplier withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The third-party API ID of original entity */ - public Supplier withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Supplier withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Supplier withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } /** * Display ID */ - public Supplier withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Supplier withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Display ID - */ - public Supplier withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } /** * Display name */ - public Supplier withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Supplier withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * Display name - */ - public Supplier withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } /** * The name of the company. */ - public Supplier withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Supplier withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Supplier withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public Supplier withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Supplier withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Supplier withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The category/type of the supplier */ - public Supplier withSupplierCategory(String supplierCategory) { - Utils.checkNotNull(supplierCategory, "supplierCategory"); + public Supplier withSupplierCategory(@Nullable String supplierCategory) { this.supplierCategory = JsonNullable.of(supplierCategory); return this; } - /** - * The category/type of the supplier - */ - public Supplier withSupplierCategory(JsonNullable supplierCategory) { - Utils.checkNotNull(supplierCategory, "supplierCategory"); - this.supplierCategory = supplierCategory; - return this; - } /** * The job title of the person. */ - public Supplier withTitle(String title) { - Utils.checkNotNull(title, "title"); + public Supplier withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Supplier withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The first name of the person. */ - public Supplier withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Supplier withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Supplier withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * Middle name of the person. */ - public Supplier withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Supplier withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Supplier withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The last name of the person. */ - public Supplier withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Supplier withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Supplier withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - public Supplier withSuffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Supplier withSuffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - public Supplier withSuffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } /** * Is this an individual or business supplier */ - public Supplier withIndividual(boolean individual) { - Utils.checkNotNull(individual, "individual"); + public Supplier withIndividual(@Nullable Boolean individual) { this.individual = JsonNullable.of(individual); return this; } - /** - * Is this an individual or business supplier - */ - public Supplier withIndividual(JsonNullable individual) { - Utils.checkNotNull(individual, "individual"); - this.individual = individual; - return this; - } - - public Supplier withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Supplier withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Supplier withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public Supplier withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Supplier withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Supplier withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Supplier withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Supplier withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Supplier withEmails(@Nullable List emails) { this.emails = emails; return this; } - public Supplier withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Supplier withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Supplier withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public Supplier withBankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Supplier withBankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Supplier withBankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - /** - * Some notes about this supplier - */ - public Supplier withNotes(String notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = JsonNullable.of(notes); - return this; - } /** * Some notes about this supplier */ - public Supplier withNotes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - public Supplier withTaxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); + public Supplier withNotes(@Nullable String notes) { + this.notes = JsonNullable.of(notes); return this; } - public Supplier withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Supplier withTaxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - public Supplier withTaxNumber(String taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); + + public Supplier withTaxNumber(@Nullable String taxNumber) { this.taxNumber = JsonNullable.of(taxNumber); return this; } - public Supplier withTaxNumber(JsonNullable taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); - this.taxNumber = taxNumber; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Supplier withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Supplier withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Supplier withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - public Supplier withAccount(LinkedLedgerAccount account) { - Utils.checkNotNull(account, "account"); + public Supplier withAccount(@Nullable LinkedLedgerAccount account) { this.account = JsonNullable.of(account); return this; } - public Supplier withAccount(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } /** * Supplier status */ - public Supplier withStatus(SupplierStatus status) { - Utils.checkNotNull(status, "status"); + public Supplier withStatus(@Nullable SupplierStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Supplier status - */ - public Supplier withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Supplier withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Supplier withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Supplier withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * Terms of payment. */ - public Supplier withTerms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Supplier withTerms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public Supplier withTerms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } /** * The channel through which the transaction is processed. */ - public Supplier withChannel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Supplier withChannel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Supplier withChannel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Supplier withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Supplier withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Supplier withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - public Supplier withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Supplier withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Supplier withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + /** * The user who last updated the object. */ - public Supplier withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Supplier withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Supplier withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public Supplier withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Supplier withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Supplier withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public Supplier withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Supplier withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Supplier withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Supplier withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Supplier withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Supplier withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Supplier withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Supplier withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Supplier withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Supplier withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Supplier withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Supplier withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** - * The subsidiary the supplier belongs to. - */ - public Supplier withSubsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = Optional.ofNullable(subsidiaryId); - return this; - } - /** * The subsidiary the supplier belongs to. */ - public Supplier withSubsidiaryId(Optional subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public Supplier withSubsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = subsidiaryId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1355,697 +1004,339 @@ public final static class Builder { private String id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable supplierCategory = JsonNullable.undefined(); + private JsonNullable supplierCategory; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable suffix = JsonNullable.undefined(); + private JsonNullable suffix; - private JsonNullable individual = JsonNullable.undefined(); + private JsonNullable individual; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> bankAccounts = Optional.empty(); + private List bankAccounts; - private JsonNullable notes = JsonNullable.undefined(); + private JsonNullable notes; - private Optional taxRate = Optional.empty(); + private LinkedTaxRate taxRate; - private JsonNullable taxNumber = JsonNullable.undefined(); + private JsonNullable taxNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable account = JsonNullable.undefined(); + private JsonNullable account; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable terms = JsonNullable.undefined(); + private JsonNullable terms; - private JsonNullable channel = JsonNullable.undefined(); + private JsonNullable channel; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; - private Optional subsidiaryId = Optional.empty(); + private String subsidiaryId; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } - - /** * Display ID */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Display ID - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * Display name */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * Display name - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The category/type of the supplier */ - public Builder supplierCategory(String supplierCategory) { - Utils.checkNotNull(supplierCategory, "supplierCategory"); + public Builder supplierCategory(@Nullable String supplierCategory) { this.supplierCategory = JsonNullable.of(supplierCategory); return this; } - /** - * The category/type of the supplier - */ - public Builder supplierCategory(JsonNullable supplierCategory) { - Utils.checkNotNull(supplierCategory, "supplierCategory"); - this.supplierCategory = supplierCategory; - return this; - } - - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * Middle name of the person. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - - public Builder suffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Builder suffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - public Builder suffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } - - /** * Is this an individual or business supplier */ - public Builder individual(boolean individual) { - Utils.checkNotNull(individual, "individual"); + public Builder individual(@Nullable Boolean individual) { this.individual = JsonNullable.of(individual); return this; } - /** - * Is this an individual or business supplier - */ - public Builder individual(JsonNullable individual) { - Utils.checkNotNull(individual, "individual"); - this.individual = individual; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder bankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Builder bankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Builder bankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - /** * Some notes about this supplier */ - public Builder notes(String notes) { - Utils.checkNotNull(notes, "notes"); + public Builder notes(@Nullable String notes) { this.notes = JsonNullable.of(notes); return this; } - /** - * Some notes about this supplier - */ - public Builder notes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - - public Builder taxRate(LinkedTaxRate taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRate taxRate) { this.taxRate = taxRate; return this; } - - public Builder taxNumber(String taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); + public Builder taxNumber(@Nullable String taxNumber) { this.taxNumber = JsonNullable.of(taxNumber); return this; } - public Builder taxNumber(JsonNullable taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); - this.taxNumber = taxNumber; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - public Builder account(LinkedLedgerAccount account) { - Utils.checkNotNull(account, "account"); + public Builder account(@Nullable LinkedLedgerAccount account) { this.account = JsonNullable.of(account); return this; } - public Builder account(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - - /** * Supplier status */ - public Builder status(SupplierStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable SupplierStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Supplier status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * Terms of payment. */ - public Builder terms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Builder terms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public Builder terms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } - - /** * The channel through which the transaction is processed. */ - public Builder channel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Builder channel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Builder channel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** * The subsidiary the supplier belongs to. */ - public Builder subsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = Optional.ofNullable(subsidiaryId); - return this; - } - - /** - * The subsidiary the supplier belongs to. - */ - public Builder subsidiaryId(Optional subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public Builder subsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = subsidiaryId; return this; } public Supplier build() { - return new Supplier( id, downstreamId, displayId, displayName, companyName, companyId, diff --git a/src/main/java/com/apideck/unify/models/components/SupplierInput.java b/src/main/java/com/apideck/unify/models/components/SupplierInput.java index 478fa5d2..19df67fb 100644 --- a/src/main/java/com/apideck/unify/models/components/SupplierInput.java +++ b/src/main/java/com/apideck/unify/models/components/SupplierInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -97,27 +96,27 @@ public class SupplierInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonInclude(Include.NON_ABSENT) @JsonProperty("emails") - private Optional> emails; + private List emails; @JsonInclude(Include.NON_ABSENT) @JsonProperty("websites") - private Optional> websites; + private List websites; @JsonInclude(Include.NON_ABSENT) @JsonProperty("bank_accounts") - private Optional> bankAccounts; + private List bankAccounts; /** * Some notes about this supplier @@ -129,7 +128,7 @@ public class SupplierInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tax_rate") - private Optional taxRate; + private LinkedTaxRateInput taxRate; @JsonInclude(Include.NON_ABSENT) @@ -141,19 +140,19 @@ public class SupplierInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("currency") - private JsonNullable currency; + private JsonNullable currency; @JsonInclude(Include.NON_ABSENT) @JsonProperty("account") - private JsonNullable account; + private JsonNullable account; /** * Supplier status */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check @@ -179,7 +178,7 @@ public class SupplierInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -193,330 +192,281 @@ public class SupplierInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; /** * The subsidiary the supplier belongs to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiary_id") - private Optional subsidiaryId; + private String subsidiaryId; @JsonCreator public SupplierInput( - @JsonProperty("display_id") JsonNullable displayId, - @JsonProperty("display_name") JsonNullable displayName, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("company_id") JsonNullable companyId, - @JsonProperty("supplier_category") JsonNullable supplierCategory, - @JsonProperty("title") JsonNullable title, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("middle_name") JsonNullable middleName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("suffix") JsonNullable suffix, - @JsonProperty("individual") JsonNullable individual, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") Optional> emails, - @JsonProperty("websites") Optional> websites, - @JsonProperty("bank_accounts") Optional> bankAccounts, - @JsonProperty("notes") JsonNullable notes, - @JsonProperty("tax_rate") Optional taxRate, - @JsonProperty("tax_number") JsonNullable taxNumber, - @JsonProperty("currency") JsonNullable currency, - @JsonProperty("account") JsonNullable account, - @JsonProperty("status") JsonNullable status, - @JsonProperty("payment_method") JsonNullable paymentMethod, - @JsonProperty("terms") JsonNullable terms, - @JsonProperty("channel") JsonNullable channel, - @JsonProperty("custom_fields") Optional> customFields, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough, - @JsonProperty("subsidiary_id") Optional subsidiaryId) { - Utils.checkNotNull(displayId, "displayId"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(companyId, "companyId"); - Utils.checkNotNull(supplierCategory, "supplierCategory"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(middleName, "middleName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(suffix, "suffix"); - Utils.checkNotNull(individual, "individual"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(websites, "websites"); - Utils.checkNotNull(bankAccounts, "bankAccounts"); - Utils.checkNotNull(notes, "notes"); - Utils.checkNotNull(taxRate, "taxRate"); - Utils.checkNotNull(taxNumber, "taxNumber"); - Utils.checkNotNull(currency, "currency"); - Utils.checkNotNull(account, "account"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(paymentMethod, "paymentMethod"); - Utils.checkNotNull(terms, "terms"); - Utils.checkNotNull(channel, "channel"); - Utils.checkNotNull(customFields, "customFields"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.displayId = displayId; - this.displayName = displayName; - this.companyName = companyName; - this.companyId = companyId; - this.supplierCategory = supplierCategory; - this.title = title; - this.firstName = firstName; - this.middleName = middleName; - this.lastName = lastName; - this.suffix = suffix; - this.individual = individual; + @JsonProperty("display_id") @Nullable JsonNullable displayId, + @JsonProperty("display_name") @Nullable JsonNullable displayName, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("company_id") @Nullable JsonNullable companyId, + @JsonProperty("supplier_category") @Nullable JsonNullable supplierCategory, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("middle_name") @Nullable JsonNullable middleName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("suffix") @Nullable JsonNullable suffix, + @JsonProperty("individual") @Nullable JsonNullable individual, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nullable List emails, + @JsonProperty("websites") @Nullable List websites, + @JsonProperty("bank_accounts") @Nullable List bankAccounts, + @JsonProperty("notes") @Nullable JsonNullable notes, + @JsonProperty("tax_rate") @Nullable LinkedTaxRateInput taxRate, + @JsonProperty("tax_number") @Nullable JsonNullable taxNumber, + @JsonProperty("currency") @Nullable JsonNullable currency, + @JsonProperty("account") @Nullable JsonNullable account, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("payment_method") @Nullable JsonNullable paymentMethod, + @JsonProperty("terms") @Nullable JsonNullable terms, + @JsonProperty("channel") @Nullable JsonNullable channel, + @JsonProperty("custom_fields") @Nullable List customFields, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough, + @JsonProperty("subsidiary_id") @Nullable String subsidiaryId) { + this.displayId = Optional.ofNullable(displayId) + .orElse(JsonNullable.undefined()); + this.displayName = Optional.ofNullable(displayName) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.companyId = Optional.ofNullable(companyId) + .orElse(JsonNullable.undefined()); + this.supplierCategory = Optional.ofNullable(supplierCategory) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.middleName = Optional.ofNullable(middleName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.suffix = Optional.ofNullable(suffix) + .orElse(JsonNullable.undefined()); + this.individual = Optional.ofNullable(individual) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.phoneNumbers = phoneNumbers; this.emails = emails; this.websites = websites; this.bankAccounts = bankAccounts; - this.notes = notes; + this.notes = Optional.ofNullable(notes) + .orElse(JsonNullable.undefined()); this.taxRate = taxRate; - this.taxNumber = taxNumber; - this.currency = currency; - this.account = account; - this.status = status; - this.paymentMethod = paymentMethod; - this.terms = terms; - this.channel = channel; + this.taxNumber = Optional.ofNullable(taxNumber) + .orElse(JsonNullable.undefined()); + this.currency = Optional.ofNullable(currency) + .orElse(JsonNullable.undefined()); + this.account = Optional.ofNullable(account) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.paymentMethod = Optional.ofNullable(paymentMethod) + .orElse(JsonNullable.undefined()); + this.terms = Optional.ofNullable(terms) + .orElse(JsonNullable.undefined()); + this.channel = Optional.ofNullable(channel) + .orElse(JsonNullable.undefined()); this.customFields = customFields; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; this.subsidiaryId = subsidiaryId; } public SupplierInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * Display ID */ - @JsonIgnore public JsonNullable displayId() { - return displayId; + return this.displayId; } /** * Display name */ - @JsonIgnore public JsonNullable displayName() { - return displayName; + return this.displayName; } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * The company or subsidiary id the transaction belongs to */ - @JsonIgnore public JsonNullable companyId() { - return companyId; + return this.companyId; } /** * The category/type of the supplier */ - @JsonIgnore public JsonNullable supplierCategory() { - return supplierCategory; + return this.supplierCategory; } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * Middle name of the person. */ - @JsonIgnore public JsonNullable middleName() { - return middleName; + return this.middleName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } - @JsonIgnore public JsonNullable suffix() { - return suffix; + return this.suffix; } /** * Is this an individual or business supplier */ - @JsonIgnore public JsonNullable individual() { - return individual; + return this.individual; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> emails() { - return (Optional>) emails; + return Optional.ofNullable(this.emails); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> websites() { - return (Optional>) websites; + return Optional.ofNullable(this.websites); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> bankAccounts() { - return (Optional>) bankAccounts; + return Optional.ofNullable(this.bankAccounts); } /** * Some notes about this supplier */ - @JsonIgnore public JsonNullable notes() { - return notes; + return this.notes; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional taxRate() { - return (Optional) taxRate; + return Optional.ofNullable(this.taxRate); } - @JsonIgnore public JsonNullable taxNumber() { - return taxNumber; + return this.taxNumber; } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable currency() { - return (JsonNullable) currency; + return this.currency; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable account() { - return (JsonNullable) account; + return this.account; } /** * Supplier status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - @JsonIgnore public JsonNullable paymentMethod() { - return paymentMethod; + return this.paymentMethod; } /** * Terms of payment. */ - @JsonIgnore public JsonNullable terms() { - return terms; + return this.terms; } /** * The channel through which the transaction is processed. */ - @JsonIgnore public JsonNullable channel() { - return channel; + return this.channel; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The subsidiary the supplier belongs to. */ - @JsonIgnore public Optional subsidiaryId() { - return subsidiaryId; + return Optional.ofNullable(this.subsidiaryId); } public static Builder builder() { @@ -527,442 +477,212 @@ public static Builder builder() { /** * Display ID */ - public SupplierInput withDisplayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public SupplierInput withDisplayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Display ID - */ - public SupplierInput withDisplayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } /** * Display name */ - public SupplierInput withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public SupplierInput withDisplayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * Display name - */ - public SupplierInput withDisplayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } /** * The name of the company. */ - public SupplierInput withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public SupplierInput withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public SupplierInput withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * The company or subsidiary id the transaction belongs to */ - public SupplierInput withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public SupplierInput withCompanyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public SupplierInput withCompanyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } /** * The category/type of the supplier */ - public SupplierInput withSupplierCategory(String supplierCategory) { - Utils.checkNotNull(supplierCategory, "supplierCategory"); + public SupplierInput withSupplierCategory(@Nullable String supplierCategory) { this.supplierCategory = JsonNullable.of(supplierCategory); return this; } - /** - * The category/type of the supplier - */ - public SupplierInput withSupplierCategory(JsonNullable supplierCategory) { - Utils.checkNotNull(supplierCategory, "supplierCategory"); - this.supplierCategory = supplierCategory; - return this; - } /** * The job title of the person. */ - public SupplierInput withTitle(String title) { - Utils.checkNotNull(title, "title"); + public SupplierInput withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public SupplierInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The first name of the person. */ - public SupplierInput withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public SupplierInput withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public SupplierInput withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * Middle name of the person. */ - public SupplierInput withMiddleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public SupplierInput withMiddleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public SupplierInput withMiddleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } /** * The last name of the person. */ - public SupplierInput withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public SupplierInput withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public SupplierInput withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - public SupplierInput withSuffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public SupplierInput withSuffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - public SupplierInput withSuffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } /** * Is this an individual or business supplier */ - public SupplierInput withIndividual(boolean individual) { - Utils.checkNotNull(individual, "individual"); + public SupplierInput withIndividual(@Nullable Boolean individual) { this.individual = JsonNullable.of(individual); return this; } - /** - * Is this an individual or business supplier - */ - public SupplierInput withIndividual(JsonNullable individual) { - Utils.checkNotNull(individual, "individual"); - this.individual = individual; - return this; - } - public SupplierInput withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - - public SupplierInput withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public SupplierInput withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public SupplierInput withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public SupplierInput withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public SupplierInput withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public SupplierInput withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public SupplierInput withEmails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public SupplierInput withEmails(@Nullable List emails) { this.emails = emails; return this; } - public SupplierInput withWebsites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public SupplierInput withWebsites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public SupplierInput withWebsites(@Nullable List websites) { this.websites = websites; return this; } - public SupplierInput withBankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public SupplierInput withBankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public SupplierInput withBankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - /** - * Some notes about this supplier - */ - public SupplierInput withNotes(String notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = JsonNullable.of(notes); - return this; - } /** * Some notes about this supplier */ - public SupplierInput withNotes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - public SupplierInput withTaxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); + public SupplierInput withNotes(@Nullable String notes) { + this.notes = JsonNullable.of(notes); return this; } - public SupplierInput withTaxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public SupplierInput withTaxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - public SupplierInput withTaxNumber(String taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); + + public SupplierInput withTaxNumber(@Nullable String taxNumber) { this.taxNumber = JsonNullable.of(taxNumber); return this; } - public SupplierInput withTaxNumber(JsonNullable taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); - this.taxNumber = taxNumber; - return this; - } /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public SupplierInput withCurrency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public SupplierInput withCurrency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public SupplierInput withCurrency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - public SupplierInput withAccount(LinkedLedgerAccountInput account) { - Utils.checkNotNull(account, "account"); + public SupplierInput withAccount(@Nullable LinkedLedgerAccountInput account) { this.account = JsonNullable.of(account); return this; } - public SupplierInput withAccount(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } /** * Supplier status */ - public SupplierInput withStatus(SupplierStatus status) { - Utils.checkNotNull(status, "status"); + public SupplierInput withStatus(@Nullable SupplierStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Supplier status - */ - public SupplierInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public SupplierInput withPaymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public SupplierInput withPaymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public SupplierInput withPaymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } /** * Terms of payment. */ - public SupplierInput withTerms(String terms) { - Utils.checkNotNull(terms, "terms"); + public SupplierInput withTerms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public SupplierInput withTerms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } /** * The channel through which the transaction is processed. */ - public SupplierInput withChannel(String channel) { - Utils.checkNotNull(channel, "channel"); + public SupplierInput withChannel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public SupplierInput withChannel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - public SupplierInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public SupplierInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public SupplierInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public SupplierInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public SupplierInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public SupplierInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public SupplierInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -970,31 +690,21 @@ public SupplierInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public SupplierInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public SupplierInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** - * The subsidiary the supplier belongs to. - */ - public SupplierInput withSubsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = Optional.ofNullable(subsidiaryId); - return this; - } - /** * The subsidiary the supplier belongs to. */ - public SupplierInput withSubsidiaryId(Optional subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public SupplierInput withSubsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = subsidiaryId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -1088,561 +798,271 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable displayId = JsonNullable.undefined(); + private JsonNullable displayId; - private JsonNullable displayName = JsonNullable.undefined(); + private JsonNullable displayName; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable companyId = JsonNullable.undefined(); + private JsonNullable companyId; - private JsonNullable supplierCategory = JsonNullable.undefined(); + private JsonNullable supplierCategory; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable middleName = JsonNullable.undefined(); + private JsonNullable middleName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable suffix = JsonNullable.undefined(); + private JsonNullable suffix; - private JsonNullable individual = JsonNullable.undefined(); + private JsonNullable individual; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; - private Optional> emails = Optional.empty(); + private List emails; - private Optional> websites = Optional.empty(); + private List websites; - private Optional> bankAccounts = Optional.empty(); + private List bankAccounts; - private JsonNullable notes = JsonNullable.undefined(); + private JsonNullable notes; - private Optional taxRate = Optional.empty(); + private LinkedTaxRateInput taxRate; - private JsonNullable taxNumber = JsonNullable.undefined(); + private JsonNullable taxNumber; - private JsonNullable currency = JsonNullable.undefined(); + private JsonNullable currency; - private JsonNullable account = JsonNullable.undefined(); + private JsonNullable account; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable paymentMethod = JsonNullable.undefined(); + private JsonNullable paymentMethod; - private JsonNullable terms = JsonNullable.undefined(); + private JsonNullable terms; - private JsonNullable channel = JsonNullable.undefined(); + private JsonNullable channel; - private Optional> customFields = Optional.empty(); + private List customFields; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; - private Optional subsidiaryId = Optional.empty(); + private String subsidiaryId; private Builder() { // force use of static builder() method } - /** * Display ID */ - public Builder displayId(String displayId) { - Utils.checkNotNull(displayId, "displayId"); + public Builder displayId(@Nullable String displayId) { this.displayId = JsonNullable.of(displayId); return this; } - /** - * Display ID - */ - public Builder displayId(JsonNullable displayId) { - Utils.checkNotNull(displayId, "displayId"); - this.displayId = displayId; - return this; - } - - /** * Display name */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = JsonNullable.of(displayName); return this; } - /** - * Display name - */ - public Builder displayName(JsonNullable displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = displayName; - return this; - } - - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * The company or subsidiary id the transaction belongs to */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = JsonNullable.of(companyId); return this; } - /** - * The company or subsidiary id the transaction belongs to - */ - public Builder companyId(JsonNullable companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = companyId; - return this; - } - - /** * The category/type of the supplier */ - public Builder supplierCategory(String supplierCategory) { - Utils.checkNotNull(supplierCategory, "supplierCategory"); + public Builder supplierCategory(@Nullable String supplierCategory) { this.supplierCategory = JsonNullable.of(supplierCategory); return this; } - /** - * The category/type of the supplier - */ - public Builder supplierCategory(JsonNullable supplierCategory) { - Utils.checkNotNull(supplierCategory, "supplierCategory"); - this.supplierCategory = supplierCategory; - return this; - } - - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * Middle name of the person. */ - public Builder middleName(String middleName) { - Utils.checkNotNull(middleName, "middleName"); + public Builder middleName(@Nullable String middleName) { this.middleName = JsonNullable.of(middleName); return this; } - /** - * Middle name of the person. - */ - public Builder middleName(JsonNullable middleName) { - Utils.checkNotNull(middleName, "middleName"); - this.middleName = middleName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - - public Builder suffix(String suffix) { - Utils.checkNotNull(suffix, "suffix"); + public Builder suffix(@Nullable String suffix) { this.suffix = JsonNullable.of(suffix); return this; } - public Builder suffix(JsonNullable suffix) { - Utils.checkNotNull(suffix, "suffix"); - this.suffix = suffix; - return this; - } - - /** * Is this an individual or business supplier */ - public Builder individual(boolean individual) { - Utils.checkNotNull(individual, "individual"); + public Builder individual(@Nullable Boolean individual) { this.individual = JsonNullable.of(individual); return this; } - /** - * Is this an individual or business supplier - */ - public Builder individual(JsonNullable individual) { - Utils.checkNotNull(individual, "individual"); - this.individual = individual; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = Optional.ofNullable(emails); - return this; - } - - public Builder emails(Optional> emails) { - Utils.checkNotNull(emails, "emails"); + public Builder emails(@Nullable List emails) { this.emails = emails; return this; } - - public Builder websites(List websites) { - Utils.checkNotNull(websites, "websites"); - this.websites = Optional.ofNullable(websites); - return this; - } - - public Builder websites(Optional> websites) { - Utils.checkNotNull(websites, "websites"); + public Builder websites(@Nullable List websites) { this.websites = websites; return this; } - - public Builder bankAccounts(List bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); - this.bankAccounts = Optional.ofNullable(bankAccounts); - return this; - } - - public Builder bankAccounts(Optional> bankAccounts) { - Utils.checkNotNull(bankAccounts, "bankAccounts"); + public Builder bankAccounts(@Nullable List bankAccounts) { this.bankAccounts = bankAccounts; return this; } - /** * Some notes about this supplier */ - public Builder notes(String notes) { - Utils.checkNotNull(notes, "notes"); + public Builder notes(@Nullable String notes) { this.notes = JsonNullable.of(notes); return this; } - /** - * Some notes about this supplier - */ - public Builder notes(JsonNullable notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = notes; - return this; - } - - - public Builder taxRate(LinkedTaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = Optional.ofNullable(taxRate); - return this; - } - - public Builder taxRate(Optional taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); + public Builder taxRate(@Nullable LinkedTaxRateInput taxRate) { this.taxRate = taxRate; return this; } - - public Builder taxNumber(String taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); + public Builder taxNumber(@Nullable String taxNumber) { this.taxNumber = JsonNullable.of(taxNumber); return this; } - public Builder taxNumber(JsonNullable taxNumber) { - Utils.checkNotNull(taxNumber, "taxNumber"); - this.taxNumber = taxNumber; - return this; - } - - /** * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). */ - public Builder currency(Currency currency) { - Utils.checkNotNull(currency, "currency"); + public Builder currency(@Nullable Currency currency) { this.currency = JsonNullable.of(currency); return this; } - /** - * Indicates the associated currency for an amount of money. Values correspond to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217). - */ - public Builder currency(JsonNullable currency) { - Utils.checkNotNull(currency, "currency"); - this.currency = currency; - return this; - } - - - public Builder account(LinkedLedgerAccountInput account) { - Utils.checkNotNull(account, "account"); + public Builder account(@Nullable LinkedLedgerAccountInput account) { this.account = JsonNullable.of(account); return this; } - public Builder account(JsonNullable account) { - Utils.checkNotNull(account, "account"); - this.account = account; - return this; - } - - /** * Supplier status */ - public Builder status(SupplierStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable SupplierStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Supplier status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Payment method used for the transaction, such as cash, credit card, bank transfer, or check */ - public Builder paymentMethod(String paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); + public Builder paymentMethod(@Nullable String paymentMethod) { this.paymentMethod = JsonNullable.of(paymentMethod); return this; } - /** - * Payment method used for the transaction, such as cash, credit card, bank transfer, or check - */ - public Builder paymentMethod(JsonNullable paymentMethod) { - Utils.checkNotNull(paymentMethod, "paymentMethod"); - this.paymentMethod = paymentMethod; - return this; - } - - /** * Terms of payment. */ - public Builder terms(String terms) { - Utils.checkNotNull(terms, "terms"); + public Builder terms(@Nullable String terms) { this.terms = JsonNullable.of(terms); return this; } - /** - * Terms of payment. - */ - public Builder terms(JsonNullable terms) { - Utils.checkNotNull(terms, "terms"); - this.terms = terms; - return this; - } - - /** * The channel through which the transaction is processed. */ - public Builder channel(String channel) { - Utils.checkNotNull(channel, "channel"); + public Builder channel(@Nullable String channel) { this.channel = JsonNullable.of(channel); return this; } - /** - * The channel through which the transaction is processed. - */ - public Builder channel(JsonNullable channel) { - Utils.checkNotNull(channel, "channel"); - this.channel = channel; - return this; - } - - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** * The subsidiary the supplier belongs to. */ - public Builder subsidiaryId(String subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); - this.subsidiaryId = Optional.ofNullable(subsidiaryId); - return this; - } - - /** - * The subsidiary the supplier belongs to. - */ - public Builder subsidiaryId(Optional subsidiaryId) { - Utils.checkNotNull(subsidiaryId, "subsidiaryId"); + public Builder subsidiaryId(@Nullable String subsidiaryId) { this.subsidiaryId = subsidiaryId; return this; } public SupplierInput build() { - return new SupplierInput( displayId, displayName, companyName, companyId, supplierCategory, title, diff --git a/src/main/java/com/apideck/unify/models/components/SuppliersFilter.java b/src/main/java/com/apideck/unify/models/components/SuppliersFilter.java index 1c513c90..b752cb54 100644 --- a/src/main/java/com/apideck/unify/models/components/SuppliersFilter.java +++ b/src/main/java/com/apideck/unify/models/components/SuppliersFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; @@ -18,50 +18,44 @@ public class SuppliersFilter { * Company Name of supplier to search for */ @SpeakeasyMetadata("queryParam:name=company_name") - private Optional companyName; + private String companyName; /** * Display Name of supplier to search for */ @SpeakeasyMetadata("queryParam:name=display_name") - private Optional displayName; + private String displayName; /** * First name of supplier to search for */ @SpeakeasyMetadata("queryParam:name=first_name") - private Optional firstName; + private String firstName; /** * Last name of supplier to search for */ @SpeakeasyMetadata("queryParam:name=last_name") - private Optional lastName; + private String lastName; /** * Email of supplier to search for */ @SpeakeasyMetadata("queryParam:name=email") - private Optional email; + private String email; @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private OffsetDateTime updatedSince; @JsonCreator public SuppliersFilter( - Optional companyName, - Optional displayName, - Optional firstName, - Optional lastName, - Optional email, - Optional updatedSince) { - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(displayName, "displayName"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(email, "email"); - Utils.checkNotNull(updatedSince, "updatedSince"); + @Nullable String companyName, + @Nullable String displayName, + @Nullable String firstName, + @Nullable String lastName, + @Nullable String email, + @Nullable OffsetDateTime updatedSince) { this.companyName = companyName; this.displayName = displayName; this.firstName = firstName; @@ -71,53 +65,47 @@ public SuppliersFilter( } public SuppliersFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * Company Name of supplier to search for */ - @JsonIgnore public Optional companyName() { - return companyName; + return Optional.ofNullable(this.companyName); } /** * Display Name of supplier to search for */ - @JsonIgnore public Optional displayName() { - return displayName; + return Optional.ofNullable(this.displayName); } /** * First name of supplier to search for */ - @JsonIgnore public Optional firstName() { - return firstName; + return Optional.ofNullable(this.firstName); } /** * Last name of supplier to search for */ - @JsonIgnore public Optional lastName() { - return lastName; + return Optional.ofNullable(this.lastName); } /** * Email of supplier to search for */ - @JsonIgnore public Optional email() { - return email; + return Optional.ofNullable(this.email); } - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } public static Builder builder() { @@ -128,111 +116,54 @@ public static Builder builder() { /** * Company Name of supplier to search for */ - public SuppliersFilter withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = Optional.ofNullable(companyName); - return this; - } - - - /** - * Company Name of supplier to search for - */ - public SuppliersFilter withCompanyName(Optional companyName) { - Utils.checkNotNull(companyName, "companyName"); + public SuppliersFilter withCompanyName(@Nullable String companyName) { this.companyName = companyName; return this; } - /** - * Display Name of supplier to search for - */ - public SuppliersFilter withDisplayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = Optional.ofNullable(displayName); - return this; - } - /** * Display Name of supplier to search for */ - public SuppliersFilter withDisplayName(Optional displayName) { - Utils.checkNotNull(displayName, "displayName"); + public SuppliersFilter withDisplayName(@Nullable String displayName) { this.displayName = displayName; return this; } - /** - * First name of supplier to search for - */ - public SuppliersFilter withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = Optional.ofNullable(firstName); - return this; - } - /** * First name of supplier to search for */ - public SuppliersFilter withFirstName(Optional firstName) { - Utils.checkNotNull(firstName, "firstName"); + public SuppliersFilter withFirstName(@Nullable String firstName) { this.firstName = firstName; return this; } - /** - * Last name of supplier to search for - */ - public SuppliersFilter withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = Optional.ofNullable(lastName); - return this; - } - /** * Last name of supplier to search for */ - public SuppliersFilter withLastName(Optional lastName) { - Utils.checkNotNull(lastName, "lastName"); + public SuppliersFilter withLastName(@Nullable String lastName) { this.lastName = lastName; return this; } - /** - * Email of supplier to search for - */ - public SuppliersFilter withEmail(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - /** * Email of supplier to search for */ - public SuppliersFilter withEmail(Optional email) { - Utils.checkNotNull(email, "email"); + public SuppliersFilter withEmail(@Nullable String email) { this.email = email; return this; } - public SuppliersFilter withUpdatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public SuppliersFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public SuppliersFilter withUpdatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -272,132 +203,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional companyName = Optional.empty(); + private String companyName; - private Optional displayName = Optional.empty(); + private String displayName; - private Optional firstName = Optional.empty(); + private String firstName; - private Optional lastName = Optional.empty(); + private String lastName; - private Optional email = Optional.empty(); + private String email; - private Optional updatedSince = Optional.empty(); + private OffsetDateTime updatedSince; private Builder() { // force use of static builder() method } - /** * Company Name of supplier to search for */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = Optional.ofNullable(companyName); - return this; - } - - /** - * Company Name of supplier to search for - */ - public Builder companyName(Optional companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = companyName; return this; } - /** * Display Name of supplier to search for */ - public Builder displayName(String displayName) { - Utils.checkNotNull(displayName, "displayName"); - this.displayName = Optional.ofNullable(displayName); - return this; - } - - /** - * Display Name of supplier to search for - */ - public Builder displayName(Optional displayName) { - Utils.checkNotNull(displayName, "displayName"); + public Builder displayName(@Nullable String displayName) { this.displayName = displayName; return this; } - /** * First name of supplier to search for */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = Optional.ofNullable(firstName); - return this; - } - - /** - * First name of supplier to search for - */ - public Builder firstName(Optional firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = firstName; return this; } - /** * Last name of supplier to search for */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = Optional.ofNullable(lastName); - return this; - } - - /** - * Last name of supplier to search for - */ - public Builder lastName(Optional lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = lastName; return this; } - - /** - * Email of supplier to search for - */ - public Builder email(String email) { - Utils.checkNotNull(email, "email"); - this.email = Optional.ofNullable(email); - return this; - } - /** * Email of supplier to search for */ - public Builder email(Optional email) { - Utils.checkNotNull(email, "email"); + public Builder email(@Nullable String email) { this.email = email; return this; } - - public Builder updatedSince(OffsetDateTime updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable OffsetDateTime updatedSince) { this.updatedSince = updatedSince; return this; } public SuppliersFilter build() { - return new SuppliersFilter( companyName, displayName, firstName, lastName, email, updatedSince); diff --git a/src/main/java/com/apideck/unify/models/components/SuppliersSort.java b/src/main/java/com/apideck/unify/models/components/SuppliersSort.java index 126dc346..f7e80278 100644 --- a/src/main/java/com/apideck/unify/models/components/SuppliersSort.java +++ b/src/main/java/com/apideck/unify/models/components/SuppliersSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class SuppliersSort { * The field on which to sort the Suppliers */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private SuppliersSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public SuppliersSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable SuppliersSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public SuppliersSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Suppliers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Suppliers */ - public SuppliersSort withBy(SuppliersSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Suppliers - */ - public SuppliersSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public SuppliersSort withBy(@Nullable SuppliersSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public SuppliersSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public SuppliersSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public SuppliersSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private SuppliersSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Suppliers - */ - public Builder by(SuppliersSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Suppliers */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable SuppliersSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public SuppliersSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new SuppliersSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/SupportedProperty.java b/src/main/java/com/apideck/unify/models/components/SupportedProperty.java index aed3d707..da69a1ae 100644 --- a/src/main/java/com/apideck/unify/models/components/SupportedProperty.java +++ b/src/main/java/com/apideck/unify/models/components/SupportedProperty.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -22,44 +21,39 @@ public class SupportedProperty { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("unified_property") - private Optional unifiedProperty; + private String unifiedProperty; /** * List of child properties of the unified property. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("child_properties") - private Optional> childProperties; + private List childProperties; @JsonCreator public SupportedProperty( - @JsonProperty("unified_property") Optional unifiedProperty, - @JsonProperty("child_properties") Optional> childProperties) { - Utils.checkNotNull(unifiedProperty, "unifiedProperty"); - Utils.checkNotNull(childProperties, "childProperties"); + @JsonProperty("unified_property") @Nullable String unifiedProperty, + @JsonProperty("child_properties") @Nullable List childProperties) { this.unifiedProperty = unifiedProperty; this.childProperties = childProperties; } public SupportedProperty() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * Name of the property in our Unified API. */ - @JsonIgnore public Optional unifiedProperty() { - return unifiedProperty; + return Optional.ofNullable(this.unifiedProperty); } /** * List of child properties of the unified property. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> childProperties() { - return (Optional>) childProperties; + return Optional.ofNullable(this.childProperties); } public static Builder builder() { @@ -70,41 +64,21 @@ public static Builder builder() { /** * Name of the property in our Unified API. */ - public SupportedProperty withUnifiedProperty(String unifiedProperty) { - Utils.checkNotNull(unifiedProperty, "unifiedProperty"); - this.unifiedProperty = Optional.ofNullable(unifiedProperty); - return this; - } - - - /** - * Name of the property in our Unified API. - */ - public SupportedProperty withUnifiedProperty(Optional unifiedProperty) { - Utils.checkNotNull(unifiedProperty, "unifiedProperty"); + public SupportedProperty withUnifiedProperty(@Nullable String unifiedProperty) { this.unifiedProperty = unifiedProperty; return this; } - /** - * List of child properties of the unified property. - */ - public SupportedProperty withChildProperties(List childProperties) { - Utils.checkNotNull(childProperties, "childProperties"); - this.childProperties = Optional.ofNullable(childProperties); - return this; - } - /** * List of child properties of the unified property. */ - public SupportedProperty withChildProperties(Optional> childProperties) { - Utils.checkNotNull(childProperties, "childProperties"); + public SupportedProperty withChildProperties(@Nullable List childProperties) { this.childProperties = childProperties; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -135,54 +109,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional unifiedProperty = Optional.empty(); + private String unifiedProperty; - private Optional> childProperties = Optional.empty(); + private List childProperties; private Builder() { // force use of static builder() method } - /** * Name of the property in our Unified API. */ - public Builder unifiedProperty(String unifiedProperty) { - Utils.checkNotNull(unifiedProperty, "unifiedProperty"); - this.unifiedProperty = Optional.ofNullable(unifiedProperty); - return this; - } - - /** - * Name of the property in our Unified API. - */ - public Builder unifiedProperty(Optional unifiedProperty) { - Utils.checkNotNull(unifiedProperty, "unifiedProperty"); + public Builder unifiedProperty(@Nullable String unifiedProperty) { this.unifiedProperty = unifiedProperty; return this; } - - /** - * List of child properties of the unified property. - */ - public Builder childProperties(List childProperties) { - Utils.checkNotNull(childProperties, "childProperties"); - this.childProperties = Optional.ofNullable(childProperties); - return this; - } - /** * List of child properties of the unified property. */ - public Builder childProperties(Optional> childProperties) { - Utils.checkNotNull(childProperties, "childProperties"); + public Builder childProperties(@Nullable List childProperties) { this.childProperties = childProperties; return this; } public SupportedProperty build() { - return new SupportedProperty( unifiedProperty, childProperties); } diff --git a/src/main/java/com/apideck/unify/models/components/Tax.java b/src/main/java/com/apideck/unify/models/components/Tax.java index fdd2d54b..448dddf3 100644 --- a/src/main/java/com/apideck/unify/models/components/Tax.java +++ b/src/main/java/com/apideck/unify/models/components/Tax.java @@ -5,14 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -40,43 +41,40 @@ public class Tax { @JsonCreator public Tax( - @JsonProperty("name") JsonNullable name, - @JsonProperty("employer") JsonNullable employer, - @JsonProperty("amount") JsonNullable amount) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(employer, "employer"); - Utils.checkNotNull(amount, "amount"); - this.name = name; - this.employer = employer; - this.amount = amount; + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("employer") @Nullable JsonNullable employer, + @JsonProperty("amount") @Nullable JsonNullable amount) { + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.employer = Optional.ofNullable(employer) + .orElse(JsonNullable.undefined()); + this.amount = Optional.ofNullable(amount) + .orElse(JsonNullable.undefined()); } public Tax() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null, null); } /** * The name of the tax. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * Paid by employer. */ - @JsonIgnore public JsonNullable employer() { - return employer; + return this.employer; } /** * The amount of the tax. */ - @JsonIgnore public JsonNullable amount() { - return amount; + return this.amount; } public static Builder builder() { @@ -87,56 +85,29 @@ public static Builder builder() { /** * The name of the tax. */ - public Tax withName(String name) { - Utils.checkNotNull(name, "name"); + public Tax withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the tax. - */ - public Tax withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * Paid by employer. */ - public Tax withEmployer(boolean employer) { - Utils.checkNotNull(employer, "employer"); + public Tax withEmployer(@Nullable Boolean employer) { this.employer = JsonNullable.of(employer); return this; } - /** - * Paid by employer. - */ - public Tax withEmployer(JsonNullable employer) { - Utils.checkNotNull(employer, "employer"); - this.employer = employer; - return this; - } /** * The amount of the tax. */ - public Tax withAmount(double amount) { - Utils.checkNotNull(amount, "amount"); + public Tax withAmount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * The amount of the tax. - */ - public Tax withAmount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -170,75 +141,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable employer = JsonNullable.undefined(); + private JsonNullable employer; - private JsonNullable amount = JsonNullable.undefined(); + private JsonNullable amount; private Builder() { // force use of static builder() method } - /** * The name of the tax. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the tax. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * Paid by employer. */ - public Builder employer(boolean employer) { - Utils.checkNotNull(employer, "employer"); + public Builder employer(@Nullable Boolean employer) { this.employer = JsonNullable.of(employer); return this; } - /** - * Paid by employer. - */ - public Builder employer(JsonNullable employer) { - Utils.checkNotNull(employer, "employer"); - this.employer = employer; - return this; - } - - /** * The amount of the tax. */ - public Builder amount(double amount) { - Utils.checkNotNull(amount, "amount"); + public Builder amount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * The amount of the tax. - */ - public Builder amount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - public Tax build() { - return new Tax( name, employer, amount); } diff --git a/src/main/java/com/apideck/unify/models/components/TaxRate.java b/src/main/java/com/apideck/unify/models/components/TaxRate.java index 8c832d7b..68be4896 100644 --- a/src/main/java/com/apideck/unify/models/components/TaxRate.java +++ b/src/main/java/com/apideck/unify/models/components/TaxRate.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -34,7 +33,7 @@ public class TaxRate { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Tax code assigned to identify this tax rate. @@ -81,7 +80,7 @@ public class TaxRate { @JsonInclude(Include.NON_ABSENT) @JsonProperty("components") - private JsonNullable> components; + private JsonNullable> components; /** * Tax type used to indicate the source of tax collected or paid @@ -109,14 +108,14 @@ public class TaxRate { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -158,275 +157,243 @@ public class TaxRate { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; /** * The subsidiaries this belongs to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiaries") - private Optional> subsidiaries; + private List subsidiaries; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonCreator public TaxRate( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") Optional name, - @JsonProperty("code") JsonNullable code, - @JsonProperty("description") JsonNullable description, - @JsonProperty("effective_tax_rate") JsonNullable effectiveTaxRate, - @JsonProperty("total_tax_rate") JsonNullable totalTaxRate, - @JsonProperty("tax_payable_account_id") JsonNullable taxPayableAccountId, - @JsonProperty("tax_remitted_account_id") JsonNullable taxRemittedAccountId, - @JsonProperty("components") JsonNullable> components, - @JsonProperty("type") JsonNullable type, - @JsonProperty("report_tax_type") JsonNullable reportTaxType, - @JsonProperty("original_tax_rate_id") JsonNullable originalTaxRateId, - @JsonProperty("status") JsonNullable status, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough, - @JsonProperty("subsidiaries") Optional> subsidiaries, - @JsonProperty("custom_fields") Optional> customFields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); - Utils.checkNotNull(totalTaxRate, "totalTaxRate"); - Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); - Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); - Utils.checkNotNull(components, "components"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(reportTaxType, "reportTaxType"); - Utils.checkNotNull(originalTaxRateId, "originalTaxRateId"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(subsidiaries, "subsidiaries"); - Utils.checkNotNull(customFields, "customFields"); - this.id = id; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("effective_tax_rate") @Nullable JsonNullable effectiveTaxRate, + @JsonProperty("total_tax_rate") @Nullable JsonNullable totalTaxRate, + @JsonProperty("tax_payable_account_id") @Nullable JsonNullable taxPayableAccountId, + @JsonProperty("tax_remitted_account_id") @Nullable JsonNullable taxRemittedAccountId, + @JsonProperty("components") @Nullable JsonNullable> components, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("report_tax_type") @Nullable JsonNullable reportTaxType, + @JsonProperty("original_tax_rate_id") @Nullable JsonNullable originalTaxRateId, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough, + @JsonProperty("subsidiaries") @Nullable List subsidiaries, + @JsonProperty("custom_fields") @Nullable List customFields) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); this.name = name; - this.code = code; - this.description = description; - this.effectiveTaxRate = effectiveTaxRate; - this.totalTaxRate = totalTaxRate; - this.taxPayableAccountId = taxPayableAccountId; - this.taxRemittedAccountId = taxRemittedAccountId; - this.components = components; - this.type = type; - this.reportTaxType = reportTaxType; - this.originalTaxRateId = originalTaxRateId; - this.status = status; - this.customMappings = customMappings; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.effectiveTaxRate = Optional.ofNullable(effectiveTaxRate) + .orElse(JsonNullable.undefined()); + this.totalTaxRate = Optional.ofNullable(totalTaxRate) + .orElse(JsonNullable.undefined()); + this.taxPayableAccountId = Optional.ofNullable(taxPayableAccountId) + .orElse(JsonNullable.undefined()); + this.taxRemittedAccountId = Optional.ofNullable(taxRemittedAccountId) + .orElse(JsonNullable.undefined()); + this.components = Optional.ofNullable(components) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.reportTaxType = Optional.ofNullable(reportTaxType) + .orElse(JsonNullable.undefined()); + this.originalTaxRateId = Optional.ofNullable(originalTaxRateId) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; this.subsidiaries = subsidiaries; this.customFields = customFields; } public TaxRate() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * ID assigned to identify this tax rate. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Name assigned to identify this tax rate. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Tax code assigned to identify this tax rate. */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Description of tax rate */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Effective tax rate */ - @JsonIgnore public JsonNullable effectiveTaxRate() { - return effectiveTaxRate; + return this.effectiveTaxRate; } /** * Not compounded sum of the components of a tax rate */ - @JsonIgnore public JsonNullable totalTaxRate() { - return totalTaxRate; + return this.totalTaxRate; } /** * Unique identifier for the account for tax collected. */ - @JsonIgnore public JsonNullable taxPayableAccountId() { - return taxPayableAccountId; + return this.taxPayableAccountId; } /** * Unique identifier for the account for tax remitted. */ - @JsonIgnore public JsonNullable taxRemittedAccountId() { - return taxRemittedAccountId; + return this.taxRemittedAccountId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> components() { - return (JsonNullable>) components; + return this.components; } /** * Tax type used to indicate the source of tax collected or paid */ - @JsonIgnore public JsonNullable type() { - return type; + return this.type; } /** * Report Tax type to aggregate tax collected or paid for reporting purposes */ - @JsonIgnore public JsonNullable reportTaxType() { - return reportTaxType; + return this.reportTaxType; } /** * ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. */ - @JsonIgnore public JsonNullable originalTaxRateId() { - return originalTaxRateId; + return this.originalTaxRateId; } /** * Tax rate status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The subsidiaries this belongs to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subsidiaries() { - return (Optional>) subsidiaries; + return Optional.ofNullable(this.subsidiaries); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } public static Builder builder() { @@ -437,391 +404,195 @@ public static Builder builder() { /** * ID assigned to identify this tax rate. */ - public TaxRate withId(String id) { - Utils.checkNotNull(id, "id"); + public TaxRate withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * ID assigned to identify this tax rate. - */ - public TaxRate withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * Name assigned to identify this tax rate. */ - public TaxRate withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - /** - * Name assigned to identify this tax rate. - */ - public TaxRate withName(Optional name) { - Utils.checkNotNull(name, "name"); + public TaxRate withName(@Nullable String name) { this.name = name; return this; } + /** * Tax code assigned to identify this tax rate. */ - public TaxRate withCode(String code) { - Utils.checkNotNull(code, "code"); + public TaxRate withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * Tax code assigned to identify this tax rate. - */ - public TaxRate withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * Description of tax rate */ - public TaxRate withDescription(String description) { - Utils.checkNotNull(description, "description"); + public TaxRate withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of tax rate - */ - public TaxRate withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * Effective tax rate */ - public TaxRate withEffectiveTaxRate(double effectiveTaxRate) { - Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + public TaxRate withEffectiveTaxRate(@Nullable Double effectiveTaxRate) { this.effectiveTaxRate = JsonNullable.of(effectiveTaxRate); return this; } - /** - * Effective tax rate - */ - public TaxRate withEffectiveTaxRate(JsonNullable effectiveTaxRate) { - Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); - this.effectiveTaxRate = effectiveTaxRate; - return this; - } /** * Not compounded sum of the components of a tax rate */ - public TaxRate withTotalTaxRate(double totalTaxRate) { - Utils.checkNotNull(totalTaxRate, "totalTaxRate"); + public TaxRate withTotalTaxRate(@Nullable Double totalTaxRate) { this.totalTaxRate = JsonNullable.of(totalTaxRate); return this; } - /** - * Not compounded sum of the components of a tax rate - */ - public TaxRate withTotalTaxRate(JsonNullable totalTaxRate) { - Utils.checkNotNull(totalTaxRate, "totalTaxRate"); - this.totalTaxRate = totalTaxRate; - return this; - } /** * Unique identifier for the account for tax collected. */ - public TaxRate withTaxPayableAccountId(String taxPayableAccountId) { - Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); + public TaxRate withTaxPayableAccountId(@Nullable String taxPayableAccountId) { this.taxPayableAccountId = JsonNullable.of(taxPayableAccountId); return this; } - /** - * Unique identifier for the account for tax collected. - */ - public TaxRate withTaxPayableAccountId(JsonNullable taxPayableAccountId) { - Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); - this.taxPayableAccountId = taxPayableAccountId; - return this; - } /** * Unique identifier for the account for tax remitted. */ - public TaxRate withTaxRemittedAccountId(String taxRemittedAccountId) { - Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); + public TaxRate withTaxRemittedAccountId(@Nullable String taxRemittedAccountId) { this.taxRemittedAccountId = JsonNullable.of(taxRemittedAccountId); return this; } - /** - * Unique identifier for the account for tax remitted. - */ - public TaxRate withTaxRemittedAccountId(JsonNullable taxRemittedAccountId) { - Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); - this.taxRemittedAccountId = taxRemittedAccountId; - return this; - } - public TaxRate withComponents(List components) { - Utils.checkNotNull(components, "components"); + public TaxRate withComponents(@Nullable List components) { this.components = JsonNullable.of(components); return this; } - public TaxRate withComponents(JsonNullable> components) { - Utils.checkNotNull(components, "components"); - this.components = components; - return this; - } /** * Tax type used to indicate the source of tax collected or paid */ - public TaxRate withType(String type) { - Utils.checkNotNull(type, "type"); + public TaxRate withType(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * Tax type used to indicate the source of tax collected or paid - */ - public TaxRate withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Report Tax type to aggregate tax collected or paid for reporting purposes */ - public TaxRate withReportTaxType(String reportTaxType) { - Utils.checkNotNull(reportTaxType, "reportTaxType"); + public TaxRate withReportTaxType(@Nullable String reportTaxType) { this.reportTaxType = JsonNullable.of(reportTaxType); return this; } - /** - * Report Tax type to aggregate tax collected or paid for reporting purposes - */ - public TaxRate withReportTaxType(JsonNullable reportTaxType) { - Utils.checkNotNull(reportTaxType, "reportTaxType"); - this.reportTaxType = reportTaxType; - return this; - } /** * ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. */ - public TaxRate withOriginalTaxRateId(String originalTaxRateId) { - Utils.checkNotNull(originalTaxRateId, "originalTaxRateId"); + public TaxRate withOriginalTaxRateId(@Nullable String originalTaxRateId) { this.originalTaxRateId = JsonNullable.of(originalTaxRateId); return this; } - /** - * ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. - */ - public TaxRate withOriginalTaxRateId(JsonNullable originalTaxRateId) { - Utils.checkNotNull(originalTaxRateId, "originalTaxRateId"); - this.originalTaxRateId = originalTaxRateId; - return this; - } /** * Tax rate status */ - public TaxRate withStatus(TaxRateStatus status) { - Utils.checkNotNull(status, "status"); + public TaxRate withStatus(@Nullable TaxRateStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Tax rate status - */ - public TaxRate withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public TaxRate withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public TaxRate withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public TaxRate withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public TaxRate withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public TaxRate withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public TaxRate withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public TaxRate withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public TaxRate withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public TaxRate withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public TaxRate withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public TaxRate withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public TaxRate withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public TaxRate withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public TaxRate withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public TaxRate withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public TaxRate withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public TaxRate withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public TaxRate withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public TaxRate withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public TaxRate withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public TaxRate withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** - * The subsidiaries this belongs to. - */ - public TaxRate withSubsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - /** * The subsidiaries this belongs to. */ - public TaxRate withSubsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public TaxRate withSubsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - public TaxRate withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public TaxRate withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public TaxRate withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -899,462 +670,225 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private Optional name = Optional.empty(); + private String name; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable effectiveTaxRate = JsonNullable.undefined(); + private JsonNullable effectiveTaxRate; - private JsonNullable totalTaxRate = JsonNullable.undefined(); + private JsonNullable totalTaxRate; - private JsonNullable taxPayableAccountId = JsonNullable.undefined(); + private JsonNullable taxPayableAccountId; - private JsonNullable taxRemittedAccountId = JsonNullable.undefined(); + private JsonNullable taxRemittedAccountId; - private JsonNullable> components = JsonNullable.undefined(); + private JsonNullable> components; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable reportTaxType = JsonNullable.undefined(); + private JsonNullable reportTaxType; - private JsonNullable originalTaxRateId = JsonNullable.undefined(); + private JsonNullable originalTaxRateId; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; - private Optional> subsidiaries = Optional.empty(); + private List subsidiaries; - private Optional> customFields = Optional.empty(); + private List customFields; private Builder() { // force use of static builder() method } - /** * ID assigned to identify this tax rate. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * ID assigned to identify this tax rate. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * Name assigned to identify this tax rate. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name assigned to identify this tax rate. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * Tax code assigned to identify this tax rate. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * Tax code assigned to identify this tax rate. - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Description of tax rate */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of tax rate - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * Effective tax rate */ - public Builder effectiveTaxRate(double effectiveTaxRate) { - Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + public Builder effectiveTaxRate(@Nullable Double effectiveTaxRate) { this.effectiveTaxRate = JsonNullable.of(effectiveTaxRate); return this; } - /** - * Effective tax rate - */ - public Builder effectiveTaxRate(JsonNullable effectiveTaxRate) { - Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); - this.effectiveTaxRate = effectiveTaxRate; - return this; - } - - /** * Not compounded sum of the components of a tax rate */ - public Builder totalTaxRate(double totalTaxRate) { - Utils.checkNotNull(totalTaxRate, "totalTaxRate"); + public Builder totalTaxRate(@Nullable Double totalTaxRate) { this.totalTaxRate = JsonNullable.of(totalTaxRate); return this; } - /** - * Not compounded sum of the components of a tax rate - */ - public Builder totalTaxRate(JsonNullable totalTaxRate) { - Utils.checkNotNull(totalTaxRate, "totalTaxRate"); - this.totalTaxRate = totalTaxRate; - return this; - } - - /** * Unique identifier for the account for tax collected. */ - public Builder taxPayableAccountId(String taxPayableAccountId) { - Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); + public Builder taxPayableAccountId(@Nullable String taxPayableAccountId) { this.taxPayableAccountId = JsonNullable.of(taxPayableAccountId); return this; } - /** - * Unique identifier for the account for tax collected. - */ - public Builder taxPayableAccountId(JsonNullable taxPayableAccountId) { - Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); - this.taxPayableAccountId = taxPayableAccountId; - return this; - } - - /** * Unique identifier for the account for tax remitted. */ - public Builder taxRemittedAccountId(String taxRemittedAccountId) { - Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); + public Builder taxRemittedAccountId(@Nullable String taxRemittedAccountId) { this.taxRemittedAccountId = JsonNullable.of(taxRemittedAccountId); return this; } - /** - * Unique identifier for the account for tax remitted. - */ - public Builder taxRemittedAccountId(JsonNullable taxRemittedAccountId) { - Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); - this.taxRemittedAccountId = taxRemittedAccountId; - return this; - } - - - public Builder components(List components) { - Utils.checkNotNull(components, "components"); + public Builder components(@Nullable List components) { this.components = JsonNullable.of(components); return this; } - public Builder components(JsonNullable> components) { - Utils.checkNotNull(components, "components"); - this.components = components; - return this; - } - - /** * Tax type used to indicate the source of tax collected or paid */ - public Builder type(String type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * Tax type used to indicate the source of tax collected or paid - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * Report Tax type to aggregate tax collected or paid for reporting purposes */ - public Builder reportTaxType(String reportTaxType) { - Utils.checkNotNull(reportTaxType, "reportTaxType"); + public Builder reportTaxType(@Nullable String reportTaxType) { this.reportTaxType = JsonNullable.of(reportTaxType); return this; } - /** - * Report Tax type to aggregate tax collected or paid for reporting purposes - */ - public Builder reportTaxType(JsonNullable reportTaxType) { - Utils.checkNotNull(reportTaxType, "reportTaxType"); - this.reportTaxType = reportTaxType; - return this; - } - - /** * ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. */ - public Builder originalTaxRateId(String originalTaxRateId) { - Utils.checkNotNull(originalTaxRateId, "originalTaxRateId"); + public Builder originalTaxRateId(@Nullable String originalTaxRateId) { this.originalTaxRateId = JsonNullable.of(originalTaxRateId); return this; } - /** - * ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. - */ - public Builder originalTaxRateId(JsonNullable originalTaxRateId) { - Utils.checkNotNull(originalTaxRateId, "originalTaxRateId"); - this.originalTaxRateId = originalTaxRateId; - return this; - } - - /** * Tax rate status */ - public Builder status(TaxRateStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable TaxRateStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Tax rate status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - - /** - * The subsidiaries this belongs to. - */ - public Builder subsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - /** * The subsidiaries this belongs to. */ - public Builder subsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public Builder subsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } public TaxRate build() { - return new TaxRate( id, name, code, description, effectiveTaxRate, totalTaxRate, diff --git a/src/main/java/com/apideck/unify/models/components/TaxRateInput.java b/src/main/java/com/apideck/unify/models/components/TaxRateInput.java index 49c60ba7..590d2906 100644 --- a/src/main/java/com/apideck/unify/models/components/TaxRateInput.java +++ b/src/main/java/com/apideck/unify/models/components/TaxRateInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -31,7 +30,7 @@ public class TaxRateInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Tax code assigned to identify this tax rate. @@ -78,7 +77,7 @@ public class TaxRateInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("components") - private JsonNullable> components; + private JsonNullable> components; /** * Tax type used to indicate the source of tax collected or paid @@ -106,7 +105,7 @@ public class TaxRateInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -120,217 +119,191 @@ public class TaxRateInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; /** * The subsidiaries this belongs to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiaries") - private Optional> subsidiaries; + private List subsidiaries; @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_fields") - private Optional> customFields; + private List customFields; @JsonCreator public TaxRateInput( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") Optional name, - @JsonProperty("code") JsonNullable code, - @JsonProperty("description") JsonNullable description, - @JsonProperty("effective_tax_rate") JsonNullable effectiveTaxRate, - @JsonProperty("total_tax_rate") JsonNullable totalTaxRate, - @JsonProperty("tax_payable_account_id") JsonNullable taxPayableAccountId, - @JsonProperty("tax_remitted_account_id") JsonNullable taxRemittedAccountId, - @JsonProperty("components") JsonNullable> components, - @JsonProperty("type") JsonNullable type, - @JsonProperty("report_tax_type") JsonNullable reportTaxType, - @JsonProperty("original_tax_rate_id") JsonNullable originalTaxRateId, - @JsonProperty("status") JsonNullable status, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough, - @JsonProperty("subsidiaries") Optional> subsidiaries, - @JsonProperty("custom_fields") Optional> customFields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); - Utils.checkNotNull(totalTaxRate, "totalTaxRate"); - Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); - Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); - Utils.checkNotNull(components, "components"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(reportTaxType, "reportTaxType"); - Utils.checkNotNull(originalTaxRateId, "originalTaxRateId"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(subsidiaries, "subsidiaries"); - Utils.checkNotNull(customFields, "customFields"); - this.id = id; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("effective_tax_rate") @Nullable JsonNullable effectiveTaxRate, + @JsonProperty("total_tax_rate") @Nullable JsonNullable totalTaxRate, + @JsonProperty("tax_payable_account_id") @Nullable JsonNullable taxPayableAccountId, + @JsonProperty("tax_remitted_account_id") @Nullable JsonNullable taxRemittedAccountId, + @JsonProperty("components") @Nullable JsonNullable> components, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("report_tax_type") @Nullable JsonNullable reportTaxType, + @JsonProperty("original_tax_rate_id") @Nullable JsonNullable originalTaxRateId, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough, + @JsonProperty("subsidiaries") @Nullable List subsidiaries, + @JsonProperty("custom_fields") @Nullable List customFields) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); this.name = name; - this.code = code; - this.description = description; - this.effectiveTaxRate = effectiveTaxRate; - this.totalTaxRate = totalTaxRate; - this.taxPayableAccountId = taxPayableAccountId; - this.taxRemittedAccountId = taxRemittedAccountId; - this.components = components; - this.type = type; - this.reportTaxType = reportTaxType; - this.originalTaxRateId = originalTaxRateId; - this.status = status; - this.rowVersion = rowVersion; + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.effectiveTaxRate = Optional.ofNullable(effectiveTaxRate) + .orElse(JsonNullable.undefined()); + this.totalTaxRate = Optional.ofNullable(totalTaxRate) + .orElse(JsonNullable.undefined()); + this.taxPayableAccountId = Optional.ofNullable(taxPayableAccountId) + .orElse(JsonNullable.undefined()); + this.taxRemittedAccountId = Optional.ofNullable(taxRemittedAccountId) + .orElse(JsonNullable.undefined()); + this.components = Optional.ofNullable(components) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.reportTaxType = Optional.ofNullable(reportTaxType) + .orElse(JsonNullable.undefined()); + this.originalTaxRateId = Optional.ofNullable(originalTaxRateId) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; this.subsidiaries = subsidiaries; this.customFields = customFields; } public TaxRateInput() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * ID assigned to identify this tax rate. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * Name assigned to identify this tax rate. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Tax code assigned to identify this tax rate. */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Description of tax rate */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Effective tax rate */ - @JsonIgnore public JsonNullable effectiveTaxRate() { - return effectiveTaxRate; + return this.effectiveTaxRate; } /** * Not compounded sum of the components of a tax rate */ - @JsonIgnore public JsonNullable totalTaxRate() { - return totalTaxRate; + return this.totalTaxRate; } /** * Unique identifier for the account for tax collected. */ - @JsonIgnore public JsonNullable taxPayableAccountId() { - return taxPayableAccountId; + return this.taxPayableAccountId; } /** * Unique identifier for the account for tax remitted. */ - @JsonIgnore public JsonNullable taxRemittedAccountId() { - return taxRemittedAccountId; + return this.taxRemittedAccountId; } - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> components() { - return (JsonNullable>) components; + return this.components; } /** * Tax type used to indicate the source of tax collected or paid */ - @JsonIgnore public JsonNullable type() { - return type; + return this.type; } /** * Report Tax type to aggregate tax collected or paid for reporting purposes */ - @JsonIgnore public JsonNullable reportTaxType() { - return reportTaxType; + return this.reportTaxType; } /** * ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. */ - @JsonIgnore public JsonNullable originalTaxRateId() { - return originalTaxRateId; + return this.originalTaxRateId; } /** * Tax rate status */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The subsidiaries this belongs to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subsidiaries() { - return (Optional>) subsidiaries; + return Optional.ofNullable(this.subsidiaries); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> customFields() { - return (Optional>) customFields; + return Optional.ofNullable(this.customFields); } public static Builder builder() { @@ -341,301 +314,150 @@ public static Builder builder() { /** * ID assigned to identify this tax rate. */ - public TaxRateInput withId(String id) { - Utils.checkNotNull(id, "id"); + public TaxRateInput withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * ID assigned to identify this tax rate. - */ - public TaxRateInput withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * Name assigned to identify this tax rate. */ - public TaxRateInput withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - /** - * Name assigned to identify this tax rate. - */ - public TaxRateInput withName(Optional name) { - Utils.checkNotNull(name, "name"); + public TaxRateInput withName(@Nullable String name) { this.name = name; return this; } + /** * Tax code assigned to identify this tax rate. */ - public TaxRateInput withCode(String code) { - Utils.checkNotNull(code, "code"); + public TaxRateInput withCode(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * Tax code assigned to identify this tax rate. - */ - public TaxRateInput withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } /** * Description of tax rate */ - public TaxRateInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public TaxRateInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of tax rate - */ - public TaxRateInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * Effective tax rate */ - public TaxRateInput withEffectiveTaxRate(double effectiveTaxRate) { - Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + public TaxRateInput withEffectiveTaxRate(@Nullable Double effectiveTaxRate) { this.effectiveTaxRate = JsonNullable.of(effectiveTaxRate); return this; } - /** - * Effective tax rate - */ - public TaxRateInput withEffectiveTaxRate(JsonNullable effectiveTaxRate) { - Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); - this.effectiveTaxRate = effectiveTaxRate; - return this; - } /** * Not compounded sum of the components of a tax rate */ - public TaxRateInput withTotalTaxRate(double totalTaxRate) { - Utils.checkNotNull(totalTaxRate, "totalTaxRate"); + public TaxRateInput withTotalTaxRate(@Nullable Double totalTaxRate) { this.totalTaxRate = JsonNullable.of(totalTaxRate); return this; } - /** - * Not compounded sum of the components of a tax rate - */ - public TaxRateInput withTotalTaxRate(JsonNullable totalTaxRate) { - Utils.checkNotNull(totalTaxRate, "totalTaxRate"); - this.totalTaxRate = totalTaxRate; - return this; - } /** * Unique identifier for the account for tax collected. */ - public TaxRateInput withTaxPayableAccountId(String taxPayableAccountId) { - Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); + public TaxRateInput withTaxPayableAccountId(@Nullable String taxPayableAccountId) { this.taxPayableAccountId = JsonNullable.of(taxPayableAccountId); return this; } - /** - * Unique identifier for the account for tax collected. - */ - public TaxRateInput withTaxPayableAccountId(JsonNullable taxPayableAccountId) { - Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); - this.taxPayableAccountId = taxPayableAccountId; - return this; - } /** * Unique identifier for the account for tax remitted. */ - public TaxRateInput withTaxRemittedAccountId(String taxRemittedAccountId) { - Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); + public TaxRateInput withTaxRemittedAccountId(@Nullable String taxRemittedAccountId) { this.taxRemittedAccountId = JsonNullable.of(taxRemittedAccountId); return this; } - /** - * Unique identifier for the account for tax remitted. - */ - public TaxRateInput withTaxRemittedAccountId(JsonNullable taxRemittedAccountId) { - Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); - this.taxRemittedAccountId = taxRemittedAccountId; - return this; - } - public TaxRateInput withComponents(List components) { - Utils.checkNotNull(components, "components"); + public TaxRateInput withComponents(@Nullable List components) { this.components = JsonNullable.of(components); return this; } - public TaxRateInput withComponents(JsonNullable> components) { - Utils.checkNotNull(components, "components"); - this.components = components; - return this; - } /** * Tax type used to indicate the source of tax collected or paid */ - public TaxRateInput withType(String type) { - Utils.checkNotNull(type, "type"); + public TaxRateInput withType(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * Tax type used to indicate the source of tax collected or paid - */ - public TaxRateInput withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Report Tax type to aggregate tax collected or paid for reporting purposes */ - public TaxRateInput withReportTaxType(String reportTaxType) { - Utils.checkNotNull(reportTaxType, "reportTaxType"); + public TaxRateInput withReportTaxType(@Nullable String reportTaxType) { this.reportTaxType = JsonNullable.of(reportTaxType); return this; } - /** - * Report Tax type to aggregate tax collected or paid for reporting purposes - */ - public TaxRateInput withReportTaxType(JsonNullable reportTaxType) { - Utils.checkNotNull(reportTaxType, "reportTaxType"); - this.reportTaxType = reportTaxType; - return this; - } /** * ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. */ - public TaxRateInput withOriginalTaxRateId(String originalTaxRateId) { - Utils.checkNotNull(originalTaxRateId, "originalTaxRateId"); + public TaxRateInput withOriginalTaxRateId(@Nullable String originalTaxRateId) { this.originalTaxRateId = JsonNullable.of(originalTaxRateId); return this; } - /** - * ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. - */ - public TaxRateInput withOriginalTaxRateId(JsonNullable originalTaxRateId) { - Utils.checkNotNull(originalTaxRateId, "originalTaxRateId"); - this.originalTaxRateId = originalTaxRateId; - return this; - } /** * Tax rate status */ - public TaxRateInput withStatus(TaxRateStatus status) { - Utils.checkNotNull(status, "status"); + public TaxRateInput withStatus(@Nullable TaxRateStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Tax rate status - */ - public TaxRateInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public TaxRateInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public TaxRateInput withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public TaxRateInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public TaxRateInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public TaxRateInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public TaxRateInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** - * The subsidiaries this belongs to. - */ - public TaxRateInput withSubsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - /** * The subsidiaries this belongs to. */ - public TaxRateInput withSubsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public TaxRateInput withSubsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - public TaxRateInput withCustomFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public TaxRateInput withCustomFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public TaxRateInput withCustomFields(@Nullable List customFields) { this.customFields = customFields; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -701,357 +523,175 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private Optional name = Optional.empty(); + private String name; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable effectiveTaxRate = JsonNullable.undefined(); + private JsonNullable effectiveTaxRate; - private JsonNullable totalTaxRate = JsonNullable.undefined(); + private JsonNullable totalTaxRate; - private JsonNullable taxPayableAccountId = JsonNullable.undefined(); + private JsonNullable taxPayableAccountId; - private JsonNullable taxRemittedAccountId = JsonNullable.undefined(); + private JsonNullable taxRemittedAccountId; - private JsonNullable> components = JsonNullable.undefined(); + private JsonNullable> components; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable reportTaxType = JsonNullable.undefined(); + private JsonNullable reportTaxType; - private JsonNullable originalTaxRateId = JsonNullable.undefined(); + private JsonNullable originalTaxRateId; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; - private Optional> subsidiaries = Optional.empty(); + private List subsidiaries; - private Optional> customFields = Optional.empty(); + private List customFields; private Builder() { // force use of static builder() method } - /** * ID assigned to identify this tax rate. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * ID assigned to identify this tax rate. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * Name assigned to identify this tax rate. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name assigned to identify this tax rate. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * Tax code assigned to identify this tax rate. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * Tax code assigned to identify this tax rate. - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Description of tax rate */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of tax rate - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * Effective tax rate */ - public Builder effectiveTaxRate(double effectiveTaxRate) { - Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); + public Builder effectiveTaxRate(@Nullable Double effectiveTaxRate) { this.effectiveTaxRate = JsonNullable.of(effectiveTaxRate); return this; } - /** - * Effective tax rate - */ - public Builder effectiveTaxRate(JsonNullable effectiveTaxRate) { - Utils.checkNotNull(effectiveTaxRate, "effectiveTaxRate"); - this.effectiveTaxRate = effectiveTaxRate; - return this; - } - - /** * Not compounded sum of the components of a tax rate */ - public Builder totalTaxRate(double totalTaxRate) { - Utils.checkNotNull(totalTaxRate, "totalTaxRate"); + public Builder totalTaxRate(@Nullable Double totalTaxRate) { this.totalTaxRate = JsonNullable.of(totalTaxRate); return this; } - /** - * Not compounded sum of the components of a tax rate - */ - public Builder totalTaxRate(JsonNullable totalTaxRate) { - Utils.checkNotNull(totalTaxRate, "totalTaxRate"); - this.totalTaxRate = totalTaxRate; - return this; - } - - /** * Unique identifier for the account for tax collected. */ - public Builder taxPayableAccountId(String taxPayableAccountId) { - Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); + public Builder taxPayableAccountId(@Nullable String taxPayableAccountId) { this.taxPayableAccountId = JsonNullable.of(taxPayableAccountId); return this; } - /** - * Unique identifier for the account for tax collected. - */ - public Builder taxPayableAccountId(JsonNullable taxPayableAccountId) { - Utils.checkNotNull(taxPayableAccountId, "taxPayableAccountId"); - this.taxPayableAccountId = taxPayableAccountId; - return this; - } - - /** * Unique identifier for the account for tax remitted. */ - public Builder taxRemittedAccountId(String taxRemittedAccountId) { - Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); + public Builder taxRemittedAccountId(@Nullable String taxRemittedAccountId) { this.taxRemittedAccountId = JsonNullable.of(taxRemittedAccountId); return this; } - /** - * Unique identifier for the account for tax remitted. - */ - public Builder taxRemittedAccountId(JsonNullable taxRemittedAccountId) { - Utils.checkNotNull(taxRemittedAccountId, "taxRemittedAccountId"); - this.taxRemittedAccountId = taxRemittedAccountId; - return this; - } - - - public Builder components(List components) { - Utils.checkNotNull(components, "components"); + public Builder components(@Nullable List components) { this.components = JsonNullable.of(components); return this; } - public Builder components(JsonNullable> components) { - Utils.checkNotNull(components, "components"); - this.components = components; - return this; - } - - /** * Tax type used to indicate the source of tax collected or paid */ - public Builder type(String type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * Tax type used to indicate the source of tax collected or paid - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * Report Tax type to aggregate tax collected or paid for reporting purposes */ - public Builder reportTaxType(String reportTaxType) { - Utils.checkNotNull(reportTaxType, "reportTaxType"); + public Builder reportTaxType(@Nullable String reportTaxType) { this.reportTaxType = JsonNullable.of(reportTaxType); return this; } - /** - * Report Tax type to aggregate tax collected or paid for reporting purposes - */ - public Builder reportTaxType(JsonNullable reportTaxType) { - Utils.checkNotNull(reportTaxType, "reportTaxType"); - this.reportTaxType = reportTaxType; - return this; - } - - /** * ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. */ - public Builder originalTaxRateId(String originalTaxRateId) { - Utils.checkNotNull(originalTaxRateId, "originalTaxRateId"); + public Builder originalTaxRateId(@Nullable String originalTaxRateId) { this.originalTaxRateId = JsonNullable.of(originalTaxRateId); return this; } - /** - * ID of the original tax rate from which the new tax rate is derived. Helps to understand the relationship between corresponding tax rate entities. - */ - public Builder originalTaxRateId(JsonNullable originalTaxRateId) { - Utils.checkNotNull(originalTaxRateId, "originalTaxRateId"); - this.originalTaxRateId = originalTaxRateId; - return this; - } - - /** * Tax rate status */ - public Builder status(TaxRateStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable TaxRateStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * Tax rate status - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - - /** - * The subsidiaries this belongs to. - */ - public Builder subsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - /** * The subsidiaries this belongs to. */ - public Builder subsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public Builder subsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } - - public Builder customFields(List customFields) { - Utils.checkNotNull(customFields, "customFields"); - this.customFields = Optional.ofNullable(customFields); - return this; - } - - public Builder customFields(Optional> customFields) { - Utils.checkNotNull(customFields, "customFields"); + public Builder customFields(@Nullable List customFields) { this.customFields = customFields; return this; } public TaxRateInput build() { - return new TaxRateInput( id, name, code, description, effectiveTaxRate, totalTaxRate, diff --git a/src/main/java/com/apideck/unify/models/components/TaxRatesFilter.java b/src/main/java/com/apideck/unify/models/components/TaxRatesFilter.java index a24ee4e5..4fa2c998 100644 --- a/src/main/java/com/apideck/unify/models/components/TaxRatesFilter.java +++ b/src/main/java/com/apideck/unify/models/components/TaxRatesFilter.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -18,44 +18,39 @@ public class TaxRatesFilter { * Boolean to describe if tax rate can be used for asset accounts */ @SpeakeasyMetadata("queryParam:name=assets") - private Optional assets; + private Boolean assets; /** * Boolean to describe if tax rate can be used for equity accounts */ @SpeakeasyMetadata("queryParam:name=equity") - private Optional equity; + private Boolean equity; /** * Boolean to describe if tax rate can be used for expense accounts */ @SpeakeasyMetadata("queryParam:name=expenses") - private Optional expenses; + private Boolean expenses; /** * Boolean to describe if tax rate can be used for liability accounts */ @SpeakeasyMetadata("queryParam:name=liabilities") - private Optional liabilities; + private Boolean liabilities; /** * Boolean to describe if tax rate can be used for revenue accounts */ @SpeakeasyMetadata("queryParam:name=revenue") - private Optional revenue; + private Boolean revenue; @JsonCreator public TaxRatesFilter( - Optional assets, - Optional equity, - Optional expenses, - Optional liabilities, - Optional revenue) { - Utils.checkNotNull(assets, "assets"); - Utils.checkNotNull(equity, "equity"); - Utils.checkNotNull(expenses, "expenses"); - Utils.checkNotNull(liabilities, "liabilities"); - Utils.checkNotNull(revenue, "revenue"); + @Nullable Boolean assets, + @Nullable Boolean equity, + @Nullable Boolean expenses, + @Nullable Boolean liabilities, + @Nullable Boolean revenue) { this.assets = assets; this.equity = equity; this.expenses = expenses; @@ -64,48 +59,43 @@ public TaxRatesFilter( } public TaxRatesFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * Boolean to describe if tax rate can be used for asset accounts */ - @JsonIgnore public Optional assets() { - return assets; + return Optional.ofNullable(this.assets); } /** * Boolean to describe if tax rate can be used for equity accounts */ - @JsonIgnore public Optional equity() { - return equity; + return Optional.ofNullable(this.equity); } /** * Boolean to describe if tax rate can be used for expense accounts */ - @JsonIgnore public Optional expenses() { - return expenses; + return Optional.ofNullable(this.expenses); } /** * Boolean to describe if tax rate can be used for liability accounts */ - @JsonIgnore public Optional liabilities() { - return liabilities; + return Optional.ofNullable(this.liabilities); } /** * Boolean to describe if tax rate can be used for revenue accounts */ - @JsonIgnore public Optional revenue() { - return revenue; + return Optional.ofNullable(this.revenue); } public static Builder builder() { @@ -116,98 +106,48 @@ public static Builder builder() { /** * Boolean to describe if tax rate can be used for asset accounts */ - public TaxRatesFilter withAssets(boolean assets) { - Utils.checkNotNull(assets, "assets"); - this.assets = Optional.ofNullable(assets); - return this; - } - - - /** - * Boolean to describe if tax rate can be used for asset accounts - */ - public TaxRatesFilter withAssets(Optional assets) { - Utils.checkNotNull(assets, "assets"); + public TaxRatesFilter withAssets(@Nullable Boolean assets) { this.assets = assets; return this; } - /** - * Boolean to describe if tax rate can be used for equity accounts - */ - public TaxRatesFilter withEquity(boolean equity) { - Utils.checkNotNull(equity, "equity"); - this.equity = Optional.ofNullable(equity); - return this; - } - /** * Boolean to describe if tax rate can be used for equity accounts */ - public TaxRatesFilter withEquity(Optional equity) { - Utils.checkNotNull(equity, "equity"); + public TaxRatesFilter withEquity(@Nullable Boolean equity) { this.equity = equity; return this; } - /** - * Boolean to describe if tax rate can be used for expense accounts - */ - public TaxRatesFilter withExpenses(boolean expenses) { - Utils.checkNotNull(expenses, "expenses"); - this.expenses = Optional.ofNullable(expenses); - return this; - } - /** * Boolean to describe if tax rate can be used for expense accounts */ - public TaxRatesFilter withExpenses(Optional expenses) { - Utils.checkNotNull(expenses, "expenses"); + public TaxRatesFilter withExpenses(@Nullable Boolean expenses) { this.expenses = expenses; return this; } - /** - * Boolean to describe if tax rate can be used for liability accounts - */ - public TaxRatesFilter withLiabilities(boolean liabilities) { - Utils.checkNotNull(liabilities, "liabilities"); - this.liabilities = Optional.ofNullable(liabilities); - return this; - } - /** * Boolean to describe if tax rate can be used for liability accounts */ - public TaxRatesFilter withLiabilities(Optional liabilities) { - Utils.checkNotNull(liabilities, "liabilities"); + public TaxRatesFilter withLiabilities(@Nullable Boolean liabilities) { this.liabilities = liabilities; return this; } - /** - * Boolean to describe if tax rate can be used for revenue accounts - */ - public TaxRatesFilter withRevenue(boolean revenue) { - Utils.checkNotNull(revenue, "revenue"); - this.revenue = Optional.ofNullable(revenue); - return this; - } - /** * Boolean to describe if tax rate can be used for revenue accounts */ - public TaxRatesFilter withRevenue(Optional revenue) { - Utils.checkNotNull(revenue, "revenue"); + public TaxRatesFilter withRevenue(@Nullable Boolean revenue) { this.revenue = revenue; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -245,117 +185,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional assets = Optional.empty(); + private Boolean assets; - private Optional equity = Optional.empty(); + private Boolean equity; - private Optional expenses = Optional.empty(); + private Boolean expenses; - private Optional liabilities = Optional.empty(); + private Boolean liabilities; - private Optional revenue = Optional.empty(); + private Boolean revenue; private Builder() { // force use of static builder() method } - - /** - * Boolean to describe if tax rate can be used for asset accounts - */ - public Builder assets(boolean assets) { - Utils.checkNotNull(assets, "assets"); - this.assets = Optional.ofNullable(assets); - return this; - } - /** * Boolean to describe if tax rate can be used for asset accounts */ - public Builder assets(Optional assets) { - Utils.checkNotNull(assets, "assets"); + public Builder assets(@Nullable Boolean assets) { this.assets = assets; return this; } - /** * Boolean to describe if tax rate can be used for equity accounts */ - public Builder equity(boolean equity) { - Utils.checkNotNull(equity, "equity"); - this.equity = Optional.ofNullable(equity); - return this; - } - - /** - * Boolean to describe if tax rate can be used for equity accounts - */ - public Builder equity(Optional equity) { - Utils.checkNotNull(equity, "equity"); + public Builder equity(@Nullable Boolean equity) { this.equity = equity; return this; } - - /** - * Boolean to describe if tax rate can be used for expense accounts - */ - public Builder expenses(boolean expenses) { - Utils.checkNotNull(expenses, "expenses"); - this.expenses = Optional.ofNullable(expenses); - return this; - } - /** * Boolean to describe if tax rate can be used for expense accounts */ - public Builder expenses(Optional expenses) { - Utils.checkNotNull(expenses, "expenses"); + public Builder expenses(@Nullable Boolean expenses) { this.expenses = expenses; return this; } - - /** - * Boolean to describe if tax rate can be used for liability accounts - */ - public Builder liabilities(boolean liabilities) { - Utils.checkNotNull(liabilities, "liabilities"); - this.liabilities = Optional.ofNullable(liabilities); - return this; - } - /** * Boolean to describe if tax rate can be used for liability accounts */ - public Builder liabilities(Optional liabilities) { - Utils.checkNotNull(liabilities, "liabilities"); + public Builder liabilities(@Nullable Boolean liabilities) { this.liabilities = liabilities; return this; } - - /** - * Boolean to describe if tax rate can be used for revenue accounts - */ - public Builder revenue(boolean revenue) { - Utils.checkNotNull(revenue, "revenue"); - this.revenue = Optional.ofNullable(revenue); - return this; - } - /** * Boolean to describe if tax rate can be used for revenue accounts */ - public Builder revenue(Optional revenue) { - Utils.checkNotNull(revenue, "revenue"); + public Builder revenue(@Nullable Boolean revenue) { this.revenue = revenue; return this; } public TaxRatesFilter build() { - return new TaxRatesFilter( assets, equity, expenses, liabilities, revenue); diff --git a/src/main/java/com/apideck/unify/models/components/Team.java b/src/main/java/com/apideck/unify/models/components/Team.java index 961b6ed6..40625460 100644 --- a/src/main/java/com/apideck/unify/models/components/Team.java +++ b/src/main/java/com/apideck/unify/models/components/Team.java @@ -5,12 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -35,32 +36,30 @@ public class Team { @JsonCreator public Team( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - this.id = id; - this.name = name; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); } public Team() { - this(JsonNullable.undefined(), JsonNullable.undefined()); + this(null, null); } /** * The unique identifier of the team. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The name of the team. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } public static Builder builder() { @@ -71,38 +70,20 @@ public static Builder builder() { /** * The unique identifier of the team. */ - public Team withId(String id) { - Utils.checkNotNull(id, "id"); + public Team withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * The unique identifier of the team. - */ - public Team withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The name of the team. */ - public Team withName(String name) { - Utils.checkNotNull(name, "name"); + public Team withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the team. - */ - public Team withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -134,54 +115,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; private Builder() { // force use of static builder() method } - /** * The unique identifier of the team. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * The unique identifier of the team. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The name of the team. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name of the team. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - public Team build() { - return new Team( id, name); } diff --git a/src/main/java/com/apideck/unify/models/components/Theme.java b/src/main/java/com/apideck/unify/models/components/Theme.java index c9d050a3..f5ff06aa 100644 --- a/src/main/java/com/apideck/unify/models/components/Theme.java +++ b/src/main/java/com/apideck/unify/models/components/Theme.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -24,75 +24,67 @@ public class Theme { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("favicon") - private Optional favicon; + private String favicon; /** * The URL to the logo to use for Vault. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("logo") - private Optional logo; + private String logo; /** * The primary color to use for Vault. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("primary_color") - private Optional primaryColor; + private String primaryColor; /** * The background color to use for the sidebar. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("sidepanel_background_color") - private Optional sidepanelBackgroundColor; + private String sidepanelBackgroundColor; /** * The text color to use for the sidebar. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("sidepanel_text_color") - private Optional sidepanelTextColor; + private String sidepanelTextColor; /** * The name that will be shown in the sidebar. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("vault_name") - private Optional vaultName; + private String vaultName; /** * The URL to the privacy policy that will be shown in the sidebar. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("privacy_url") - private Optional privacyUrl; + private String privacyUrl; /** * The URL to the terms and conditions that will be shown in the sidebar. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("terms_url") - private Optional termsUrl; + private String termsUrl; @JsonCreator public Theme( - @JsonProperty("favicon") Optional favicon, - @JsonProperty("logo") Optional logo, - @JsonProperty("primary_color") Optional primaryColor, - @JsonProperty("sidepanel_background_color") Optional sidepanelBackgroundColor, - @JsonProperty("sidepanel_text_color") Optional sidepanelTextColor, - @JsonProperty("vault_name") Optional vaultName, - @JsonProperty("privacy_url") Optional privacyUrl, - @JsonProperty("terms_url") Optional termsUrl) { - Utils.checkNotNull(favicon, "favicon"); - Utils.checkNotNull(logo, "logo"); - Utils.checkNotNull(primaryColor, "primaryColor"); - Utils.checkNotNull(sidepanelBackgroundColor, "sidepanelBackgroundColor"); - Utils.checkNotNull(sidepanelTextColor, "sidepanelTextColor"); - Utils.checkNotNull(vaultName, "vaultName"); - Utils.checkNotNull(privacyUrl, "privacyUrl"); - Utils.checkNotNull(termsUrl, "termsUrl"); + @JsonProperty("favicon") @Nullable String favicon, + @JsonProperty("logo") @Nullable String logo, + @JsonProperty("primary_color") @Nullable String primaryColor, + @JsonProperty("sidepanel_background_color") @Nullable String sidepanelBackgroundColor, + @JsonProperty("sidepanel_text_color") @Nullable String sidepanelTextColor, + @JsonProperty("vault_name") @Nullable String vaultName, + @JsonProperty("privacy_url") @Nullable String privacyUrl, + @JsonProperty("terms_url") @Nullable String termsUrl) { this.favicon = favicon; this.logo = logo; this.primaryColor = primaryColor; @@ -104,73 +96,65 @@ public Theme( } public Theme() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null); } /** * The URL to the favicon to use for Vault. */ - @JsonIgnore public Optional favicon() { - return favicon; + return Optional.ofNullable(this.favicon); } /** * The URL to the logo to use for Vault. */ - @JsonIgnore public Optional logo() { - return logo; + return Optional.ofNullable(this.logo); } /** * The primary color to use for Vault. */ - @JsonIgnore public Optional primaryColor() { - return primaryColor; + return Optional.ofNullable(this.primaryColor); } /** * The background color to use for the sidebar. */ - @JsonIgnore public Optional sidepanelBackgroundColor() { - return sidepanelBackgroundColor; + return Optional.ofNullable(this.sidepanelBackgroundColor); } /** * The text color to use for the sidebar. */ - @JsonIgnore public Optional sidepanelTextColor() { - return sidepanelTextColor; + return Optional.ofNullable(this.sidepanelTextColor); } /** * The name that will be shown in the sidebar. */ - @JsonIgnore public Optional vaultName() { - return vaultName; + return Optional.ofNullable(this.vaultName); } /** * The URL to the privacy policy that will be shown in the sidebar. */ - @JsonIgnore public Optional privacyUrl() { - return privacyUrl; + return Optional.ofNullable(this.privacyUrl); } /** * The URL to the terms and conditions that will be shown in the sidebar. */ - @JsonIgnore public Optional termsUrl() { - return termsUrl; + return Optional.ofNullable(this.termsUrl); } public static Builder builder() { @@ -181,155 +165,75 @@ public static Builder builder() { /** * The URL to the favicon to use for Vault. */ - public Theme withFavicon(String favicon) { - Utils.checkNotNull(favicon, "favicon"); - this.favicon = Optional.ofNullable(favicon); - return this; - } - - - /** - * The URL to the favicon to use for Vault. - */ - public Theme withFavicon(Optional favicon) { - Utils.checkNotNull(favicon, "favicon"); + public Theme withFavicon(@Nullable String favicon) { this.favicon = favicon; return this; } - /** - * The URL to the logo to use for Vault. - */ - public Theme withLogo(String logo) { - Utils.checkNotNull(logo, "logo"); - this.logo = Optional.ofNullable(logo); - return this; - } - /** * The URL to the logo to use for Vault. */ - public Theme withLogo(Optional logo) { - Utils.checkNotNull(logo, "logo"); + public Theme withLogo(@Nullable String logo) { this.logo = logo; return this; } - /** - * The primary color to use for Vault. - */ - public Theme withPrimaryColor(String primaryColor) { - Utils.checkNotNull(primaryColor, "primaryColor"); - this.primaryColor = Optional.ofNullable(primaryColor); - return this; - } - /** * The primary color to use for Vault. */ - public Theme withPrimaryColor(Optional primaryColor) { - Utils.checkNotNull(primaryColor, "primaryColor"); + public Theme withPrimaryColor(@Nullable String primaryColor) { this.primaryColor = primaryColor; return this; } - /** - * The background color to use for the sidebar. - */ - public Theme withSidepanelBackgroundColor(String sidepanelBackgroundColor) { - Utils.checkNotNull(sidepanelBackgroundColor, "sidepanelBackgroundColor"); - this.sidepanelBackgroundColor = Optional.ofNullable(sidepanelBackgroundColor); - return this; - } - /** * The background color to use for the sidebar. */ - public Theme withSidepanelBackgroundColor(Optional sidepanelBackgroundColor) { - Utils.checkNotNull(sidepanelBackgroundColor, "sidepanelBackgroundColor"); + public Theme withSidepanelBackgroundColor(@Nullable String sidepanelBackgroundColor) { this.sidepanelBackgroundColor = sidepanelBackgroundColor; return this; } - /** - * The text color to use for the sidebar. - */ - public Theme withSidepanelTextColor(String sidepanelTextColor) { - Utils.checkNotNull(sidepanelTextColor, "sidepanelTextColor"); - this.sidepanelTextColor = Optional.ofNullable(sidepanelTextColor); - return this; - } - /** * The text color to use for the sidebar. */ - public Theme withSidepanelTextColor(Optional sidepanelTextColor) { - Utils.checkNotNull(sidepanelTextColor, "sidepanelTextColor"); + public Theme withSidepanelTextColor(@Nullable String sidepanelTextColor) { this.sidepanelTextColor = sidepanelTextColor; return this; } - /** - * The name that will be shown in the sidebar. - */ - public Theme withVaultName(String vaultName) { - Utils.checkNotNull(vaultName, "vaultName"); - this.vaultName = Optional.ofNullable(vaultName); - return this; - } - /** * The name that will be shown in the sidebar. */ - public Theme withVaultName(Optional vaultName) { - Utils.checkNotNull(vaultName, "vaultName"); + public Theme withVaultName(@Nullable String vaultName) { this.vaultName = vaultName; return this; } - /** - * The URL to the privacy policy that will be shown in the sidebar. - */ - public Theme withPrivacyUrl(String privacyUrl) { - Utils.checkNotNull(privacyUrl, "privacyUrl"); - this.privacyUrl = Optional.ofNullable(privacyUrl); - return this; - } - /** * The URL to the privacy policy that will be shown in the sidebar. */ - public Theme withPrivacyUrl(Optional privacyUrl) { - Utils.checkNotNull(privacyUrl, "privacyUrl"); + public Theme withPrivacyUrl(@Nullable String privacyUrl) { this.privacyUrl = privacyUrl; return this; } - /** - * The URL to the terms and conditions that will be shown in the sidebar. - */ - public Theme withTermsUrl(String termsUrl) { - Utils.checkNotNull(termsUrl, "termsUrl"); - this.termsUrl = Optional.ofNullable(termsUrl); - return this; - } - /** * The URL to the terms and conditions that will be shown in the sidebar. */ - public Theme withTermsUrl(Optional termsUrl) { - Utils.checkNotNull(termsUrl, "termsUrl"); + public Theme withTermsUrl(@Nullable String termsUrl) { this.termsUrl = termsUrl; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -374,180 +278,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional favicon = Optional.empty(); + private String favicon; - private Optional logo = Optional.empty(); + private String logo; - private Optional primaryColor = Optional.empty(); + private String primaryColor; - private Optional sidepanelBackgroundColor = Optional.empty(); + private String sidepanelBackgroundColor; - private Optional sidepanelTextColor = Optional.empty(); + private String sidepanelTextColor; - private Optional vaultName = Optional.empty(); + private String vaultName; - private Optional privacyUrl = Optional.empty(); + private String privacyUrl; - private Optional termsUrl = Optional.empty(); + private String termsUrl; private Builder() { // force use of static builder() method } - /** * The URL to the favicon to use for Vault. */ - public Builder favicon(String favicon) { - Utils.checkNotNull(favicon, "favicon"); - this.favicon = Optional.ofNullable(favicon); - return this; - } - - /** - * The URL to the favicon to use for Vault. - */ - public Builder favicon(Optional favicon) { - Utils.checkNotNull(favicon, "favicon"); + public Builder favicon(@Nullable String favicon) { this.favicon = favicon; return this; } - - /** - * The URL to the logo to use for Vault. - */ - public Builder logo(String logo) { - Utils.checkNotNull(logo, "logo"); - this.logo = Optional.ofNullable(logo); - return this; - } - /** * The URL to the logo to use for Vault. */ - public Builder logo(Optional logo) { - Utils.checkNotNull(logo, "logo"); + public Builder logo(@Nullable String logo) { this.logo = logo; return this; } - /** * The primary color to use for Vault. */ - public Builder primaryColor(String primaryColor) { - Utils.checkNotNull(primaryColor, "primaryColor"); - this.primaryColor = Optional.ofNullable(primaryColor); - return this; - } - - /** - * The primary color to use for Vault. - */ - public Builder primaryColor(Optional primaryColor) { - Utils.checkNotNull(primaryColor, "primaryColor"); + public Builder primaryColor(@Nullable String primaryColor) { this.primaryColor = primaryColor; return this; } - /** * The background color to use for the sidebar. */ - public Builder sidepanelBackgroundColor(String sidepanelBackgroundColor) { - Utils.checkNotNull(sidepanelBackgroundColor, "sidepanelBackgroundColor"); - this.sidepanelBackgroundColor = Optional.ofNullable(sidepanelBackgroundColor); - return this; - } - - /** - * The background color to use for the sidebar. - */ - public Builder sidepanelBackgroundColor(Optional sidepanelBackgroundColor) { - Utils.checkNotNull(sidepanelBackgroundColor, "sidepanelBackgroundColor"); + public Builder sidepanelBackgroundColor(@Nullable String sidepanelBackgroundColor) { this.sidepanelBackgroundColor = sidepanelBackgroundColor; return this; } - /** * The text color to use for the sidebar. */ - public Builder sidepanelTextColor(String sidepanelTextColor) { - Utils.checkNotNull(sidepanelTextColor, "sidepanelTextColor"); - this.sidepanelTextColor = Optional.ofNullable(sidepanelTextColor); - return this; - } - - /** - * The text color to use for the sidebar. - */ - public Builder sidepanelTextColor(Optional sidepanelTextColor) { - Utils.checkNotNull(sidepanelTextColor, "sidepanelTextColor"); + public Builder sidepanelTextColor(@Nullable String sidepanelTextColor) { this.sidepanelTextColor = sidepanelTextColor; return this; } - /** * The name that will be shown in the sidebar. */ - public Builder vaultName(String vaultName) { - Utils.checkNotNull(vaultName, "vaultName"); - this.vaultName = Optional.ofNullable(vaultName); - return this; - } - - /** - * The name that will be shown in the sidebar. - */ - public Builder vaultName(Optional vaultName) { - Utils.checkNotNull(vaultName, "vaultName"); + public Builder vaultName(@Nullable String vaultName) { this.vaultName = vaultName; return this; } - - /** - * The URL to the privacy policy that will be shown in the sidebar. - */ - public Builder privacyUrl(String privacyUrl) { - Utils.checkNotNull(privacyUrl, "privacyUrl"); - this.privacyUrl = Optional.ofNullable(privacyUrl); - return this; - } - /** * The URL to the privacy policy that will be shown in the sidebar. */ - public Builder privacyUrl(Optional privacyUrl) { - Utils.checkNotNull(privacyUrl, "privacyUrl"); + public Builder privacyUrl(@Nullable String privacyUrl) { this.privacyUrl = privacyUrl; return this; } - /** * The URL to the terms and conditions that will be shown in the sidebar. */ - public Builder termsUrl(String termsUrl) { - Utils.checkNotNull(termsUrl, "termsUrl"); - this.termsUrl = Optional.ofNullable(termsUrl); - return this; - } - - /** - * The URL to the terms and conditions that will be shown in the sidebar. - */ - public Builder termsUrl(Optional termsUrl) { - Utils.checkNotNull(termsUrl, "termsUrl"); + public Builder termsUrl(@Nullable String termsUrl) { this.termsUrl = termsUrl; return this; } public Theme build() { - return new Theme( favicon, logo, primaryColor, sidepanelBackgroundColor, sidepanelTextColor, vaultName, diff --git a/src/main/java/com/apideck/unify/models/components/Ticket.java b/src/main/java/com/apideck/unify/models/components/Ticket.java index 18a633b0..c1867f4e 100644 --- a/src/main/java/com/apideck/unify/models/components/Ticket.java +++ b/src/main/java/com/apideck/unify/models/components/Ticket.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -74,12 +74,12 @@ public class Ticket { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("priority") - private JsonNullable priority; + private JsonNullable priority; @JsonInclude(Include.NON_ABSENT) @JsonProperty("assignees") - private Optional> assignees; + private List assignees; /** * The date and time when the object was last updated. @@ -119,220 +119,195 @@ public class Ticket { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private Optional> tags; + private List tags; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public Ticket( - @JsonProperty("id") String id, - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("collection_id") JsonNullable collectionId, - @JsonProperty("type") JsonNullable type, - @JsonProperty("subject") JsonNullable subject, - @JsonProperty("description") JsonNullable description, - @JsonProperty("status") JsonNullable status, - @JsonProperty("priority") JsonNullable priority, - @JsonProperty("assignees") Optional> assignees, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("due_date") JsonNullable dueDate, - @JsonProperty("completed_at") JsonNullable completedAt, - @JsonProperty("tags") Optional> tags, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(subject, "subject"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(priority, "priority"); - Utils.checkNotNull(assignees, "assignees"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(dueDate, "dueDate"); - Utils.checkNotNull(completedAt, "completedAt"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(passThrough, "passThrough"); - this.id = id; - this.parentId = parentId; - this.collectionId = collectionId; - this.type = type; - this.subject = subject; - this.description = description; - this.status = status; - this.priority = priority; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("collection_id") @Nullable JsonNullable collectionId, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("subject") @Nullable JsonNullable subject, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("priority") @Nullable JsonNullable priority, + @JsonProperty("assignees") @Nullable List assignees, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("due_date") @Nullable JsonNullable dueDate, + @JsonProperty("completed_at") @Nullable JsonNullable completedAt, + @JsonProperty("tags") @Nullable List tags, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.collectionId = Optional.ofNullable(collectionId) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.subject = Optional.ofNullable(subject) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.priority = Optional.ofNullable(priority) + .orElse(JsonNullable.undefined()); this.assignees = assignees; - this.updatedAt = updatedAt; - this.createdAt = createdAt; - this.createdBy = createdBy; - this.dueDate = dueDate; - this.completedAt = completedAt; + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.dueDate = Optional.ofNullable(dueDate) + .orElse(JsonNullable.undefined()); + this.completedAt = Optional.ofNullable(completedAt) + .orElse(JsonNullable.undefined()); this.tags = tags; - this.customMappings = customMappings; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public Ticket( - String id) { - this(id, JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The ticket's parent ID */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The ticket's collection ID */ - @JsonIgnore public JsonNullable collectionId() { - return collectionId; + return this.collectionId; } /** * The ticket's type */ - @JsonIgnore public JsonNullable type() { - return type; + return this.type; } /** * Subject of the ticket */ - @JsonIgnore public JsonNullable subject() { - return subject; + return this.subject; } /** * The ticket's description. HTML version of description is mapped if supported by the third-party platform */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. */ - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * Priority of the ticket */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable priority() { - return (JsonNullable) priority; + return this.priority; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> assignees() { - return (Optional>) assignees; + return Optional.ofNullable(this.assignees); } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * Due date of the ticket */ - @JsonIgnore public JsonNullable dueDate() { - return dueDate; + return this.dueDate; } /** * When the ticket was completed */ - @JsonIgnore public JsonNullable completedAt() { - return completedAt; + return this.completedAt; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> tags() { - return (Optional>) tags; + return Optional.ofNullable(this.tags); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -343,278 +318,137 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public Ticket withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Ticket withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The ticket's parent ID */ - public Ticket withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Ticket withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * The ticket's parent ID - */ - public Ticket withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The ticket's collection ID */ - public Ticket withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); + public Ticket withCollectionId(@Nullable String collectionId) { this.collectionId = JsonNullable.of(collectionId); return this; } - /** - * The ticket's collection ID - */ - public Ticket withCollectionId(JsonNullable collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; - return this; - } /** * The ticket's type */ - public Ticket withType(String type) { - Utils.checkNotNull(type, "type"); + public Ticket withType(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * The ticket's type - */ - public Ticket withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Subject of the ticket */ - public Ticket withSubject(String subject) { - Utils.checkNotNull(subject, "subject"); + public Ticket withSubject(@Nullable String subject) { this.subject = JsonNullable.of(subject); return this; } - /** - * Subject of the ticket - */ - public Ticket withSubject(JsonNullable subject) { - Utils.checkNotNull(subject, "subject"); - this.subject = subject; - return this; - } /** * The ticket's description. HTML version of description is mapped if supported by the third-party platform */ - public Ticket withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Ticket withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The ticket's description. HTML version of description is mapped if supported by the third-party platform - */ - public Ticket withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. */ - public Ticket withStatus(String status) { - Utils.checkNotNull(status, "status"); + public Ticket withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. - */ - public Ticket withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Priority of the ticket */ - public Ticket withPriority(Priority priority) { - Utils.checkNotNull(priority, "priority"); + public Ticket withPriority(@Nullable Priority priority) { this.priority = JsonNullable.of(priority); return this; } - /** - * Priority of the ticket - */ - public Ticket withPriority(JsonNullable priority) { - Utils.checkNotNull(priority, "priority"); - this.priority = priority; - return this; - } - - public Ticket withAssignees(List assignees) { - Utils.checkNotNull(assignees, "assignees"); - this.assignees = Optional.ofNullable(assignees); - return this; - } - - public Ticket withAssignees(Optional> assignees) { - Utils.checkNotNull(assignees, "assignees"); + public Ticket withAssignees(@Nullable List assignees) { this.assignees = assignees; return this; } + /** * The date and time when the object was last updated. */ - public Ticket withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Ticket withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Ticket withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Ticket withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Ticket withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Ticket withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } /** * The user who created the object. */ - public Ticket withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Ticket withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Ticket withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * Due date of the ticket */ - public Ticket withDueDate(OffsetDateTime dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Ticket withDueDate(@Nullable OffsetDateTime dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * Due date of the ticket - */ - public Ticket withDueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } /** * When the ticket was completed */ - public Ticket withCompletedAt(OffsetDateTime completedAt) { - Utils.checkNotNull(completedAt, "completedAt"); + public Ticket withCompletedAt(@Nullable OffsetDateTime completedAt) { this.completedAt = JsonNullable.of(completedAt); return this; } - /** - * When the ticket was completed - */ - public Ticket withCompletedAt(JsonNullable completedAt) { - Utils.checkNotNull(completedAt, "completedAt"); - this.completedAt = completedAt; - return this; - } - - public Ticket withTags(List tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = Optional.ofNullable(tags); - return this; - } - - public Ticket withTags(Optional> tags) { - Utils.checkNotNull(tags, "tags"); + public Ticket withTags(@Nullable List tags) { this.tags = tags; return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Ticket withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = JsonNullable.of(customMappings); - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public Ticket withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Ticket withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public Ticket withCustomMappings(@Nullable Map customMappings) { + this.customMappings = JsonNullable.of(customMappings); return this; } @@ -622,12 +456,12 @@ public Ticket withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Ticket withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Ticket withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -695,346 +529,173 @@ public final static class Builder { private String id; - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable collectionId = JsonNullable.undefined(); + private JsonNullable collectionId; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable subject = JsonNullable.undefined(); + private JsonNullable subject; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable priority = JsonNullable.undefined(); + private JsonNullable priority; - private Optional> assignees = Optional.empty(); + private List assignees; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable dueDate = JsonNullable.undefined(); + private JsonNullable dueDate; - private JsonNullable completedAt = JsonNullable.undefined(); + private JsonNullable completedAt; - private Optional> tags = Optional.empty(); + private List tags; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The ticket's parent ID */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * The ticket's parent ID - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The ticket's collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); + public Builder collectionId(@Nullable String collectionId) { this.collectionId = JsonNullable.of(collectionId); return this; } - /** - * The ticket's collection ID - */ - public Builder collectionId(JsonNullable collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; - return this; - } - - /** * The ticket's type */ - public Builder type(String type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * The ticket's type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * Subject of the ticket */ - public Builder subject(String subject) { - Utils.checkNotNull(subject, "subject"); + public Builder subject(@Nullable String subject) { this.subject = JsonNullable.of(subject); return this; } - /** - * Subject of the ticket - */ - public Builder subject(JsonNullable subject) { - Utils.checkNotNull(subject, "subject"); - this.subject = subject; - return this; - } - - /** * The ticket's description. HTML version of description is mapped if supported by the third-party platform */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The ticket's description. HTML version of description is mapped if supported by the third-party platform - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Priority of the ticket */ - public Builder priority(Priority priority) { - Utils.checkNotNull(priority, "priority"); + public Builder priority(@Nullable Priority priority) { this.priority = JsonNullable.of(priority); return this; } - /** - * Priority of the ticket - */ - public Builder priority(JsonNullable priority) { - Utils.checkNotNull(priority, "priority"); - this.priority = priority; - return this; - } - - - public Builder assignees(List assignees) { - Utils.checkNotNull(assignees, "assignees"); - this.assignees = Optional.ofNullable(assignees); - return this; - } - - public Builder assignees(Optional> assignees) { - Utils.checkNotNull(assignees, "assignees"); + public Builder assignees(@Nullable List assignees) { this.assignees = assignees; return this; } - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * Due date of the ticket */ - public Builder dueDate(OffsetDateTime dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Builder dueDate(@Nullable OffsetDateTime dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * Due date of the ticket - */ - public Builder dueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } - - /** * When the ticket was completed */ - public Builder completedAt(OffsetDateTime completedAt) { - Utils.checkNotNull(completedAt, "completedAt"); + public Builder completedAt(@Nullable OffsetDateTime completedAt) { this.completedAt = JsonNullable.of(completedAt); return this; } - /** - * When the ticket was completed - */ - public Builder completedAt(JsonNullable completedAt) { - Utils.checkNotNull(completedAt, "completedAt"); - this.completedAt = completedAt; - return this; - } - - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = Optional.ofNullable(tags); - return this; - } - - public Builder tags(Optional> tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = tags; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public Ticket build() { - return new Ticket( id, parentId, collectionId, type, subject, description, diff --git a/src/main/java/com/apideck/unify/models/components/TicketInput.java b/src/main/java/com/apideck/unify/models/components/TicketInput.java index f4782bb4..52c0d286 100644 --- a/src/main/java/com/apideck/unify/models/components/TicketInput.java +++ b/src/main/java/com/apideck/unify/models/components/TicketInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -59,12 +58,12 @@ public class TicketInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("priority") - private JsonNullable priority; + private JsonNullable priority; @JsonInclude(Include.NON_ABSENT) @JsonProperty("assignees") - private Optional> assignees; + private List assignees; /** * Due date of the ticket @@ -76,132 +75,115 @@ public class TicketInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("tags") - private Optional> tags; + private List tags; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public TicketInput( - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("type") JsonNullable type, - @JsonProperty("subject") JsonNullable subject, - @JsonProperty("description") JsonNullable description, - @JsonProperty("status") JsonNullable status, - @JsonProperty("priority") JsonNullable priority, - @JsonProperty("assignees") Optional> assignees, - @JsonProperty("due_date") JsonNullable dueDate, - @JsonProperty("tags") Optional> tags, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(subject, "subject"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(priority, "priority"); - Utils.checkNotNull(assignees, "assignees"); - Utils.checkNotNull(dueDate, "dueDate"); - Utils.checkNotNull(tags, "tags"); - Utils.checkNotNull(passThrough, "passThrough"); - this.parentId = parentId; - this.type = type; - this.subject = subject; - this.description = description; - this.status = status; - this.priority = priority; + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("subject") @Nullable JsonNullable subject, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("priority") @Nullable JsonNullable priority, + @JsonProperty("assignees") @Nullable List assignees, + @JsonProperty("due_date") @Nullable JsonNullable dueDate, + @JsonProperty("tags") @Nullable List tags, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.subject = Optional.ofNullable(subject) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.priority = Optional.ofNullable(priority) + .orElse(JsonNullable.undefined()); this.assignees = assignees; - this.dueDate = dueDate; + this.dueDate = Optional.ofNullable(dueDate) + .orElse(JsonNullable.undefined()); this.tags = tags; this.passThrough = passThrough; } public TicketInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * The ticket's parent ID */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The ticket's type */ - @JsonIgnore public JsonNullable type() { - return type; + return this.type; } /** * Subject of the ticket */ - @JsonIgnore public JsonNullable subject() { - return subject; + return this.subject; } /** * The ticket's description. HTML version of description is mapped if supported by the third-party platform */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. */ - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * Priority of the ticket */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable priority() { - return (JsonNullable) priority; + return this.priority; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> assignees() { - return (Optional>) assignees; + return Optional.ofNullable(this.assignees); } /** * Due date of the ticket */ - @JsonIgnore public JsonNullable dueDate() { - return dueDate; + return this.dueDate; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> tags() { - return (Optional>) tags; + return Optional.ofNullable(this.tags); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -212,174 +194,87 @@ public static Builder builder() { /** * The ticket's parent ID */ - public TicketInput withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public TicketInput withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * The ticket's parent ID - */ - public TicketInput withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The ticket's type */ - public TicketInput withType(String type) { - Utils.checkNotNull(type, "type"); + public TicketInput withType(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * The ticket's type - */ - public TicketInput withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * Subject of the ticket */ - public TicketInput withSubject(String subject) { - Utils.checkNotNull(subject, "subject"); + public TicketInput withSubject(@Nullable String subject) { this.subject = JsonNullable.of(subject); return this; } - /** - * Subject of the ticket - */ - public TicketInput withSubject(JsonNullable subject) { - Utils.checkNotNull(subject, "subject"); - this.subject = subject; - return this; - } /** * The ticket's description. HTML version of description is mapped if supported by the third-party platform */ - public TicketInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public TicketInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The ticket's description. HTML version of description is mapped if supported by the third-party platform - */ - public TicketInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. */ - public TicketInput withStatus(String status) { - Utils.checkNotNull(status, "status"); + public TicketInput withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. - */ - public TicketInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Priority of the ticket */ - public TicketInput withPriority(Priority priority) { - Utils.checkNotNull(priority, "priority"); + public TicketInput withPriority(@Nullable Priority priority) { this.priority = JsonNullable.of(priority); return this; } - /** - * Priority of the ticket - */ - public TicketInput withPriority(JsonNullable priority) { - Utils.checkNotNull(priority, "priority"); - this.priority = priority; - return this; - } - - public TicketInput withAssignees(List assignees) { - Utils.checkNotNull(assignees, "assignees"); - this.assignees = Optional.ofNullable(assignees); - return this; - } - - public TicketInput withAssignees(Optional> assignees) { - Utils.checkNotNull(assignees, "assignees"); + public TicketInput withAssignees(@Nullable List assignees) { this.assignees = assignees; return this; } - /** - * Due date of the ticket - */ - public TicketInput withDueDate(OffsetDateTime dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = JsonNullable.of(dueDate); - return this; - } /** * Due date of the ticket */ - public TicketInput withDueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } - - public TicketInput withTags(List tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = Optional.ofNullable(tags); + public TicketInput withDueDate(@Nullable OffsetDateTime dueDate) { + this.dueDate = JsonNullable.of(dueDate); return this; } - public TicketInput withTags(Optional> tags) { - Utils.checkNotNull(tags, "tags"); + public TicketInput withTags(@Nullable List tags) { this.tags = tags; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public TicketInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public TicketInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public TicketInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -429,210 +324,105 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private JsonNullable subject = JsonNullable.undefined(); + private JsonNullable subject; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable priority = JsonNullable.undefined(); + private JsonNullable priority; - private Optional> assignees = Optional.empty(); + private List assignees; - private JsonNullable dueDate = JsonNullable.undefined(); + private JsonNullable dueDate; - private Optional> tags = Optional.empty(); + private List tags; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The ticket's parent ID */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * The ticket's parent ID - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The ticket's type */ - public Builder type(String type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = JsonNullable.of(type); return this; } - /** - * The ticket's type - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - /** * Subject of the ticket */ - public Builder subject(String subject) { - Utils.checkNotNull(subject, "subject"); + public Builder subject(@Nullable String subject) { this.subject = JsonNullable.of(subject); return this; } - /** - * Subject of the ticket - */ - public Builder subject(JsonNullable subject) { - Utils.checkNotNull(subject, "subject"); - this.subject = subject; - return this; - } - - /** * The ticket's description. HTML version of description is mapped if supported by the third-party platform */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * The ticket's description. HTML version of description is mapped if supported by the third-party platform - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The current status of the ticket. Possible values include: open, in_progress, closed, or - in cases where there is no clear mapping - the original value passed through. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Priority of the ticket */ - public Builder priority(Priority priority) { - Utils.checkNotNull(priority, "priority"); + public Builder priority(@Nullable Priority priority) { this.priority = JsonNullable.of(priority); return this; } - /** - * Priority of the ticket - */ - public Builder priority(JsonNullable priority) { - Utils.checkNotNull(priority, "priority"); - this.priority = priority; - return this; - } - - - public Builder assignees(List assignees) { - Utils.checkNotNull(assignees, "assignees"); - this.assignees = Optional.ofNullable(assignees); - return this; - } - - public Builder assignees(Optional> assignees) { - Utils.checkNotNull(assignees, "assignees"); + public Builder assignees(@Nullable List assignees) { this.assignees = assignees; return this; } - /** * Due date of the ticket */ - public Builder dueDate(OffsetDateTime dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); + public Builder dueDate(@Nullable OffsetDateTime dueDate) { this.dueDate = JsonNullable.of(dueDate); return this; } - /** - * Due date of the ticket - */ - public Builder dueDate(JsonNullable dueDate) { - Utils.checkNotNull(dueDate, "dueDate"); - this.dueDate = dueDate; - return this; - } - - - public Builder tags(List tags) { - Utils.checkNotNull(tags, "tags"); - this.tags = Optional.ofNullable(tags); - return this; - } - - public Builder tags(Optional> tags) { - Utils.checkNotNull(tags, "tags"); + public Builder tags(@Nullable List tags) { this.tags = tags; return this; } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public TicketInput build() { - return new TicketInput( parentId, type, subject, description, status, priority, diff --git a/src/main/java/com/apideck/unify/models/components/TicketsSort.java b/src/main/java/com/apideck/unify/models/components/TicketsSort.java index 55fe07ef..57a28226 100644 --- a/src/main/java/com/apideck/unify/models/components/TicketsSort.java +++ b/src/main/java/com/apideck/unify/models/components/TicketsSort.java @@ -7,11 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -20,44 +19,39 @@ public class TicketsSort { * The field on which to sort the Tickets */ @SpeakeasyMetadata("queryParam:name=by") - private Optional by; + private TicketsSortBy by; /** * The direction in which to sort the results */ @SpeakeasyMetadata("queryParam:name=direction") - private Optional direction; + private SortDirection direction; @JsonCreator public TicketsSort( - Optional by, - Optional direction) { - Utils.checkNotNull(by, "by"); - Utils.checkNotNull(direction, "direction"); + @Nullable TicketsSortBy by, + @Nullable SortDirection direction) { this.by = by; - this.direction = direction; + this.direction = Optional.ofNullable(direction) + .orElse(Builder._SINGLETON_VALUE_Direction.value()); } public TicketsSort() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The field on which to sort the Tickets */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional by() { - return (Optional) by; + return Optional.ofNullable(this.by); } /** * The direction in which to sort the results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional direction() { - return (Optional) direction; + return Optional.ofNullable(this.direction); } public static Builder builder() { @@ -68,41 +62,21 @@ public static Builder builder() { /** * The field on which to sort the Tickets */ - public TicketsSort withBy(TicketsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - - - /** - * The field on which to sort the Tickets - */ - public TicketsSort withBy(Optional by) { - Utils.checkNotNull(by, "by"); + public TicketsSort withBy(@Nullable TicketsSortBy by) { this.by = by; return this; } - /** - * The direction in which to sort the results - */ - public TicketsSort withDirection(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - /** * The direction in which to sort the results */ - public TicketsSort withDirection(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public TicketsSort withDirection(@Nullable SortDirection direction) { this.direction = direction; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -133,66 +107,40 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional by = Optional.empty(); + private TicketsSortBy by; - private Optional direction; + private SortDirection direction; private Builder() { // force use of static builder() method } - - /** - * The field on which to sort the Tickets - */ - public Builder by(TicketsSortBy by) { - Utils.checkNotNull(by, "by"); - this.by = Optional.ofNullable(by); - return this; - } - /** * The field on which to sort the Tickets */ - public Builder by(Optional by) { - Utils.checkNotNull(by, "by"); + public Builder by(@Nullable TicketsSortBy by) { this.by = by; return this; } - /** * The direction in which to sort the results */ - public Builder direction(SortDirection direction) { - Utils.checkNotNull(direction, "direction"); - this.direction = Optional.ofNullable(direction); - return this; - } - - /** - * The direction in which to sort the results - */ - public Builder direction(Optional direction) { - Utils.checkNotNull(direction, "direction"); + public Builder direction(@Nullable SortDirection direction) { this.direction = direction; return this; } public TicketsSort build() { - if (direction == null) { - direction = _SINGLETON_VALUE_Direction.value(); - } - return new TicketsSort( by, direction); } - private static final LazySingletonValue> _SINGLETON_VALUE_Direction = + private static final LazySingletonValue _SINGLETON_VALUE_Direction = new LazySingletonValue<>( "direction", "\"asc\"", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/components/TimeOffRequest.java b/src/main/java/com/apideck/unify/models/components/TimeOffRequest.java index 9b2e4197..d6d9d145 100644 --- a/src/main/java/com/apideck/unify/models/components/TimeOffRequest.java +++ b/src/main/java/com/apideck/unify/models/components/TimeOffRequest.java @@ -5,15 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -27,7 +26,7 @@ public class TimeOffRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * ID of the employee @@ -48,7 +47,7 @@ public class TimeOffRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Description of the time off request. @@ -83,7 +82,7 @@ public class TimeOffRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("request_type") - private JsonNullable requestType; + private JsonNullable requestType; /** * The date the request was approved @@ -97,7 +96,7 @@ public class TimeOffRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("units") - private JsonNullable units; + private JsonNullable units; /** * The amount of time off requested. @@ -116,14 +115,14 @@ public class TimeOffRequest { @JsonInclude(Include.NON_ABSENT) @JsonProperty("notes") - private Optional notes; + private Notes notes; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -158,261 +157,230 @@ public class TimeOffRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; /** * The policy type of the time off request */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("policy_type") - private Optional policyType; + private String policyType; @JsonCreator public TimeOffRequest( - @JsonProperty("id") Optional id, - @JsonProperty("employee_id") JsonNullable employeeId, - @JsonProperty("policy_id") JsonNullable policyId, - @JsonProperty("status") JsonNullable status, - @JsonProperty("description") JsonNullable description, - @JsonProperty("start_date") JsonNullable startDate, - @JsonProperty("end_date") JsonNullable endDate, - @JsonProperty("request_date") JsonNullable requestDate, - @JsonProperty("request_type") JsonNullable requestType, - @JsonProperty("approval_date") JsonNullable approvalDate, - @JsonProperty("units") JsonNullable units, - @JsonProperty("amount") JsonNullable amount, - @JsonProperty("day_part") JsonNullable dayPart, - @JsonProperty("notes") Optional notes, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough, - @JsonProperty("policy_type") Optional policyType) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(employeeId, "employeeId"); - Utils.checkNotNull(policyId, "policyId"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(requestDate, "requestDate"); - Utils.checkNotNull(requestType, "requestType"); - Utils.checkNotNull(approvalDate, "approvalDate"); - Utils.checkNotNull(units, "units"); - Utils.checkNotNull(amount, "amount"); - Utils.checkNotNull(dayPart, "dayPart"); - Utils.checkNotNull(notes, "notes"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(policyType, "policyType"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("employee_id") @Nullable JsonNullable employeeId, + @JsonProperty("policy_id") @Nullable JsonNullable policyId, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("start_date") @Nullable JsonNullable startDate, + @JsonProperty("end_date") @Nullable JsonNullable endDate, + @JsonProperty("request_date") @Nullable JsonNullable requestDate, + @JsonProperty("request_type") @Nullable JsonNullable requestType, + @JsonProperty("approval_date") @Nullable JsonNullable approvalDate, + @JsonProperty("units") @Nullable JsonNullable units, + @JsonProperty("amount") @Nullable JsonNullable amount, + @JsonProperty("day_part") @Nullable JsonNullable dayPart, + @JsonProperty("notes") @Nullable Notes notes, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough, + @JsonProperty("policy_type") @Nullable String policyType) { this.id = id; - this.employeeId = employeeId; - this.policyId = policyId; - this.status = status; - this.description = description; - this.startDate = startDate; - this.endDate = endDate; - this.requestDate = requestDate; - this.requestType = requestType; - this.approvalDate = approvalDate; - this.units = units; - this.amount = amount; - this.dayPart = dayPart; + this.employeeId = Optional.ofNullable(employeeId) + .orElse(JsonNullable.undefined()); + this.policyId = Optional.ofNullable(policyId) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.startDate = Optional.ofNullable(startDate) + .orElse(JsonNullable.undefined()); + this.endDate = Optional.ofNullable(endDate) + .orElse(JsonNullable.undefined()); + this.requestDate = Optional.ofNullable(requestDate) + .orElse(JsonNullable.undefined()); + this.requestType = Optional.ofNullable(requestType) + .orElse(JsonNullable.undefined()); + this.approvalDate = Optional.ofNullable(approvalDate) + .orElse(JsonNullable.undefined()); + this.units = Optional.ofNullable(units) + .orElse(JsonNullable.undefined()); + this.amount = Optional.ofNullable(amount) + .orElse(JsonNullable.undefined()); + this.dayPart = Optional.ofNullable(dayPart) + .orElse(JsonNullable.undefined()); this.notes = notes; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; this.policyType = policyType; } public TimeOffRequest() { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * ID of the employee */ - @JsonIgnore public JsonNullable employeeId() { - return employeeId; + return this.employeeId; } /** * ID of the policy */ - @JsonIgnore public JsonNullable policyId() { - return policyId; + return this.policyId; } /** * The status of the time off request. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Description of the time off request. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The start date of the time off request. */ - @JsonIgnore public JsonNullable startDate() { - return startDate; + return this.startDate; } /** * The end date of the time off request. */ - @JsonIgnore public JsonNullable endDate() { - return endDate; + return this.endDate; } /** * The date the request was made. */ - @JsonIgnore public JsonNullable requestDate() { - return requestDate; + return this.requestDate; } /** * The type of request */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable requestType() { - return (JsonNullable) requestType; + return this.requestType; } /** * The date the request was approved */ - @JsonIgnore public JsonNullable approvalDate() { - return approvalDate; + return this.approvalDate; } /** * The unit of time off requested. Possible values include: `hours`, `days`, or `other`. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable units() { - return (JsonNullable) units; + return this.units; } /** * The amount of time off requested. */ - @JsonIgnore public JsonNullable amount() { - return amount; + return this.amount; } /** * The day part of the time off request. */ - @JsonIgnore public JsonNullable dayPart() { - return dayPart; + return this.dayPart; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional notes() { - return (Optional) notes; + return Optional.ofNullable(this.notes); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The policy type of the time off request */ - @JsonIgnore public Optional policyType() { - return policyType; + return Optional.ofNullable(this.policyType); } public static Builder builder() { @@ -423,379 +391,189 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public TimeOffRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public TimeOffRequest withId(Optional id) { - Utils.checkNotNull(id, "id"); + public TimeOffRequest withId(@Nullable String id) { this.id = id; return this; } + /** * ID of the employee */ - public TimeOffRequest withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public TimeOffRequest withEmployeeId(@Nullable String employeeId) { this.employeeId = JsonNullable.of(employeeId); return this; } - /** - * ID of the employee - */ - public TimeOffRequest withEmployeeId(JsonNullable employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } /** * ID of the policy */ - public TimeOffRequest withPolicyId(String policyId) { - Utils.checkNotNull(policyId, "policyId"); + public TimeOffRequest withPolicyId(@Nullable String policyId) { this.policyId = JsonNullable.of(policyId); return this; } - /** - * ID of the policy - */ - public TimeOffRequest withPolicyId(JsonNullable policyId) { - Utils.checkNotNull(policyId, "policyId"); - this.policyId = policyId; - return this; - } /** * The status of the time off request. */ - public TimeOffRequest withStatus(TimeOffRequestStatusStatus status) { - Utils.checkNotNull(status, "status"); + public TimeOffRequest withStatus(@Nullable TimeOffRequestStatusStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the time off request. - */ - public TimeOffRequest withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Description of the time off request. */ - public TimeOffRequest withDescription(String description) { - Utils.checkNotNull(description, "description"); + public TimeOffRequest withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of the time off request. - */ - public TimeOffRequest withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The start date of the time off request. */ - public TimeOffRequest withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); + public TimeOffRequest withStartDate(@Nullable String startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The start date of the time off request. - */ - public TimeOffRequest withStartDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } /** * The end date of the time off request. */ - public TimeOffRequest withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); + public TimeOffRequest withEndDate(@Nullable String endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The end date of the time off request. - */ - public TimeOffRequest withEndDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } /** * The date the request was made. */ - public TimeOffRequest withRequestDate(String requestDate) { - Utils.checkNotNull(requestDate, "requestDate"); + public TimeOffRequest withRequestDate(@Nullable String requestDate) { this.requestDate = JsonNullable.of(requestDate); return this; } - /** - * The date the request was made. - */ - public TimeOffRequest withRequestDate(JsonNullable requestDate) { - Utils.checkNotNull(requestDate, "requestDate"); - this.requestDate = requestDate; - return this; - } /** * The type of request */ - public TimeOffRequest withRequestType(RequestType requestType) { - Utils.checkNotNull(requestType, "requestType"); + public TimeOffRequest withRequestType(@Nullable RequestType requestType) { this.requestType = JsonNullable.of(requestType); return this; } - /** - * The type of request - */ - public TimeOffRequest withRequestType(JsonNullable requestType) { - Utils.checkNotNull(requestType, "requestType"); - this.requestType = requestType; - return this; - } /** * The date the request was approved */ - public TimeOffRequest withApprovalDate(String approvalDate) { - Utils.checkNotNull(approvalDate, "approvalDate"); + public TimeOffRequest withApprovalDate(@Nullable String approvalDate) { this.approvalDate = JsonNullable.of(approvalDate); return this; } - /** - * The date the request was approved - */ - public TimeOffRequest withApprovalDate(JsonNullable approvalDate) { - Utils.checkNotNull(approvalDate, "approvalDate"); - this.approvalDate = approvalDate; - return this; - } /** * The unit of time off requested. Possible values include: `hours`, `days`, or `other`. */ - public TimeOffRequest withUnits(Units units) { - Utils.checkNotNull(units, "units"); + public TimeOffRequest withUnits(@Nullable Units units) { this.units = JsonNullable.of(units); return this; } - /** - * The unit of time off requested. Possible values include: `hours`, `days`, or `other`. - */ - public TimeOffRequest withUnits(JsonNullable units) { - Utils.checkNotNull(units, "units"); - this.units = units; - return this; - } /** * The amount of time off requested. */ - public TimeOffRequest withAmount(double amount) { - Utils.checkNotNull(amount, "amount"); + public TimeOffRequest withAmount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * The amount of time off requested. - */ - public TimeOffRequest withAmount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } /** * The day part of the time off request. */ - public TimeOffRequest withDayPart(String dayPart) { - Utils.checkNotNull(dayPart, "dayPart"); + public TimeOffRequest withDayPart(@Nullable String dayPart) { this.dayPart = JsonNullable.of(dayPart); return this; } - /** - * The day part of the time off request. - */ - public TimeOffRequest withDayPart(JsonNullable dayPart) { - Utils.checkNotNull(dayPart, "dayPart"); - this.dayPart = dayPart; - return this; - } - - public TimeOffRequest withNotes(Notes notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = Optional.ofNullable(notes); - return this; - } - - public TimeOffRequest withNotes(Optional notes) { - Utils.checkNotNull(notes, "notes"); + public TimeOffRequest withNotes(@Nullable Notes notes) { this.notes = notes; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public TimeOffRequest withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public TimeOffRequest withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public TimeOffRequest withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public TimeOffRequest withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public TimeOffRequest withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public TimeOffRequest withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public TimeOffRequest withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public TimeOffRequest withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public TimeOffRequest withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public TimeOffRequest withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public TimeOffRequest withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public TimeOffRequest withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public TimeOffRequest withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public TimeOffRequest withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public TimeOffRequest withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public TimeOffRequest withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public TimeOffRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public TimeOffRequest withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** - * The policy type of the time off request - */ - public TimeOffRequest withPolicyType(String policyType) { - Utils.checkNotNull(policyType, "policyType"); - this.policyType = Optional.ofNullable(policyType); - return this; - } - /** * The policy type of the time off request */ - public TimeOffRequest withPolicyType(Optional policyType) { - Utils.checkNotNull(policyType, "policyType"); + public TimeOffRequest withPolicyType(@Nullable String policyType) { this.policyType = policyType; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -870,447 +648,218 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable employeeId = JsonNullable.undefined(); + private JsonNullable employeeId; - private JsonNullable policyId = JsonNullable.undefined(); + private JsonNullable policyId; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable startDate = JsonNullable.undefined(); + private JsonNullable startDate; - private JsonNullable endDate = JsonNullable.undefined(); + private JsonNullable endDate; - private JsonNullable requestDate = JsonNullable.undefined(); + private JsonNullable requestDate; - private JsonNullable requestType = JsonNullable.undefined(); + private JsonNullable requestType; - private JsonNullable approvalDate = JsonNullable.undefined(); + private JsonNullable approvalDate; - private JsonNullable units = JsonNullable.undefined(); + private JsonNullable units; - private JsonNullable amount = JsonNullable.undefined(); + private JsonNullable amount; - private JsonNullable dayPart = JsonNullable.undefined(); + private JsonNullable dayPart; - private Optional notes = Optional.empty(); + private Notes notes; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; - private Optional policyType = Optional.empty(); + private String policyType; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * ID of the employee */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public Builder employeeId(@Nullable String employeeId) { this.employeeId = JsonNullable.of(employeeId); return this; } - /** - * ID of the employee - */ - public Builder employeeId(JsonNullable employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } - - /** * ID of the policy */ - public Builder policyId(String policyId) { - Utils.checkNotNull(policyId, "policyId"); + public Builder policyId(@Nullable String policyId) { this.policyId = JsonNullable.of(policyId); return this; } - /** - * ID of the policy - */ - public Builder policyId(JsonNullable policyId) { - Utils.checkNotNull(policyId, "policyId"); - this.policyId = policyId; - return this; - } - - /** * The status of the time off request. */ - public Builder status(TimeOffRequestStatusStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable TimeOffRequestStatusStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the time off request. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Description of the time off request. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of the time off request. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The start date of the time off request. */ - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable String startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The start date of the time off request. - */ - public Builder startDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } - - /** * The end date of the time off request. */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable String endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The end date of the time off request. - */ - public Builder endDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** * The date the request was made. */ - public Builder requestDate(String requestDate) { - Utils.checkNotNull(requestDate, "requestDate"); + public Builder requestDate(@Nullable String requestDate) { this.requestDate = JsonNullable.of(requestDate); return this; } - /** - * The date the request was made. - */ - public Builder requestDate(JsonNullable requestDate) { - Utils.checkNotNull(requestDate, "requestDate"); - this.requestDate = requestDate; - return this; - } - - /** * The type of request */ - public Builder requestType(RequestType requestType) { - Utils.checkNotNull(requestType, "requestType"); + public Builder requestType(@Nullable RequestType requestType) { this.requestType = JsonNullable.of(requestType); return this; } - /** - * The type of request - */ - public Builder requestType(JsonNullable requestType) { - Utils.checkNotNull(requestType, "requestType"); - this.requestType = requestType; - return this; - } - - /** * The date the request was approved */ - public Builder approvalDate(String approvalDate) { - Utils.checkNotNull(approvalDate, "approvalDate"); + public Builder approvalDate(@Nullable String approvalDate) { this.approvalDate = JsonNullable.of(approvalDate); return this; } - /** - * The date the request was approved - */ - public Builder approvalDate(JsonNullable approvalDate) { - Utils.checkNotNull(approvalDate, "approvalDate"); - this.approvalDate = approvalDate; - return this; - } - - /** * The unit of time off requested. Possible values include: `hours`, `days`, or `other`. */ - public Builder units(Units units) { - Utils.checkNotNull(units, "units"); + public Builder units(@Nullable Units units) { this.units = JsonNullable.of(units); return this; } - /** - * The unit of time off requested. Possible values include: `hours`, `days`, or `other`. - */ - public Builder units(JsonNullable units) { - Utils.checkNotNull(units, "units"); - this.units = units; - return this; - } - - /** * The amount of time off requested. */ - public Builder amount(double amount) { - Utils.checkNotNull(amount, "amount"); + public Builder amount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * The amount of time off requested. - */ - public Builder amount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** * The day part of the time off request. */ - public Builder dayPart(String dayPart) { - Utils.checkNotNull(dayPart, "dayPart"); + public Builder dayPart(@Nullable String dayPart) { this.dayPart = JsonNullable.of(dayPart); return this; } - /** - * The day part of the time off request. - */ - public Builder dayPart(JsonNullable dayPart) { - Utils.checkNotNull(dayPart, "dayPart"); - this.dayPart = dayPart; - return this; - } - - - public Builder notes(Notes notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = Optional.ofNullable(notes); - return this; - } - - public Builder notes(Optional notes) { - Utils.checkNotNull(notes, "notes"); + public Builder notes(@Nullable Notes notes) { this.notes = notes; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - - /** - * The policy type of the time off request - */ - public Builder policyType(String policyType) { - Utils.checkNotNull(policyType, "policyType"); - this.policyType = Optional.ofNullable(policyType); - return this; - } - /** * The policy type of the time off request */ - public Builder policyType(Optional policyType) { - Utils.checkNotNull(policyType, "policyType"); + public Builder policyType(@Nullable String policyType) { this.policyType = policyType; return this; } public TimeOffRequest build() { - return new TimeOffRequest( id, employeeId, policyId, status, description, startDate, diff --git a/src/main/java/com/apideck/unify/models/components/TimeOffRequestInput.java b/src/main/java/com/apideck/unify/models/components/TimeOffRequestInput.java index d3772173..ee151d8d 100644 --- a/src/main/java/com/apideck/unify/models/components/TimeOffRequestInput.java +++ b/src/main/java/com/apideck/unify/models/components/TimeOffRequestInput.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -38,7 +37,7 @@ public class TimeOffRequestInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private JsonNullable status; + private JsonNullable status; /** * Description of the time off request. @@ -73,7 +72,7 @@ public class TimeOffRequestInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("request_type") - private JsonNullable requestType; + private JsonNullable requestType; /** * The date the request was approved @@ -87,7 +86,7 @@ public class TimeOffRequestInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("units") - private JsonNullable units; + private JsonNullable units; /** * The amount of time off requested. @@ -106,199 +105,176 @@ public class TimeOffRequestInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("notes") - private Optional notes; + private Notes notes; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; /** * The policy type of the time off request */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("policy_type") - private Optional policyType; + private String policyType; @JsonCreator public TimeOffRequestInput( - @JsonProperty("employee_id") JsonNullable employeeId, - @JsonProperty("policy_id") JsonNullable policyId, - @JsonProperty("status") JsonNullable status, - @JsonProperty("description") JsonNullable description, - @JsonProperty("start_date") JsonNullable startDate, - @JsonProperty("end_date") JsonNullable endDate, - @JsonProperty("request_date") JsonNullable requestDate, - @JsonProperty("request_type") JsonNullable requestType, - @JsonProperty("approval_date") JsonNullable approvalDate, - @JsonProperty("units") JsonNullable units, - @JsonProperty("amount") JsonNullable amount, - @JsonProperty("day_part") JsonNullable dayPart, - @JsonProperty("notes") Optional notes, - @JsonProperty("pass_through") Optional> passThrough, - @JsonProperty("policy_type") Optional policyType) { - Utils.checkNotNull(employeeId, "employeeId"); - Utils.checkNotNull(policyId, "policyId"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(requestDate, "requestDate"); - Utils.checkNotNull(requestType, "requestType"); - Utils.checkNotNull(approvalDate, "approvalDate"); - Utils.checkNotNull(units, "units"); - Utils.checkNotNull(amount, "amount"); - Utils.checkNotNull(dayPart, "dayPart"); - Utils.checkNotNull(notes, "notes"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(policyType, "policyType"); - this.employeeId = employeeId; - this.policyId = policyId; - this.status = status; - this.description = description; - this.startDate = startDate; - this.endDate = endDate; - this.requestDate = requestDate; - this.requestType = requestType; - this.approvalDate = approvalDate; - this.units = units; - this.amount = amount; - this.dayPart = dayPart; + @JsonProperty("employee_id") @Nullable JsonNullable employeeId, + @JsonProperty("policy_id") @Nullable JsonNullable policyId, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("start_date") @Nullable JsonNullable startDate, + @JsonProperty("end_date") @Nullable JsonNullable endDate, + @JsonProperty("request_date") @Nullable JsonNullable requestDate, + @JsonProperty("request_type") @Nullable JsonNullable requestType, + @JsonProperty("approval_date") @Nullable JsonNullable approvalDate, + @JsonProperty("units") @Nullable JsonNullable units, + @JsonProperty("amount") @Nullable JsonNullable amount, + @JsonProperty("day_part") @Nullable JsonNullable dayPart, + @JsonProperty("notes") @Nullable Notes notes, + @JsonProperty("pass_through") @Nullable List passThrough, + @JsonProperty("policy_type") @Nullable String policyType) { + this.employeeId = Optional.ofNullable(employeeId) + .orElse(JsonNullable.undefined()); + this.policyId = Optional.ofNullable(policyId) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.startDate = Optional.ofNullable(startDate) + .orElse(JsonNullable.undefined()); + this.endDate = Optional.ofNullable(endDate) + .orElse(JsonNullable.undefined()); + this.requestDate = Optional.ofNullable(requestDate) + .orElse(JsonNullable.undefined()); + this.requestType = Optional.ofNullable(requestType) + .orElse(JsonNullable.undefined()); + this.approvalDate = Optional.ofNullable(approvalDate) + .orElse(JsonNullable.undefined()); + this.units = Optional.ofNullable(units) + .orElse(JsonNullable.undefined()); + this.amount = Optional.ofNullable(amount) + .orElse(JsonNullable.undefined()); + this.dayPart = Optional.ofNullable(dayPart) + .orElse(JsonNullable.undefined()); this.notes = notes; this.passThrough = passThrough; this.policyType = policyType; } public TimeOffRequestInput() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null); } /** * ID of the employee */ - @JsonIgnore public JsonNullable employeeId() { - return employeeId; + return this.employeeId; } /** * ID of the policy */ - @JsonIgnore public JsonNullable policyId() { - return policyId; + return this.policyId; } /** * The status of the time off request. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable status() { - return (JsonNullable) status; + return this.status; } /** * Description of the time off request. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The start date of the time off request. */ - @JsonIgnore public JsonNullable startDate() { - return startDate; + return this.startDate; } /** * The end date of the time off request. */ - @JsonIgnore public JsonNullable endDate() { - return endDate; + return this.endDate; } /** * The date the request was made. */ - @JsonIgnore public JsonNullable requestDate() { - return requestDate; + return this.requestDate; } /** * The type of request */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable requestType() { - return (JsonNullable) requestType; + return this.requestType; } /** * The date the request was approved */ - @JsonIgnore public JsonNullable approvalDate() { - return approvalDate; + return this.approvalDate; } /** * The unit of time off requested. Possible values include: `hours`, `days`, or `other`. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable units() { - return (JsonNullable) units; + return this.units; } /** * The amount of time off requested. */ - @JsonIgnore public JsonNullable amount() { - return amount; + return this.amount; } /** * The day part of the time off request. */ - @JsonIgnore public JsonNullable dayPart() { - return dayPart; + return this.dayPart; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional notes() { - return (Optional) notes; + return Optional.ofNullable(this.notes); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The policy type of the time off request */ - @JsonIgnore public Optional policyType() { - return policyType; + return Optional.ofNullable(this.policyType); } public static Builder builder() { @@ -309,270 +285,135 @@ public static Builder builder() { /** * ID of the employee */ - public TimeOffRequestInput withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public TimeOffRequestInput withEmployeeId(@Nullable String employeeId) { this.employeeId = JsonNullable.of(employeeId); return this; } - /** - * ID of the employee - */ - public TimeOffRequestInput withEmployeeId(JsonNullable employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } /** * ID of the policy */ - public TimeOffRequestInput withPolicyId(String policyId) { - Utils.checkNotNull(policyId, "policyId"); + public TimeOffRequestInput withPolicyId(@Nullable String policyId) { this.policyId = JsonNullable.of(policyId); return this; } - /** - * ID of the policy - */ - public TimeOffRequestInput withPolicyId(JsonNullable policyId) { - Utils.checkNotNull(policyId, "policyId"); - this.policyId = policyId; - return this; - } /** * The status of the time off request. */ - public TimeOffRequestInput withStatus(TimeOffRequestStatusStatus status) { - Utils.checkNotNull(status, "status"); + public TimeOffRequestInput withStatus(@Nullable TimeOffRequestStatusStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the time off request. - */ - public TimeOffRequestInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * Description of the time off request. */ - public TimeOffRequestInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public TimeOffRequestInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of the time off request. - */ - public TimeOffRequestInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The start date of the time off request. */ - public TimeOffRequestInput withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); + public TimeOffRequestInput withStartDate(@Nullable String startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The start date of the time off request. - */ - public TimeOffRequestInput withStartDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } /** * The end date of the time off request. */ - public TimeOffRequestInput withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); + public TimeOffRequestInput withEndDate(@Nullable String endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The end date of the time off request. - */ - public TimeOffRequestInput withEndDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } /** * The date the request was made. */ - public TimeOffRequestInput withRequestDate(String requestDate) { - Utils.checkNotNull(requestDate, "requestDate"); + public TimeOffRequestInput withRequestDate(@Nullable String requestDate) { this.requestDate = JsonNullable.of(requestDate); return this; } - /** - * The date the request was made. - */ - public TimeOffRequestInput withRequestDate(JsonNullable requestDate) { - Utils.checkNotNull(requestDate, "requestDate"); - this.requestDate = requestDate; - return this; - } /** * The type of request */ - public TimeOffRequestInput withRequestType(RequestType requestType) { - Utils.checkNotNull(requestType, "requestType"); + public TimeOffRequestInput withRequestType(@Nullable RequestType requestType) { this.requestType = JsonNullable.of(requestType); return this; } - /** - * The type of request - */ - public TimeOffRequestInput withRequestType(JsonNullable requestType) { - Utils.checkNotNull(requestType, "requestType"); - this.requestType = requestType; - return this; - } /** * The date the request was approved */ - public TimeOffRequestInput withApprovalDate(String approvalDate) { - Utils.checkNotNull(approvalDate, "approvalDate"); + public TimeOffRequestInput withApprovalDate(@Nullable String approvalDate) { this.approvalDate = JsonNullable.of(approvalDate); return this; } - /** - * The date the request was approved - */ - public TimeOffRequestInput withApprovalDate(JsonNullable approvalDate) { - Utils.checkNotNull(approvalDate, "approvalDate"); - this.approvalDate = approvalDate; - return this; - } /** * The unit of time off requested. Possible values include: `hours`, `days`, or `other`. */ - public TimeOffRequestInput withUnits(Units units) { - Utils.checkNotNull(units, "units"); + public TimeOffRequestInput withUnits(@Nullable Units units) { this.units = JsonNullable.of(units); return this; } - /** - * The unit of time off requested. Possible values include: `hours`, `days`, or `other`. - */ - public TimeOffRequestInput withUnits(JsonNullable units) { - Utils.checkNotNull(units, "units"); - this.units = units; - return this; - } /** * The amount of time off requested. */ - public TimeOffRequestInput withAmount(double amount) { - Utils.checkNotNull(amount, "amount"); + public TimeOffRequestInput withAmount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * The amount of time off requested. - */ - public TimeOffRequestInput withAmount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } /** * The day part of the time off request. */ - public TimeOffRequestInput withDayPart(String dayPart) { - Utils.checkNotNull(dayPart, "dayPart"); + public TimeOffRequestInput withDayPart(@Nullable String dayPart) { this.dayPart = JsonNullable.of(dayPart); return this; } - /** - * The day part of the time off request. - */ - public TimeOffRequestInput withDayPart(JsonNullable dayPart) { - Utils.checkNotNull(dayPart, "dayPart"); - this.dayPart = dayPart; - return this; - } - - public TimeOffRequestInput withNotes(Notes notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = Optional.ofNullable(notes); - return this; - } - - public TimeOffRequestInput withNotes(Optional notes) { - Utils.checkNotNull(notes, "notes"); + public TimeOffRequestInput withNotes(@Nullable Notes notes) { this.notes = notes; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public TimeOffRequestInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public TimeOffRequestInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public TimeOffRequestInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** - * The policy type of the time off request - */ - public TimeOffRequestInput withPolicyType(String policyType) { - Utils.checkNotNull(policyType, "policyType"); - this.policyType = Optional.ofNullable(policyType); - return this; - } - /** * The policy type of the time off request */ - public TimeOffRequestInput withPolicyType(Optional policyType) { - Utils.checkNotNull(policyType, "policyType"); + public TimeOffRequestInput withPolicyType(@Nullable String policyType) { this.policyType = policyType; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -633,321 +474,158 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable employeeId = JsonNullable.undefined(); + private JsonNullable employeeId; - private JsonNullable policyId = JsonNullable.undefined(); + private JsonNullable policyId; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable startDate = JsonNullable.undefined(); + private JsonNullable startDate; - private JsonNullable endDate = JsonNullable.undefined(); + private JsonNullable endDate; - private JsonNullable requestDate = JsonNullable.undefined(); + private JsonNullable requestDate; - private JsonNullable requestType = JsonNullable.undefined(); + private JsonNullable requestType; - private JsonNullable approvalDate = JsonNullable.undefined(); + private JsonNullable approvalDate; - private JsonNullable units = JsonNullable.undefined(); + private JsonNullable units; - private JsonNullable amount = JsonNullable.undefined(); + private JsonNullable amount; - private JsonNullable dayPart = JsonNullable.undefined(); + private JsonNullable dayPart; - private Optional notes = Optional.empty(); + private Notes notes; - private Optional> passThrough = Optional.empty(); + private List passThrough; - private Optional policyType = Optional.empty(); + private String policyType; private Builder() { // force use of static builder() method } - /** * ID of the employee */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public Builder employeeId(@Nullable String employeeId) { this.employeeId = JsonNullable.of(employeeId); return this; } - /** - * ID of the employee - */ - public Builder employeeId(JsonNullable employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } - - /** * ID of the policy */ - public Builder policyId(String policyId) { - Utils.checkNotNull(policyId, "policyId"); + public Builder policyId(@Nullable String policyId) { this.policyId = JsonNullable.of(policyId); return this; } - /** - * ID of the policy - */ - public Builder policyId(JsonNullable policyId) { - Utils.checkNotNull(policyId, "policyId"); - this.policyId = policyId; - return this; - } - - /** * The status of the time off request. */ - public Builder status(TimeOffRequestStatusStatus status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable TimeOffRequestStatusStatus status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the time off request. - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * Description of the time off request. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Description of the time off request. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The start date of the time off request. */ - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable String startDate) { this.startDate = JsonNullable.of(startDate); return this; } - /** - * The start date of the time off request. - */ - public Builder startDate(JsonNullable startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = startDate; - return this; - } - - /** * The end date of the time off request. */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable String endDate) { this.endDate = JsonNullable.of(endDate); return this; } - /** - * The end date of the time off request. - */ - public Builder endDate(JsonNullable endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = endDate; - return this; - } - - /** * The date the request was made. */ - public Builder requestDate(String requestDate) { - Utils.checkNotNull(requestDate, "requestDate"); + public Builder requestDate(@Nullable String requestDate) { this.requestDate = JsonNullable.of(requestDate); return this; } - /** - * The date the request was made. - */ - public Builder requestDate(JsonNullable requestDate) { - Utils.checkNotNull(requestDate, "requestDate"); - this.requestDate = requestDate; - return this; - } - - /** * The type of request */ - public Builder requestType(RequestType requestType) { - Utils.checkNotNull(requestType, "requestType"); + public Builder requestType(@Nullable RequestType requestType) { this.requestType = JsonNullable.of(requestType); return this; } - /** - * The type of request - */ - public Builder requestType(JsonNullable requestType) { - Utils.checkNotNull(requestType, "requestType"); - this.requestType = requestType; - return this; - } - - /** * The date the request was approved */ - public Builder approvalDate(String approvalDate) { - Utils.checkNotNull(approvalDate, "approvalDate"); + public Builder approvalDate(@Nullable String approvalDate) { this.approvalDate = JsonNullable.of(approvalDate); return this; } - /** - * The date the request was approved - */ - public Builder approvalDate(JsonNullable approvalDate) { - Utils.checkNotNull(approvalDate, "approvalDate"); - this.approvalDate = approvalDate; - return this; - } - - /** * The unit of time off requested. Possible values include: `hours`, `days`, or `other`. */ - public Builder units(Units units) { - Utils.checkNotNull(units, "units"); + public Builder units(@Nullable Units units) { this.units = JsonNullable.of(units); return this; } - /** - * The unit of time off requested. Possible values include: `hours`, `days`, or `other`. - */ - public Builder units(JsonNullable units) { - Utils.checkNotNull(units, "units"); - this.units = units; - return this; - } - - /** * The amount of time off requested. */ - public Builder amount(double amount) { - Utils.checkNotNull(amount, "amount"); + public Builder amount(@Nullable Double amount) { this.amount = JsonNullable.of(amount); return this; } - /** - * The amount of time off requested. - */ - public Builder amount(JsonNullable amount) { - Utils.checkNotNull(amount, "amount"); - this.amount = amount; - return this; - } - - /** * The day part of the time off request. */ - public Builder dayPart(String dayPart) { - Utils.checkNotNull(dayPart, "dayPart"); + public Builder dayPart(@Nullable String dayPart) { this.dayPart = JsonNullable.of(dayPart); return this; } - /** - * The day part of the time off request. - */ - public Builder dayPart(JsonNullable dayPart) { - Utils.checkNotNull(dayPart, "dayPart"); - this.dayPart = dayPart; - return this; - } - - - public Builder notes(Notes notes) { - Utils.checkNotNull(notes, "notes"); - this.notes = Optional.ofNullable(notes); - return this; - } - - public Builder notes(Optional notes) { - Utils.checkNotNull(notes, "notes"); + public Builder notes(@Nullable Notes notes) { this.notes = notes; return this; } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** * The policy type of the time off request */ - public Builder policyType(String policyType) { - Utils.checkNotNull(policyType, "policyType"); - this.policyType = Optional.ofNullable(policyType); - return this; - } - - /** - * The policy type of the time off request - */ - public Builder policyType(Optional policyType) { - Utils.checkNotNull(policyType, "policyType"); + public Builder policyType(@Nullable String policyType) { this.policyType = policyType; return this; } public TimeOffRequestInput build() { - return new TimeOffRequestInput( employeeId, policyId, status, description, startDate, endDate, diff --git a/src/main/java/com/apideck/unify/models/components/TimeOffRequestsFilter.java b/src/main/java/com/apideck/unify/models/components/TimeOffRequestsFilter.java index d15028f5..f60a5416 100644 --- a/src/main/java/com/apideck/unify/models/components/TimeOffRequestsFilter.java +++ b/src/main/java/com/apideck/unify/models/components/TimeOffRequestsFilter.java @@ -6,10 +6,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -18,52 +17,46 @@ public class TimeOffRequestsFilter { * Start date */ @SpeakeasyMetadata("queryParam:name=start_date") - private Optional startDate; + private String startDate; /** * End date */ @SpeakeasyMetadata("queryParam:name=end_date") - private Optional endDate; + private String endDate; /** * Minimum date the time off request was last created or modified */ @SpeakeasyMetadata("queryParam:name=updated_since") - private Optional updatedSince; + private String updatedSince; /** * Employee ID */ @SpeakeasyMetadata("queryParam:name=employee_id") - private Optional employeeId; + private String employeeId; /** * Time off request status to filter on */ @SpeakeasyMetadata("queryParam:name=time_off_request_status") - private Optional timeOffRequestStatus; + private TimeOffRequestStatus timeOffRequestStatus; /** * Company ID */ @SpeakeasyMetadata("queryParam:name=company_id") - private Optional companyId; + private String companyId; @JsonCreator public TimeOffRequestsFilter( - Optional startDate, - Optional endDate, - Optional updatedSince, - Optional employeeId, - Optional timeOffRequestStatus, - Optional companyId) { - Utils.checkNotNull(startDate, "startDate"); - Utils.checkNotNull(endDate, "endDate"); - Utils.checkNotNull(updatedSince, "updatedSince"); - Utils.checkNotNull(employeeId, "employeeId"); - Utils.checkNotNull(timeOffRequestStatus, "timeOffRequestStatus"); - Utils.checkNotNull(companyId, "companyId"); + @Nullable String startDate, + @Nullable String endDate, + @Nullable String updatedSince, + @Nullable String employeeId, + @Nullable TimeOffRequestStatus timeOffRequestStatus, + @Nullable String companyId) { this.startDate = startDate; this.endDate = endDate; this.updatedSince = updatedSince; @@ -73,57 +66,50 @@ public TimeOffRequestsFilter( } public TimeOffRequestsFilter() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * Start date */ - @JsonIgnore public Optional startDate() { - return startDate; + return Optional.ofNullable(this.startDate); } /** * End date */ - @JsonIgnore public Optional endDate() { - return endDate; + return Optional.ofNullable(this.endDate); } /** * Minimum date the time off request was last created or modified */ - @JsonIgnore public Optional updatedSince() { - return updatedSince; + return Optional.ofNullable(this.updatedSince); } /** * Employee ID */ - @JsonIgnore public Optional employeeId() { - return employeeId; + return Optional.ofNullable(this.employeeId); } /** * Time off request status to filter on */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional timeOffRequestStatus() { - return (Optional) timeOffRequestStatus; + return Optional.ofNullable(this.timeOffRequestStatus); } /** * Company ID */ - @JsonIgnore public Optional companyId() { - return companyId; + return Optional.ofNullable(this.companyId); } public static Builder builder() { @@ -134,117 +120,57 @@ public static Builder builder() { /** * Start date */ - public TimeOffRequestsFilter withStartDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - - - /** - * Start date - */ - public TimeOffRequestsFilter withStartDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public TimeOffRequestsFilter withStartDate(@Nullable String startDate) { this.startDate = startDate; return this; } - /** - * End date - */ - public TimeOffRequestsFilter withEndDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * End date */ - public TimeOffRequestsFilter withEndDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public TimeOffRequestsFilter withEndDate(@Nullable String endDate) { this.endDate = endDate; return this; } - /** - * Minimum date the time off request was last created or modified - */ - public TimeOffRequestsFilter withUpdatedSince(String updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - /** * Minimum date the time off request was last created or modified */ - public TimeOffRequestsFilter withUpdatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public TimeOffRequestsFilter withUpdatedSince(@Nullable String updatedSince) { this.updatedSince = updatedSince; return this; } - /** - * Employee ID - */ - public TimeOffRequestsFilter withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = Optional.ofNullable(employeeId); - return this; - } - /** * Employee ID */ - public TimeOffRequestsFilter withEmployeeId(Optional employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public TimeOffRequestsFilter withEmployeeId(@Nullable String employeeId) { this.employeeId = employeeId; return this; } - /** - * Time off request status to filter on - */ - public TimeOffRequestsFilter withTimeOffRequestStatus(TimeOffRequestStatus timeOffRequestStatus) { - Utils.checkNotNull(timeOffRequestStatus, "timeOffRequestStatus"); - this.timeOffRequestStatus = Optional.ofNullable(timeOffRequestStatus); - return this; - } - /** * Time off request status to filter on */ - public TimeOffRequestsFilter withTimeOffRequestStatus(Optional timeOffRequestStatus) { - Utils.checkNotNull(timeOffRequestStatus, "timeOffRequestStatus"); + public TimeOffRequestsFilter withTimeOffRequestStatus(@Nullable TimeOffRequestStatus timeOffRequestStatus) { this.timeOffRequestStatus = timeOffRequestStatus; return this; } - /** - * Company ID - */ - public TimeOffRequestsFilter withCompanyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - /** * Company ID */ - public TimeOffRequestsFilter withCompanyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public TimeOffRequestsFilter withCompanyId(@Nullable String companyId) { this.companyId = companyId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -284,138 +210,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional startDate = Optional.empty(); + private String startDate; - private Optional endDate = Optional.empty(); + private String endDate; - private Optional updatedSince = Optional.empty(); + private String updatedSince; - private Optional employeeId = Optional.empty(); + private String employeeId; - private Optional timeOffRequestStatus = Optional.empty(); + private TimeOffRequestStatus timeOffRequestStatus; - private Optional companyId = Optional.empty(); + private String companyId; private Builder() { // force use of static builder() method } - /** * Start date */ - public Builder startDate(String startDate) { - Utils.checkNotNull(startDate, "startDate"); - this.startDate = Optional.ofNullable(startDate); - return this; - } - - /** - * Start date - */ - public Builder startDate(Optional startDate) { - Utils.checkNotNull(startDate, "startDate"); + public Builder startDate(@Nullable String startDate) { this.startDate = startDate; return this; } - - /** - * End date - */ - public Builder endDate(String endDate) { - Utils.checkNotNull(endDate, "endDate"); - this.endDate = Optional.ofNullable(endDate); - return this; - } - /** * End date */ - public Builder endDate(Optional endDate) { - Utils.checkNotNull(endDate, "endDate"); + public Builder endDate(@Nullable String endDate) { this.endDate = endDate; return this; } - - /** - * Minimum date the time off request was last created or modified - */ - public Builder updatedSince(String updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); - this.updatedSince = Optional.ofNullable(updatedSince); - return this; - } - /** * Minimum date the time off request was last created or modified */ - public Builder updatedSince(Optional updatedSince) { - Utils.checkNotNull(updatedSince, "updatedSince"); + public Builder updatedSince(@Nullable String updatedSince) { this.updatedSince = updatedSince; return this; } - - /** - * Employee ID - */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = Optional.ofNullable(employeeId); - return this; - } - /** * Employee ID */ - public Builder employeeId(Optional employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); + public Builder employeeId(@Nullable String employeeId) { this.employeeId = employeeId; return this; } - - /** - * Time off request status to filter on - */ - public Builder timeOffRequestStatus(TimeOffRequestStatus timeOffRequestStatus) { - Utils.checkNotNull(timeOffRequestStatus, "timeOffRequestStatus"); - this.timeOffRequestStatus = Optional.ofNullable(timeOffRequestStatus); - return this; - } - /** * Time off request status to filter on */ - public Builder timeOffRequestStatus(Optional timeOffRequestStatus) { - Utils.checkNotNull(timeOffRequestStatus, "timeOffRequestStatus"); + public Builder timeOffRequestStatus(@Nullable TimeOffRequestStatus timeOffRequestStatus) { this.timeOffRequestStatus = timeOffRequestStatus; return this; } - - /** - * Company ID - */ - public Builder companyId(String companyId) { - Utils.checkNotNull(companyId, "companyId"); - this.companyId = Optional.ofNullable(companyId); - return this; - } - /** * Company ID */ - public Builder companyId(Optional companyId) { - Utils.checkNotNull(companyId, "companyId"); + public Builder companyId(@Nullable String companyId) { this.companyId = companyId; return this; } public TimeOffRequestsFilter build() { - return new TimeOffRequestsFilter( startDate, endDate, updatedSince, employeeId, timeOffRequestStatus, companyId); diff --git a/src/main/java/com/apideck/unify/models/components/TlsSupport.java b/src/main/java/com/apideck/unify/models/components/TlsSupport.java index e76f80c0..e04471a0 100644 --- a/src/main/java/com/apideck/unify/models/components/TlsSupport.java +++ b/src/main/java/com/apideck/unify/models/components/TlsSupport.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,40 +18,36 @@ public class TlsSupport { @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private Optional type; + private String type; /** * Description of the TLS support */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("description") - private Optional description; + private String description; @JsonCreator public TlsSupport( - @JsonProperty("type") Optional type, - @JsonProperty("description") Optional description) { - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(description, "description"); + @JsonProperty("type") @Nullable String type, + @JsonProperty("description") @Nullable String description) { this.type = type; this.description = description; } public TlsSupport() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @JsonIgnore public Optional type() { - return type; + return Optional.ofNullable(this.type); } /** * Description of the TLS support */ - @JsonIgnore public Optional description() { - return description; + return Optional.ofNullable(this.description); } public static Builder builder() { @@ -59,38 +55,21 @@ public static Builder builder() { } - public TlsSupport withType(String type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - - public TlsSupport withType(Optional type) { - Utils.checkNotNull(type, "type"); + public TlsSupport withType(@Nullable String type) { this.type = type; return this; } - /** - * Description of the TLS support - */ - public TlsSupport withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = Optional.ofNullable(description); - return this; - } - /** * Description of the TLS support */ - public TlsSupport withDescription(Optional description) { - Utils.checkNotNull(description, "description"); + public TlsSupport withDescription(@Nullable String description) { this.description = description; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,48 +100,28 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional type = Optional.empty(); + private String type; - private Optional description = Optional.empty(); + private String description; private Builder() { // force use of static builder() method } - - public Builder type(String type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable String type) { this.type = type; return this; } - /** * Description of the TLS support */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); - this.description = Optional.ofNullable(description); - return this; - } - - /** - * Description of the TLS support - */ - public Builder description(Optional description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = description; return this; } public TlsSupport build() { - return new TlsSupport( type, description); } diff --git a/src/main/java/com/apideck/unify/models/components/TrackingCategory.java b/src/main/java/com/apideck/unify/models/components/TrackingCategory.java index 40174780..1e7c69b5 100644 --- a/src/main/java/com/apideck/unify/models/components/TrackingCategory.java +++ b/src/main/java/com/apideck/unify/models/components/TrackingCategory.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -26,7 +25,7 @@ public class TrackingCategory { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * A unique identifier for an object. @@ -40,7 +39,7 @@ public class TrackingCategory { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * The code of the tracking category. @@ -54,14 +53,14 @@ public class TrackingCategory { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private TrackingCategoryStatus status; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -103,172 +102,150 @@ public class TrackingCategory { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; /** * The subsidiaries the account belongs to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiaries") - private Optional> subsidiaries; + private List subsidiaries; @JsonCreator public TrackingCategory( - @JsonProperty("id") Optional id, - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("name") Optional name, - @JsonProperty("code") JsonNullable code, - @JsonProperty("status") Optional status, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough, - @JsonProperty("subsidiaries") Optional> subsidiaries) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(subsidiaries, "subsidiaries"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("name") @Nullable String name, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("status") @Nullable TrackingCategoryStatus status, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough, + @JsonProperty("subsidiaries") @Nullable List subsidiaries) { this.id = id; - this.parentId = parentId; + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); this.name = name; - this.code = code; + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); this.status = status; - this.customMappings = customMappings; - this.rowVersion = rowVersion; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; this.subsidiaries = subsidiaries; } public TrackingCategory() { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The name of the tracking category. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The code of the tracking category. */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Based on the status some functionality is enabled or disabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The subsidiaries the account belongs to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subsidiaries() { - return (Optional>) subsidiaries; + return Optional.ofNullable(this.subsidiaries); } public static Builder builder() { @@ -279,46 +256,17 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public TrackingCategory withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public TrackingCategory withId(Optional id) { - Utils.checkNotNull(id, "id"); + public TrackingCategory withId(@Nullable String id) { this.id = id; return this; } - /** - * A unique identifier for an object. - */ - public TrackingCategory withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = JsonNullable.of(parentId); - return this; - } /** * A unique identifier for an object. */ - public TrackingCategory withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** - * The name of the tracking category. - */ - public TrackingCategory withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); + public TrackingCategory withParentId(@Nullable String parentId) { + this.parentId = JsonNullable.of(parentId); return this; } @@ -326,36 +274,17 @@ public TrackingCategory withName(String name) { /** * The name of the tracking category. */ - public TrackingCategory withName(Optional name) { - Utils.checkNotNull(name, "name"); + public TrackingCategory withName(@Nullable String name) { this.name = name; return this; } - /** - * The code of the tracking category. - */ - public TrackingCategory withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = JsonNullable.of(code); - return this; - } /** * The code of the tracking category. */ - public TrackingCategory withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public TrackingCategory withStatus(TrackingCategoryStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); + public TrackingCategory withCode(@Nullable String code) { + this.code = JsonNullable.of(code); return this; } @@ -363,158 +292,84 @@ public TrackingCategory withStatus(TrackingCategoryStatus status) { /** * Based on the status some functionality is enabled or disabled. */ - public TrackingCategory withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public TrackingCategory withStatus(@Nullable TrackingCategoryStatus status) { this.status = status; return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public TrackingCategory withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public TrackingCategory withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public TrackingCategory withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public TrackingCategory withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public TrackingCategory withRowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public TrackingCategory withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } /** * The user who last updated the object. */ - public TrackingCategory withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public TrackingCategory withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public TrackingCategory withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public TrackingCategory withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public TrackingCategory withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public TrackingCategory withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public TrackingCategory withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public TrackingCategory withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public TrackingCategory withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public TrackingCategory withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public TrackingCategory withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public TrackingCategory withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public TrackingCategory withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public TrackingCategory withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public TrackingCategory withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** - * The subsidiaries the account belongs to. - */ - public TrackingCategory withSubsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - /** * The subsidiaries the account belongs to. */ - public TrackingCategory withSubsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public TrackingCategory withSubsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -571,285 +426,141 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private Optional name = Optional.empty(); + private String name; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private Optional status = Optional.empty(); + private TrackingCategoryStatus status; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; - private Optional> subsidiaries = Optional.empty(); + private List subsidiaries; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * A unique identifier for an object. */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - - /** - * The name of the tracking category. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the tracking category. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * The code of the tracking category. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code of the tracking category. - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Based on the status some functionality is enabled or disabled. */ - public Builder status(TrackingCategoryStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable TrackingCategoryStatus status) { this.status = status; return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - - /** - * The subsidiaries the account belongs to. - */ - public Builder subsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - /** * The subsidiaries the account belongs to. */ - public Builder subsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public Builder subsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } public TrackingCategory build() { - return new TrackingCategory( id, parentId, name, code, status, customMappings, diff --git a/src/main/java/com/apideck/unify/models/components/TrackingCategoryInput.java b/src/main/java/com/apideck/unify/models/components/TrackingCategoryInput.java index 625f66ec..e9cb75e5 100644 --- a/src/main/java/com/apideck/unify/models/components/TrackingCategoryInput.java +++ b/src/main/java/com/apideck/unify/models/components/TrackingCategoryInput.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,7 +29,7 @@ public class TrackingCategoryInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * The code of the tracking category. @@ -44,7 +43,7 @@ public class TrackingCategoryInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private TrackingCategoryStatus status; /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. @@ -58,103 +57,89 @@ public class TrackingCategoryInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; /** * The subsidiaries the account belongs to. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("subsidiaries") - private Optional> subsidiaries; + private List subsidiaries; @JsonCreator public TrackingCategoryInput( - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("name") Optional name, - @JsonProperty("code") JsonNullable code, - @JsonProperty("status") Optional status, - @JsonProperty("row_version") JsonNullable rowVersion, - @JsonProperty("pass_through") Optional> passThrough, - @JsonProperty("subsidiaries") Optional> subsidiaries) { - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(rowVersion, "rowVersion"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.parentId = parentId; + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("name") @Nullable String name, + @JsonProperty("code") @Nullable JsonNullable code, + @JsonProperty("status") @Nullable TrackingCategoryStatus status, + @JsonProperty("row_version") @Nullable JsonNullable rowVersion, + @JsonProperty("pass_through") @Nullable List passThrough, + @JsonProperty("subsidiaries") @Nullable List subsidiaries) { + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); this.name = name; - this.code = code; + this.code = Optional.ofNullable(code) + .orElse(JsonNullable.undefined()); this.status = status; - this.rowVersion = rowVersion; + this.rowVersion = Optional.ofNullable(rowVersion) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; this.subsidiaries = subsidiaries; } public TrackingCategoryInput() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } /** * A unique identifier for an object. */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The name of the tracking category. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * The code of the tracking category. */ - @JsonIgnore public JsonNullable code() { - return code; + return this.code; } /** * Based on the status some functionality is enabled or disabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - @JsonIgnore public JsonNullable rowVersion() { - return rowVersion; + return this.rowVersion; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The subsidiaries the account belongs to. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> subsidiaries() { - return (Optional>) subsidiaries; + return Optional.ofNullable(this.subsidiaries); } public static Builder builder() { @@ -165,64 +150,26 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public TrackingCategoryInput withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public TrackingCategoryInput withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public TrackingCategoryInput withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** - * The name of the tracking category. - */ - public TrackingCategoryInput withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the tracking category. */ - public TrackingCategoryInput withName(Optional name) { - Utils.checkNotNull(name, "name"); + public TrackingCategoryInput withName(@Nullable String name) { this.name = name; return this; } - /** - * The code of the tracking category. - */ - public TrackingCategoryInput withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = JsonNullable.of(code); - return this; - } /** * The code of the tracking category. */ - public TrackingCategoryInput withCode(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public TrackingCategoryInput withStatus(TrackingCategoryStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); + public TrackingCategoryInput withCode(@Nullable String code) { + this.code = JsonNullable.of(code); return this; } @@ -230,36 +177,17 @@ public TrackingCategoryInput withStatus(TrackingCategoryStatus status) { /** * Based on the status some functionality is enabled or disabled. */ - public TrackingCategoryInput withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public TrackingCategoryInput withStatus(@Nullable TrackingCategoryStatus status) { this.status = status; return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public TrackingCategoryInput withRowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = JsonNullable.of(rowVersion); - return this; - } /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public TrackingCategoryInput withRowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public TrackingCategoryInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public TrackingCategoryInput withRowVersion(@Nullable String rowVersion) { + this.rowVersion = JsonNullable.of(rowVersion); return this; } @@ -267,31 +195,21 @@ public TrackingCategoryInput withPassThrough(List passThrough) /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public TrackingCategoryInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public TrackingCategoryInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** - * The subsidiaries the account belongs to. - */ - public TrackingCategoryInput withSubsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - /** * The subsidiaries the account belongs to. */ - public TrackingCategoryInput withSubsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public TrackingCategoryInput withSubsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -334,159 +252,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private Optional name = Optional.empty(); + private String name; - private JsonNullable code = JsonNullable.undefined(); + private JsonNullable code; - private Optional status = Optional.empty(); + private TrackingCategoryStatus status; - private JsonNullable rowVersion = JsonNullable.undefined(); + private JsonNullable rowVersion; - private Optional> passThrough = Optional.empty(); + private List passThrough; - private Optional> subsidiaries = Optional.empty(); + private List subsidiaries; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * A unique identifier for an object. - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - - /** - * The name of the tracking category. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * The name of the tracking category. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * The code of the tracking category. */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = JsonNullable.of(code); return this; } - /** - * The code of the tracking category. - */ - public Builder code(JsonNullable code) { - Utils.checkNotNull(code, "code"); - this.code = code; - return this; - } - - /** * Based on the status some functionality is enabled or disabled. */ - public Builder status(TrackingCategoryStatus status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - - /** - * Based on the status some functionality is enabled or disabled. - */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable TrackingCategoryStatus status) { this.status = status; return this; } - /** * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. */ - public Builder rowVersion(String rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); + public Builder rowVersion(@Nullable String rowVersion) { this.rowVersion = JsonNullable.of(rowVersion); return this; } - /** - * A binary value used to detect updates to a object and prevent data conflicts. It is incremented each time an update is made to the object. - */ - public Builder rowVersion(JsonNullable rowVersion) { - Utils.checkNotNull(rowVersion, "rowVersion"); - this.rowVersion = rowVersion; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } - /** * The subsidiaries the account belongs to. */ - public Builder subsidiaries(List subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); - this.subsidiaries = Optional.ofNullable(subsidiaries); - return this; - } - - /** - * The subsidiaries the account belongs to. - */ - public Builder subsidiaries(Optional> subsidiaries) { - Utils.checkNotNull(subsidiaries, "subsidiaries"); + public Builder subsidiaries(@Nullable List subsidiaries) { this.subsidiaries = subsidiaries; return this; } public TrackingCategoryInput build() { - return new TrackingCategoryInput( parentId, name, code, status, rowVersion, passThrough, diff --git a/src/main/java/com/apideck/unify/models/components/TrackingCategorySubsidiaries.java b/src/main/java/com/apideck/unify/models/components/TrackingCategorySubsidiaries.java index be2464df..4d3b64ee 100644 --- a/src/main/java/com/apideck/unify/models/components/TrackingCategorySubsidiaries.java +++ b/src/main/java/com/apideck/unify/models/components/TrackingCategorySubsidiaries.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -20,25 +20,23 @@ public class TrackingCategorySubsidiaries { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; @JsonCreator public TrackingCategorySubsidiaries( - @JsonProperty("id") Optional id) { - Utils.checkNotNull(id, "id"); + @JsonProperty("id") @Nullable String id) { this.id = id; } public TrackingCategorySubsidiaries() { - this(Optional.empty()); + this(null); } /** * The ID of the subsidiary. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } public static Builder builder() { @@ -49,22 +47,12 @@ public static Builder builder() { /** * The ID of the subsidiary. */ - public TrackingCategorySubsidiaries withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The ID of the subsidiary. - */ - public TrackingCategorySubsidiaries withId(Optional id) { - Utils.checkNotNull(id, "id"); + public TrackingCategorySubsidiaries withId(@Nullable String id) { this.id = id; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -93,33 +81,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; private Builder() { // force use of static builder() method } - - /** - * The ID of the subsidiary. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * The ID of the subsidiary. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } public TrackingCategorySubsidiaries build() { - return new TrackingCategorySubsidiaries( id); } diff --git a/src/main/java/com/apideck/unify/models/components/TrackingItem.java b/src/main/java/com/apideck/unify/models/components/TrackingItem.java index 106d4120..28e27457 100644 --- a/src/main/java/com/apideck/unify/models/components/TrackingItem.java +++ b/src/main/java/com/apideck/unify/models/components/TrackingItem.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.time.OffsetDateTime; @@ -26,14 +26,14 @@ public class TrackingItem { */ @JsonInclude(Include.ALWAYS) @JsonProperty("provider") - private Optional provider; + private JsonNullable provider; /** * The tracking number associated with the shipment, which can be used to track the progress of the delivery. */ @JsonInclude(Include.ALWAYS) @JsonProperty("number") - private Optional number; + private JsonNullable number; /** * The URL of the carrier's tracking page, which can be used to view detailed information about the shipment's progress. @@ -51,55 +51,49 @@ public class TrackingItem { @JsonCreator public TrackingItem( - @JsonProperty("provider") Optional provider, - @JsonProperty("number") Optional number, - @JsonProperty("url") JsonNullable url, - @JsonProperty("updated_at") JsonNullable updatedAt) { - Utils.checkNotNull(provider, "provider"); - Utils.checkNotNull(number, "number"); - Utils.checkNotNull(url, "url"); - Utils.checkNotNull(updatedAt, "updatedAt"); - this.provider = provider; - this.number = number; - this.url = url; - this.updatedAt = updatedAt; + @JsonProperty("provider") @Nullable String provider, + @JsonProperty("number") @Nullable String number, + @JsonProperty("url") @Nullable JsonNullable url, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt) { + this.provider = JsonNullable.of(provider); + this.number = JsonNullable.of(number); + this.url = Optional.ofNullable(url) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); } public TrackingItem() { - this(Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined()); + this(null, null, null, + null); } /** * The name or code of the carrier or shipping company that is handling the shipment. */ - @JsonIgnore - public Optional provider() { - return provider; + public JsonNullable provider() { + return this.provider; } /** * The tracking number associated with the shipment, which can be used to track the progress of the delivery. */ - @JsonIgnore - public Optional number() { - return number; + public JsonNullable number() { + return this.number; } /** * The URL of the carrier's tracking page, which can be used to view detailed information about the shipment's progress. */ - @JsonIgnore public JsonNullable url() { - return url; + return this.url; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } public static Builder builder() { @@ -110,76 +104,38 @@ public static Builder builder() { /** * The name or code of the carrier or shipping company that is handling the shipment. */ - public TrackingItem withProvider(String provider) { - Utils.checkNotNull(provider, "provider"); - this.provider = Optional.ofNullable(provider); + public TrackingItem withProvider(@Nullable String provider) { + this.provider = JsonNullable.of(provider); return this; } - /** - * The name or code of the carrier or shipping company that is handling the shipment. - */ - public TrackingItem withProvider(Optional provider) { - Utils.checkNotNull(provider, "provider"); - this.provider = provider; - return this; - } - /** * The tracking number associated with the shipment, which can be used to track the progress of the delivery. */ - public TrackingItem withNumber(String number) { - Utils.checkNotNull(number, "number"); - this.number = Optional.ofNullable(number); + public TrackingItem withNumber(@Nullable String number) { + this.number = JsonNullable.of(number); return this; } - /** - * The tracking number associated with the shipment, which can be used to track the progress of the delivery. - */ - public TrackingItem withNumber(Optional number) { - Utils.checkNotNull(number, "number"); - this.number = number; - return this; - } - /** * The URL of the carrier's tracking page, which can be used to view detailed information about the shipment's progress. */ - public TrackingItem withUrl(String url) { - Utils.checkNotNull(url, "url"); + public TrackingItem withUrl(@Nullable String url) { this.url = JsonNullable.of(url); return this; } - /** - * The URL of the carrier's tracking page, which can be used to view detailed information about the shipment's progress. - */ - public TrackingItem withUrl(JsonNullable url) { - Utils.checkNotNull(url, "url"); - this.url = url; - return this; - } /** * The date and time when the object was last updated. */ - public TrackingItem withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public TrackingItem withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public TrackingItem withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -216,96 +172,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional provider = Optional.empty(); + private String provider; - private Optional number = Optional.empty(); + private String number; - private JsonNullable url = JsonNullable.undefined(); + private JsonNullable url; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; private Builder() { // force use of static builder() method } - /** * The name or code of the carrier or shipping company that is handling the shipment. */ - public Builder provider(String provider) { - Utils.checkNotNull(provider, "provider"); - this.provider = Optional.ofNullable(provider); - return this; - } - - /** - * The name or code of the carrier or shipping company that is handling the shipment. - */ - public Builder provider(Optional provider) { - Utils.checkNotNull(provider, "provider"); + public Builder provider(@Nullable String provider) { this.provider = provider; return this; } - /** * The tracking number associated with the shipment, which can be used to track the progress of the delivery. */ - public Builder number(String number) { - Utils.checkNotNull(number, "number"); - this.number = Optional.ofNullable(number); - return this; - } - - /** - * The tracking number associated with the shipment, which can be used to track the progress of the delivery. - */ - public Builder number(Optional number) { - Utils.checkNotNull(number, "number"); + public Builder number(@Nullable String number) { this.number = number; return this; } - /** * The URL of the carrier's tracking page, which can be used to view detailed information about the shipment's progress. */ - public Builder url(String url) { - Utils.checkNotNull(url, "url"); + public Builder url(@Nullable String url) { this.url = JsonNullable.of(url); return this; } - /** - * The URL of the carrier's tracking page, which can be used to view detailed information about the shipment's progress. - */ - public Builder url(JsonNullable url) { - Utils.checkNotNull(url, "url"); - this.url = url; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - public TrackingItem build() { - return new TrackingItem( provider, number, url, updatedAt); diff --git a/src/main/java/com/apideck/unify/models/components/Transactions.java b/src/main/java/com/apideck/unify/models/components/Transactions.java index 51f2307c..1914558f 100644 --- a/src/main/java/com/apideck/unify/models/components/Transactions.java +++ b/src/main/java/com/apideck/unify/models/components/Transactions.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Double; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.Optional; @@ -29,7 +28,7 @@ public class Transactions { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("description") - private Optional description; + private String description; /** * The amount of the transaction. @@ -54,123 +53,109 @@ public class Transactions { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("counterparty") - private Optional counterparty; + private String counterparty; /** * The reference of the transaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("reference") - private Optional reference; + private String reference; /** * Type of transaction. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("transaction_type") - private Optional transactionType; + private BankFeedStatementTransactionType transactionType; @JsonCreator public Transactions( - @JsonProperty("posted_date") OffsetDateTime postedDate, - @JsonProperty("description") Optional description, + @JsonProperty("posted_date") @Nonnull OffsetDateTime postedDate, + @JsonProperty("description") @Nullable String description, @JsonProperty("amount") double amount, - @JsonProperty("credit_or_debit") CreditOrDebit creditOrDebit, - @JsonProperty("source_transaction_id") String sourceTransactionId, - @JsonProperty("counterparty") Optional counterparty, - @JsonProperty("reference") Optional reference, - @JsonProperty("transaction_type") Optional transactionType) { - Utils.checkNotNull(postedDate, "postedDate"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(amount, "amount"); - Utils.checkNotNull(creditOrDebit, "creditOrDebit"); - Utils.checkNotNull(sourceTransactionId, "sourceTransactionId"); - Utils.checkNotNull(counterparty, "counterparty"); - Utils.checkNotNull(reference, "reference"); - Utils.checkNotNull(transactionType, "transactionType"); - this.postedDate = postedDate; + @JsonProperty("credit_or_debit") @Nonnull CreditOrDebit creditOrDebit, + @JsonProperty("source_transaction_id") @Nonnull String sourceTransactionId, + @JsonProperty("counterparty") @Nullable String counterparty, + @JsonProperty("reference") @Nullable String reference, + @JsonProperty("transaction_type") @Nullable BankFeedStatementTransactionType transactionType) { + this.postedDate = Optional.ofNullable(postedDate) + .orElseThrow(() -> new IllegalArgumentException("postedDate cannot be null")); this.description = description; this.amount = amount; - this.creditOrDebit = creditOrDebit; - this.sourceTransactionId = sourceTransactionId; + this.creditOrDebit = Optional.ofNullable(creditOrDebit) + .orElseThrow(() -> new IllegalArgumentException("creditOrDebit cannot be null")); + this.sourceTransactionId = Optional.ofNullable(sourceTransactionId) + .orElseThrow(() -> new IllegalArgumentException("sourceTransactionId cannot be null")); this.counterparty = counterparty; this.reference = reference; this.transactionType = transactionType; } public Transactions( - OffsetDateTime postedDate, + @Nonnull OffsetDateTime postedDate, double amount, - CreditOrDebit creditOrDebit, - String sourceTransactionId) { - this(postedDate, Optional.empty(), amount, - creditOrDebit, sourceTransactionId, Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull CreditOrDebit creditOrDebit, + @Nonnull String sourceTransactionId) { + this(postedDate, null, amount, + creditOrDebit, sourceTransactionId, null, + null, null); } /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - @JsonIgnore public OffsetDateTime postedDate() { - return postedDate; + return this.postedDate; } /** * A description of the transaction. */ - @JsonIgnore public Optional description() { - return description; + return Optional.ofNullable(this.description); } /** * The amount of the transaction. */ - @JsonIgnore public double amount() { - return amount; + return this.amount; } /** * Whether the amount is a credit or debit. */ - @JsonIgnore public CreditOrDebit creditOrDebit() { - return creditOrDebit; + return this.creditOrDebit; } /** * The ID of the source transaction. */ - @JsonIgnore public String sourceTransactionId() { - return sourceTransactionId; + return this.sourceTransactionId; } /** * The counterparty of the transaction. */ - @JsonIgnore public Optional counterparty() { - return counterparty; + return Optional.ofNullable(this.counterparty); } /** * The reference of the transaction. */ - @JsonIgnore public Optional reference() { - return reference; + return Optional.ofNullable(this.reference); } /** * Type of transaction. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional transactionType() { - return (Optional) transactionType; + return Optional.ofNullable(this.transactionType); } public static Builder builder() { @@ -181,18 +166,8 @@ public static Builder builder() { /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public Transactions withPostedDate(OffsetDateTime postedDate) { - Utils.checkNotNull(postedDate, "postedDate"); - this.postedDate = postedDate; - return this; - } - - /** - * A description of the transaction. - */ - public Transactions withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = Optional.ofNullable(description); + public Transactions withPostedDate(@Nonnull OffsetDateTime postedDate) { + this.postedDate = Utils.checkNotNull(postedDate, "postedDate"); return this; } @@ -200,45 +175,35 @@ public Transactions withDescription(String description) { /** * A description of the transaction. */ - public Transactions withDescription(Optional description) { - Utils.checkNotNull(description, "description"); + public Transactions withDescription(@Nullable String description) { this.description = description; return this; } + /** * The amount of the transaction. */ public Transactions withAmount(double amount) { - Utils.checkNotNull(amount, "amount"); this.amount = amount; return this; } + /** * Whether the amount is a credit or debit. */ - public Transactions withCreditOrDebit(CreditOrDebit creditOrDebit) { - Utils.checkNotNull(creditOrDebit, "creditOrDebit"); - this.creditOrDebit = creditOrDebit; + public Transactions withCreditOrDebit(@Nonnull CreditOrDebit creditOrDebit) { + this.creditOrDebit = Utils.checkNotNull(creditOrDebit, "creditOrDebit"); return this; } - /** - * The ID of the source transaction. - */ - public Transactions withSourceTransactionId(String sourceTransactionId) { - Utils.checkNotNull(sourceTransactionId, "sourceTransactionId"); - this.sourceTransactionId = sourceTransactionId; - return this; - } /** - * The counterparty of the transaction. + * The ID of the source transaction. */ - public Transactions withCounterparty(String counterparty) { - Utils.checkNotNull(counterparty, "counterparty"); - this.counterparty = Optional.ofNullable(counterparty); + public Transactions withSourceTransactionId(@Nonnull String sourceTransactionId) { + this.sourceTransactionId = Utils.checkNotNull(sourceTransactionId, "sourceTransactionId"); return this; } @@ -246,50 +211,30 @@ public Transactions withCounterparty(String counterparty) { /** * The counterparty of the transaction. */ - public Transactions withCounterparty(Optional counterparty) { - Utils.checkNotNull(counterparty, "counterparty"); + public Transactions withCounterparty(@Nullable String counterparty) { this.counterparty = counterparty; return this; } - /** - * The reference of the transaction. - */ - public Transactions withReference(String reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = Optional.ofNullable(reference); - return this; - } - /** * The reference of the transaction. */ - public Transactions withReference(Optional reference) { - Utils.checkNotNull(reference, "reference"); + public Transactions withReference(@Nullable String reference) { this.reference = reference; return this; } - /** - * Type of transaction. - */ - public Transactions withTransactionType(BankFeedStatementTransactionType transactionType) { - Utils.checkNotNull(transactionType, "transactionType"); - this.transactionType = Optional.ofNullable(transactionType); - return this; - } - /** * Type of transaction. */ - public Transactions withTransactionType(Optional transactionType) { - Utils.checkNotNull(transactionType, "transactionType"); + public Transactions withTransactionType(@Nullable BankFeedStatementTransactionType transactionType) { this.transactionType = transactionType; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -336,142 +281,89 @@ public final static class Builder { private OffsetDateTime postedDate; - private Optional description = Optional.empty(); + private String description; - private Double amount; + private double amount; private CreditOrDebit creditOrDebit; private String sourceTransactionId; - private Optional counterparty = Optional.empty(); + private String counterparty; - private Optional reference = Optional.empty(); + private String reference; - private Optional transactionType = Optional.empty(); + private BankFeedStatementTransactionType transactionType; private Builder() { // force use of static builder() method } - /** * The date of the transaction - YYYY:MM::DDThh:mm:ss.sTZD */ - public Builder postedDate(OffsetDateTime postedDate) { - Utils.checkNotNull(postedDate, "postedDate"); - this.postedDate = postedDate; + public Builder postedDate(@Nonnull OffsetDateTime postedDate) { + this.postedDate = Utils.checkNotNull(postedDate, "postedDate"); return this; } - /** * A description of the transaction. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); - this.description = Optional.ofNullable(description); - return this; - } - - /** - * A description of the transaction. - */ - public Builder description(Optional description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = description; return this; } - /** * The amount of the transaction. */ public Builder amount(double amount) { - Utils.checkNotNull(amount, "amount"); this.amount = amount; return this; } - /** * Whether the amount is a credit or debit. */ - public Builder creditOrDebit(CreditOrDebit creditOrDebit) { - Utils.checkNotNull(creditOrDebit, "creditOrDebit"); - this.creditOrDebit = creditOrDebit; + public Builder creditOrDebit(@Nonnull CreditOrDebit creditOrDebit) { + this.creditOrDebit = Utils.checkNotNull(creditOrDebit, "creditOrDebit"); return this; } - /** * The ID of the source transaction. */ - public Builder sourceTransactionId(String sourceTransactionId) { - Utils.checkNotNull(sourceTransactionId, "sourceTransactionId"); - this.sourceTransactionId = sourceTransactionId; - return this; - } - - - /** - * The counterparty of the transaction. - */ - public Builder counterparty(String counterparty) { - Utils.checkNotNull(counterparty, "counterparty"); - this.counterparty = Optional.ofNullable(counterparty); + public Builder sourceTransactionId(@Nonnull String sourceTransactionId) { + this.sourceTransactionId = Utils.checkNotNull(sourceTransactionId, "sourceTransactionId"); return this; } /** * The counterparty of the transaction. */ - public Builder counterparty(Optional counterparty) { - Utils.checkNotNull(counterparty, "counterparty"); + public Builder counterparty(@Nullable String counterparty) { this.counterparty = counterparty; return this; } - - /** - * The reference of the transaction. - */ - public Builder reference(String reference) { - Utils.checkNotNull(reference, "reference"); - this.reference = Optional.ofNullable(reference); - return this; - } - /** * The reference of the transaction. */ - public Builder reference(Optional reference) { - Utils.checkNotNull(reference, "reference"); + public Builder reference(@Nullable String reference) { this.reference = reference; return this; } - /** * Type of transaction. */ - public Builder transactionType(BankFeedStatementTransactionType transactionType) { - Utils.checkNotNull(transactionType, "transactionType"); - this.transactionType = Optional.ofNullable(transactionType); - return this; - } - - /** - * Type of transaction. - */ - public Builder transactionType(Optional transactionType) { - Utils.checkNotNull(transactionType, "transactionType"); + public Builder transactionType(@Nullable BankFeedStatementTransactionType transactionType) { this.transactionType = transactionType; return this; } public Transactions build() { - return new Transactions( postedDate, description, amount, creditOrDebit, sourceTransactionId, counterparty, diff --git a/src/main/java/com/apideck/unify/models/components/UncategorizedAccounts.java b/src/main/java/com/apideck/unify/models/components/UncategorizedAccounts.java index d9fc82ca..aa81483b 100644 --- a/src/main/java/com/apideck/unify/models/components/UncategorizedAccounts.java +++ b/src/main/java/com/apideck/unify/models/components/UncategorizedAccounts.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -28,35 +28,35 @@ public class UncategorizedAccounts { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The account code of the account */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("code") - private Optional code; + private String code; /** * The name of the account. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("title") - private Optional title; + private String title; /** * The type of profit and loss */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; /** * The aggregated total of all accounts within this category. */ @JsonInclude(Include.ALWAYS) @JsonProperty("total") - private Optional total; + private JsonNullable total; @JsonProperty("records") @@ -64,76 +64,65 @@ public class UncategorizedAccounts { @JsonCreator public UncategorizedAccounts( - @JsonProperty("id") Optional id, - @JsonProperty("code") Optional code, - @JsonProperty("title") Optional title, - @JsonProperty("type") JsonNullable type, - @JsonProperty("total") Optional total, - @JsonProperty("records") Object records) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(code, "code"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(total, "total"); - Utils.checkNotNull(records, "records"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("code") @Nullable String code, + @JsonProperty("title") @Nullable String title, + @JsonProperty("type") @Nullable JsonNullable type, + @JsonProperty("total") @Nullable Double total, + @JsonProperty("records") @Nonnull Object records) { this.id = id; this.code = code; this.title = title; - this.type = type; - this.total = total; - this.records = records; + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); + this.total = JsonNullable.of(total); + this.records = Optional.ofNullable(records) + .orElseThrow(() -> new IllegalArgumentException("records cannot be null")); } public UncategorizedAccounts( - Object records) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), records); + @Nonnull Object records) { + this(null, null, null, + null, null, records); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The account code of the account */ - @JsonIgnore public Optional code() { - return code; + return Optional.ofNullable(this.code); } /** * The name of the account. */ - @JsonIgnore public Optional title() { - return title; + return Optional.ofNullable(this.title); } /** * The type of profit and loss */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } /** * The aggregated total of all accounts within this category. */ - @JsonIgnore - public Optional total() { - return total; + public JsonNullable total() { + return this.total; } - @JsonIgnore public Object records() { - return records; + return this.records; } public static Builder builder() { @@ -144,102 +133,53 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public UncategorizedAccounts withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public UncategorizedAccounts withId(Optional id) { - Utils.checkNotNull(id, "id"); + public UncategorizedAccounts withId(@Nullable String id) { this.id = id; return this; } - /** - * The account code of the account - */ - public UncategorizedAccounts withCode(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - /** * The account code of the account */ - public UncategorizedAccounts withCode(Optional code) { - Utils.checkNotNull(code, "code"); + public UncategorizedAccounts withCode(@Nullable String code) { this.code = code; return this; } - /** - * The name of the account. - */ - public UncategorizedAccounts withTitle(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public UncategorizedAccounts withTitle(Optional title) { - Utils.checkNotNull(title, "title"); + public UncategorizedAccounts withTitle(@Nullable String title) { this.title = title; return this; } + /** * The type of profit and loss */ - public UncategorizedAccounts withType(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public UncategorizedAccounts withType(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public UncategorizedAccounts withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } /** * The aggregated total of all accounts within this category. */ - public UncategorizedAccounts withTotal(double total) { - Utils.checkNotNull(total, "total"); - this.total = Optional.ofNullable(total); + public UncategorizedAccounts withTotal(@Nullable Double total) { + this.total = JsonNullable.of(total); return this; } - /** - * The aggregated total of all accounts within this category. - */ - public UncategorizedAccounts withTotal(Optional total) { - Utils.checkNotNull(total, "total"); - this.total = total; + public UncategorizedAccounts withRecords(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } - public UncategorizedAccounts withRecords(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -280,15 +220,15 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional code = Optional.empty(); + private String code; - private Optional title = Optional.empty(); + private String title; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; - private Optional total = Optional.empty(); + private Double total; private Object records; @@ -296,110 +236,52 @@ private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * A unique identifier for an object. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The account code of the account */ - public Builder code(String code) { - Utils.checkNotNull(code, "code"); - this.code = Optional.ofNullable(code); - return this; - } - - /** - * The account code of the account - */ - public Builder code(Optional code) { - Utils.checkNotNull(code, "code"); + public Builder code(@Nullable String code) { this.code = code; return this; } - - /** - * The name of the account. - */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); - this.title = Optional.ofNullable(title); - return this; - } - /** * The name of the account. */ - public Builder title(Optional title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = title; return this; } - /** * The type of profit and loss */ - public Builder type(ProfitAndLossType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ProfitAndLossType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of profit and loss - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - - - /** - * The aggregated total of all accounts within this category. - */ - public Builder total(double total) { - Utils.checkNotNull(total, "total"); - this.total = Optional.ofNullable(total); - return this; - } - /** * The aggregated total of all accounts within this category. */ - public Builder total(Optional total) { - Utils.checkNotNull(total, "total"); + public Builder total(@Nullable Double total) { this.total = total; return this; } - - public Builder records(Object records) { - Utils.checkNotNull(records, "records"); - this.records = records; + public Builder records(@Nonnull Object records) { + this.records = Utils.checkNotNull(records, "records"); return this; } public UncategorizedAccounts build() { - return new UncategorizedAccounts( id, code, title, type, total, records); diff --git a/src/main/java/com/apideck/unify/models/components/UnexpectedErrorResponse.java b/src/main/java/com/apideck/unify/models/components/UnexpectedErrorResponse.java index fbbed1c2..31b2b84c 100644 --- a/src/main/java/com/apideck/unify/models/components/UnexpectedErrorResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UnexpectedErrorResponse.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; /** @@ -26,57 +25,51 @@ public class UnexpectedErrorResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status_code") - private Optional statusCode; + private Double statusCode; /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("error") - private Optional error; + private String error; /** * The type of error returned */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type_name") - private Optional typeName; + private String typeName; /** * A human-readable message providing more details about the error. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") - private Optional message; + private String message; /** * Contains parameter or domain specific information related to the error and why it occurred. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("detail") - private Optional detail; + private Detail detail; /** * Link to documentation of error type */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("ref") - private Optional ref; + private String ref; @JsonCreator public UnexpectedErrorResponse( - @JsonProperty("status_code") Optional statusCode, - @JsonProperty("error") Optional error, - @JsonProperty("type_name") Optional typeName, - @JsonProperty("message") Optional message, - @JsonProperty("detail") Optional detail, - @JsonProperty("ref") Optional ref) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(error, "error"); - Utils.checkNotNull(typeName, "typeName"); - Utils.checkNotNull(message, "message"); - Utils.checkNotNull(detail, "detail"); - Utils.checkNotNull(ref, "ref"); + @JsonProperty("status_code") @Nullable Double statusCode, + @JsonProperty("error") @Nullable String error, + @JsonProperty("type_name") @Nullable String typeName, + @JsonProperty("message") @Nullable String message, + @JsonProperty("detail") @Nullable Detail detail, + @JsonProperty("ref") @Nullable String ref) { this.statusCode = statusCode; this.error = error; this.typeName = typeName; @@ -86,57 +79,50 @@ public UnexpectedErrorResponse( } public UnexpectedErrorResponse() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * HTTP status code */ - @JsonIgnore public Optional statusCode() { - return statusCode; + return Optional.ofNullable(this.statusCode); } /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - @JsonIgnore public Optional error() { - return error; + return Optional.ofNullable(this.error); } /** * The type of error returned */ - @JsonIgnore public Optional typeName() { - return typeName; + return Optional.ofNullable(this.typeName); } /** * A human-readable message providing more details about the error. */ - @JsonIgnore public Optional message() { - return message; + return Optional.ofNullable(this.message); } /** * Contains parameter or domain specific information related to the error and why it occurred. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional detail() { - return (Optional) detail; + return Optional.ofNullable(this.detail); } /** * Link to documentation of error type */ - @JsonIgnore public Optional ref() { - return ref; + return Optional.ofNullable(this.ref); } public static Builder builder() { @@ -147,117 +133,57 @@ public static Builder builder() { /** * HTTP status code */ - public UnexpectedErrorResponse withStatusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - - /** - * HTTP status code - */ - public UnexpectedErrorResponse withStatusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public UnexpectedErrorResponse withStatusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public UnexpectedErrorResponse withError(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public UnexpectedErrorResponse withError(Optional error) { - Utils.checkNotNull(error, "error"); + public UnexpectedErrorResponse withError(@Nullable String error) { this.error = error; return this; } - /** - * The type of error returned - */ - public UnexpectedErrorResponse withTypeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - /** * The type of error returned */ - public UnexpectedErrorResponse withTypeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public UnexpectedErrorResponse withTypeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** - * A human-readable message providing more details about the error. - */ - public UnexpectedErrorResponse withMessage(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - /** * A human-readable message providing more details about the error. */ - public UnexpectedErrorResponse withMessage(Optional message) { - Utils.checkNotNull(message, "message"); + public UnexpectedErrorResponse withMessage(@Nullable String message) { this.message = message; return this; } - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public UnexpectedErrorResponse withDetail(Detail detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public UnexpectedErrorResponse withDetail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public UnexpectedErrorResponse withDetail(@Nullable Detail detail) { this.detail = detail; return this; } - /** - * Link to documentation of error type - */ - public UnexpectedErrorResponse withRef(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public UnexpectedErrorResponse withRef(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public UnexpectedErrorResponse withRef(@Nullable String ref) { this.ref = ref; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -297,138 +223,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional statusCode = Optional.empty(); + private Double statusCode; - private Optional error = Optional.empty(); + private String error; - private Optional typeName = Optional.empty(); + private String typeName; - private Optional message = Optional.empty(); + private String message; - private Optional detail = Optional.empty(); + private Detail detail; - private Optional ref = Optional.empty(); + private String ref; private Builder() { // force use of static builder() method } - /** * HTTP status code */ - public Builder statusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - /** - * HTTP status code - */ - public Builder statusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public Builder statusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public Builder error(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public Builder error(Optional error) { - Utils.checkNotNull(error, "error"); + public Builder error(@Nullable String error) { this.error = error; return this; } - - /** - * The type of error returned - */ - public Builder typeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - /** * The type of error returned */ - public Builder typeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public Builder typeName(@Nullable String typeName) { this.typeName = typeName; return this; } - - /** - * A human-readable message providing more details about the error. - */ - public Builder message(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - /** * A human-readable message providing more details about the error. */ - public Builder message(Optional message) { - Utils.checkNotNull(message, "message"); + public Builder message(@Nullable String message) { this.message = message; return this; } - - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public Builder detail(Detail detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public Builder detail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public Builder detail(@Nullable Detail detail) { this.detail = detail; return this; } - - /** - * Link to documentation of error type - */ - public Builder ref(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public Builder ref(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public Builder ref(@Nullable String ref) { this.ref = ref; return this; } public UnexpectedErrorResponse build() { - return new UnexpectedErrorResponse( statusCode, error, typeName, message, detail, ref); diff --git a/src/main/java/com/apideck/unify/models/components/UnifiedApis.java b/src/main/java/com/apideck/unify/models/components/UnifiedApis.java index 06742172..6c7a3070 100644 --- a/src/main/java/com/apideck/unify/models/components/UnifiedApis.java +++ b/src/main/java/com/apideck/unify/models/components/UnifiedApis.java @@ -5,14 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -23,64 +22,57 @@ public class UnifiedApis { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private UnifiedApiId id; /** * Name of the API. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("auth_only") - private Optional authOnly; + private Boolean authOnly; @JsonInclude(Include.NON_ABSENT) @JsonProperty("oauth_scopes") - private Optional> oauthScopes; + private List oauthScopes; /** * List of resources that are supported on the connector. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_resources") - private Optional> supportedResources; + private List supportedResources; /** * List of resources that are not supported on the downstream. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_unsupported_resources") - private Optional> downstreamUnsupportedResources; + private List downstreamUnsupportedResources; /** * List of events that are supported on the connector for this Unified API. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("supported_events") - private Optional> supportedEvents; + private List supportedEvents; @JsonCreator public UnifiedApis( - @JsonProperty("id") Optional id, - @JsonProperty("name") Optional name, - @JsonProperty("auth_only") Optional authOnly, - @JsonProperty("oauth_scopes") Optional> oauthScopes, - @JsonProperty("supported_resources") Optional> supportedResources, - @JsonProperty("downstream_unsupported_resources") Optional> downstreamUnsupportedResources, - @JsonProperty("supported_events") Optional> supportedEvents) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(authOnly, "authOnly"); - Utils.checkNotNull(oauthScopes, "oauthScopes"); - Utils.checkNotNull(supportedResources, "supportedResources"); - Utils.checkNotNull(downstreamUnsupportedResources, "downstreamUnsupportedResources"); - Utils.checkNotNull(supportedEvents, "supportedEvents"); + @JsonProperty("id") @Nullable UnifiedApiId id, + @JsonProperty("name") @Nullable String name, + @JsonProperty("auth_only") @Nullable Boolean authOnly, + @JsonProperty("oauth_scopes") @Nullable List oauthScopes, + @JsonProperty("supported_resources") @Nullable List supportedResources, + @JsonProperty("downstream_unsupported_resources") @Nullable List downstreamUnsupportedResources, + @JsonProperty("supported_events") @Nullable List supportedEvents) { this.id = id; this.name = name; this.authOnly = authOnly; @@ -91,67 +83,55 @@ public UnifiedApis( } public UnifiedApis() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } /** * Name of Apideck Unified API */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional id() { - return (Optional) id; + return Optional.ofNullable(this.id); } /** * Name of the API. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API */ - @JsonIgnore public Optional authOnly() { - return authOnly; + return Optional.ofNullable(this.authOnly); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> oauthScopes() { - return (Optional>) oauthScopes; + return Optional.ofNullable(this.oauthScopes); } /** * List of resources that are supported on the connector. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedResources() { - return (Optional>) supportedResources; + return Optional.ofNullable(this.supportedResources); } /** * List of resources that are not supported on the downstream. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> downstreamUnsupportedResources() { - return (Optional>) downstreamUnsupportedResources; + return Optional.ofNullable(this.downstreamUnsupportedResources); } /** * List of events that are supported on the connector for this Unified API. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> supportedEvents() { - return (Optional>) supportedEvents; + return Optional.ofNullable(this.supportedEvents); } public static Builder builder() { @@ -162,130 +142,63 @@ public static Builder builder() { /** * Name of Apideck Unified API */ - public UnifiedApis withId(UnifiedApiId id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * Name of Apideck Unified API - */ - public UnifiedApis withId(Optional id) { - Utils.checkNotNull(id, "id"); + public UnifiedApis withId(@Nullable UnifiedApiId id) { this.id = id; return this; } - /** - * Name of the API. - */ - public UnifiedApis withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the API. */ - public UnifiedApis withName(Optional name) { - Utils.checkNotNull(name, "name"); + public UnifiedApis withName(@Nullable String name) { this.name = name; return this; } - /** - * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API - */ - public UnifiedApis withAuthOnly(boolean authOnly) { - Utils.checkNotNull(authOnly, "authOnly"); - this.authOnly = Optional.ofNullable(authOnly); - return this; - } - /** * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API */ - public UnifiedApis withAuthOnly(Optional authOnly) { - Utils.checkNotNull(authOnly, "authOnly"); + public UnifiedApis withAuthOnly(@Nullable Boolean authOnly) { this.authOnly = authOnly; return this; } - public UnifiedApis withOauthScopes(List oauthScopes) { - Utils.checkNotNull(oauthScopes, "oauthScopes"); - this.oauthScopes = Optional.ofNullable(oauthScopes); - return this; - } - - public UnifiedApis withOauthScopes(Optional> oauthScopes) { - Utils.checkNotNull(oauthScopes, "oauthScopes"); + public UnifiedApis withOauthScopes(@Nullable List oauthScopes) { this.oauthScopes = oauthScopes; return this; } - /** - * List of resources that are supported on the connector. - */ - public UnifiedApis withSupportedResources(List supportedResources) { - Utils.checkNotNull(supportedResources, "supportedResources"); - this.supportedResources = Optional.ofNullable(supportedResources); - return this; - } - /** * List of resources that are supported on the connector. */ - public UnifiedApis withSupportedResources(Optional> supportedResources) { - Utils.checkNotNull(supportedResources, "supportedResources"); + public UnifiedApis withSupportedResources(@Nullable List supportedResources) { this.supportedResources = supportedResources; return this; } - /** - * List of resources that are not supported on the downstream. - */ - public UnifiedApis withDownstreamUnsupportedResources(List downstreamUnsupportedResources) { - Utils.checkNotNull(downstreamUnsupportedResources, "downstreamUnsupportedResources"); - this.downstreamUnsupportedResources = Optional.ofNullable(downstreamUnsupportedResources); - return this; - } - /** * List of resources that are not supported on the downstream. */ - public UnifiedApis withDownstreamUnsupportedResources(Optional> downstreamUnsupportedResources) { - Utils.checkNotNull(downstreamUnsupportedResources, "downstreamUnsupportedResources"); + public UnifiedApis withDownstreamUnsupportedResources(@Nullable List downstreamUnsupportedResources) { this.downstreamUnsupportedResources = downstreamUnsupportedResources; return this; } - /** - * List of events that are supported on the connector for this Unified API. - */ - public UnifiedApis withSupportedEvents(List supportedEvents) { - Utils.checkNotNull(supportedEvents, "supportedEvents"); - this.supportedEvents = Optional.ofNullable(supportedEvents); - return this; - } - /** * List of events that are supported on the connector for this Unified API. */ - public UnifiedApis withSupportedEvents(Optional> supportedEvents) { - Utils.checkNotNull(supportedEvents, "supportedEvents"); + public UnifiedApis withSupportedEvents(@Nullable List supportedEvents) { this.supportedEvents = supportedEvents; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -328,153 +241,78 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private UnifiedApiId id; - private Optional name = Optional.empty(); + private String name; - private Optional authOnly = Optional.empty(); + private Boolean authOnly; - private Optional> oauthScopes = Optional.empty(); + private List oauthScopes; - private Optional> supportedResources = Optional.empty(); + private List supportedResources; - private Optional> downstreamUnsupportedResources = Optional.empty(); + private List downstreamUnsupportedResources; - private Optional> supportedEvents = Optional.empty(); + private List supportedEvents; private Builder() { // force use of static builder() method } - - /** - * Name of Apideck Unified API - */ - public Builder id(UnifiedApiId id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * Name of Apideck Unified API */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable UnifiedApiId id) { this.id = id; return this; } - - /** - * Name of the API. - */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - /** * Name of the API. */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API */ - public Builder authOnly(boolean authOnly) { - Utils.checkNotNull(authOnly, "authOnly"); - this.authOnly = Optional.ofNullable(authOnly); - return this; - } - - /** - * Indicates whether a connector only supports authentication. In this case the connector is not mapped to a Unified API, but can be used with the Proxy API - */ - public Builder authOnly(Optional authOnly) { - Utils.checkNotNull(authOnly, "authOnly"); + public Builder authOnly(@Nullable Boolean authOnly) { this.authOnly = authOnly; return this; } - - public Builder oauthScopes(List oauthScopes) { - Utils.checkNotNull(oauthScopes, "oauthScopes"); - this.oauthScopes = Optional.ofNullable(oauthScopes); - return this; - } - - public Builder oauthScopes(Optional> oauthScopes) { - Utils.checkNotNull(oauthScopes, "oauthScopes"); + public Builder oauthScopes(@Nullable List oauthScopes) { this.oauthScopes = oauthScopes; return this; } - /** * List of resources that are supported on the connector. */ - public Builder supportedResources(List supportedResources) { - Utils.checkNotNull(supportedResources, "supportedResources"); - this.supportedResources = Optional.ofNullable(supportedResources); - return this; - } - - /** - * List of resources that are supported on the connector. - */ - public Builder supportedResources(Optional> supportedResources) { - Utils.checkNotNull(supportedResources, "supportedResources"); + public Builder supportedResources(@Nullable List supportedResources) { this.supportedResources = supportedResources; return this; } - - /** - * List of resources that are not supported on the downstream. - */ - public Builder downstreamUnsupportedResources(List downstreamUnsupportedResources) { - Utils.checkNotNull(downstreamUnsupportedResources, "downstreamUnsupportedResources"); - this.downstreamUnsupportedResources = Optional.ofNullable(downstreamUnsupportedResources); - return this; - } - /** * List of resources that are not supported on the downstream. */ - public Builder downstreamUnsupportedResources(Optional> downstreamUnsupportedResources) { - Utils.checkNotNull(downstreamUnsupportedResources, "downstreamUnsupportedResources"); + public Builder downstreamUnsupportedResources(@Nullable List downstreamUnsupportedResources) { this.downstreamUnsupportedResources = downstreamUnsupportedResources; return this; } - /** * List of events that are supported on the connector for this Unified API. */ - public Builder supportedEvents(List supportedEvents) { - Utils.checkNotNull(supportedEvents, "supportedEvents"); - this.supportedEvents = Optional.ofNullable(supportedEvents); - return this; - } - - /** - * List of events that are supported on the connector for this Unified API. - */ - public Builder supportedEvents(Optional> supportedEvents) { - Utils.checkNotNull(supportedEvents, "supportedEvents"); + public Builder supportedEvents(@Nullable List supportedEvents) { this.supportedEvents = supportedEvents; return this; } public UnifiedApis build() { - return new UnifiedApis( id, name, authOnly, oauthScopes, supportedResources, downstreamUnsupportedResources, diff --git a/src/main/java/com/apideck/unify/models/components/UnifiedFile.java b/src/main/java/com/apideck/unify/models/components/UnifiedFile.java index 6512c335..4db33911 100644 --- a/src/main/java/com/apideck/unify/models/components/UnifiedFile.java +++ b/src/main/java/com/apideck/unify/models/components/UnifiedFile.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -41,7 +41,7 @@ public class UnifiedFile { */ @JsonInclude(Include.ALWAYS) @JsonProperty("name") - private Optional name; + private JsonNullable name; /** * Optional description of the file @@ -55,7 +55,7 @@ public class UnifiedFile { */ @JsonInclude(Include.ALWAYS) @JsonProperty("type") - private Optional type; + private JsonNullable type; /** * The full path of the file or folder (includes the file name) @@ -76,7 +76,7 @@ public class UnifiedFile { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downloadable") - private Optional downloadable; + private Boolean downloadable; /** * The size of the file in bytes @@ -88,49 +88,49 @@ public class UnifiedFile { @JsonInclude(Include.NON_ABSENT) @JsonProperty("owner") - private Optional owner; + private Owner owner; /** * The parent folders of the file, starting from the root */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("parent_folders") - private Optional> parentFolders; + private List parentFolders; /** * Whether the list of parent folders is complete. Some connectors only return the direct parent of a file */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("parent_folders_complete") - private Optional parentFoldersComplete; + private Boolean parentFoldersComplete; /** * Permissions the current user has on this file. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("permissions") - private Optional permissions; + private Permissions permissions; /** * Whether the current file is exportable to other file formats. This property is relevant for proprietary file formats such as Google Docs or Dropbox Paper. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("exportable") - private Optional exportable; + private Boolean exportable; /** * The available file formats when exporting this file. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("export_formats") - private JsonNullable> exportFormats; + private JsonNullable> exportFormats; /** * When custom mappings are configured on the resource, the result is included here. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The user who last updated the object. @@ -162,240 +162,206 @@ public class UnifiedFile { @JsonCreator public UnifiedFile( - @JsonProperty("id") String id, - @JsonProperty("downstream_id") JsonNullable downstreamId, - @JsonProperty("name") Optional name, - @JsonProperty("description") JsonNullable description, - @JsonProperty("type") Optional type, - @JsonProperty("path") JsonNullable path, - @JsonProperty("mime_type") JsonNullable mimeType, - @JsonProperty("downloadable") Optional downloadable, - @JsonProperty("size") JsonNullable size, - @JsonProperty("owner") Optional owner, - @JsonProperty("parent_folders") Optional> parentFolders, - @JsonProperty("parent_folders_complete") Optional parentFoldersComplete, - @JsonProperty("permissions") Optional permissions, - @JsonProperty("exportable") Optional exportable, - @JsonProperty("export_formats") JsonNullable> exportFormats, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_by") JsonNullable updatedBy, - @JsonProperty("created_by") JsonNullable createdBy, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(type, "type"); - Utils.checkNotNull(path, "path"); - Utils.checkNotNull(mimeType, "mimeType"); - Utils.checkNotNull(downloadable, "downloadable"); - Utils.checkNotNull(size, "size"); - Utils.checkNotNull(owner, "owner"); - Utils.checkNotNull(parentFolders, "parentFolders"); - Utils.checkNotNull(parentFoldersComplete, "parentFoldersComplete"); - Utils.checkNotNull(permissions, "permissions"); - Utils.checkNotNull(exportable, "exportable"); - Utils.checkNotNull(exportFormats, "exportFormats"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedBy, "updatedBy"); - Utils.checkNotNull(createdBy, "createdBy"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - this.id = id; - this.downstreamId = downstreamId; - this.name = name; - this.description = description; - this.type = type; - this.path = path; - this.mimeType = mimeType; + @JsonProperty("id") @Nonnull String id, + @JsonProperty("downstream_id") @Nullable JsonNullable downstreamId, + @JsonProperty("name") @Nullable String name, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("type") @Nullable FileType type, + @JsonProperty("path") @Nullable JsonNullable path, + @JsonProperty("mime_type") @Nullable JsonNullable mimeType, + @JsonProperty("downloadable") @Nullable Boolean downloadable, + @JsonProperty("size") @Nullable JsonNullable size, + @JsonProperty("owner") @Nullable Owner owner, + @JsonProperty("parent_folders") @Nullable List parentFolders, + @JsonProperty("parent_folders_complete") @Nullable Boolean parentFoldersComplete, + @JsonProperty("permissions") @Nullable Permissions permissions, + @JsonProperty("exportable") @Nullable Boolean exportable, + @JsonProperty("export_formats") @Nullable JsonNullable> exportFormats, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_by") @Nullable JsonNullable updatedBy, + @JsonProperty("created_by") @Nullable JsonNullable createdBy, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.downstreamId = Optional.ofNullable(downstreamId) + .orElse(JsonNullable.undefined()); + this.name = JsonNullable.of(name); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.type = JsonNullable.of(type); + this.path = Optional.ofNullable(path) + .orElse(JsonNullable.undefined()); + this.mimeType = Optional.ofNullable(mimeType) + .orElse(JsonNullable.undefined()); this.downloadable = downloadable; - this.size = size; + this.size = Optional.ofNullable(size) + .orElse(JsonNullable.undefined()); this.owner = owner; this.parentFolders = parentFolders; this.parentFoldersComplete = parentFoldersComplete; this.permissions = permissions; this.exportable = exportable; - this.exportFormats = exportFormats; - this.customMappings = customMappings; - this.updatedBy = updatedBy; - this.createdBy = createdBy; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.exportFormats = Optional.ofNullable(exportFormats) + .orElse(JsonNullable.undefined()); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedBy = Optional.ofNullable(updatedBy) + .orElse(JsonNullable.undefined()); + this.createdBy = Optional.ofNullable(createdBy) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); } public UnifiedFile( - String id) { - this(id, JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The third-party API ID of original entity */ - @JsonIgnore public JsonNullable downstreamId() { - return downstreamId; + return this.downstreamId; } /** * The name of the file */ - @JsonIgnore - public Optional name() { - return name; + public JsonNullable name() { + return this.name; } /** * Optional description of the file */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The type of resource. Could be file, folder or url */ - @SuppressWarnings("unchecked") - @JsonIgnore - public Optional type() { - return (Optional) type; + public JsonNullable type() { + return this.type; } /** * The full path of the file or folder (includes the file name) */ - @JsonIgnore public JsonNullable path() { - return path; + return this.path; } /** * The MIME type of the file. */ - @JsonIgnore public JsonNullable mimeType() { - return mimeType; + return this.mimeType; } /** * Whether the current user can download this file */ - @JsonIgnore public Optional downloadable() { - return downloadable; + return Optional.ofNullable(this.downloadable); } /** * The size of the file in bytes */ - @JsonIgnore public JsonNullable size() { - return size; + return this.size; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional owner() { - return (Optional) owner; + return Optional.ofNullable(this.owner); } /** * The parent folders of the file, starting from the root */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> parentFolders() { - return (Optional>) parentFolders; + return Optional.ofNullable(this.parentFolders); } /** * Whether the list of parent folders is complete. Some connectors only return the direct parent of a file */ - @JsonIgnore public Optional parentFoldersComplete() { - return parentFoldersComplete; + return Optional.ofNullable(this.parentFoldersComplete); } /** * Permissions the current user has on this file. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional permissions() { - return (Optional) permissions; + return Optional.ofNullable(this.permissions); } /** * Whether the current file is exportable to other file formats. This property is relevant for proprietary file formats such as Google Docs or Dropbox Paper. */ - @JsonIgnore public Optional exportable() { - return exportable; + return Optional.ofNullable(this.exportable); } /** * The available file formats when exporting this file. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> exportFormats() { - return (JsonNullable>) exportFormats; + return this.exportFormats; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The user who last updated the object. */ - @JsonIgnore public JsonNullable updatedBy() { - return updatedBy; + return this.updatedBy; } /** * The user who created the object. */ - @JsonIgnore public JsonNullable createdBy() { - return createdBy; + return this.createdBy; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } public static Builder builder() { @@ -406,355 +372,179 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public UnifiedFile withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public UnifiedFile withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * The third-party API ID of original entity */ - public UnifiedFile withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public UnifiedFile withDownstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public UnifiedFile withDownstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } /** * The name of the file */ - public UnifiedFile withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); + public UnifiedFile withName(@Nullable String name) { + this.name = JsonNullable.of(name); return this; } - /** - * The name of the file - */ - public UnifiedFile withName(Optional name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - /** * Optional description of the file */ - public UnifiedFile withDescription(String description) { - Utils.checkNotNull(description, "description"); + public UnifiedFile withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Optional description of the file - */ - public UnifiedFile withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The type of resource. Could be file, folder or url */ - public UnifiedFile withType(FileType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); + public UnifiedFile withType(@Nullable FileType type) { + this.type = JsonNullable.of(type); return this; } - /** - * The type of resource. Could be file, folder or url - */ - public UnifiedFile withType(Optional type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - /** * The full path of the file or folder (includes the file name) */ - public UnifiedFile withPath(String path) { - Utils.checkNotNull(path, "path"); + public UnifiedFile withPath(@Nullable String path) { this.path = JsonNullable.of(path); return this; } - /** - * The full path of the file or folder (includes the file name) - */ - public UnifiedFile withPath(JsonNullable path) { - Utils.checkNotNull(path, "path"); - this.path = path; - return this; - } /** * The MIME type of the file. */ - public UnifiedFile withMimeType(String mimeType) { - Utils.checkNotNull(mimeType, "mimeType"); + public UnifiedFile withMimeType(@Nullable String mimeType) { this.mimeType = JsonNullable.of(mimeType); return this; } - /** - * The MIME type of the file. - */ - public UnifiedFile withMimeType(JsonNullable mimeType) { - Utils.checkNotNull(mimeType, "mimeType"); - this.mimeType = mimeType; - return this; - } - - /** - * Whether the current user can download this file - */ - public UnifiedFile withDownloadable(boolean downloadable) { - Utils.checkNotNull(downloadable, "downloadable"); - this.downloadable = Optional.ofNullable(downloadable); - return this; - } - /** * Whether the current user can download this file */ - public UnifiedFile withDownloadable(Optional downloadable) { - Utils.checkNotNull(downloadable, "downloadable"); + public UnifiedFile withDownloadable(@Nullable Boolean downloadable) { this.downloadable = downloadable; return this; } - /** - * The size of the file in bytes - */ - public UnifiedFile withSize(long size) { - Utils.checkNotNull(size, "size"); - this.size = JsonNullable.of(size); - return this; - } /** * The size of the file in bytes */ - public UnifiedFile withSize(JsonNullable size) { - Utils.checkNotNull(size, "size"); - this.size = size; - return this; - } - - public UnifiedFile withOwner(Owner owner) { - Utils.checkNotNull(owner, "owner"); - this.owner = Optional.ofNullable(owner); + public UnifiedFile withSize(@Nullable Long size) { + this.size = JsonNullable.of(size); return this; } - public UnifiedFile withOwner(Optional owner) { - Utils.checkNotNull(owner, "owner"); + public UnifiedFile withOwner(@Nullable Owner owner) { this.owner = owner; return this; } - /** - * The parent folders of the file, starting from the root - */ - public UnifiedFile withParentFolders(List parentFolders) { - Utils.checkNotNull(parentFolders, "parentFolders"); - this.parentFolders = Optional.ofNullable(parentFolders); - return this; - } - /** * The parent folders of the file, starting from the root */ - public UnifiedFile withParentFolders(Optional> parentFolders) { - Utils.checkNotNull(parentFolders, "parentFolders"); + public UnifiedFile withParentFolders(@Nullable List parentFolders) { this.parentFolders = parentFolders; return this; } - /** - * Whether the list of parent folders is complete. Some connectors only return the direct parent of a file - */ - public UnifiedFile withParentFoldersComplete(boolean parentFoldersComplete) { - Utils.checkNotNull(parentFoldersComplete, "parentFoldersComplete"); - this.parentFoldersComplete = Optional.ofNullable(parentFoldersComplete); - return this; - } - /** * Whether the list of parent folders is complete. Some connectors only return the direct parent of a file */ - public UnifiedFile withParentFoldersComplete(Optional parentFoldersComplete) { - Utils.checkNotNull(parentFoldersComplete, "parentFoldersComplete"); + public UnifiedFile withParentFoldersComplete(@Nullable Boolean parentFoldersComplete) { this.parentFoldersComplete = parentFoldersComplete; return this; } - /** - * Permissions the current user has on this file. - */ - public UnifiedFile withPermissions(Permissions permissions) { - Utils.checkNotNull(permissions, "permissions"); - this.permissions = Optional.ofNullable(permissions); - return this; - } - /** * Permissions the current user has on this file. */ - public UnifiedFile withPermissions(Optional permissions) { - Utils.checkNotNull(permissions, "permissions"); + public UnifiedFile withPermissions(@Nullable Permissions permissions) { this.permissions = permissions; return this; } - /** - * Whether the current file is exportable to other file formats. This property is relevant for proprietary file formats such as Google Docs or Dropbox Paper. - */ - public UnifiedFile withExportable(boolean exportable) { - Utils.checkNotNull(exportable, "exportable"); - this.exportable = Optional.ofNullable(exportable); - return this; - } - /** * Whether the current file is exportable to other file formats. This property is relevant for proprietary file formats such as Google Docs or Dropbox Paper. */ - public UnifiedFile withExportable(Optional exportable) { - Utils.checkNotNull(exportable, "exportable"); + public UnifiedFile withExportable(@Nullable Boolean exportable) { this.exportable = exportable; return this; } + /** * The available file formats when exporting this file. */ - public UnifiedFile withExportFormats(List exportFormats) { - Utils.checkNotNull(exportFormats, "exportFormats"); + public UnifiedFile withExportFormats(@Nullable List exportFormats) { this.exportFormats = JsonNullable.of(exportFormats); return this; } - /** - * The available file formats when exporting this file. - */ - public UnifiedFile withExportFormats(JsonNullable> exportFormats) { - Utils.checkNotNull(exportFormats, "exportFormats"); - this.exportFormats = exportFormats; - return this; - } /** * When custom mappings are configured on the resource, the result is included here. */ - public UnifiedFile withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public UnifiedFile withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public UnifiedFile withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The user who last updated the object. */ - public UnifiedFile withUpdatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public UnifiedFile withUpdatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public UnifiedFile withUpdatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } /** * The user who created the object. */ - public UnifiedFile withCreatedBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public UnifiedFile withCreatedBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public UnifiedFile withCreatedBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } /** * The date and time when the object was last updated. */ - public UnifiedFile withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public UnifiedFile withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public UnifiedFile withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public UnifiedFile withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public UnifiedFile withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public UnifiedFile withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -830,415 +620,206 @@ public final static class Builder { private String id; - private JsonNullable downstreamId = JsonNullable.undefined(); + private JsonNullable downstreamId; - private Optional name = Optional.empty(); + private String name; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional type = Optional.empty(); + private FileType type; - private JsonNullable path = JsonNullable.undefined(); + private JsonNullable path; - private JsonNullable mimeType = JsonNullable.undefined(); + private JsonNullable mimeType; - private Optional downloadable = Optional.empty(); + private Boolean downloadable; - private JsonNullable size = JsonNullable.undefined(); + private JsonNullable size; - private Optional owner = Optional.empty(); + private Owner owner; - private Optional> parentFolders = Optional.empty(); + private List parentFolders; - private Optional parentFoldersComplete = Optional.empty(); + private Boolean parentFoldersComplete; - private Optional permissions = Optional.empty(); + private Permissions permissions; - private Optional exportable = Optional.empty(); + private Boolean exportable; - private JsonNullable> exportFormats = JsonNullable.undefined(); + private JsonNullable> exportFormats; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedBy = JsonNullable.undefined(); + private JsonNullable updatedBy; - private JsonNullable createdBy = JsonNullable.undefined(); + private JsonNullable createdBy; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; private Builder() { // force use of static builder() method } - /** * A unique identifier for an object. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The third-party API ID of original entity */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = JsonNullable.of(downstreamId); return this; } - /** - * The third-party API ID of original entity - */ - public Builder downstreamId(JsonNullable downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = downstreamId; - return this; - } - - /** * The name of the file */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * The name of the file - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - /** * Optional description of the file */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * Optional description of the file - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * The type of resource. Could be file, folder or url - */ - public Builder type(FileType type) { - Utils.checkNotNull(type, "type"); - this.type = Optional.ofNullable(type); - return this; - } - /** * The type of resource. Could be file, folder or url */ - public Builder type(Optional type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable FileType type) { this.type = type; return this; } - /** * The full path of the file or folder (includes the file name) */ - public Builder path(String path) { - Utils.checkNotNull(path, "path"); + public Builder path(@Nullable String path) { this.path = JsonNullable.of(path); return this; } - /** - * The full path of the file or folder (includes the file name) - */ - public Builder path(JsonNullable path) { - Utils.checkNotNull(path, "path"); - this.path = path; - return this; - } - - /** * The MIME type of the file. */ - public Builder mimeType(String mimeType) { - Utils.checkNotNull(mimeType, "mimeType"); + public Builder mimeType(@Nullable String mimeType) { this.mimeType = JsonNullable.of(mimeType); return this; } - /** - * The MIME type of the file. - */ - public Builder mimeType(JsonNullable mimeType) { - Utils.checkNotNull(mimeType, "mimeType"); - this.mimeType = mimeType; - return this; - } - - /** * Whether the current user can download this file */ - public Builder downloadable(boolean downloadable) { - Utils.checkNotNull(downloadable, "downloadable"); - this.downloadable = Optional.ofNullable(downloadable); - return this; - } - - /** - * Whether the current user can download this file - */ - public Builder downloadable(Optional downloadable) { - Utils.checkNotNull(downloadable, "downloadable"); + public Builder downloadable(@Nullable Boolean downloadable) { this.downloadable = downloadable; return this; } - /** * The size of the file in bytes */ - public Builder size(long size) { - Utils.checkNotNull(size, "size"); + public Builder size(@Nullable Long size) { this.size = JsonNullable.of(size); return this; } - /** - * The size of the file in bytes - */ - public Builder size(JsonNullable size) { - Utils.checkNotNull(size, "size"); - this.size = size; - return this; - } - - - public Builder owner(Owner owner) { - Utils.checkNotNull(owner, "owner"); - this.owner = Optional.ofNullable(owner); - return this; - } - - public Builder owner(Optional owner) { - Utils.checkNotNull(owner, "owner"); + public Builder owner(@Nullable Owner owner) { this.owner = owner; return this; } - - /** - * The parent folders of the file, starting from the root - */ - public Builder parentFolders(List parentFolders) { - Utils.checkNotNull(parentFolders, "parentFolders"); - this.parentFolders = Optional.ofNullable(parentFolders); - return this; - } - /** * The parent folders of the file, starting from the root */ - public Builder parentFolders(Optional> parentFolders) { - Utils.checkNotNull(parentFolders, "parentFolders"); + public Builder parentFolders(@Nullable List parentFolders) { this.parentFolders = parentFolders; return this; } - - /** - * Whether the list of parent folders is complete. Some connectors only return the direct parent of a file - */ - public Builder parentFoldersComplete(boolean parentFoldersComplete) { - Utils.checkNotNull(parentFoldersComplete, "parentFoldersComplete"); - this.parentFoldersComplete = Optional.ofNullable(parentFoldersComplete); - return this; - } - /** * Whether the list of parent folders is complete. Some connectors only return the direct parent of a file */ - public Builder parentFoldersComplete(Optional parentFoldersComplete) { - Utils.checkNotNull(parentFoldersComplete, "parentFoldersComplete"); + public Builder parentFoldersComplete(@Nullable Boolean parentFoldersComplete) { this.parentFoldersComplete = parentFoldersComplete; return this; } - /** * Permissions the current user has on this file. */ - public Builder permissions(Permissions permissions) { - Utils.checkNotNull(permissions, "permissions"); - this.permissions = Optional.ofNullable(permissions); - return this; - } - - /** - * Permissions the current user has on this file. - */ - public Builder permissions(Optional permissions) { - Utils.checkNotNull(permissions, "permissions"); + public Builder permissions(@Nullable Permissions permissions) { this.permissions = permissions; return this; } - - /** - * Whether the current file is exportable to other file formats. This property is relevant for proprietary file formats such as Google Docs or Dropbox Paper. - */ - public Builder exportable(boolean exportable) { - Utils.checkNotNull(exportable, "exportable"); - this.exportable = Optional.ofNullable(exportable); - return this; - } - /** * Whether the current file is exportable to other file formats. This property is relevant for proprietary file formats such as Google Docs or Dropbox Paper. */ - public Builder exportable(Optional exportable) { - Utils.checkNotNull(exportable, "exportable"); + public Builder exportable(@Nullable Boolean exportable) { this.exportable = exportable; return this; } - /** * The available file formats when exporting this file. */ - public Builder exportFormats(List exportFormats) { - Utils.checkNotNull(exportFormats, "exportFormats"); + public Builder exportFormats(@Nullable List exportFormats) { this.exportFormats = JsonNullable.of(exportFormats); return this; } - /** - * The available file formats when exporting this file. - */ - public Builder exportFormats(JsonNullable> exportFormats) { - Utils.checkNotNull(exportFormats, "exportFormats"); - this.exportFormats = exportFormats; - return this; - } - - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The user who last updated the object. */ - public Builder updatedBy(String updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); + public Builder updatedBy(@Nullable String updatedBy) { this.updatedBy = JsonNullable.of(updatedBy); return this; } - /** - * The user who last updated the object. - */ - public Builder updatedBy(JsonNullable updatedBy) { - Utils.checkNotNull(updatedBy, "updatedBy"); - this.updatedBy = updatedBy; - return this; - } - - /** * The user who created the object. */ - public Builder createdBy(String createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); + public Builder createdBy(@Nullable String createdBy) { this.createdBy = JsonNullable.of(createdBy); return this; } - /** - * The user who created the object. - */ - public Builder createdBy(JsonNullable createdBy) { - Utils.checkNotNull(createdBy, "createdBy"); - this.createdBy = createdBy; - return this; - } - - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - public UnifiedFile build() { - return new UnifiedFile( id, downstreamId, name, description, type, path, diff --git a/src/main/java/com/apideck/unify/models/components/UnifiedId.java b/src/main/java/com/apideck/unify/models/components/UnifiedId.java index 8d302546..5c5eb3ae 100644 --- a/src/main/java/com/apideck/unify/models/components/UnifiedId.java +++ b/src/main/java/com/apideck/unify/models/components/UnifiedId.java @@ -5,10 +5,11 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; import java.lang.Override; import java.lang.String; +import java.util.Optional; /** * UnifiedId @@ -24,17 +25,16 @@ public class UnifiedId { @JsonCreator public UnifiedId( - @JsonProperty("id") String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + @JsonProperty("id") @Nonnull String id) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); } /** * The unique identifier of the resource */ - @JsonIgnore public String id() { - return id; + return this.id; } public static Builder builder() { @@ -45,12 +45,12 @@ public static Builder builder() { /** * The unique identifier of the resource */ - public UnifiedId withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public UnifiedId withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,18 +85,15 @@ private Builder() { // force use of static builder() method } - /** * The unique identifier of the resource */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } public UnifiedId build() { - return new UnifiedId( id); } diff --git a/src/main/java/com/apideck/unify/models/components/UpdateAccountingDepartmentResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateAccountingDepartmentResponse.java index 14307d57..5fd6a075 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateAccountingDepartmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateAccountingDepartmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateAccountingDepartmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateAccountingDepartmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateAccountingDepartmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateAccountingDepartmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateAccountingDepartmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateAccountingDepartmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateAccountingDepartmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateAccountingDepartmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateAccountingDepartmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateAccountingDepartmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateAccountingDepartmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateAccountingDepartmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateAccountingDepartmentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateAccountingDepartmentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateAccountingDepartmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateAccountingDepartmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateAccountingDepartmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateAccountingDepartmentResponse build() { - return new UpdateAccountingDepartmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateAccountingLocationResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateAccountingLocationResponse.java index 0a03c3ee..f8f4612b 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateAccountingLocationResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateAccountingLocationResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateAccountingLocationResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateAccountingLocationResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateAccountingLocationResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateAccountingLocationResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateAccountingLocationResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateAccountingLocationResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateAccountingLocationResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateAccountingLocationResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateAccountingLocationResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateAccountingLocationResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateAccountingLocationResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateAccountingLocationResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateAccountingLocationResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateAccountingLocationResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateAccountingLocationResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateAccountingLocationResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateAccountingLocationResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateAccountingLocationResponse build() { - return new UpdateAccountingLocationResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateActivityResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateActivityResponse.java index b08c54e2..65e31b79 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateActivityResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateActivityResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateActivityResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateActivityResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateActivityResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateActivityResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateActivityResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateActivityResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateActivityResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateActivityResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateActivityResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateActivityResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateActivityResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateActivityResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateActivityResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateActivityResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateActivityResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateActivityResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateActivityResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateActivityResponse build() { - return new UpdateActivityResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateApplicantResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateApplicantResponse.java index fb5deb7c..19430a83 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateApplicantResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateApplicantResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateApplicantResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateApplicantResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateApplicantResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateApplicantResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateApplicantResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateApplicantResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateApplicantResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateApplicantResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateApplicantResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateApplicantResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateApplicantResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateApplicantResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateApplicantResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateApplicantResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateApplicantResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateApplicantResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateApplicantResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateApplicantResponse build() { - return new UpdateApplicantResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateApplicationResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateApplicationResponse.java index f145189f..80170091 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateApplicationResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateApplicationResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateApplicationResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateApplicationResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateApplicationResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateApplicationResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateApplicationResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateApplicationResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateApplicationResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateApplicationResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateApplicationResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateApplicationResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateApplicationResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateApplicationResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateApplicationResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateApplicationResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateApplicationResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateApplicationResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateApplicationResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateApplicationResponse build() { - return new UpdateApplicationResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateBankFeedAccountResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateBankFeedAccountResponse.java index 40bae7ed..5b8ffebe 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateBankFeedAccountResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateBankFeedAccountResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateBankFeedAccountResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateBankFeedAccountResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateBankFeedAccountResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateBankFeedAccountResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateBankFeedAccountResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateBankFeedAccountResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateBankFeedAccountResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateBankFeedAccountResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateBankFeedAccountResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateBankFeedAccountResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateBankFeedAccountResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateBankFeedAccountResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateBankFeedAccountResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateBankFeedAccountResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateBankFeedAccountResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateBankFeedAccountResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateBankFeedAccountResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateBankFeedAccountResponse build() { - return new UpdateBankFeedAccountResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateBankFeedStatementResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateBankFeedStatementResponse.java index d7e0e8fa..4ade346e 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateBankFeedStatementResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateBankFeedStatementResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateBankFeedStatementResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateBankFeedStatementResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateBankFeedStatementResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateBankFeedStatementResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateBankFeedStatementResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateBankFeedStatementResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateBankFeedStatementResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateBankFeedStatementResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateBankFeedStatementResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateBankFeedStatementResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateBankFeedStatementResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateBankFeedStatementResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateBankFeedStatementResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateBankFeedStatementResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateBankFeedStatementResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateBankFeedStatementResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateBankFeedStatementResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateBankFeedStatementResponse build() { - return new UpdateBankFeedStatementResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateBillPaymentResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateBillPaymentResponse.java index 718c2922..8ca86e41 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateBillPaymentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateBillPaymentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateBillPaymentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateBillPaymentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateBillPaymentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateBillPaymentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateBillPaymentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateBillPaymentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateBillPaymentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateBillPaymentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateBillPaymentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateBillPaymentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateBillPaymentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateBillPaymentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateBillPaymentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateBillPaymentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateBillPaymentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateBillPaymentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateBillPaymentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateBillPaymentResponse build() { - return new UpdateBillPaymentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateBillResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateBillResponse.java index b411d7ca..049df9ba 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateBillResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateBillResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateBillResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateBillResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateBillResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateBillResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateBillResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateBillResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateBillResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateBillResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateBillResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateBillResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateBillResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateBillResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateBillResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateBillResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateBillResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateBillResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateBillResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateBillResponse build() { - return new UpdateBillResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateCommentResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateCommentResponse.java index f73b93b7..ee5cd989 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateCommentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateCommentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateCommentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateCommentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateCommentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateCommentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateCommentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateCommentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateCommentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateCommentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateCommentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateCommentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateCommentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateCommentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateCommentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateCommentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateCommentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateCommentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateCommentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateCommentResponse build() { - return new UpdateCommentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateCompanyResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateCompanyResponse.java index 9750569b..58852d66 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateCompanyResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateCompanyResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateCompanyResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateCompanyResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateCompanyResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateCompanyResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateCompanyResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateCompanyResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateCompanyResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateCompanyResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateCompanyResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateCompanyResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateCompanyResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateCompanyResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateCompanyResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateCompanyResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateCompanyResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateCompanyResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateCompanyResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateCompanyResponse build() { - return new UpdateCompanyResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateConnectionResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateConnectionResponse.java index 6a6b7c4f..64d662a4 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateConnectionResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateConnectionResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class UpdateConnectionResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateConnectionResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Connection data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Connection data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateConnectionResponse( long statusCode, - String status, - Connection data) { + @Nonnull String status, + @Nonnull Connection data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Connection data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateConnectionResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateConnectionResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateConnectionResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public UpdateConnectionResponse withData(Connection data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public UpdateConnectionResponse withData(@Nonnull Connection data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateConnectionResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateConnectionResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateConnectionResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Connection data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Connection data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Connection data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateConnectionResponse build() { - return new UpdateConnectionResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/UpdateConsumerRequest.java b/src/main/java/com/apideck/unify/models/components/UpdateConsumerRequest.java index db9cba6c..ef8decb7 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateConsumerRequest.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateConsumerRequest.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -21,26 +20,23 @@ public class UpdateConsumerRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("metadata") - private Optional metadata; + private ConsumerMetadata metadata; @JsonCreator public UpdateConsumerRequest( - @JsonProperty("metadata") Optional metadata) { - Utils.checkNotNull(metadata, "metadata"); + @JsonProperty("metadata") @Nullable ConsumerMetadata metadata) { this.metadata = metadata; } public UpdateConsumerRequest() { - this(Optional.empty()); + this(null); } /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional metadata() { - return (Optional) metadata; + return Optional.ofNullable(this.metadata); } public static Builder builder() { @@ -51,22 +47,12 @@ public static Builder builder() { /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - public UpdateConsumerRequest withMetadata(ConsumerMetadata metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = Optional.ofNullable(metadata); - return this; - } - - - /** - * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - */ - public UpdateConsumerRequest withMetadata(Optional metadata) { - Utils.checkNotNull(metadata, "metadata"); + public UpdateConsumerRequest withMetadata(@Nullable ConsumerMetadata metadata) { this.metadata = metadata; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -95,33 +81,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional metadata = Optional.empty(); + private ConsumerMetadata metadata; private Builder() { // force use of static builder() method } - - /** - * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. - */ - public Builder metadata(ConsumerMetadata metadata) { - Utils.checkNotNull(metadata, "metadata"); - this.metadata = Optional.ofNullable(metadata); - return this; - } - /** * The metadata of the consumer. This is used to display the consumer in the sidebar. This is optional, but recommended. */ - public Builder metadata(Optional metadata) { - Utils.checkNotNull(metadata, "metadata"); + public Builder metadata(@Nullable ConsumerMetadata metadata) { this.metadata = metadata; return this; } public UpdateConsumerRequest build() { - return new UpdateConsumerRequest( metadata); } diff --git a/src/main/java/com/apideck/unify/models/components/UpdateConsumerResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateConsumerResponse.java index 028a2312..28865636 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateConsumerResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateConsumerResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class UpdateConsumerResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateConsumerResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Consumer data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Consumer data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateConsumerResponse( long statusCode, - String status, - Consumer data) { + @Nonnull String status, + @Nonnull Consumer data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Consumer data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateConsumerResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateConsumerResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateConsumerResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public UpdateConsumerResponse withData(Consumer data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public UpdateConsumerResponse withData(@Nonnull Consumer data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateConsumerResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateConsumerResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateConsumerResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Consumer data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Consumer data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Consumer data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateConsumerResponse build() { - return new UpdateConsumerResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/UpdateContactResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateContactResponse.java index 67403e7d..bbdfe3dd 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateContactResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateContactResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateContactResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateContactResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateContactResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateContactResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateContactResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateContactResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateContactResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateContactResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateContactResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateContactResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateContactResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateContactResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateContactResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateContactResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateContactResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateContactResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateContactResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateContactResponse build() { - return new UpdateContactResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateCreditNoteResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateCreditNoteResponse.java index ec98622a..2dea5a87 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateCreditNoteResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateCreditNoteResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateCreditNoteResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateCreditNoteResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateCreditNoteResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateCreditNoteResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateCreditNoteResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateCreditNoteResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateCreditNoteResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateCreditNoteResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateCreditNoteResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateCreditNoteResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateCreditNoteResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateCreditNoteResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateCreditNoteResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateCreditNoteResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateCreditNoteResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateCreditNoteResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateCreditNoteResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateCreditNoteResponse build() { - return new UpdateCreditNoteResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateCustomObjectResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateCustomObjectResponse.java index 50470b2d..c52e8120 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateCustomObjectResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateCustomObjectResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateCustomObjectResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateCustomObjectResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateCustomObjectResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateCustomObjectResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateCustomObjectResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateCustomObjectResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateCustomObjectResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateCustomObjectResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateCustomObjectResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateCustomObjectResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateCustomObjectResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateCustomObjectResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateCustomObjectResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateCustomObjectResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateCustomObjectResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateCustomObjectResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateCustomObjectResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateCustomObjectResponse build() { - return new UpdateCustomObjectResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateCustomObjectSchemaResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateCustomObjectSchemaResponse.java index 94845a86..fd55484d 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateCustomObjectSchemaResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateCustomObjectSchemaResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateCustomObjectSchemaResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateCustomObjectSchemaResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateCustomObjectSchemaResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateCustomObjectSchemaResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateCustomObjectSchemaResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateCustomObjectSchemaResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateCustomObjectSchemaResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateCustomObjectSchemaResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateCustomObjectSchemaResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateCustomObjectSchemaResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateCustomObjectSchemaResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateCustomObjectSchemaResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateCustomObjectSchemaResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateCustomObjectSchemaResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateCustomObjectSchemaResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateCustomObjectSchemaResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateCustomObjectSchemaResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateCustomObjectSchemaResponse build() { - return new UpdateCustomObjectSchemaResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateCustomerResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateCustomerResponse.java index c607bdb2..dfc49a8f 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateCustomerResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateCustomerResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateCustomerResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateCustomerResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateCustomerResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateCustomerResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateCustomerResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateCustomerResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateCustomerResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateCustomerResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateCustomerResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateCustomerResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateCustomerResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateCustomerResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateCustomerResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateCustomerResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateCustomerResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateCustomerResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateCustomerResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateCustomerResponse build() { - return new UpdateCustomerResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateDepartmentResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateDepartmentResponse.java index 3fc443f6..fb54196b 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateDepartmentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateDepartmentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateDepartmentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateDepartmentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateDepartmentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateDepartmentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateDepartmentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateDepartmentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateDepartmentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateDepartmentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateDepartmentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateDepartmentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateDepartmentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateDepartmentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateDepartmentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateDepartmentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateDepartmentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateDepartmentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateDepartmentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateDepartmentResponse build() { - return new UpdateDepartmentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateDriveGroupResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateDriveGroupResponse.java index f186a9a6..bfc73745 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateDriveGroupResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateDriveGroupResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateDriveGroupResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateDriveGroupResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateDriveGroupResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateDriveGroupResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateDriveGroupResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateDriveGroupResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateDriveGroupResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateDriveGroupResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateDriveGroupResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateDriveGroupResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateDriveGroupResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateDriveGroupResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateDriveGroupResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateDriveGroupResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateDriveGroupResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateDriveGroupResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateDriveGroupResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateDriveGroupResponse build() { - return new UpdateDriveGroupResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateDriveResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateDriveResponse.java index 6d001c6a..bc121597 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateDriveResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateDriveResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateDriveResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateDriveResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateDriveResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateDriveResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateDriveResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateDriveResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateDriveResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateDriveResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateDriveResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateDriveResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateDriveResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateDriveResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateDriveResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateDriveResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateDriveResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateDriveResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateDriveResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateDriveResponse build() { - return new UpdateDriveResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateEmployeeResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateEmployeeResponse.java index 9e6b8f89..549c22bf 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateEmployeeResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateEmployeeResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateEmployeeResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateEmployeeResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateEmployeeResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateEmployeeResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateEmployeeResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateEmployeeResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateEmployeeResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateEmployeeResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateEmployeeResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateEmployeeResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateEmployeeResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateEmployeeResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateEmployeeResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateEmployeeResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateEmployeeResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateEmployeeResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateEmployeeResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateEmployeeResponse build() { - return new UpdateEmployeeResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateExpenseResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateExpenseResponse.java index 254a00a9..5ee167d9 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateExpenseResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateExpenseResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateExpenseResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateExpenseResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateExpenseResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateExpenseResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateExpenseResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateExpenseResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateExpenseResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateExpenseResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateExpenseResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateExpenseResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateExpenseResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateExpenseResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateExpenseResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateExpenseResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateExpenseResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateExpenseResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateExpenseResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateExpenseResponse build() { - return new UpdateExpenseResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateFileRequest.java b/src/main/java/com/apideck/unify/models/components/UpdateFileRequest.java index 3e907bc4..d698499b 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateFileRequest.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateFileRequest.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -22,39 +21,35 @@ public class UpdateFileRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Optional description of the file. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("description") - private Optional description; + private String description; /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("parent_folder_id") - private Optional parentFolderId; + private String parentFolderId; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public UpdateFileRequest( - @JsonProperty("name") Optional name, - @JsonProperty("description") Optional description, - @JsonProperty("parent_folder_id") Optional parentFolderId, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(parentFolderId, "parentFolderId"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("name") @Nullable String name, + @JsonProperty("description") @Nullable String description, + @JsonProperty("parent_folder_id") @Nullable String parentFolderId, + @JsonProperty("pass_through") @Nullable List passThrough) { this.name = name; this.description = description; this.parentFolderId = parentFolderId; @@ -62,41 +57,36 @@ public UpdateFileRequest( } public UpdateFileRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * The name of the file. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Optional description of the file. */ - @JsonIgnore public Optional description() { - return description; + return Optional.ofNullable(this.description); } /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - @JsonIgnore public Optional parentFolderId() { - return parentFolderId; + return Optional.ofNullable(this.parentFolderId); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -107,79 +97,39 @@ public static Builder builder() { /** * The name of the file. */ - public UpdateFileRequest withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - /** - * The name of the file. - */ - public UpdateFileRequest withName(Optional name) { - Utils.checkNotNull(name, "name"); + public UpdateFileRequest withName(@Nullable String name) { this.name = name; return this; } - /** - * Optional description of the file. - */ - public UpdateFileRequest withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = Optional.ofNullable(description); - return this; - } - /** * Optional description of the file. */ - public UpdateFileRequest withDescription(Optional description) { - Utils.checkNotNull(description, "description"); + public UpdateFileRequest withDescription(@Nullable String description) { this.description = description; return this; } - /** - * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - */ - public UpdateFileRequest withParentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = Optional.ofNullable(parentFolderId); - return this; - } - /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - public UpdateFileRequest withParentFolderId(Optional parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); + public UpdateFileRequest withParentFolderId(@Nullable String parentFolderId) { this.parentFolderId = parentFolderId; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public UpdateFileRequest withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public UpdateFileRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public UpdateFileRequest withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -215,96 +165,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional name = Optional.empty(); + private String name; - private Optional description = Optional.empty(); + private String description; - private Optional parentFolderId = Optional.empty(); + private String parentFolderId; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The name of the file. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * The name of the file. - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * Optional description of the file. - */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); - this.description = Optional.ofNullable(description); - return this; - } - /** * Optional description of the file. */ - public Builder description(Optional description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = description; return this; } - /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - public Builder parentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = Optional.ofNullable(parentFolderId); - return this; - } - - /** - * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - */ - public Builder parentFolderId(Optional parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); + public Builder parentFolderId(@Nullable String parentFolderId) { this.parentFolderId = parentFolderId; return this; } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public UpdateFileRequest build() { - return new UpdateFileRequest( name, description, parentFolderId, passThrough); diff --git a/src/main/java/com/apideck/unify/models/components/UpdateFileResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateFileResponse.java index a216eff5..3e85ef1d 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateFileResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateFileResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateFileResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateFileResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateFileResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateFileResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateFileResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateFileResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateFileResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateFileResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateFileResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateFileResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateFileResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateFileResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateFileResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateFileResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateFileResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateFileResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateFileResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateFileResponse build() { - return new UpdateFileResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateFolderRequest.java b/src/main/java/com/apideck/unify/models/components/UpdateFolderRequest.java index 67e26a69..0181dfc0 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateFolderRequest.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateFolderRequest.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -22,39 +21,35 @@ public class UpdateFolderRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("name") - private Optional name; + private String name; /** * Optional description of the folder. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("description") - private Optional description; + private String description; /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("parent_folder_id") - private Optional parentFolderId; + private String parentFolderId; /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public UpdateFolderRequest( - @JsonProperty("name") Optional name, - @JsonProperty("description") Optional description, - @JsonProperty("parent_folder_id") Optional parentFolderId, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(parentFolderId, "parentFolderId"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("name") @Nullable String name, + @JsonProperty("description") @Nullable String description, + @JsonProperty("parent_folder_id") @Nullable String parentFolderId, + @JsonProperty("pass_through") @Nullable List passThrough) { this.name = name; this.description = description; this.parentFolderId = parentFolderId; @@ -62,41 +57,36 @@ public UpdateFolderRequest( } public UpdateFolderRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * The name of the folder. */ - @JsonIgnore public Optional name() { - return name; + return Optional.ofNullable(this.name); } /** * Optional description of the folder. */ - @JsonIgnore public Optional description() { - return description; + return Optional.ofNullable(this.description); } /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - @JsonIgnore public Optional parentFolderId() { - return parentFolderId; + return Optional.ofNullable(this.parentFolderId); } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -107,79 +97,39 @@ public static Builder builder() { /** * The name of the folder. */ - public UpdateFolderRequest withName(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - - /** - * The name of the folder. - */ - public UpdateFolderRequest withName(Optional name) { - Utils.checkNotNull(name, "name"); + public UpdateFolderRequest withName(@Nullable String name) { this.name = name; return this; } - /** - * Optional description of the folder. - */ - public UpdateFolderRequest withDescription(String description) { - Utils.checkNotNull(description, "description"); - this.description = Optional.ofNullable(description); - return this; - } - /** * Optional description of the folder. */ - public UpdateFolderRequest withDescription(Optional description) { - Utils.checkNotNull(description, "description"); + public UpdateFolderRequest withDescription(@Nullable String description) { this.description = description; return this; } - /** - * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - */ - public UpdateFolderRequest withParentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = Optional.ofNullable(parentFolderId); - return this; - } - /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - public UpdateFolderRequest withParentFolderId(Optional parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); + public UpdateFolderRequest withParentFolderId(@Nullable String parentFolderId) { this.parentFolderId = parentFolderId; return this; } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public UpdateFolderRequest withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public UpdateFolderRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public UpdateFolderRequest withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -215,96 +165,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional name = Optional.empty(); + private String name; - private Optional description = Optional.empty(); + private String description; - private Optional parentFolderId = Optional.empty(); + private String parentFolderId; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The name of the folder. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); - this.name = Optional.ofNullable(name); - return this; - } - - /** - * The name of the folder. - */ - public Builder name(Optional name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = name; return this; } - - /** - * Optional description of the folder. - */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); - this.description = Optional.ofNullable(description); - return this; - } - /** * Optional description of the folder. */ - public Builder description(Optional description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = description; return this; } - /** * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. */ - public Builder parentFolderId(String parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); - this.parentFolderId = Optional.ofNullable(parentFolderId); - return this; - } - - /** - * The parent folder to create the new file within. This can be an ID or a path depending on the downstream folder. Please see the connector section below to see downstream specific gotchas. - */ - public Builder parentFolderId(Optional parentFolderId) { - Utils.checkNotNull(parentFolderId, "parentFolderId"); + public Builder parentFolderId(@Nullable String parentFolderId) { this.parentFolderId = parentFolderId; return this; } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public UpdateFolderRequest build() { - return new UpdateFolderRequest( name, description, parentFolderId, passThrough); diff --git a/src/main/java/com/apideck/unify/models/components/UpdateFolderResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateFolderResponse.java index 6730a585..93348518 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateFolderResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateFolderResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateFolderResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateFolderResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateFolderResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateFolderResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateFolderResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateFolderResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateFolderResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateFolderResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateFolderResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateFolderResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateFolderResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateFolderResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateFolderResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateFolderResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateFolderResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateFolderResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateFolderResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateFolderResponse build() { - return new UpdateFolderResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateHrisCompanyResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateHrisCompanyResponse.java index 1a493610..bb556b0e 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateHrisCompanyResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateHrisCompanyResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateHrisCompanyResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateHrisCompanyResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateHrisCompanyResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateHrisCompanyResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateHrisCompanyResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateHrisCompanyResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateHrisCompanyResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateHrisCompanyResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateHrisCompanyResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateHrisCompanyResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateHrisCompanyResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateHrisCompanyResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateHrisCompanyResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateHrisCompanyResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateHrisCompanyResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateHrisCompanyResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateHrisCompanyResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateHrisCompanyResponse build() { - return new UpdateHrisCompanyResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateInvoiceItemsResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateInvoiceItemsResponse.java index 96cc6139..4c196679 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateInvoiceItemsResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateInvoiceItemsResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateInvoiceItemsResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateInvoiceItemsResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateInvoiceItemsResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateInvoiceItemsResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateInvoiceItemsResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateInvoiceItemsResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateInvoiceItemsResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateInvoiceItemsResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateInvoiceItemsResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateInvoiceItemsResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateInvoiceItemsResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateInvoiceItemsResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateInvoiceItemsResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateInvoiceItemsResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateInvoiceItemsResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateInvoiceItemsResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateInvoiceItemsResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateInvoiceItemsResponse build() { - return new UpdateInvoiceItemsResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateInvoiceResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateInvoiceResponse.java index c7247bcf..b3dd015e 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateInvoiceResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateInvoiceResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -62,97 +62,88 @@ public class UpdateInvoiceResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateInvoiceResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") InvoiceResponse data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull InvoiceResponse data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateInvoiceResponse( long statusCode, - String status, - String service, - String resource, - String operation, - InvoiceResponse data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull InvoiceResponse data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } - @JsonIgnore public InvoiceResponse data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -164,70 +155,61 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateInvoiceResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateInvoiceResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateInvoiceResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateInvoiceResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateInvoiceResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateInvoiceResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateInvoiceResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateInvoiceResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateInvoiceResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - public UpdateInvoiceResponse withData(InvoiceResponse data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public UpdateInvoiceResponse withData(@Nonnull InvoiceResponse data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateInvoiceResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateInvoiceResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateInvoiceResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -271,7 +253,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -283,90 +265,66 @@ public final static class Builder { private InvoiceResponse data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - - public Builder data(InvoiceResponse data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull InvoiceResponse data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateInvoiceResponse build() { - return new UpdateInvoiceResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateJournalEntryResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateJournalEntryResponse.java index f319805f..e75323df 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateJournalEntryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateJournalEntryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateJournalEntryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateJournalEntryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateJournalEntryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateJournalEntryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateJournalEntryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateJournalEntryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateJournalEntryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateJournalEntryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateJournalEntryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateJournalEntryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateJournalEntryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateJournalEntryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateJournalEntryResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateJournalEntryResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateJournalEntryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateJournalEntryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateJournalEntryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateJournalEntryResponse build() { - return new UpdateJournalEntryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateLeadResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateLeadResponse.java index f680932d..38ebe2e0 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateLeadResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateLeadResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateLeadResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateLeadResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateLeadResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateLeadResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateLeadResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateLeadResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateLeadResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateLeadResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateLeadResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateLeadResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateLeadResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateLeadResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateLeadResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateLeadResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateLeadResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateLeadResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateLeadResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateLeadResponse build() { - return new UpdateLeadResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateLedgerAccountResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateLedgerAccountResponse.java index f2597a04..b318c86d 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateLedgerAccountResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateLedgerAccountResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateLedgerAccountResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateLedgerAccountResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateLedgerAccountResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateLedgerAccountResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateLedgerAccountResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateLedgerAccountResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateLedgerAccountResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateLedgerAccountResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateLedgerAccountResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateLedgerAccountResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateLedgerAccountResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateLedgerAccountResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateLedgerAccountResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateLedgerAccountResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateLedgerAccountResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateLedgerAccountResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateLedgerAccountResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateLedgerAccountResponse build() { - return new UpdateLedgerAccountResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateMessageResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateMessageResponse.java index d30e9d1d..5d76e946 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateMessageResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateMessageResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateMessageResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateMessageResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateMessageResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateMessageResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateMessageResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateMessageResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateMessageResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateMessageResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateMessageResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateMessageResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateMessageResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateMessageResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateMessageResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateMessageResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateMessageResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateMessageResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateMessageResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateMessageResponse build() { - return new UpdateMessageResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateNoteResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateNoteResponse.java index 53da807d..19907943 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateNoteResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateNoteResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateNoteResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateNoteResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateNoteResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateNoteResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateNoteResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateNoteResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateNoteResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateNoteResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateNoteResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateNoteResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateNoteResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateNoteResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateNoteResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateNoteResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateNoteResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateNoteResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateNoteResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateNoteResponse build() { - return new UpdateNoteResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateOpportunityResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateOpportunityResponse.java index eb54f9a7..2c600265 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateOpportunityResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateOpportunityResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateOpportunityResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateOpportunityResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateOpportunityResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateOpportunityResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateOpportunityResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateOpportunityResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateOpportunityResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateOpportunityResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateOpportunityResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateOpportunityResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateOpportunityResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateOpportunityResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateOpportunityResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateOpportunityResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateOpportunityResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateOpportunityResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateOpportunityResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateOpportunityResponse build() { - return new UpdateOpportunityResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdatePaymentResponse.java b/src/main/java/com/apideck/unify/models/components/UpdatePaymentResponse.java index 676abdab..387f005d 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdatePaymentResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdatePaymentResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdatePaymentResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdatePaymentResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdatePaymentResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdatePaymentResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdatePaymentResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdatePaymentResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdatePaymentResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdatePaymentResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdatePaymentResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdatePaymentResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdatePaymentResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdatePaymentResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdatePaymentResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdatePaymentResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdatePaymentResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdatePaymentResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdatePaymentResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdatePaymentResponse build() { - return new UpdatePaymentResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdatePipelineResponse.java b/src/main/java/com/apideck/unify/models/components/UpdatePipelineResponse.java index d8d9bec5..c741be61 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdatePipelineResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdatePipelineResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdatePipelineResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdatePipelineResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdatePipelineResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdatePipelineResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdatePipelineResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdatePipelineResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdatePipelineResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdatePipelineResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdatePipelineResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdatePipelineResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdatePipelineResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdatePipelineResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdatePipelineResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdatePipelineResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdatePipelineResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdatePipelineResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdatePipelineResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdatePipelineResponse build() { - return new UpdatePipelineResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdatePurchaseOrderResponse.java b/src/main/java/com/apideck/unify/models/components/UpdatePurchaseOrderResponse.java index a1b4c380..74509242 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdatePurchaseOrderResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdatePurchaseOrderResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdatePurchaseOrderResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdatePurchaseOrderResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdatePurchaseOrderResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdatePurchaseOrderResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdatePurchaseOrderResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdatePurchaseOrderResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdatePurchaseOrderResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdatePurchaseOrderResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdatePurchaseOrderResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdatePurchaseOrderResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdatePurchaseOrderResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdatePurchaseOrderResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdatePurchaseOrderResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdatePurchaseOrderResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdatePurchaseOrderResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdatePurchaseOrderResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdatePurchaseOrderResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdatePurchaseOrderResponse build() { - return new UpdatePurchaseOrderResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateSharedLinkResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateSharedLinkResponse.java index b75c3163..b09856d5 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateSharedLinkResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateSharedLinkResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateSharedLinkResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateSharedLinkResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateSharedLinkResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateSharedLinkResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateSharedLinkResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateSharedLinkResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateSharedLinkResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateSharedLinkResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateSharedLinkResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateSharedLinkResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateSharedLinkResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateSharedLinkResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateSharedLinkResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateSharedLinkResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateSharedLinkResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateSharedLinkResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateSharedLinkResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateSharedLinkResponse build() { - return new UpdateSharedLinkResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateSubsidiaryResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateSubsidiaryResponse.java index d45ae6ce..cf74c8fc 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateSubsidiaryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateSubsidiaryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateSubsidiaryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateSubsidiaryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateSubsidiaryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateSubsidiaryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateSubsidiaryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateSubsidiaryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateSubsidiaryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateSubsidiaryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateSubsidiaryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateSubsidiaryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateSubsidiaryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateSubsidiaryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateSubsidiaryResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateSubsidiaryResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateSubsidiaryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateSubsidiaryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateSubsidiaryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateSubsidiaryResponse build() { - return new UpdateSubsidiaryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateSupplierResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateSupplierResponse.java index 7b85304a..ea97de73 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateSupplierResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateSupplierResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateSupplierResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateSupplierResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateSupplierResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateSupplierResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateSupplierResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateSupplierResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateSupplierResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateSupplierResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateSupplierResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateSupplierResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateSupplierResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateSupplierResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateSupplierResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateSupplierResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateSupplierResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateSupplierResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateSupplierResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateSupplierResponse build() { - return new UpdateSupplierResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateTaxRateResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateTaxRateResponse.java index 9d17f1f5..8d57cb3d 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateTaxRateResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateTaxRateResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateTaxRateResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateTaxRateResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateTaxRateResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateTaxRateResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateTaxRateResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateTaxRateResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateTaxRateResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateTaxRateResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateTaxRateResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateTaxRateResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateTaxRateResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateTaxRateResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateTaxRateResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateTaxRateResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateTaxRateResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateTaxRateResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateTaxRateResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateTaxRateResponse build() { - return new UpdateTaxRateResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateTicketResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateTicketResponse.java index 834aff64..df8c2370 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateTicketResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateTicketResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateTicketResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateTicketResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateTicketResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateTicketResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateTicketResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateTicketResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateTicketResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateTicketResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateTicketResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateTicketResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateTicketResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateTicketResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateTicketResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateTicketResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateTicketResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateTicketResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateTicketResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateTicketResponse build() { - return new UpdateTicketResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateTimeOffRequestResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateTimeOffRequestResponse.java index b6dfdd85..55e784ff 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateTimeOffRequestResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateTimeOffRequestResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateTimeOffRequestResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateTimeOffRequestResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateTimeOffRequestResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateTimeOffRequestResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateTimeOffRequestResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateTimeOffRequestResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateTimeOffRequestResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateTimeOffRequestResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateTimeOffRequestResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateTimeOffRequestResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateTimeOffRequestResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateTimeOffRequestResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateTimeOffRequestResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateTimeOffRequestResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateTimeOffRequestResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateTimeOffRequestResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateTimeOffRequestResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateTimeOffRequestResponse build() { - return new UpdateTimeOffRequestResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateTrackingCategoryResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateTrackingCategoryResponse.java index fc15b279..29dd5545 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateTrackingCategoryResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateTrackingCategoryResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateTrackingCategoryResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateTrackingCategoryResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateTrackingCategoryResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateTrackingCategoryResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateTrackingCategoryResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateTrackingCategoryResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateTrackingCategoryResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateTrackingCategoryResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateTrackingCategoryResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateTrackingCategoryResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateTrackingCategoryResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateTrackingCategoryResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateTrackingCategoryResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateTrackingCategoryResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateTrackingCategoryResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateTrackingCategoryResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateTrackingCategoryResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateTrackingCategoryResponse build() { - return new UpdateTrackingCategoryResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateUploadSessionResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateUploadSessionResponse.java index 58deaf72..a5aaf2b2 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateUploadSessionResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateUploadSessionResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateUploadSessionResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateUploadSessionResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateUploadSessionResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateUploadSessionResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateUploadSessionResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateUploadSessionResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateUploadSessionResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateUploadSessionResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateUploadSessionResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateUploadSessionResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateUploadSessionResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateUploadSessionResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateUploadSessionResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateUploadSessionResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateUploadSessionResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateUploadSessionResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateUploadSessionResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateUploadSessionResponse build() { - return new UpdateUploadSessionResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateUserResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateUserResponse.java index b1a805a9..f9c29b81 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateUserResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateUserResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -64,100 +64,91 @@ public class UpdateUserResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateUserResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("service") String service, - @JsonProperty("resource") String resource, - @JsonProperty("operation") String operation, - @JsonProperty("data") UnifiedId data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(service, "service"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(operation, "operation"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("service") @Nonnull String service, + @JsonProperty("resource") @Nonnull String resource, + @JsonProperty("operation") @Nonnull String operation, + @JsonProperty("data") @Nonnull UnifiedId data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.service = service; - this.resource = resource; - this.operation = operation; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.service = Optional.ofNullable(service) + .orElseThrow(() -> new IllegalArgumentException("service cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.operation = Optional.ofNullable(operation) + .orElseThrow(() -> new IllegalArgumentException("operation cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateUserResponse( long statusCode, - String status, - String service, - String resource, - String operation, - UnifiedId data) { + @Nonnull String status, + @Nonnull String service, + @Nonnull String resource, + @Nonnull String operation, + @Nonnull UnifiedId data) { this(statusCode, status, service, resource, operation, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } /** * Apideck ID of service provider */ - @JsonIgnore public String service() { - return service; + return this.service; } /** * Unified API resource name */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Operation performed */ - @JsonIgnore public String operation() { - return operation; + return this.operation; } /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - @JsonIgnore public UnifiedId data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -169,73 +160,64 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateUserResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateUserResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateUserResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } + /** * Apideck ID of service provider */ - public UpdateUserResponse withService(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public UpdateUserResponse withService(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } + /** * Unified API resource name */ - public UpdateUserResponse withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public UpdateUserResponse withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Operation performed */ - public UpdateUserResponse withOperation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public UpdateUserResponse withOperation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } + /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public UpdateUserResponse withData(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public UpdateUserResponse withData(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateUserResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateUserResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateUserResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -279,7 +261,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; @@ -291,93 +273,69 @@ public final static class Builder { private UnifiedId data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - /** * Apideck ID of service provider */ - public Builder service(String service) { - Utils.checkNotNull(service, "service"); - this.service = service; + public Builder service(@Nonnull String service) { + this.service = Utils.checkNotNull(service, "service"); return this; } - /** * Unified API resource name */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Operation performed */ - public Builder operation(String operation) { - Utils.checkNotNull(operation, "operation"); - this.operation = operation; + public Builder operation(@Nonnull String operation) { + this.operation = Utils.checkNotNull(operation, "operation"); return this; } - /** * A object containing a unique identifier for the resource that was created, updated, or deleted. */ - public Builder data(UnifiedId data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull UnifiedId data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateUserResponse build() { - return new UpdateUserResponse( statusCode, status, service, resource, operation, data, diff --git a/src/main/java/com/apideck/unify/models/components/UpdateWebhookRequest.java b/src/main/java/com/apideck/unify/models/components/UpdateWebhookRequest.java index 392a1e2d..f15b4da0 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateWebhookRequest.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateWebhookRequest.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,75 +29,66 @@ public class UpdateWebhookRequest { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status") - private Optional status; + private Status status; /** * The delivery url of the webhook endpoint. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("delivery_url") - private Optional deliveryUrl; + private String deliveryUrl; /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("events") - private Optional> events; + private List events; @JsonCreator public UpdateWebhookRequest( - @JsonProperty("description") JsonNullable description, - @JsonProperty("status") Optional status, - @JsonProperty("delivery_url") Optional deliveryUrl, - @JsonProperty("events") Optional> events) { - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); - Utils.checkNotNull(events, "events"); - this.description = description; + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("status") @Nullable Status status, + @JsonProperty("delivery_url") @Nullable String deliveryUrl, + @JsonProperty("events") @Nullable List events) { + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); this.status = status; this.deliveryUrl = deliveryUrl; this.events = events; } public UpdateWebhookRequest() { - this(JsonNullable.undefined(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The status of the webhook. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional status() { - return (Optional) status; + return Optional.ofNullable(this.status); } /** * The delivery url of the webhook endpoint. */ - @JsonIgnore public Optional deliveryUrl() { - return deliveryUrl; + return Optional.ofNullable(this.deliveryUrl); } /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> events() { - return (Optional>) events; + return Optional.ofNullable(this.events); } public static Builder builder() { @@ -109,78 +99,39 @@ public static Builder builder() { /** * A description of the object. */ - public UpdateWebhookRequest withDescription(String description) { - Utils.checkNotNull(description, "description"); + public UpdateWebhookRequest withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public UpdateWebhookRequest withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** - * The status of the webhook. - */ - public UpdateWebhookRequest withStatus(Status status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * The status of the webhook. */ - public UpdateWebhookRequest withStatus(Optional status) { - Utils.checkNotNull(status, "status"); + public UpdateWebhookRequest withStatus(@Nullable Status status) { this.status = status; return this; } - /** - * The delivery url of the webhook endpoint. - */ - public UpdateWebhookRequest withDeliveryUrl(String deliveryUrl) { - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); - this.deliveryUrl = Optional.ofNullable(deliveryUrl); - return this; - } - /** * The delivery url of the webhook endpoint. */ - public UpdateWebhookRequest withDeliveryUrl(Optional deliveryUrl) { - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); + public UpdateWebhookRequest withDeliveryUrl(@Nullable String deliveryUrl) { this.deliveryUrl = deliveryUrl; return this; } - /** - * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. - */ - public UpdateWebhookRequest withEvents(List events) { - Utils.checkNotNull(events, "events"); - this.events = Optional.ofNullable(events); - return this; - } - /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ - public UpdateWebhookRequest withEvents(Optional> events) { - Utils.checkNotNull(events, "events"); + public UpdateWebhookRequest withEvents(@Nullable List events) { this.events = events; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -216,96 +167,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private Optional status = Optional.empty(); + private Status status; - private Optional deliveryUrl = Optional.empty(); + private String deliveryUrl; - private Optional> events = Optional.empty(); + private List events; private Builder() { // force use of static builder() method } - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - - /** - * The status of the webhook. - */ - public Builder status(Status status) { - Utils.checkNotNull(status, "status"); - this.status = Optional.ofNullable(status); - return this; - } - /** * The status of the webhook. */ - public Builder status(Optional status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable Status status) { this.status = status; return this; } - /** * The delivery url of the webhook endpoint. */ - public Builder deliveryUrl(String deliveryUrl) { - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); - this.deliveryUrl = Optional.ofNullable(deliveryUrl); - return this; - } - - /** - * The delivery url of the webhook endpoint. - */ - public Builder deliveryUrl(Optional deliveryUrl) { - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); + public Builder deliveryUrl(@Nullable String deliveryUrl) { this.deliveryUrl = deliveryUrl; return this; } - /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ - public Builder events(List events) { - Utils.checkNotNull(events, "events"); - this.events = Optional.ofNullable(events); - return this; - } - - /** - * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. - */ - public Builder events(Optional> events) { - Utils.checkNotNull(events, "events"); + public Builder events(@Nullable List events) { this.events = events; return this; } public UpdateWebhookRequest build() { - return new UpdateWebhookRequest( description, status, deliveryUrl, events); diff --git a/src/main/java/com/apideck/unify/models/components/UpdateWebhookResponse.java b/src/main/java/com/apideck/unify/models/components/UpdateWebhookResponse.java index 333edc09..5eb274c8 100644 --- a/src/main/java/com/apideck/unify/models/components/UpdateWebhookResponse.java +++ b/src/main/java/com/apideck/unify/models/components/UpdateWebhookResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class UpdateWebhookResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public UpdateWebhookResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") Webhook data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull Webhook data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public UpdateWebhookResponse( long statusCode, - String status, - Webhook data) { + @Nonnull String status, + @Nonnull Webhook data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public Webhook data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public UpdateWebhookResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public UpdateWebhookResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public UpdateWebhookResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public UpdateWebhookResponse withData(Webhook data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public UpdateWebhookResponse withData(@Nonnull Webhook data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public UpdateWebhookResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public UpdateWebhookResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public UpdateWebhookResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private Webhook data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(Webhook data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull Webhook data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public UpdateWebhookResponse build() { - return new UpdateWebhookResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/UploadSession.java b/src/main/java/com/apideck/unify/models/components/UploadSession.java index 963a43fc..12298f3a 100644 --- a/src/main/java/com/apideck/unify/models/components/UploadSession.java +++ b/src/main/java/com/apideck/unify/models/components/UploadSession.java @@ -5,10 +5,10 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Double; import java.lang.Override; @@ -24,35 +24,35 @@ public class UploadSession { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * Indicates if the upload session was completed successfully. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("success") - private Optional success; + private Boolean success; /** * Size in bytes of each part of the file that you will upload. Uploaded parts need to be this size for the upload to be successful. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("part_size") - private Optional partSize; + private Double partSize; /** * Indicates if parts of the file can uploaded in parallel. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("parallel_upload_supported") - private Optional parallelUploadSupported; + private Boolean parallelUploadSupported; /** * The range of bytes that was successfully uploaded. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("uploaded_byte_range") - private Optional uploadedByteRange; + private String uploadedByteRange; @JsonInclude(Include.NON_ABSENT) @@ -61,74 +61,63 @@ public class UploadSession { @JsonCreator public UploadSession( - @JsonProperty("id") Optional id, - @JsonProperty("success") Optional success, - @JsonProperty("part_size") Optional partSize, - @JsonProperty("parallel_upload_supported") Optional parallelUploadSupported, - @JsonProperty("uploaded_byte_range") Optional uploadedByteRange, - @JsonProperty("expires_at") JsonNullable expiresAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(success, "success"); - Utils.checkNotNull(partSize, "partSize"); - Utils.checkNotNull(parallelUploadSupported, "parallelUploadSupported"); - Utils.checkNotNull(uploadedByteRange, "uploadedByteRange"); - Utils.checkNotNull(expiresAt, "expiresAt"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("success") @Nullable Boolean success, + @JsonProperty("part_size") @Nullable Double partSize, + @JsonProperty("parallel_upload_supported") @Nullable Boolean parallelUploadSupported, + @JsonProperty("uploaded_byte_range") @Nullable String uploadedByteRange, + @JsonProperty("expires_at") @Nullable JsonNullable expiresAt) { this.id = id; this.success = success; this.partSize = partSize; this.parallelUploadSupported = parallelUploadSupported; this.uploadedByteRange = uploadedByteRange; - this.expiresAt = expiresAt; + this.expiresAt = Optional.ofNullable(expiresAt) + .orElse(JsonNullable.undefined()); } public UploadSession() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null); } /** * A unique identifier for an object. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * Indicates if the upload session was completed successfully. */ - @JsonIgnore public Optional success() { - return success; + return Optional.ofNullable(this.success); } /** * Size in bytes of each part of the file that you will upload. Uploaded parts need to be this size for the upload to be successful. */ - @JsonIgnore public Optional partSize() { - return partSize; + return Optional.ofNullable(this.partSize); } /** * Indicates if parts of the file can uploaded in parallel. */ - @JsonIgnore public Optional parallelUploadSupported() { - return parallelUploadSupported; + return Optional.ofNullable(this.parallelUploadSupported); } /** * The range of bytes that was successfully uploaded. */ - @JsonIgnore public Optional uploadedByteRange() { - return uploadedByteRange; + return Optional.ofNullable(this.uploadedByteRange); } - @JsonIgnore public JsonNullable expiresAt() { - return expiresAt; + return this.expiresAt; } public static Builder builder() { @@ -139,109 +128,53 @@ public static Builder builder() { /** * A unique identifier for an object. */ - public UploadSession withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * A unique identifier for an object. - */ - public UploadSession withId(Optional id) { - Utils.checkNotNull(id, "id"); + public UploadSession withId(@Nullable String id) { this.id = id; return this; } - /** - * Indicates if the upload session was completed successfully. - */ - public UploadSession withSuccess(boolean success) { - Utils.checkNotNull(success, "success"); - this.success = Optional.ofNullable(success); - return this; - } - /** * Indicates if the upload session was completed successfully. */ - public UploadSession withSuccess(Optional success) { - Utils.checkNotNull(success, "success"); + public UploadSession withSuccess(@Nullable Boolean success) { this.success = success; return this; } - /** - * Size in bytes of each part of the file that you will upload. Uploaded parts need to be this size for the upload to be successful. - */ - public UploadSession withPartSize(double partSize) { - Utils.checkNotNull(partSize, "partSize"); - this.partSize = Optional.ofNullable(partSize); - return this; - } - /** * Size in bytes of each part of the file that you will upload. Uploaded parts need to be this size for the upload to be successful. */ - public UploadSession withPartSize(Optional partSize) { - Utils.checkNotNull(partSize, "partSize"); + public UploadSession withPartSize(@Nullable Double partSize) { this.partSize = partSize; return this; } - /** - * Indicates if parts of the file can uploaded in parallel. - */ - public UploadSession withParallelUploadSupported(boolean parallelUploadSupported) { - Utils.checkNotNull(parallelUploadSupported, "parallelUploadSupported"); - this.parallelUploadSupported = Optional.ofNullable(parallelUploadSupported); - return this; - } - /** * Indicates if parts of the file can uploaded in parallel. */ - public UploadSession withParallelUploadSupported(Optional parallelUploadSupported) { - Utils.checkNotNull(parallelUploadSupported, "parallelUploadSupported"); + public UploadSession withParallelUploadSupported(@Nullable Boolean parallelUploadSupported) { this.parallelUploadSupported = parallelUploadSupported; return this; } - /** - * The range of bytes that was successfully uploaded. - */ - public UploadSession withUploadedByteRange(String uploadedByteRange) { - Utils.checkNotNull(uploadedByteRange, "uploadedByteRange"); - this.uploadedByteRange = Optional.ofNullable(uploadedByteRange); - return this; - } - /** * The range of bytes that was successfully uploaded. */ - public UploadSession withUploadedByteRange(Optional uploadedByteRange) { - Utils.checkNotNull(uploadedByteRange, "uploadedByteRange"); + public UploadSession withUploadedByteRange(@Nullable String uploadedByteRange) { this.uploadedByteRange = uploadedByteRange; return this; } - public UploadSession withExpiresAt(OffsetDateTime expiresAt) { - Utils.checkNotNull(expiresAt, "expiresAt"); + + public UploadSession withExpiresAt(@Nullable OffsetDateTime expiresAt) { this.expiresAt = JsonNullable.of(expiresAt); return this; } - public UploadSession withExpiresAt(JsonNullable expiresAt) { - Utils.checkNotNull(expiresAt, "expiresAt"); - this.expiresAt = expiresAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -282,132 +215,68 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional success = Optional.empty(); + private Boolean success; - private Optional partSize = Optional.empty(); + private Double partSize; - private Optional parallelUploadSupported = Optional.empty(); + private Boolean parallelUploadSupported; - private Optional uploadedByteRange = Optional.empty(); + private String uploadedByteRange; - private JsonNullable expiresAt = JsonNullable.undefined(); + private JsonNullable expiresAt; private Builder() { // force use of static builder() method } - - /** - * A unique identifier for an object. - */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - /** * A unique identifier for an object. */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * Indicates if the upload session was completed successfully. */ - public Builder success(boolean success) { - Utils.checkNotNull(success, "success"); - this.success = Optional.ofNullable(success); - return this; - } - - /** - * Indicates if the upload session was completed successfully. - */ - public Builder success(Optional success) { - Utils.checkNotNull(success, "success"); + public Builder success(@Nullable Boolean success) { this.success = success; return this; } - /** * Size in bytes of each part of the file that you will upload. Uploaded parts need to be this size for the upload to be successful. */ - public Builder partSize(double partSize) { - Utils.checkNotNull(partSize, "partSize"); - this.partSize = Optional.ofNullable(partSize); - return this; - } - - /** - * Size in bytes of each part of the file that you will upload. Uploaded parts need to be this size for the upload to be successful. - */ - public Builder partSize(Optional partSize) { - Utils.checkNotNull(partSize, "partSize"); + public Builder partSize(@Nullable Double partSize) { this.partSize = partSize; return this; } - /** * Indicates if parts of the file can uploaded in parallel. */ - public Builder parallelUploadSupported(boolean parallelUploadSupported) { - Utils.checkNotNull(parallelUploadSupported, "parallelUploadSupported"); - this.parallelUploadSupported = Optional.ofNullable(parallelUploadSupported); - return this; - } - - /** - * Indicates if parts of the file can uploaded in parallel. - */ - public Builder parallelUploadSupported(Optional parallelUploadSupported) { - Utils.checkNotNull(parallelUploadSupported, "parallelUploadSupported"); + public Builder parallelUploadSupported(@Nullable Boolean parallelUploadSupported) { this.parallelUploadSupported = parallelUploadSupported; return this; } - - /** - * The range of bytes that was successfully uploaded. - */ - public Builder uploadedByteRange(String uploadedByteRange) { - Utils.checkNotNull(uploadedByteRange, "uploadedByteRange"); - this.uploadedByteRange = Optional.ofNullable(uploadedByteRange); - return this; - } - /** * The range of bytes that was successfully uploaded. */ - public Builder uploadedByteRange(Optional uploadedByteRange) { - Utils.checkNotNull(uploadedByteRange, "uploadedByteRange"); + public Builder uploadedByteRange(@Nullable String uploadedByteRange) { this.uploadedByteRange = uploadedByteRange; return this; } - - public Builder expiresAt(OffsetDateTime expiresAt) { - Utils.checkNotNull(expiresAt, "expiresAt"); + public Builder expiresAt(@Nullable OffsetDateTime expiresAt) { this.expiresAt = JsonNullable.of(expiresAt); return this; } - public Builder expiresAt(JsonNullable expiresAt) { - Utils.checkNotNull(expiresAt, "expiresAt"); - this.expiresAt = expiresAt; - return this; - } - public UploadSession build() { - return new UploadSession( id, success, partSize, parallelUploadSupported, uploadedByteRange, expiresAt); diff --git a/src/main/java/com/apideck/unify/models/components/User.java b/src/main/java/com/apideck/unify/models/components/User.java index c2217290..95bf4b9f 100644 --- a/src/main/java/com/apideck/unify/models/components/User.java +++ b/src/main/java/com/apideck/unify/models/components/User.java @@ -5,15 +5,15 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Deprecated; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Map; import java.util.Optional; @@ -26,7 +26,7 @@ public class User { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * The parent user id @@ -125,12 +125,12 @@ public class User { @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonProperty("emails") @@ -141,7 +141,7 @@ public class User { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("custom_mappings") - private JsonNullable> customMappings; + private JsonNullable> customMappings; /** * The date and time when the user was last updated. @@ -162,140 +162,129 @@ public class User { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public User( - @JsonProperty("id") Optional id, - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("username") JsonNullable username, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("title") JsonNullable title, - @JsonProperty("division") JsonNullable division, - @JsonProperty("department") JsonNullable department, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("employee_number") JsonNullable employeeNumber, - @JsonProperty("description") JsonNullable description, - @JsonProperty("image") JsonNullable image, - @JsonProperty("language") JsonNullable language, - @JsonProperty("status") JsonNullable status, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") List emails, - @JsonProperty("custom_mappings") JsonNullable> customMappings, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(username, "username"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(division, "division"); - Utils.checkNotNull(department, "department"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(employeeNumber, "employeeNumber"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(image, "image"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(customMappings, "customMappings"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); - Utils.checkNotNull(passThrough, "passThrough"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("username") @Nullable JsonNullable username, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("division") @Nullable JsonNullable division, + @JsonProperty("department") @Nullable JsonNullable department, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("employee_number") @Nullable JsonNullable employeeNumber, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("image") @Nullable JsonNullable image, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nonnull List emails, + @JsonProperty("custom_mappings") @Nullable JsonNullable> customMappings, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt, + @JsonProperty("pass_through") @Nullable List passThrough) { this.id = id; - this.parentId = parentId; - this.username = username; - this.firstName = firstName; - this.lastName = lastName; - this.title = title; - this.division = division; - this.department = department; - this.companyName = companyName; - this.employeeNumber = employeeNumber; - this.description = description; - this.image = image; - this.language = language; - this.status = status; + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.username = Optional.ofNullable(username) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.division = Optional.ofNullable(division) + .orElse(JsonNullable.undefined()); + this.department = Optional.ofNullable(department) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.employeeNumber = Optional.ofNullable(employeeNumber) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.image = Optional.ofNullable(image) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.phoneNumbers = phoneNumbers; - this.emails = emails; - this.customMappings = customMappings; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.emails = Optional.ofNullable(emails) + .orElseThrow(() -> new IllegalArgumentException("emails cannot be null")); + this.customMappings = Optional.ofNullable(customMappings) + .orElse(JsonNullable.undefined()); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; } public User( - List emails) { - this(Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), emails, JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty()); + @Nonnull List emails) { + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, emails, null, + null, null, null); } /** * The unique identifier for the user */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * The parent user id */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The username of the user */ - @JsonIgnore public JsonNullable username() { - return username; + return this.username; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - @JsonIgnore public JsonNullable division() { - return division; + return this.division; } /** @@ -304,108 +293,90 @@ public JsonNullable division() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable department() { - return department; + return this.department; } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - @JsonIgnore public JsonNullable employeeNumber() { - return employeeNumber; + return this.employeeNumber; } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The URL of the user's avatar */ - @JsonIgnore public JsonNullable image() { - return image; + return this.image; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } /** * The status of the user */ - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @JsonIgnore public List emails() { - return emails; + return this.emails; } /** * When custom mappings are configured on the resource, the result is included here. */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> customMappings() { - return (JsonNullable>) customMappings; + return this.customMappings; } /** * The date and time when the user was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the user was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -416,129 +387,65 @@ public static Builder builder() { /** * The unique identifier for the user */ - public User withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier for the user - */ - public User withId(Optional id) { - Utils.checkNotNull(id, "id"); + public User withId(@Nullable String id) { this.id = id; return this; } + /** * The parent user id */ - public User withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public User withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * The parent user id - */ - public User withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The username of the user */ - public User withUsername(String username) { - Utils.checkNotNull(username, "username"); + public User withUsername(@Nullable String username) { this.username = JsonNullable.of(username); return this; } - /** - * The username of the user - */ - public User withUsername(JsonNullable username) { - Utils.checkNotNull(username, "username"); - this.username = username; - return this; - } /** * The first name of the person. */ - public User withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public User withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public User withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public User withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public User withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public User withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * The job title of the person. */ - public User withTitle(String title) { - Utils.checkNotNull(title, "title"); + public User withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public User withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - public User withDivision(String division) { - Utils.checkNotNull(division, "division"); + public User withDivision(@Nullable String division) { this.division = JsonNullable.of(division); return this; } - /** - * The division the person is currently in. Usually a collection of departments or teams or regions. - */ - public User withDivision(JsonNullable division) { - Utils.checkNotNull(division, "division"); - this.division = division; - return this; - } /** * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. @@ -546,237 +453,120 @@ public User withDivision(JsonNullable division) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public User withDepartment(String department) { - Utils.checkNotNull(department, "department"); + public User withDepartment(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public User withDepartment(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } /** * The name of the company. */ - public User withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public User withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public User withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - public User withEmployeeNumber(String employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); + public User withEmployeeNumber(@Nullable String employeeNumber) { this.employeeNumber = JsonNullable.of(employeeNumber); return this; } - /** - * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - */ - public User withEmployeeNumber(JsonNullable employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); - this.employeeNumber = employeeNumber; - return this; - } /** * A description of the object. */ - public User withDescription(String description) { - Utils.checkNotNull(description, "description"); + public User withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public User withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The URL of the user's avatar */ - public User withImage(String image) { - Utils.checkNotNull(image, "image"); + public User withImage(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * The URL of the user's avatar - */ - public User withImage(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public User withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public User withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public User withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } /** * The status of the user */ - public User withStatus(String status) { - Utils.checkNotNull(status, "status"); + public User withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the user - */ - public User withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - public User withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - - public User withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public User withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public User withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public User withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public User withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public User withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = emails; + + public User withEmails(@Nonnull List emails) { + this.emails = Utils.checkNotNull(emails, "emails"); return this; } + /** * When custom mappings are configured on the resource, the result is included here. */ - public User withCustomMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public User withCustomMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public User withCustomMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } /** * The date and time when the user was last updated. */ - public User withUpdatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public User withUpdatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the user was last updated. - */ - public User withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the user was created. */ - public User withCreatedAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public User withCreatedAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the user was created. - */ - public User withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public User withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public User withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public User withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -851,436 +641,216 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable username = JsonNullable.undefined(); + private JsonNullable username; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable division = JsonNullable.undefined(); + private JsonNullable division; @Deprecated - private JsonNullable department = JsonNullable.undefined(); + private JsonNullable department; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable employeeNumber = JsonNullable.undefined(); + private JsonNullable employeeNumber; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable image = JsonNullable.undefined(); + private JsonNullable image; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; private List emails; - private JsonNullable> customMappings = JsonNullable.undefined(); + private JsonNullable> customMappings; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The unique identifier for the user */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * The unique identifier for the user - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * The parent user id */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * The parent user id - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The username of the user */ - public Builder username(String username) { - Utils.checkNotNull(username, "username"); + public Builder username(@Nullable String username) { this.username = JsonNullable.of(username); return this; } - /** - * The username of the user - */ - public Builder username(JsonNullable username) { - Utils.checkNotNull(username, "username"); - this.username = username; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - public Builder division(String division) { - Utils.checkNotNull(division, "division"); + public Builder division(@Nullable String division) { this.division = JsonNullable.of(division); return this; } - /** - * The division the person is currently in. Usually a collection of departments or teams or regions. - */ - public Builder division(JsonNullable division) { - Utils.checkNotNull(division, "division"); - this.division = division; - return this; - } - - /** * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder department(String department) { - Utils.checkNotNull(department, "department"); + public Builder department(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder department(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } - - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - public Builder employeeNumber(String employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); + public Builder employeeNumber(@Nullable String employeeNumber) { this.employeeNumber = JsonNullable.of(employeeNumber); return this; } - /** - * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - */ - public Builder employeeNumber(JsonNullable employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); - this.employeeNumber = employeeNumber; - return this; - } - - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The URL of the user's avatar */ - public Builder image(String image) { - Utils.checkNotNull(image, "image"); + public Builder image(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * The URL of the user's avatar - */ - public Builder image(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - /** * The status of the user */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the user - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = emails; + public Builder emails(@Nonnull List emails) { + this.emails = Utils.checkNotNull(emails, "emails"); return this; } - /** * When custom mappings are configured on the resource, the result is included here. */ - public Builder customMappings(Map customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); + public Builder customMappings(@Nullable Map customMappings) { this.customMappings = JsonNullable.of(customMappings); return this; } - /** - * When custom mappings are configured on the resource, the result is included here. - */ - public Builder customMappings(JsonNullable> customMappings) { - Utils.checkNotNull(customMappings, "customMappings"); - this.customMappings = customMappings; - return this; - } - - /** * The date and time when the user was last updated. */ - public Builder updatedAt(String updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable String updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the user was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the user was created. */ - public Builder createdAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable String createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the user was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - - /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public User build() { - return new User( id, parentId, username, firstName, lastName, title, diff --git a/src/main/java/com/apideck/unify/models/components/UserInput.java b/src/main/java/com/apideck/unify/models/components/UserInput.java index b47a684f..5f025e3f 100644 --- a/src/main/java/com/apideck/unify/models/components/UserInput.java +++ b/src/main/java/com/apideck/unify/models/components/UserInput.java @@ -5,14 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Deprecated; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -123,12 +123,12 @@ public class UserInput { @JsonInclude(Include.NON_ABSENT) @JsonProperty("addresses") - private Optional> addresses; + private List
addresses; @JsonInclude(Include.NON_ABSENT) @JsonProperty("phone_numbers") - private Optional> phoneNumbers; + private List phoneNumbers; @JsonProperty("emails") @@ -139,122 +139,113 @@ public class UserInput { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("pass_through") - private Optional> passThrough; + private List passThrough; @JsonCreator public UserInput( - @JsonProperty("parent_id") JsonNullable parentId, - @JsonProperty("username") JsonNullable username, - @JsonProperty("first_name") JsonNullable firstName, - @JsonProperty("last_name") JsonNullable lastName, - @JsonProperty("title") JsonNullable title, - @JsonProperty("division") JsonNullable division, - @JsonProperty("department") JsonNullable department, - @JsonProperty("company_name") JsonNullable companyName, - @JsonProperty("employee_number") JsonNullable employeeNumber, - @JsonProperty("description") JsonNullable description, - @JsonProperty("image") JsonNullable image, - @JsonProperty("language") JsonNullable language, - @JsonProperty("status") JsonNullable status, - @JsonProperty("password") JsonNullable password, - @JsonProperty("addresses") Optional> addresses, - @JsonProperty("phone_numbers") Optional> phoneNumbers, - @JsonProperty("emails") List emails, - @JsonProperty("pass_through") Optional> passThrough) { - Utils.checkNotNull(parentId, "parentId"); - Utils.checkNotNull(username, "username"); - Utils.checkNotNull(firstName, "firstName"); - Utils.checkNotNull(lastName, "lastName"); - Utils.checkNotNull(title, "title"); - Utils.checkNotNull(division, "division"); - Utils.checkNotNull(department, "department"); - Utils.checkNotNull(companyName, "companyName"); - Utils.checkNotNull(employeeNumber, "employeeNumber"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(image, "image"); - Utils.checkNotNull(language, "language"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(password, "password"); - Utils.checkNotNull(addresses, "addresses"); - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - Utils.checkNotNull(emails, "emails"); - Utils.checkNotNull(passThrough, "passThrough"); - this.parentId = parentId; - this.username = username; - this.firstName = firstName; - this.lastName = lastName; - this.title = title; - this.division = division; - this.department = department; - this.companyName = companyName; - this.employeeNumber = employeeNumber; - this.description = description; - this.image = image; - this.language = language; - this.status = status; - this.password = password; + @JsonProperty("parent_id") @Nullable JsonNullable parentId, + @JsonProperty("username") @Nullable JsonNullable username, + @JsonProperty("first_name") @Nullable JsonNullable firstName, + @JsonProperty("last_name") @Nullable JsonNullable lastName, + @JsonProperty("title") @Nullable JsonNullable title, + @JsonProperty("division") @Nullable JsonNullable division, + @JsonProperty("department") @Nullable JsonNullable department, + @JsonProperty("company_name") @Nullable JsonNullable companyName, + @JsonProperty("employee_number") @Nullable JsonNullable employeeNumber, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("image") @Nullable JsonNullable image, + @JsonProperty("language") @Nullable JsonNullable language, + @JsonProperty("status") @Nullable JsonNullable status, + @JsonProperty("password") @Nullable JsonNullable password, + @JsonProperty("addresses") @Nullable List
addresses, + @JsonProperty("phone_numbers") @Nullable List phoneNumbers, + @JsonProperty("emails") @Nonnull List emails, + @JsonProperty("pass_through") @Nullable List passThrough) { + this.parentId = Optional.ofNullable(parentId) + .orElse(JsonNullable.undefined()); + this.username = Optional.ofNullable(username) + .orElse(JsonNullable.undefined()); + this.firstName = Optional.ofNullable(firstName) + .orElse(JsonNullable.undefined()); + this.lastName = Optional.ofNullable(lastName) + .orElse(JsonNullable.undefined()); + this.title = Optional.ofNullable(title) + .orElse(JsonNullable.undefined()); + this.division = Optional.ofNullable(division) + .orElse(JsonNullable.undefined()); + this.department = Optional.ofNullable(department) + .orElse(JsonNullable.undefined()); + this.companyName = Optional.ofNullable(companyName) + .orElse(JsonNullable.undefined()); + this.employeeNumber = Optional.ofNullable(employeeNumber) + .orElse(JsonNullable.undefined()); + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.image = Optional.ofNullable(image) + .orElse(JsonNullable.undefined()); + this.language = Optional.ofNullable(language) + .orElse(JsonNullable.undefined()); + this.status = Optional.ofNullable(status) + .orElse(JsonNullable.undefined()); + this.password = Optional.ofNullable(password) + .orElse(JsonNullable.undefined()); this.addresses = addresses; this.phoneNumbers = phoneNumbers; - this.emails = emails; + this.emails = Optional.ofNullable(emails) + .orElseThrow(() -> new IllegalArgumentException("emails cannot be null")); this.passThrough = passThrough; } public UserInput( - List emails) { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), emails, Optional.empty()); + @Nonnull List emails) { + this(null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, null, null, + null, emails, null); } /** * The parent user id */ - @JsonIgnore public JsonNullable parentId() { - return parentId; + return this.parentId; } /** * The username of the user */ - @JsonIgnore public JsonNullable username() { - return username; + return this.username; } /** * The first name of the person. */ - @JsonIgnore public JsonNullable firstName() { - return firstName; + return this.firstName; } /** * The last name of the person. */ - @JsonIgnore public JsonNullable lastName() { - return lastName; + return this.lastName; } /** * The job title of the person. */ - @JsonIgnore public JsonNullable title() { - return title; + return this.title; } /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - @JsonIgnore public JsonNullable division() { - return division; + return this.division; } /** @@ -263,91 +254,76 @@ public JsonNullable division() { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - @JsonIgnore public JsonNullable department() { - return department; + return this.department; } /** * The name of the company. */ - @JsonIgnore public JsonNullable companyName() { - return companyName; + return this.companyName; } /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - @JsonIgnore public JsonNullable employeeNumber() { - return employeeNumber; + return this.employeeNumber; } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * The URL of the user's avatar */ - @JsonIgnore public JsonNullable image() { - return image; + return this.image; } /** * language code according to ISO 639-1. For the United States - EN */ - @JsonIgnore public JsonNullable language() { - return language; + return this.language; } /** * The status of the user */ - @JsonIgnore public JsonNullable status() { - return status; + return this.status; } /** * The password of the user */ - @JsonIgnore public JsonNullable password() { - return password; + return this.password; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> addresses() { - return (Optional>) addresses; + return Optional.ofNullable(this.addresses); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> phoneNumbers() { - return (Optional>) phoneNumbers; + return Optional.ofNullable(this.phoneNumbers); } - @JsonIgnore public List emails() { - return emails; + return this.emails; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -358,110 +334,56 @@ public static Builder builder() { /** * The parent user id */ - public UserInput withParentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public UserInput withParentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * The parent user id - */ - public UserInput withParentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } /** * The username of the user */ - public UserInput withUsername(String username) { - Utils.checkNotNull(username, "username"); + public UserInput withUsername(@Nullable String username) { this.username = JsonNullable.of(username); return this; } - /** - * The username of the user - */ - public UserInput withUsername(JsonNullable username) { - Utils.checkNotNull(username, "username"); - this.username = username; - return this; - } /** * The first name of the person. */ - public UserInput withFirstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public UserInput withFirstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public UserInput withFirstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } /** * The last name of the person. */ - public UserInput withLastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public UserInput withLastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public UserInput withLastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } /** * The job title of the person. */ - public UserInput withTitle(String title) { - Utils.checkNotNull(title, "title"); + public UserInput withTitle(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public UserInput withTitle(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - public UserInput withDivision(String division) { - Utils.checkNotNull(division, "division"); + public UserInput withDivision(@Nullable String division) { this.division = JsonNullable.of(division); return this; } - /** - * The division the person is currently in. Usually a collection of departments or teams or regions. - */ - public UserInput withDivision(JsonNullable division) { - Utils.checkNotNull(division, "division"); - this.division = division; - return this; - } /** * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. @@ -469,188 +391,89 @@ public UserInput withDivision(JsonNullable division) { * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public UserInput withDepartment(String department) { - Utils.checkNotNull(department, "department"); + public UserInput withDepartment(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public UserInput withDepartment(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } /** * The name of the company. */ - public UserInput withCompanyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public UserInput withCompanyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public UserInput withCompanyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - public UserInput withEmployeeNumber(String employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); + public UserInput withEmployeeNumber(@Nullable String employeeNumber) { this.employeeNumber = JsonNullable.of(employeeNumber); return this; } - /** - * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - */ - public UserInput withEmployeeNumber(JsonNullable employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); - this.employeeNumber = employeeNumber; - return this; - } /** * A description of the object. */ - public UserInput withDescription(String description) { - Utils.checkNotNull(description, "description"); + public UserInput withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public UserInput withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * The URL of the user's avatar */ - public UserInput withImage(String image) { - Utils.checkNotNull(image, "image"); + public UserInput withImage(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * The URL of the user's avatar - */ - public UserInput withImage(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } /** * language code according to ISO 639-1. For the United States - EN */ - public UserInput withLanguage(String language) { - Utils.checkNotNull(language, "language"); + public UserInput withLanguage(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public UserInput withLanguage(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } /** * The status of the user */ - public UserInput withStatus(String status) { - Utils.checkNotNull(status, "status"); + public UserInput withStatus(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the user - */ - public UserInput withStatus(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** * The password of the user */ - public UserInput withPassword(String password) { - Utils.checkNotNull(password, "password"); + public UserInput withPassword(@Nullable String password) { this.password = JsonNullable.of(password); return this; } - /** - * The password of the user - */ - public UserInput withPassword(JsonNullable password) { - Utils.checkNotNull(password, "password"); - this.password = password; - return this; - } - - public UserInput withAddresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public UserInput withAddresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public UserInput withAddresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - public UserInput withPhoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public UserInput withPhoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public UserInput withPhoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public UserInput withEmails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = emails; - return this; - } - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public UserInput withPassThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public UserInput withEmails(@Nonnull List emails) { + this.emails = Utils.checkNotNull(emails, "emails"); return this; } @@ -658,12 +481,12 @@ public UserInput withPassThrough(List passThrough) { /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public UserInput withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public UserInput withPassThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -731,373 +554,186 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable parentId = JsonNullable.undefined(); + private JsonNullable parentId; - private JsonNullable username = JsonNullable.undefined(); + private JsonNullable username; - private JsonNullable firstName = JsonNullable.undefined(); + private JsonNullable firstName; - private JsonNullable lastName = JsonNullable.undefined(); + private JsonNullable lastName; - private JsonNullable title = JsonNullable.undefined(); + private JsonNullable title; - private JsonNullable division = JsonNullable.undefined(); + private JsonNullable division; @Deprecated - private JsonNullable department = JsonNullable.undefined(); + private JsonNullable department; - private JsonNullable companyName = JsonNullable.undefined(); + private JsonNullable companyName; - private JsonNullable employeeNumber = JsonNullable.undefined(); + private JsonNullable employeeNumber; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; - private JsonNullable image = JsonNullable.undefined(); + private JsonNullable image; - private JsonNullable language = JsonNullable.undefined(); + private JsonNullable language; - private JsonNullable status = JsonNullable.undefined(); + private JsonNullable status; - private JsonNullable password = JsonNullable.undefined(); + private JsonNullable password; - private Optional> addresses = Optional.empty(); + private List
addresses; - private Optional> phoneNumbers = Optional.empty(); + private List phoneNumbers; private List emails; - private Optional> passThrough = Optional.empty(); + private List passThrough; private Builder() { // force use of static builder() method } - /** * The parent user id */ - public Builder parentId(String parentId) { - Utils.checkNotNull(parentId, "parentId"); + public Builder parentId(@Nullable String parentId) { this.parentId = JsonNullable.of(parentId); return this; } - /** - * The parent user id - */ - public Builder parentId(JsonNullable parentId) { - Utils.checkNotNull(parentId, "parentId"); - this.parentId = parentId; - return this; - } - - /** * The username of the user */ - public Builder username(String username) { - Utils.checkNotNull(username, "username"); + public Builder username(@Nullable String username) { this.username = JsonNullable.of(username); return this; } - /** - * The username of the user - */ - public Builder username(JsonNullable username) { - Utils.checkNotNull(username, "username"); - this.username = username; - return this; - } - - /** * The first name of the person. */ - public Builder firstName(String firstName) { - Utils.checkNotNull(firstName, "firstName"); + public Builder firstName(@Nullable String firstName) { this.firstName = JsonNullable.of(firstName); return this; } - /** - * The first name of the person. - */ - public Builder firstName(JsonNullable firstName) { - Utils.checkNotNull(firstName, "firstName"); - this.firstName = firstName; - return this; - } - - /** * The last name of the person. */ - public Builder lastName(String lastName) { - Utils.checkNotNull(lastName, "lastName"); + public Builder lastName(@Nullable String lastName) { this.lastName = JsonNullable.of(lastName); return this; } - /** - * The last name of the person. - */ - public Builder lastName(JsonNullable lastName) { - Utils.checkNotNull(lastName, "lastName"); - this.lastName = lastName; - return this; - } - - /** * The job title of the person. */ - public Builder title(String title) { - Utils.checkNotNull(title, "title"); + public Builder title(@Nullable String title) { this.title = JsonNullable.of(title); return this; } - /** - * The job title of the person. - */ - public Builder title(JsonNullable title) { - Utils.checkNotNull(title, "title"); - this.title = title; - return this; - } - - /** * The division the person is currently in. Usually a collection of departments or teams or regions. */ - public Builder division(String division) { - Utils.checkNotNull(division, "division"); + public Builder division(@Nullable String division) { this.division = JsonNullable.of(division); return this; } - /** - * The division the person is currently in. Usually a collection of departments or teams or regions. - */ - public Builder division(JsonNullable division) { - Utils.checkNotNull(division, "division"); - this.division = division; - return this; - } - - /** * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ @Deprecated - public Builder department(String department) { - Utils.checkNotNull(department, "department"); + public Builder department(@Nullable String department) { this.department = JsonNullable.of(department); return this; } - /** - * The department the person is currently in. [Deprecated](https://developers.apideck.com/changelog) in favor of the dedicated department_id and department_name field. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - @Deprecated - public Builder department(JsonNullable department) { - Utils.checkNotNull(department, "department"); - this.department = department; - return this; - } - - /** * The name of the company. */ - public Builder companyName(String companyName) { - Utils.checkNotNull(companyName, "companyName"); + public Builder companyName(@Nullable String companyName) { this.companyName = JsonNullable.of(companyName); return this; } - /** - * The name of the company. - */ - public Builder companyName(JsonNullable companyName) { - Utils.checkNotNull(companyName, "companyName"); - this.companyName = companyName; - return this; - } - - /** * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. */ - public Builder employeeNumber(String employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); + public Builder employeeNumber(@Nullable String employeeNumber) { this.employeeNumber = JsonNullable.of(employeeNumber); return this; } - /** - * An Employee Number, Employee ID or Employee Code, is a unique number that has been assigned to each individual staff member within a company. - */ - public Builder employeeNumber(JsonNullable employeeNumber) { - Utils.checkNotNull(employeeNumber, "employeeNumber"); - this.employeeNumber = employeeNumber; - return this; - } - - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * The URL of the user's avatar */ - public Builder image(String image) { - Utils.checkNotNull(image, "image"); + public Builder image(@Nullable String image) { this.image = JsonNullable.of(image); return this; } - /** - * The URL of the user's avatar - */ - public Builder image(JsonNullable image) { - Utils.checkNotNull(image, "image"); - this.image = image; - return this; - } - - /** * language code according to ISO 639-1. For the United States - EN */ - public Builder language(String language) { - Utils.checkNotNull(language, "language"); + public Builder language(@Nullable String language) { this.language = JsonNullable.of(language); return this; } - /** - * language code according to ISO 639-1. For the United States - EN - */ - public Builder language(JsonNullable language) { - Utils.checkNotNull(language, "language"); - this.language = language; - return this; - } - - /** * The status of the user */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); + public Builder status(@Nullable String status) { this.status = JsonNullable.of(status); return this; } - /** - * The status of the user - */ - public Builder status(JsonNullable status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - /** * The password of the user */ - public Builder password(String password) { - Utils.checkNotNull(password, "password"); + public Builder password(@Nullable String password) { this.password = JsonNullable.of(password); return this; } - /** - * The password of the user - */ - public Builder password(JsonNullable password) { - Utils.checkNotNull(password, "password"); - this.password = password; - return this; - } - - - public Builder addresses(List
addresses) { - Utils.checkNotNull(addresses, "addresses"); - this.addresses = Optional.ofNullable(addresses); - return this; - } - - public Builder addresses(Optional> addresses) { - Utils.checkNotNull(addresses, "addresses"); + public Builder addresses(@Nullable List
addresses) { this.addresses = addresses; return this; } - - public Builder phoneNumbers(List phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); - this.phoneNumbers = Optional.ofNullable(phoneNumbers); - return this; - } - - public Builder phoneNumbers(Optional> phoneNumbers) { - Utils.checkNotNull(phoneNumbers, "phoneNumbers"); + public Builder phoneNumbers(@Nullable List phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - - public Builder emails(List emails) { - Utils.checkNotNull(emails, "emails"); - this.emails = emails; - return this; - } - - - /** - * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. - */ - public Builder passThrough(List passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public Builder emails(@Nonnull List emails) { + this.emails = Utils.checkNotNull(emails, "emails"); return this; } /** * The pass_through property allows passing service-specific, custom data or structured modifications in request body when creating or updating resources. */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable List passThrough) { this.passThrough = passThrough; return this; } public UserInput build() { - return new UserInput( parentId, username, firstName, lastName, title, division, diff --git a/src/main/java/com/apideck/unify/models/components/ValidateConnectionStateResponse.java b/src/main/java/com/apideck/unify/models/components/ValidateConnectionStateResponse.java index d9042866..901c163d 100644 --- a/src/main/java/com/apideck/unify/models/components/ValidateConnectionStateResponse.java +++ b/src/main/java/com/apideck/unify/models/components/ValidateConnectionStateResponse.java @@ -5,16 +5,16 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.lang.Long; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; /** @@ -44,60 +44,54 @@ public class ValidateConnectionStateResponse { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("_raw") - private JsonNullable> raw; + private JsonNullable> raw; @JsonCreator public ValidateConnectionStateResponse( @JsonProperty("status_code") long statusCode, - @JsonProperty("status") String status, - @JsonProperty("data") ValidateConnectionStateResponseData data, - @JsonProperty("_raw") JsonNullable> raw) { - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(data, "data"); - Utils.checkNotNull(raw, "raw"); + @JsonProperty("status") @Nonnull String status, + @JsonProperty("data") @Nonnull ValidateConnectionStateResponseData data, + @JsonProperty("_raw") @Nullable JsonNullable> raw) { this.statusCode = statusCode; - this.status = status; - this.data = data; - this.raw = raw; + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); + this.data = Optional.ofNullable(data) + .orElseThrow(() -> new IllegalArgumentException("data cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(JsonNullable.undefined()); } public ValidateConnectionStateResponse( long statusCode, - String status, - ValidateConnectionStateResponseData data) { + @Nonnull String status, + @Nonnull ValidateConnectionStateResponseData data) { this(statusCode, status, data, - JsonNullable.undefined()); + null); } /** * HTTP Response Status Code */ - @JsonIgnore public long statusCode() { - return statusCode; + return this.statusCode; } /** * HTTP Response Status */ - @JsonIgnore public String status() { - return status; + return this.status; } - @JsonIgnore public ValidateConnectionStateResponseData data() { - return data; + return this.data; } /** * Raw response from the integration when raw=true query param is provided */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable> raw() { - return (JsonNullable>) raw; + return this.raw; } public static Builder builder() { @@ -109,43 +103,34 @@ public static Builder builder() { * HTTP Response Status Code */ public ValidateConnectionStateResponse withStatusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } + /** * HTTP Response Status */ - public ValidateConnectionStateResponse withStatus(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public ValidateConnectionStateResponse withStatus(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - public ValidateConnectionStateResponse withData(ValidateConnectionStateResponseData data) { - Utils.checkNotNull(data, "data"); - this.data = data; + + public ValidateConnectionStateResponse withData(@Nonnull ValidateConnectionStateResponseData data) { + this.data = Utils.checkNotNull(data, "data"); return this; } + /** * Raw response from the integration when raw=true query param is provided */ - public ValidateConnectionStateResponse withRaw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public ValidateConnectionStateResponse withRaw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public ValidateConnectionStateResponse withRaw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -182,66 +167,48 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Long statusCode; + private long statusCode; private String status; private ValidateConnectionStateResponseData data; - private JsonNullable> raw = JsonNullable.undefined(); + private JsonNullable> raw; private Builder() { // force use of static builder() method } - /** * HTTP Response Status Code */ public Builder statusCode(long statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * HTTP Response Status */ - public Builder status(String status) { - Utils.checkNotNull(status, "status"); - this.status = status; + public Builder status(@Nonnull String status) { + this.status = Utils.checkNotNull(status, "status"); return this; } - - public Builder data(ValidateConnectionStateResponseData data) { - Utils.checkNotNull(data, "data"); - this.data = data; + public Builder data(@Nonnull ValidateConnectionStateResponseData data) { + this.data = Utils.checkNotNull(data, "data"); return this; } - /** * Raw response from the integration when raw=true query param is provided */ - public Builder raw(Map raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Map raw) { this.raw = JsonNullable.of(raw); return this; } - /** - * Raw response from the integration when raw=true query param is provided - */ - public Builder raw(JsonNullable> raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = raw; - return this; - } - public ValidateConnectionStateResponse build() { - return new ValidateConnectionStateResponse( statusCode, status, data, raw); diff --git a/src/main/java/com/apideck/unify/models/components/ValidateConnectionStateResponseData.java b/src/main/java/com/apideck/unify/models/components/ValidateConnectionStateResponseData.java index e82c7d8e..a7403b22 100644 --- a/src/main/java/com/apideck/unify/models/components/ValidateConnectionStateResponseData.java +++ b/src/main/java/com/apideck/unify/models/components/ValidateConnectionStateResponseData.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -21,44 +20,39 @@ public class ValidateConnectionStateResponseData { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * [Connection state flow](#section/Connection-state) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("state") - private Optional state; + private ConnectionState state; @JsonCreator public ValidateConnectionStateResponseData( - @JsonProperty("id") Optional id, - @JsonProperty("state") Optional state) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(state, "state"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("state") @Nullable ConnectionState state) { this.id = id; this.state = state; } public ValidateConnectionStateResponseData() { - this(Optional.empty(), Optional.empty()); + this(null, null); } /** * The unique identifier of the connection. */ - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * [Connection state flow](#section/Connection-state) */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional state() { - return (Optional) state; + return Optional.ofNullable(this.state); } public static Builder builder() { @@ -69,41 +63,21 @@ public static Builder builder() { /** * The unique identifier of the connection. */ - public ValidateConnectionStateResponseData withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - /** - * The unique identifier of the connection. - */ - public ValidateConnectionStateResponseData withId(Optional id) { - Utils.checkNotNull(id, "id"); + public ValidateConnectionStateResponseData withId(@Nullable String id) { this.id = id; return this; } - /** - * [Connection state flow](#section/Connection-state) - */ - public ValidateConnectionStateResponseData withState(ConnectionState state) { - Utils.checkNotNull(state, "state"); - this.state = Optional.ofNullable(state); - return this; - } - /** * [Connection state flow](#section/Connection-state) */ - public ValidateConnectionStateResponseData withState(Optional state) { - Utils.checkNotNull(state, "state"); + public ValidateConnectionStateResponseData withState(@Nullable ConnectionState state) { this.state = state; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,54 +108,31 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private Optional state = Optional.empty(); + private ConnectionState state; private Builder() { // force use of static builder() method } - /** * The unique identifier of the connection. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - /** - * The unique identifier of the connection. - */ - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - - /** - * [Connection state flow](#section/Connection-state) - */ - public Builder state(ConnectionState state) { - Utils.checkNotNull(state, "state"); - this.state = Optional.ofNullable(state); - return this; - } - /** * [Connection state flow](#section/Connection-state) */ - public Builder state(Optional state) { - Utils.checkNotNull(state, "state"); + public Builder state(@Nullable ConnectionState state) { this.state = state; return this; } public ValidateConnectionStateResponseData build() { - return new ValidateConnectionStateResponseData( id, state); } diff --git a/src/main/java/com/apideck/unify/models/components/Variants.java b/src/main/java/com/apideck/unify/models/components/Variants.java index 673ece9e..fd290149 100644 --- a/src/main/java/com/apideck/unify/models/components/Variants.java +++ b/src/main/java/com/apideck/unify/models/components/Variants.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -70,116 +69,103 @@ public class Variants { @JsonInclude(Include.NON_ABSENT) @JsonProperty("options") - private Optional> options; + private List options; @JsonInclude(Include.NON_ABSENT) @JsonProperty("images") - private Optional> images; + private List images; @JsonCreator public Variants( - @JsonProperty("id") JsonNullable id, - @JsonProperty("name") JsonNullable name, - @JsonProperty("price") JsonNullable price, - @JsonProperty("sku") JsonNullable sku, - @JsonProperty("inventory_quantity") JsonNullable inventoryQuantity, - @JsonProperty("weight") JsonNullable weight, - @JsonProperty("weight_unit") JsonNullable weightUnit, - @JsonProperty("options") Optional> options, - @JsonProperty("images") Optional> images) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(name, "name"); - Utils.checkNotNull(price, "price"); - Utils.checkNotNull(sku, "sku"); - Utils.checkNotNull(inventoryQuantity, "inventoryQuantity"); - Utils.checkNotNull(weight, "weight"); - Utils.checkNotNull(weightUnit, "weightUnit"); - Utils.checkNotNull(options, "options"); - Utils.checkNotNull(images, "images"); - this.id = id; - this.name = name; - this.price = price; - this.sku = sku; - this.inventoryQuantity = inventoryQuantity; - this.weight = weight; - this.weightUnit = weightUnit; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("name") @Nullable JsonNullable name, + @JsonProperty("price") @Nullable JsonNullable price, + @JsonProperty("sku") @Nullable JsonNullable sku, + @JsonProperty("inventory_quantity") @Nullable JsonNullable inventoryQuantity, + @JsonProperty("weight") @Nullable JsonNullable weight, + @JsonProperty("weight_unit") @Nullable JsonNullable weightUnit, + @JsonProperty("options") @Nullable List options, + @JsonProperty("images") @Nullable List images) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.name = Optional.ofNullable(name) + .orElse(JsonNullable.undefined()); + this.price = Optional.ofNullable(price) + .orElse(JsonNullable.undefined()); + this.sku = Optional.ofNullable(sku) + .orElse(JsonNullable.undefined()); + this.inventoryQuantity = Optional.ofNullable(inventoryQuantity) + .orElse(JsonNullable.undefined()); + this.weight = Optional.ofNullable(weight) + .orElse(JsonNullable.undefined()); + this.weightUnit = Optional.ofNullable(weightUnit) + .orElse(JsonNullable.undefined()); this.options = options; this.images = images; } public Variants() { - this(JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), - JsonNullable.undefined(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null); } /** * A unique identifier for the variant of the product. */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The name for the variant, used for displaying to customers. */ - @JsonIgnore public JsonNullable name() { - return name; + return this.name; } /** * The price of the variant. */ - @JsonIgnore public JsonNullable price() { - return price; + return this.price; } /** * The stock keeping unit of the variant. */ - @JsonIgnore public JsonNullable sku() { - return sku; + return this.sku; } /** * The quantity of the variant in stock. */ - @JsonIgnore public JsonNullable inventoryQuantity() { - return inventoryQuantity; + return this.inventoryQuantity; } /** * The weight of the variant. */ - @JsonIgnore public JsonNullable weight() { - return weight; + return this.weight; } /** * The unit of measurement for the weight of the variant. */ - @JsonIgnore public JsonNullable weightUnit() { - return weightUnit; + return this.weightUnit; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> options() { - return (Optional>) options; + return Optional.ofNullable(this.options); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> images() { - return (Optional>) images; + return Optional.ofNullable(this.images); } public static Builder builder() { @@ -190,155 +176,78 @@ public static Builder builder() { /** * A unique identifier for the variant of the product. */ - public Variants withId(String id) { - Utils.checkNotNull(id, "id"); + public Variants withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for the variant of the product. - */ - public Variants withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The name for the variant, used for displaying to customers. */ - public Variants withName(String name) { - Utils.checkNotNull(name, "name"); + public Variants withName(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name for the variant, used for displaying to customers. - */ - public Variants withName(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } /** * The price of the variant. */ - public Variants withPrice(String price) { - Utils.checkNotNull(price, "price"); + public Variants withPrice(@Nullable String price) { this.price = JsonNullable.of(price); return this; } - /** - * The price of the variant. - */ - public Variants withPrice(JsonNullable price) { - Utils.checkNotNull(price, "price"); - this.price = price; - return this; - } /** * The stock keeping unit of the variant. */ - public Variants withSku(String sku) { - Utils.checkNotNull(sku, "sku"); + public Variants withSku(@Nullable String sku) { this.sku = JsonNullable.of(sku); return this; } - /** - * The stock keeping unit of the variant. - */ - public Variants withSku(JsonNullable sku) { - Utils.checkNotNull(sku, "sku"); - this.sku = sku; - return this; - } /** * The quantity of the variant in stock. */ - public Variants withInventoryQuantity(String inventoryQuantity) { - Utils.checkNotNull(inventoryQuantity, "inventoryQuantity"); + public Variants withInventoryQuantity(@Nullable String inventoryQuantity) { this.inventoryQuantity = JsonNullable.of(inventoryQuantity); return this; } - /** - * The quantity of the variant in stock. - */ - public Variants withInventoryQuantity(JsonNullable inventoryQuantity) { - Utils.checkNotNull(inventoryQuantity, "inventoryQuantity"); - this.inventoryQuantity = inventoryQuantity; - return this; - } /** * The weight of the variant. */ - public Variants withWeight(String weight) { - Utils.checkNotNull(weight, "weight"); + public Variants withWeight(@Nullable String weight) { this.weight = JsonNullable.of(weight); return this; } - /** - * The weight of the variant. - */ - public Variants withWeight(JsonNullable weight) { - Utils.checkNotNull(weight, "weight"); - this.weight = weight; - return this; - } /** * The unit of measurement for the weight of the variant. */ - public Variants withWeightUnit(String weightUnit) { - Utils.checkNotNull(weightUnit, "weightUnit"); + public Variants withWeightUnit(@Nullable String weightUnit) { this.weightUnit = JsonNullable.of(weightUnit); return this; } - /** - * The unit of measurement for the weight of the variant. - */ - public Variants withWeightUnit(JsonNullable weightUnit) { - Utils.checkNotNull(weightUnit, "weightUnit"); - this.weightUnit = weightUnit; - return this; - } - - public Variants withOptions(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - - public Variants withOptions(Optional> options) { - Utils.checkNotNull(options, "options"); + public Variants withOptions(@Nullable List options) { this.options = options; return this; } - public Variants withImages(List images) { - Utils.checkNotNull(images, "images"); - this.images = Optional.ofNullable(images); - return this; - } - - public Variants withImages(Optional> images) { - Utils.checkNotNull(images, "images"); + public Variants withImages(@Nullable List images) { this.images = images; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -385,189 +294,95 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; - private JsonNullable name = JsonNullable.undefined(); + private JsonNullable name; - private JsonNullable price = JsonNullable.undefined(); + private JsonNullable price; - private JsonNullable sku = JsonNullable.undefined(); + private JsonNullable sku; - private JsonNullable inventoryQuantity = JsonNullable.undefined(); + private JsonNullable inventoryQuantity; - private JsonNullable weight = JsonNullable.undefined(); + private JsonNullable weight; - private JsonNullable weightUnit = JsonNullable.undefined(); + private JsonNullable weightUnit; - private Optional> options = Optional.empty(); + private List options; - private Optional> images = Optional.empty(); + private List images; private Builder() { // force use of static builder() method } - /** * A unique identifier for the variant of the product. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * A unique identifier for the variant of the product. - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The name for the variant, used for displaying to customers. */ - public Builder name(String name) { - Utils.checkNotNull(name, "name"); + public Builder name(@Nullable String name) { this.name = JsonNullable.of(name); return this; } - /** - * The name for the variant, used for displaying to customers. - */ - public Builder name(JsonNullable name) { - Utils.checkNotNull(name, "name"); - this.name = name; - return this; - } - - /** * The price of the variant. */ - public Builder price(String price) { - Utils.checkNotNull(price, "price"); + public Builder price(@Nullable String price) { this.price = JsonNullable.of(price); return this; } - /** - * The price of the variant. - */ - public Builder price(JsonNullable price) { - Utils.checkNotNull(price, "price"); - this.price = price; - return this; - } - - /** * The stock keeping unit of the variant. */ - public Builder sku(String sku) { - Utils.checkNotNull(sku, "sku"); + public Builder sku(@Nullable String sku) { this.sku = JsonNullable.of(sku); return this; } - /** - * The stock keeping unit of the variant. - */ - public Builder sku(JsonNullable sku) { - Utils.checkNotNull(sku, "sku"); - this.sku = sku; - return this; - } - - /** * The quantity of the variant in stock. */ - public Builder inventoryQuantity(String inventoryQuantity) { - Utils.checkNotNull(inventoryQuantity, "inventoryQuantity"); + public Builder inventoryQuantity(@Nullable String inventoryQuantity) { this.inventoryQuantity = JsonNullable.of(inventoryQuantity); return this; } - /** - * The quantity of the variant in stock. - */ - public Builder inventoryQuantity(JsonNullable inventoryQuantity) { - Utils.checkNotNull(inventoryQuantity, "inventoryQuantity"); - this.inventoryQuantity = inventoryQuantity; - return this; - } - - /** * The weight of the variant. */ - public Builder weight(String weight) { - Utils.checkNotNull(weight, "weight"); + public Builder weight(@Nullable String weight) { this.weight = JsonNullable.of(weight); return this; } - /** - * The weight of the variant. - */ - public Builder weight(JsonNullable weight) { - Utils.checkNotNull(weight, "weight"); - this.weight = weight; - return this; - } - - /** * The unit of measurement for the weight of the variant. */ - public Builder weightUnit(String weightUnit) { - Utils.checkNotNull(weightUnit, "weightUnit"); + public Builder weightUnit(@Nullable String weightUnit) { this.weightUnit = JsonNullable.of(weightUnit); return this; } - /** - * The unit of measurement for the weight of the variant. - */ - public Builder weightUnit(JsonNullable weightUnit) { - Utils.checkNotNull(weightUnit, "weightUnit"); - this.weightUnit = weightUnit; - return this; - } - - - public Builder options(List options) { - Utils.checkNotNull(options, "options"); - this.options = Optional.ofNullable(options); - return this; - } - - public Builder options(Optional> options) { - Utils.checkNotNull(options, "options"); + public Builder options(@Nullable List options) { this.options = options; return this; } - - public Builder images(List images) { - Utils.checkNotNull(images, "images"); - this.images = Optional.ofNullable(images); - return this; - } - - public Builder images(Optional> images) { - Utils.checkNotNull(images, "images"); + public Builder images(@Nullable List images) { this.images = images; return this; } public Variants build() { - return new Variants( id, name, price, sku, inventoryQuantity, weight, diff --git a/src/main/java/com/apideck/unify/models/components/VirtualWebhooks.java b/src/main/java/com/apideck/unify/models/components/VirtualWebhooks.java index 719ad82b..88c8a1a4 100644 --- a/src/main/java/com/apideck/unify/models/components/VirtualWebhooks.java +++ b/src/main/java/com/apideck/unify/models/components/VirtualWebhooks.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; @@ -32,38 +32,34 @@ public class VirtualWebhooks { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("resources") - private Optional> resources; + private Map resources; @JsonCreator public VirtualWebhooks( - @JsonProperty("request_rate") RequestRate requestRate, - @JsonProperty("resources") Optional> resources) { - Utils.checkNotNull(requestRate, "requestRate"); - Utils.checkNotNull(resources, "resources"); - this.requestRate = requestRate; + @JsonProperty("request_rate") @Nonnull RequestRate requestRate, + @JsonProperty("resources") @Nullable Map resources) { + this.requestRate = Optional.ofNullable(requestRate) + .orElseThrow(() -> new IllegalArgumentException("requestRate cannot be null")); this.resources = resources; } public VirtualWebhooks( - RequestRate requestRate) { - this(requestRate, Optional.empty()); + @Nonnull RequestRate requestRate) { + this(requestRate, null); } /** * The rate at which requests for resources will be made to downstream. */ - @JsonIgnore public RequestRate requestRate() { - return requestRate; + return this.requestRate; } /** * The resources that will be requested from downstream. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> resources() { - return (Optional>) resources; + return Optional.ofNullable(this.resources); } public static Builder builder() { @@ -74,18 +70,8 @@ public static Builder builder() { /** * The rate at which requests for resources will be made to downstream. */ - public VirtualWebhooks withRequestRate(RequestRate requestRate) { - Utils.checkNotNull(requestRate, "requestRate"); - this.requestRate = requestRate; - return this; - } - - /** - * The resources that will be requested from downstream. - */ - public VirtualWebhooks withResources(Map resources) { - Utils.checkNotNull(resources, "resources"); - this.resources = Optional.ofNullable(resources); + public VirtualWebhooks withRequestRate(@Nonnull RequestRate requestRate) { + this.requestRate = Utils.checkNotNull(requestRate, "requestRate"); return this; } @@ -93,12 +79,12 @@ public VirtualWebhooks withResources(Map resour /** * The resources that will be requested from downstream. */ - public VirtualWebhooks withResources(Optional> resources) { - Utils.checkNotNull(resources, "resources"); + public VirtualWebhooks withResources(@Nullable Map resources) { this.resources = resources; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -131,43 +117,29 @@ public final static class Builder { private RequestRate requestRate; - private Optional> resources = Optional.empty(); + private Map resources; private Builder() { // force use of static builder() method } - /** * The rate at which requests for resources will be made to downstream. */ - public Builder requestRate(RequestRate requestRate) { - Utils.checkNotNull(requestRate, "requestRate"); - this.requestRate = requestRate; - return this; - } - - - /** - * The resources that will be requested from downstream. - */ - public Builder resources(Map resources) { - Utils.checkNotNull(resources, "resources"); - this.resources = Optional.ofNullable(resources); + public Builder requestRate(@Nonnull RequestRate requestRate) { + this.requestRate = Utils.checkNotNull(requestRate, "requestRate"); return this; } /** * The resources that will be requested from downstream. */ - public Builder resources(Optional> resources) { - Utils.checkNotNull(resources, "resources"); + public Builder resources(@Nullable Map resources) { this.resources = resources; return this; } public VirtualWebhooks build() { - return new VirtualWebhooks( requestRate, resources); } diff --git a/src/main/java/com/apideck/unify/models/components/Webhook.java b/src/main/java/com/apideck/unify/models/components/Webhook.java index 0cd36e2d..d59483c9 100644 --- a/src/main/java/com/apideck/unify/models/components/Webhook.java +++ b/src/main/java/com/apideck/unify/models/components/Webhook.java @@ -5,13 +5,13 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.time.OffsetDateTime; import java.util.List; import java.util.Optional; @@ -22,7 +22,7 @@ public class Webhook { @JsonInclude(Include.NON_ABSENT) @JsonProperty("id") - private Optional id; + private String id; /** * A description of the object. @@ -48,7 +48,7 @@ public class Webhook { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("disabled_reason") - private Optional disabledReason; + private DisabledReason disabledReason; /** * The delivery url of the webhook endpoint. @@ -84,126 +84,113 @@ public class Webhook { @JsonCreator public Webhook( - @JsonProperty("id") Optional id, - @JsonProperty("description") JsonNullable description, - @JsonProperty("unified_api") UnifiedApiId unifiedApi, - @JsonProperty("status") Status status, - @JsonProperty("disabled_reason") Optional disabledReason, - @JsonProperty("delivery_url") String deliveryUrl, - @JsonProperty("execute_base_url") String executeBaseUrl, - @JsonProperty("events") List events, - @JsonProperty("updated_at") JsonNullable updatedAt, - @JsonProperty("created_at") JsonNullable createdAt) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(description, "description"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(status, "status"); - Utils.checkNotNull(disabledReason, "disabledReason"); - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); - Utils.checkNotNull(executeBaseUrl, "executeBaseUrl"); - Utils.checkNotNull(events, "events"); - Utils.checkNotNull(updatedAt, "updatedAt"); - Utils.checkNotNull(createdAt, "createdAt"); + @JsonProperty("id") @Nullable String id, + @JsonProperty("description") @Nullable JsonNullable description, + @JsonProperty("unified_api") @Nonnull UnifiedApiId unifiedApi, + @JsonProperty("status") @Nonnull Status status, + @JsonProperty("disabled_reason") @Nullable DisabledReason disabledReason, + @JsonProperty("delivery_url") @Nonnull String deliveryUrl, + @JsonProperty("execute_base_url") @Nonnull String executeBaseUrl, + @JsonProperty("events") @Nonnull List events, + @JsonProperty("updated_at") @Nullable JsonNullable updatedAt, + @JsonProperty("created_at") @Nullable JsonNullable createdAt) { this.id = id; - this.description = description; - this.unifiedApi = unifiedApi; - this.status = status; + this.description = Optional.ofNullable(description) + .orElse(JsonNullable.undefined()); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); + this.status = Optional.ofNullable(status) + .orElseThrow(() -> new IllegalArgumentException("status cannot be null")); this.disabledReason = disabledReason; - this.deliveryUrl = deliveryUrl; - this.executeBaseUrl = executeBaseUrl; - this.events = events; - this.updatedAt = updatedAt; - this.createdAt = createdAt; + this.deliveryUrl = Optional.ofNullable(deliveryUrl) + .orElseThrow(() -> new IllegalArgumentException("deliveryUrl cannot be null")); + this.executeBaseUrl = Optional.ofNullable(executeBaseUrl) + .orElseThrow(() -> new IllegalArgumentException("executeBaseUrl cannot be null")); + this.events = Optional.ofNullable(events) + .orElseThrow(() -> new IllegalArgumentException("events cannot be null")); + this.updatedAt = Optional.ofNullable(updatedAt) + .orElse(JsonNullable.undefined()); + this.createdAt = Optional.ofNullable(createdAt) + .orElse(JsonNullable.undefined()); } public Webhook( - UnifiedApiId unifiedApi, - Status status, - String deliveryUrl, - String executeBaseUrl, - List events) { - this(Optional.empty(), JsonNullable.undefined(), unifiedApi, - status, Optional.empty(), deliveryUrl, - executeBaseUrl, events, JsonNullable.undefined(), - JsonNullable.undefined()); + @Nonnull UnifiedApiId unifiedApi, + @Nonnull Status status, + @Nonnull String deliveryUrl, + @Nonnull String executeBaseUrl, + @Nonnull List events) { + this(null, null, unifiedApi, + status, null, deliveryUrl, + executeBaseUrl, events, null, + null); } - @JsonIgnore public Optional id() { - return id; + return Optional.ofNullable(this.id); } /** * A description of the object. */ - @JsonIgnore public JsonNullable description() { - return description; + return this.description; } /** * Name of Apideck Unified API */ - @JsonIgnore public UnifiedApiId unifiedApi() { - return unifiedApi; + return this.unifiedApi; } /** * The status of the webhook. */ - @JsonIgnore public Status status() { - return status; + return this.status; } /** * Indicates if the webhook has has been disabled as it reached its retry limit or if account is over the usage allocated by it's plan. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional disabledReason() { - return (Optional) disabledReason; + return Optional.ofNullable(this.disabledReason); } /** * The delivery url of the webhook endpoint. */ - @JsonIgnore public String deliveryUrl() { - return deliveryUrl; + return this.deliveryUrl; } /** * The Unify Base URL events from connectors will be sent to after service id is appended. */ - @JsonIgnore public String executeBaseUrl() { - return executeBaseUrl; + return this.executeBaseUrl; } /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ - @JsonIgnore public List events() { - return events; + return this.events; } /** * The date and time when the object was last updated. */ - @JsonIgnore public JsonNullable updatedAt() { - return updatedAt; + return this.updatedAt; } /** * The date and time when the object was created. */ - @JsonIgnore public JsonNullable createdAt() { - return createdAt; + return this.createdAt; } public static Builder builder() { @@ -211,61 +198,35 @@ public static Builder builder() { } - public Webhook withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - - public Webhook withId(Optional id) { - Utils.checkNotNull(id, "id"); + public Webhook withId(@Nullable String id) { this.id = id; return this; } + /** * A description of the object. */ - public Webhook withDescription(String description) { - Utils.checkNotNull(description, "description"); + public Webhook withDescription(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Webhook withDescription(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } /** * Name of Apideck Unified API */ - public Webhook withUnifiedApi(UnifiedApiId unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Webhook withUnifiedApi(@Nonnull UnifiedApiId unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** - * The status of the webhook. - */ - public Webhook withStatus(Status status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } /** - * Indicates if the webhook has has been disabled as it reached its retry limit or if account is over the usage allocated by it's plan. + * The status of the webhook. */ - public Webhook withDisabledReason(DisabledReason disabledReason) { - Utils.checkNotNull(disabledReason, "disabledReason"); - this.disabledReason = Optional.ofNullable(disabledReason); + public Webhook withStatus(@Nonnull Status status) { + this.status = Utils.checkNotNull(status, "status"); return this; } @@ -273,74 +234,56 @@ public Webhook withDisabledReason(DisabledReason disabledReason) { /** * Indicates if the webhook has has been disabled as it reached its retry limit or if account is over the usage allocated by it's plan. */ - public Webhook withDisabledReason(Optional disabledReason) { - Utils.checkNotNull(disabledReason, "disabledReason"); + public Webhook withDisabledReason(@Nullable DisabledReason disabledReason) { this.disabledReason = disabledReason; return this; } + /** * The delivery url of the webhook endpoint. */ - public Webhook withDeliveryUrl(String deliveryUrl) { - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); - this.deliveryUrl = deliveryUrl; + public Webhook withDeliveryUrl(@Nonnull String deliveryUrl) { + this.deliveryUrl = Utils.checkNotNull(deliveryUrl, "deliveryUrl"); return this; } + /** * The Unify Base URL events from connectors will be sent to after service id is appended. */ - public Webhook withExecuteBaseUrl(String executeBaseUrl) { - Utils.checkNotNull(executeBaseUrl, "executeBaseUrl"); - this.executeBaseUrl = executeBaseUrl; + public Webhook withExecuteBaseUrl(@Nonnull String executeBaseUrl) { + this.executeBaseUrl = Utils.checkNotNull(executeBaseUrl, "executeBaseUrl"); return this; } + /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ - public Webhook withEvents(List events) { - Utils.checkNotNull(events, "events"); - this.events = events; + public Webhook withEvents(@Nonnull List events) { + this.events = Utils.checkNotNull(events, "events"); return this; } + /** * The date and time when the object was last updated. */ - public Webhook withUpdatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Webhook withUpdatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Webhook withUpdatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } /** * The date and time when the object was created. */ - public Webhook withCreatedAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Webhook withCreatedAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Webhook withCreatedAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -391,15 +334,15 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional id = Optional.empty(); + private String id; - private JsonNullable description = JsonNullable.undefined(); + private JsonNullable description; private UnifiedApiId unifiedApi; private Status status; - private Optional disabledReason = Optional.empty(); + private DisabledReason disabledReason; private String deliveryUrl; @@ -407,155 +350,92 @@ public final static class Builder { private List events; - private JsonNullable updatedAt = JsonNullable.undefined(); + private JsonNullable updatedAt; - private JsonNullable createdAt = JsonNullable.undefined(); + private JsonNullable createdAt; private Builder() { // force use of static builder() method } - - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = Optional.ofNullable(id); - return this; - } - - public Builder id(Optional id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = id; return this; } - /** * A description of the object. */ - public Builder description(String description) { - Utils.checkNotNull(description, "description"); + public Builder description(@Nullable String description) { this.description = JsonNullable.of(description); return this; } - /** - * A description of the object. - */ - public Builder description(JsonNullable description) { - Utils.checkNotNull(description, "description"); - this.description = description; - return this; - } - - /** * Name of Apideck Unified API */ - public Builder unifiedApi(UnifiedApiId unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull UnifiedApiId unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** * The status of the webhook. */ - public Builder status(Status status) { - Utils.checkNotNull(status, "status"); - this.status = status; - return this; - } - - - /** - * Indicates if the webhook has has been disabled as it reached its retry limit or if account is over the usage allocated by it's plan. - */ - public Builder disabledReason(DisabledReason disabledReason) { - Utils.checkNotNull(disabledReason, "disabledReason"); - this.disabledReason = Optional.ofNullable(disabledReason); + public Builder status(@Nonnull Status status) { + this.status = Utils.checkNotNull(status, "status"); return this; } /** * Indicates if the webhook has has been disabled as it reached its retry limit or if account is over the usage allocated by it's plan. */ - public Builder disabledReason(Optional disabledReason) { - Utils.checkNotNull(disabledReason, "disabledReason"); + public Builder disabledReason(@Nullable DisabledReason disabledReason) { this.disabledReason = disabledReason; return this; } - /** * The delivery url of the webhook endpoint. */ - public Builder deliveryUrl(String deliveryUrl) { - Utils.checkNotNull(deliveryUrl, "deliveryUrl"); - this.deliveryUrl = deliveryUrl; + public Builder deliveryUrl(@Nonnull String deliveryUrl) { + this.deliveryUrl = Utils.checkNotNull(deliveryUrl, "deliveryUrl"); return this; } - /** * The Unify Base URL events from connectors will be sent to after service id is appended. */ - public Builder executeBaseUrl(String executeBaseUrl) { - Utils.checkNotNull(executeBaseUrl, "executeBaseUrl"); - this.executeBaseUrl = executeBaseUrl; + public Builder executeBaseUrl(@Nonnull String executeBaseUrl) { + this.executeBaseUrl = Utils.checkNotNull(executeBaseUrl, "executeBaseUrl"); return this; } - /** * The list of subscribed events for this webhook. [`*`] indicates that all events are enabled. */ - public Builder events(List events) { - Utils.checkNotNull(events, "events"); - this.events = events; + public Builder events(@Nonnull List events) { + this.events = Utils.checkNotNull(events, "events"); return this; } - /** * The date and time when the object was last updated. */ - public Builder updatedAt(OffsetDateTime updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); + public Builder updatedAt(@Nullable OffsetDateTime updatedAt) { this.updatedAt = JsonNullable.of(updatedAt); return this; } - /** - * The date and time when the object was last updated. - */ - public Builder updatedAt(JsonNullable updatedAt) { - Utils.checkNotNull(updatedAt, "updatedAt"); - this.updatedAt = updatedAt; - return this; - } - - /** * The date and time when the object was created. */ - public Builder createdAt(OffsetDateTime createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable OffsetDateTime createdAt) { this.createdAt = JsonNullable.of(createdAt); return this; } - /** - * The date and time when the object was created. - */ - public Builder createdAt(JsonNullable createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = createdAt; - return this; - } - public Webhook build() { - return new Webhook( id, description, unifiedApi, status, disabledReason, deliveryUrl, diff --git a/src/main/java/com/apideck/unify/models/components/WebhookSubscription.java b/src/main/java/com/apideck/unify/models/components/WebhookSubscription.java index e2537f29..1e659f82 100644 --- a/src/main/java/com/apideck/unify/models/components/WebhookSubscription.java +++ b/src/main/java/com/apideck/unify/models/components/WebhookSubscription.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -22,48 +21,43 @@ public class WebhookSubscription { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_id") - private Optional downstreamId; + private String downstreamId; /** * The list of Unify Events this connection is subscribed to */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("unify_event_types") - private Optional> unifyEventTypes; + private List unifyEventTypes; /** * The list of downstream Events this connection is subscribed to */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("downstream_event_types") - private Optional> downstreamEventTypes; + private List downstreamEventTypes; /** * The URL the downstream is sending to when the event is triggered */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("execute_url") - private Optional executeUrl; + private String executeUrl; /** * The date and time the webhook subscription was created downstream */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("created_at") - private Optional createdAt; + private String createdAt; @JsonCreator public WebhookSubscription( - @JsonProperty("downstream_id") Optional downstreamId, - @JsonProperty("unify_event_types") Optional> unifyEventTypes, - @JsonProperty("downstream_event_types") Optional> downstreamEventTypes, - @JsonProperty("execute_url") Optional executeUrl, - @JsonProperty("created_at") Optional createdAt) { - Utils.checkNotNull(downstreamId, "downstreamId"); - Utils.checkNotNull(unifyEventTypes, "unifyEventTypes"); - Utils.checkNotNull(downstreamEventTypes, "downstreamEventTypes"); - Utils.checkNotNull(executeUrl, "executeUrl"); - Utils.checkNotNull(createdAt, "createdAt"); + @JsonProperty("downstream_id") @Nullable String downstreamId, + @JsonProperty("unify_event_types") @Nullable List unifyEventTypes, + @JsonProperty("downstream_event_types") @Nullable List downstreamEventTypes, + @JsonProperty("execute_url") @Nullable String executeUrl, + @JsonProperty("created_at") @Nullable String createdAt) { this.downstreamId = downstreamId; this.unifyEventTypes = unifyEventTypes; this.downstreamEventTypes = downstreamEventTypes; @@ -72,50 +66,43 @@ public WebhookSubscription( } public WebhookSubscription() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + this(null, null, null, + null, null); } /** * The ID of the downstream service */ - @JsonIgnore public Optional downstreamId() { - return downstreamId; + return Optional.ofNullable(this.downstreamId); } /** * The list of Unify Events this connection is subscribed to */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> unifyEventTypes() { - return (Optional>) unifyEventTypes; + return Optional.ofNullable(this.unifyEventTypes); } /** * The list of downstream Events this connection is subscribed to */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> downstreamEventTypes() { - return (Optional>) downstreamEventTypes; + return Optional.ofNullable(this.downstreamEventTypes); } /** * The URL the downstream is sending to when the event is triggered */ - @JsonIgnore public Optional executeUrl() { - return executeUrl; + return Optional.ofNullable(this.executeUrl); } /** * The date and time the webhook subscription was created downstream */ - @JsonIgnore public Optional createdAt() { - return createdAt; + return Optional.ofNullable(this.createdAt); } public static Builder builder() { @@ -126,98 +113,48 @@ public static Builder builder() { /** * The ID of the downstream service */ - public WebhookSubscription withDownstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = Optional.ofNullable(downstreamId); - return this; - } - - - /** - * The ID of the downstream service - */ - public WebhookSubscription withDownstreamId(Optional downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public WebhookSubscription withDownstreamId(@Nullable String downstreamId) { this.downstreamId = downstreamId; return this; } - /** - * The list of Unify Events this connection is subscribed to - */ - public WebhookSubscription withUnifyEventTypes(List unifyEventTypes) { - Utils.checkNotNull(unifyEventTypes, "unifyEventTypes"); - this.unifyEventTypes = Optional.ofNullable(unifyEventTypes); - return this; - } - /** * The list of Unify Events this connection is subscribed to */ - public WebhookSubscription withUnifyEventTypes(Optional> unifyEventTypes) { - Utils.checkNotNull(unifyEventTypes, "unifyEventTypes"); + public WebhookSubscription withUnifyEventTypes(@Nullable List unifyEventTypes) { this.unifyEventTypes = unifyEventTypes; return this; } - /** - * The list of downstream Events this connection is subscribed to - */ - public WebhookSubscription withDownstreamEventTypes(List downstreamEventTypes) { - Utils.checkNotNull(downstreamEventTypes, "downstreamEventTypes"); - this.downstreamEventTypes = Optional.ofNullable(downstreamEventTypes); - return this; - } - /** * The list of downstream Events this connection is subscribed to */ - public WebhookSubscription withDownstreamEventTypes(Optional> downstreamEventTypes) { - Utils.checkNotNull(downstreamEventTypes, "downstreamEventTypes"); + public WebhookSubscription withDownstreamEventTypes(@Nullable List downstreamEventTypes) { this.downstreamEventTypes = downstreamEventTypes; return this; } - /** - * The URL the downstream is sending to when the event is triggered - */ - public WebhookSubscription withExecuteUrl(String executeUrl) { - Utils.checkNotNull(executeUrl, "executeUrl"); - this.executeUrl = Optional.ofNullable(executeUrl); - return this; - } - /** * The URL the downstream is sending to when the event is triggered */ - public WebhookSubscription withExecuteUrl(Optional executeUrl) { - Utils.checkNotNull(executeUrl, "executeUrl"); + public WebhookSubscription withExecuteUrl(@Nullable String executeUrl) { this.executeUrl = executeUrl; return this; } - /** - * The date and time the webhook subscription was created downstream - */ - public WebhookSubscription withCreatedAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - /** * The date and time the webhook subscription was created downstream */ - public WebhookSubscription withCreatedAt(Optional createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public WebhookSubscription withCreatedAt(@Nullable String createdAt) { this.createdAt = createdAt; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -255,117 +192,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional downstreamId = Optional.empty(); + private String downstreamId; - private Optional> unifyEventTypes = Optional.empty(); + private List unifyEventTypes; - private Optional> downstreamEventTypes = Optional.empty(); + private List downstreamEventTypes; - private Optional executeUrl = Optional.empty(); + private String executeUrl; - private Optional createdAt = Optional.empty(); + private String createdAt; private Builder() { // force use of static builder() method } - - /** - * The ID of the downstream service - */ - public Builder downstreamId(String downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); - this.downstreamId = Optional.ofNullable(downstreamId); - return this; - } - /** * The ID of the downstream service */ - public Builder downstreamId(Optional downstreamId) { - Utils.checkNotNull(downstreamId, "downstreamId"); + public Builder downstreamId(@Nullable String downstreamId) { this.downstreamId = downstreamId; return this; } - /** * The list of Unify Events this connection is subscribed to */ - public Builder unifyEventTypes(List unifyEventTypes) { - Utils.checkNotNull(unifyEventTypes, "unifyEventTypes"); - this.unifyEventTypes = Optional.ofNullable(unifyEventTypes); - return this; - } - - /** - * The list of Unify Events this connection is subscribed to - */ - public Builder unifyEventTypes(Optional> unifyEventTypes) { - Utils.checkNotNull(unifyEventTypes, "unifyEventTypes"); + public Builder unifyEventTypes(@Nullable List unifyEventTypes) { this.unifyEventTypes = unifyEventTypes; return this; } - - /** - * The list of downstream Events this connection is subscribed to - */ - public Builder downstreamEventTypes(List downstreamEventTypes) { - Utils.checkNotNull(downstreamEventTypes, "downstreamEventTypes"); - this.downstreamEventTypes = Optional.ofNullable(downstreamEventTypes); - return this; - } - /** * The list of downstream Events this connection is subscribed to */ - public Builder downstreamEventTypes(Optional> downstreamEventTypes) { - Utils.checkNotNull(downstreamEventTypes, "downstreamEventTypes"); + public Builder downstreamEventTypes(@Nullable List downstreamEventTypes) { this.downstreamEventTypes = downstreamEventTypes; return this; } - - /** - * The URL the downstream is sending to when the event is triggered - */ - public Builder executeUrl(String executeUrl) { - Utils.checkNotNull(executeUrl, "executeUrl"); - this.executeUrl = Optional.ofNullable(executeUrl); - return this; - } - /** * The URL the downstream is sending to when the event is triggered */ - public Builder executeUrl(Optional executeUrl) { - Utils.checkNotNull(executeUrl, "executeUrl"); + public Builder executeUrl(@Nullable String executeUrl) { this.executeUrl = executeUrl; return this; } - - /** - * The date and time the webhook subscription was created downstream - */ - public Builder createdAt(String createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); - this.createdAt = Optional.ofNullable(createdAt); - return this; - } - /** * The date and time the webhook subscription was created downstream */ - public Builder createdAt(Optional createdAt) { - Utils.checkNotNull(createdAt, "createdAt"); + public Builder createdAt(@Nullable String createdAt) { this.createdAt = createdAt; return this; } public WebhookSubscription build() { - return new WebhookSubscription( downstreamId, unifyEventTypes, downstreamEventTypes, executeUrl, createdAt); diff --git a/src/main/java/com/apideck/unify/models/components/WebhookSupport.java b/src/main/java/com/apideck/unify/models/components/WebhookSupport.java index f3e574f4..d19e7d6e 100644 --- a/src/main/java/com/apideck/unify/models/components/WebhookSupport.java +++ b/src/main/java/com/apideck/unify/models/components/WebhookSupport.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; /** @@ -25,39 +24,35 @@ public class WebhookSupport { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("mode") - private Optional mode; + private Mode mode; /** * Received events are scoped to connection or across integration. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("subscription_level") - private Optional subscriptionLevel; + private SubscriptionLevel subscriptionLevel; /** * How the subscription is managed in the downstream. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("managed_via") - private Optional managedVia; + private ManagedVia managedVia; /** * Virtual webhook config for the connector. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("virtual_webhooks") - private Optional virtualWebhooks; + private VirtualWebhooks virtualWebhooks; @JsonCreator public WebhookSupport( - @JsonProperty("mode") Optional mode, - @JsonProperty("subscription_level") Optional subscriptionLevel, - @JsonProperty("managed_via") Optional managedVia, - @JsonProperty("virtual_webhooks") Optional virtualWebhooks) { - Utils.checkNotNull(mode, "mode"); - Utils.checkNotNull(subscriptionLevel, "subscriptionLevel"); - Utils.checkNotNull(managedVia, "managedVia"); - Utils.checkNotNull(virtualWebhooks, "virtualWebhooks"); + @JsonProperty("mode") @Nullable Mode mode, + @JsonProperty("subscription_level") @Nullable SubscriptionLevel subscriptionLevel, + @JsonProperty("managed_via") @Nullable ManagedVia managedVia, + @JsonProperty("virtual_webhooks") @Nullable VirtualWebhooks virtualWebhooks) { this.mode = mode; this.subscriptionLevel = subscriptionLevel; this.managedVia = managedVia; @@ -65,44 +60,36 @@ public WebhookSupport( } public WebhookSupport() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * Mode of the webhook support. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional mode() { - return (Optional) mode; + return Optional.ofNullable(this.mode); } /** * Received events are scoped to connection or across integration. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional subscriptionLevel() { - return (Optional) subscriptionLevel; + return Optional.ofNullable(this.subscriptionLevel); } /** * How the subscription is managed in the downstream. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional managedVia() { - return (Optional) managedVia; + return Optional.ofNullable(this.managedVia); } /** * Virtual webhook config for the connector. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional virtualWebhooks() { - return (Optional) virtualWebhooks; + return Optional.ofNullable(this.virtualWebhooks); } public static Builder builder() { @@ -113,79 +100,39 @@ public static Builder builder() { /** * Mode of the webhook support. */ - public WebhookSupport withMode(Mode mode) { - Utils.checkNotNull(mode, "mode"); - this.mode = Optional.ofNullable(mode); - return this; - } - - - /** - * Mode of the webhook support. - */ - public WebhookSupport withMode(Optional mode) { - Utils.checkNotNull(mode, "mode"); + public WebhookSupport withMode(@Nullable Mode mode) { this.mode = mode; return this; } - /** - * Received events are scoped to connection or across integration. - */ - public WebhookSupport withSubscriptionLevel(SubscriptionLevel subscriptionLevel) { - Utils.checkNotNull(subscriptionLevel, "subscriptionLevel"); - this.subscriptionLevel = Optional.ofNullable(subscriptionLevel); - return this; - } - /** * Received events are scoped to connection or across integration. */ - public WebhookSupport withSubscriptionLevel(Optional subscriptionLevel) { - Utils.checkNotNull(subscriptionLevel, "subscriptionLevel"); + public WebhookSupport withSubscriptionLevel(@Nullable SubscriptionLevel subscriptionLevel) { this.subscriptionLevel = subscriptionLevel; return this; } - /** - * How the subscription is managed in the downstream. - */ - public WebhookSupport withManagedVia(ManagedVia managedVia) { - Utils.checkNotNull(managedVia, "managedVia"); - this.managedVia = Optional.ofNullable(managedVia); - return this; - } - /** * How the subscription is managed in the downstream. */ - public WebhookSupport withManagedVia(Optional managedVia) { - Utils.checkNotNull(managedVia, "managedVia"); + public WebhookSupport withManagedVia(@Nullable ManagedVia managedVia) { this.managedVia = managedVia; return this; } - /** - * Virtual webhook config for the connector. - */ - public WebhookSupport withVirtualWebhooks(VirtualWebhooks virtualWebhooks) { - Utils.checkNotNull(virtualWebhooks, "virtualWebhooks"); - this.virtualWebhooks = Optional.ofNullable(virtualWebhooks); - return this; - } - /** * Virtual webhook config for the connector. */ - public WebhookSupport withVirtualWebhooks(Optional virtualWebhooks) { - Utils.checkNotNull(virtualWebhooks, "virtualWebhooks"); + public WebhookSupport withVirtualWebhooks(@Nullable VirtualWebhooks virtualWebhooks) { this.virtualWebhooks = virtualWebhooks; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -221,96 +168,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional mode = Optional.empty(); + private Mode mode; - private Optional subscriptionLevel = Optional.empty(); + private SubscriptionLevel subscriptionLevel; - private Optional managedVia = Optional.empty(); + private ManagedVia managedVia; - private Optional virtualWebhooks = Optional.empty(); + private VirtualWebhooks virtualWebhooks; private Builder() { // force use of static builder() method } - /** * Mode of the webhook support. */ - public Builder mode(Mode mode) { - Utils.checkNotNull(mode, "mode"); - this.mode = Optional.ofNullable(mode); - return this; - } - - /** - * Mode of the webhook support. - */ - public Builder mode(Optional mode) { - Utils.checkNotNull(mode, "mode"); + public Builder mode(@Nullable Mode mode) { this.mode = mode; return this; } - - /** - * Received events are scoped to connection or across integration. - */ - public Builder subscriptionLevel(SubscriptionLevel subscriptionLevel) { - Utils.checkNotNull(subscriptionLevel, "subscriptionLevel"); - this.subscriptionLevel = Optional.ofNullable(subscriptionLevel); - return this; - } - /** * Received events are scoped to connection or across integration. */ - public Builder subscriptionLevel(Optional subscriptionLevel) { - Utils.checkNotNull(subscriptionLevel, "subscriptionLevel"); + public Builder subscriptionLevel(@Nullable SubscriptionLevel subscriptionLevel) { this.subscriptionLevel = subscriptionLevel; return this; } - /** * How the subscription is managed in the downstream. */ - public Builder managedVia(ManagedVia managedVia) { - Utils.checkNotNull(managedVia, "managedVia"); - this.managedVia = Optional.ofNullable(managedVia); - return this; - } - - /** - * How the subscription is managed in the downstream. - */ - public Builder managedVia(Optional managedVia) { - Utils.checkNotNull(managedVia, "managedVia"); + public Builder managedVia(@Nullable ManagedVia managedVia) { this.managedVia = managedVia; return this; } - /** * Virtual webhook config for the connector. */ - public Builder virtualWebhooks(VirtualWebhooks virtualWebhooks) { - Utils.checkNotNull(virtualWebhooks, "virtualWebhooks"); - this.virtualWebhooks = Optional.ofNullable(virtualWebhooks); - return this; - } - - /** - * Virtual webhook config for the connector. - */ - public Builder virtualWebhooks(Optional virtualWebhooks) { - Utils.checkNotNull(virtualWebhooks, "virtualWebhooks"); + public Builder virtualWebhooks(@Nullable VirtualWebhooks virtualWebhooks) { this.virtualWebhooks = virtualWebhooks; return this; } public WebhookSupport build() { - return new WebhookSupport( mode, subscriptionLevel, managedVia, virtualWebhooks); diff --git a/src/main/java/com/apideck/unify/models/components/WebhookSupportResources.java b/src/main/java/com/apideck/unify/models/components/WebhookSupportResources.java index 77f937b2..245b16b7 100644 --- a/src/main/java/com/apideck/unify/models/components/WebhookSupportResources.java +++ b/src/main/java/com/apideck/unify/models/components/WebhookSupportResources.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.List; import java.util.Optional; @@ -20,23 +19,20 @@ public class WebhookSupportResources { @JsonInclude(Include.NON_ABSENT) @JsonProperty("events") - private Optional> events; + private List events; @JsonCreator public WebhookSupportResources( - @JsonProperty("events") Optional> events) { - Utils.checkNotNull(events, "events"); + @JsonProperty("events") @Nullable List events) { this.events = events; } public WebhookSupportResources() { - this(Optional.empty()); + this(null); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> events() { - return (Optional>) events; + return Optional.ofNullable(this.events); } public static Builder builder() { @@ -44,19 +40,12 @@ public static Builder builder() { } - public WebhookSupportResources withEvents(List events) { - Utils.checkNotNull(events, "events"); - this.events = Optional.ofNullable(events); - return this; - } - - - public WebhookSupportResources withEvents(Optional> events) { - Utils.checkNotNull(events, "events"); + public WebhookSupportResources withEvents(@Nullable List events) { this.events = events; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,27 +74,18 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional> events = Optional.empty(); + private List events; private Builder() { // force use of static builder() method } - - public Builder events(List events) { - Utils.checkNotNull(events, "events"); - this.events = Optional.ofNullable(events); - return this; - } - - public Builder events(Optional> events) { - Utils.checkNotNull(events, "events"); + public Builder events(@Nullable List events) { this.events = events; return this; } public WebhookSupportResources build() { - return new WebhookSupportResources( events); } diff --git a/src/main/java/com/apideck/unify/models/components/Website.java b/src/main/java/com/apideck/unify/models/components/Website.java index 92b2780e..70d015e9 100644 --- a/src/main/java/com/apideck/unify/models/components/Website.java +++ b/src/main/java/com/apideck/unify/models/components/Website.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -34,49 +35,45 @@ public class Website { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; @JsonCreator public Website( - @JsonProperty("id") JsonNullable id, - @JsonProperty("url") String url, - @JsonProperty("type") JsonNullable type) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(url, "url"); - Utils.checkNotNull(type, "type"); - this.id = id; - this.url = url; - this.type = type; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("url") @Nonnull String url, + @JsonProperty("type") @Nullable JsonNullable type) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.url = Optional.ofNullable(url) + .orElseThrow(() -> new IllegalArgumentException("url cannot be null")); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); } public Website( - String url) { - this(JsonNullable.undefined(), url, JsonNullable.undefined()); + @Nonnull String url) { + this(null, url, null); } /** * Unique identifier for the website */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The website URL */ - @JsonIgnore public String url() { - return url; + return this.url; } /** * The type of website */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } public static Builder builder() { @@ -87,47 +84,29 @@ public static Builder builder() { /** * Unique identifier for the website */ - public Website withId(String id) { - Utils.checkNotNull(id, "id"); + public Website withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the website - */ - public Website withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The website URL */ - public Website withUrl(String url) { - Utils.checkNotNull(url, "url"); - this.url = url; + public Website withUrl(@Nonnull String url) { + this.url = Utils.checkNotNull(url, "url"); return this; } + /** * The type of website */ - public Website withType(WebsiteType type) { - Utils.checkNotNull(type, "type"); + public Website withType(@Nullable WebsiteType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of website - */ - public Website withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -161,66 +140,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; private String url; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; private Builder() { // force use of static builder() method } - /** * Unique identifier for the website */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the website - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The website URL */ - public Builder url(String url) { - Utils.checkNotNull(url, "url"); - this.url = url; + public Builder url(@Nonnull String url) { + this.url = Utils.checkNotNull(url, "url"); return this; } - /** * The type of website */ - public Builder type(WebsiteType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable WebsiteType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of website - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - public Website build() { - return new Website( id, url, type); } diff --git a/src/main/java/com/apideck/unify/models/components/Websites.java b/src/main/java/com/apideck/unify/models/components/Websites.java index 7a4ca49b..3cd601fa 100644 --- a/src/main/java/com/apideck/unify/models/components/Websites.java +++ b/src/main/java/com/apideck/unify/models/components/Websites.java @@ -5,13 +5,14 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; +import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -34,49 +35,45 @@ public class Websites { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type") - private JsonNullable type; + private JsonNullable type; @JsonCreator public Websites( - @JsonProperty("id") JsonNullable id, - @JsonProperty("url") String url, - @JsonProperty("type") JsonNullable type) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(url, "url"); - Utils.checkNotNull(type, "type"); - this.id = id; - this.url = url; - this.type = type; + @JsonProperty("id") @Nullable JsonNullable id, + @JsonProperty("url") @Nonnull String url, + @JsonProperty("type") @Nullable JsonNullable type) { + this.id = Optional.ofNullable(id) + .orElse(JsonNullable.undefined()); + this.url = Optional.ofNullable(url) + .orElseThrow(() -> new IllegalArgumentException("url cannot be null")); + this.type = Optional.ofNullable(type) + .orElse(JsonNullable.undefined()); } public Websites( - String url) { - this(JsonNullable.undefined(), url, JsonNullable.undefined()); + @Nonnull String url) { + this(null, url, null); } /** * Unique identifier for the website */ - @JsonIgnore public JsonNullable id() { - return id; + return this.id; } /** * The website URL */ - @JsonIgnore public String url() { - return url; + return this.url; } /** * The type of website */ - @SuppressWarnings("unchecked") - @JsonIgnore public JsonNullable type() { - return (JsonNullable) type; + return this.type; } public static Builder builder() { @@ -87,47 +84,29 @@ public static Builder builder() { /** * Unique identifier for the website */ - public Websites withId(String id) { - Utils.checkNotNull(id, "id"); + public Websites withId(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the website - */ - public Websites withId(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** * The website URL */ - public Websites withUrl(String url) { - Utils.checkNotNull(url, "url"); - this.url = url; + public Websites withUrl(@Nonnull String url) { + this.url = Utils.checkNotNull(url, "url"); return this; } + /** * The type of website */ - public Websites withType(ApplicantType type) { - Utils.checkNotNull(type, "type"); + public Websites withType(@Nullable ApplicantType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of website - */ - public Websites withType(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -161,66 +140,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private JsonNullable id = JsonNullable.undefined(); + private JsonNullable id; private String url; - private JsonNullable type = JsonNullable.undefined(); + private JsonNullable type; private Builder() { // force use of static builder() method } - /** * Unique identifier for the website */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); + public Builder id(@Nullable String id) { this.id = JsonNullable.of(id); return this; } - /** - * Unique identifier for the website - */ - public Builder id(JsonNullable id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** * The website URL */ - public Builder url(String url) { - Utils.checkNotNull(url, "url"); - this.url = url; + public Builder url(@Nonnull String url) { + this.url = Utils.checkNotNull(url, "url"); return this; } - /** * The type of website */ - public Builder type(ApplicantType type) { - Utils.checkNotNull(type, "type"); + public Builder type(@Nullable ApplicantType type) { this.type = JsonNullable.of(type); return this; } - /** - * The type of website - */ - public Builder type(JsonNullable type) { - Utils.checkNotNull(type, "type"); - this.type = type; - return this; - } - public Websites build() { - return new Websites( id, url, type); } diff --git a/src/main/java/com/apideck/unify/models/components/WorkPattern.java b/src/main/java/com/apideck/unify/models/components/WorkPattern.java index bb69a64f..7281d184 100644 --- a/src/main/java/com/apideck/unify/models/components/WorkPattern.java +++ b/src/main/java/com/apideck/unify/models/components/WorkPattern.java @@ -5,13 +5,12 @@ import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -19,37 +18,31 @@ public class WorkPattern { @JsonInclude(Include.NON_ABSENT) @JsonProperty("odd_weeks") - private Optional oddWeeks; + private OddWeeks oddWeeks; @JsonInclude(Include.NON_ABSENT) @JsonProperty("even_weeks") - private Optional evenWeeks; + private EvenWeeks evenWeeks; @JsonCreator public WorkPattern( - @JsonProperty("odd_weeks") Optional oddWeeks, - @JsonProperty("even_weeks") Optional evenWeeks) { - Utils.checkNotNull(oddWeeks, "oddWeeks"); - Utils.checkNotNull(evenWeeks, "evenWeeks"); + @JsonProperty("odd_weeks") @Nullable OddWeeks oddWeeks, + @JsonProperty("even_weeks") @Nullable EvenWeeks evenWeeks) { this.oddWeeks = oddWeeks; this.evenWeeks = evenWeeks; } public WorkPattern() { - this(Optional.empty(), Optional.empty()); + this(null, null); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional oddWeeks() { - return (Optional) oddWeeks; + return Optional.ofNullable(this.oddWeeks); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional evenWeeks() { - return (Optional) evenWeeks; + return Optional.ofNullable(this.evenWeeks); } public static Builder builder() { @@ -57,32 +50,18 @@ public static Builder builder() { } - public WorkPattern withOddWeeks(OddWeeks oddWeeks) { - Utils.checkNotNull(oddWeeks, "oddWeeks"); - this.oddWeeks = Optional.ofNullable(oddWeeks); - return this; - } - - - public WorkPattern withOddWeeks(Optional oddWeeks) { - Utils.checkNotNull(oddWeeks, "oddWeeks"); + public WorkPattern withOddWeeks(@Nullable OddWeeks oddWeeks) { this.oddWeeks = oddWeeks; return this; } - public WorkPattern withEvenWeeks(EvenWeeks evenWeeks) { - Utils.checkNotNull(evenWeeks, "evenWeeks"); - this.evenWeeks = Optional.ofNullable(evenWeeks); - return this; - } - - public WorkPattern withEvenWeeks(Optional evenWeeks) { - Utils.checkNotNull(evenWeeks, "evenWeeks"); + public WorkPattern withEvenWeeks(@Nullable EvenWeeks evenWeeks) { this.evenWeeks = evenWeeks; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -113,42 +92,25 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional oddWeeks = Optional.empty(); + private OddWeeks oddWeeks; - private Optional evenWeeks = Optional.empty(); + private EvenWeeks evenWeeks; private Builder() { // force use of static builder() method } - - public Builder oddWeeks(OddWeeks oddWeeks) { - Utils.checkNotNull(oddWeeks, "oddWeeks"); - this.oddWeeks = Optional.ofNullable(oddWeeks); - return this; - } - - public Builder oddWeeks(Optional oddWeeks) { - Utils.checkNotNull(oddWeeks, "oddWeeks"); + public Builder oddWeeks(@Nullable OddWeeks oddWeeks) { this.oddWeeks = oddWeeks; return this; } - - public Builder evenWeeks(EvenWeeks evenWeeks) { - Utils.checkNotNull(evenWeeks, "evenWeeks"); - this.evenWeeks = Optional.ofNullable(evenWeeks); - return this; - } - - public Builder evenWeeks(Optional evenWeeks) { - Utils.checkNotNull(evenWeeks, "evenWeeks"); + public Builder evenWeeks(@Nullable EvenWeeks evenWeeks) { this.evenWeeks = evenWeeks; return this; } public WorkPattern build() { - return new WorkPattern( oddWeeks, evenWeeks); } diff --git a/src/main/java/com/apideck/unify/models/errors/BadRequestResponse.java b/src/main/java/com/apideck/unify/models/errors/BadRequestResponse.java index aaa3e7ab..723f5bfe 100644 --- a/src/main/java/com/apideck/unify/models/errors/BadRequestResponse.java +++ b/src/main/java/com/apideck/unify/models/errors/BadRequestResponse.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.RuntimeException; @@ -28,58 +29,52 @@ public class BadRequestResponse extends RuntimeException { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status_code") - private Optional statusCode; + private Double statusCode; /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("error") - private Optional error; + private String error; /** * The type of error returned */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type_name") - private Optional typeName; + private String typeName; /** * A human-readable message providing more details about the error. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") - private Optional message; + private String message; /** * Contains parameter or domain specific information related to the error and why it occurred. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("detail") - private Optional detail; + private Detail detail; /** * Link to documentation of error type */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("ref") - private Optional ref; + private String ref; @JsonCreator public BadRequestResponse( - @JsonProperty("status_code") Optional statusCode, - @JsonProperty("error") Optional error, - @JsonProperty("type_name") Optional typeName, - @JsonProperty("message") Optional message, - @JsonProperty("detail") Optional detail, - @JsonProperty("ref") Optional ref) { + @JsonProperty("status_code") @Nullable Double statusCode, + @JsonProperty("error") @Nullable String error, + @JsonProperty("type_name") @Nullable String typeName, + @JsonProperty("message") @Nullable String message, + @JsonProperty("detail") @Nullable Detail detail, + @JsonProperty("ref") @Nullable String ref) { super(Utils.valueOrElse(message, "API error occurred")); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(error, "error"); - Utils.checkNotNull(typeName, "typeName"); - Utils.checkNotNull(message, "message"); - Utils.checkNotNull(detail, "detail"); - Utils.checkNotNull(ref, "ref"); this.statusCode = statusCode; this.error = error; this.typeName = typeName; @@ -89,40 +84,36 @@ public BadRequestResponse( } public BadRequestResponse() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * HTTP status code */ - @JsonIgnore public Optional statusCode() { - return statusCode; + return Optional.ofNullable(this.statusCode); } /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - @JsonIgnore public Optional error() { - return error; + return Optional.ofNullable(this.error); } /** * The type of error returned */ - @JsonIgnore public Optional typeName() { - return typeName; + return Optional.ofNullable(this.typeName); } /** * A human-readable message providing more details about the error. */ - @JsonIgnore public Optional message() { - return message; + return Optional.ofNullable(this.message); } @JsonIgnore @@ -134,18 +125,15 @@ public String getMessage() { /** * Contains parameter or domain specific information related to the error and why it occurred. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional detail() { - return (Optional) detail; + return Optional.ofNullable(this.detail); } /** * Link to documentation of error type */ - @JsonIgnore public Optional ref() { - return ref; + return Optional.ofNullable(this.ref); } public static Builder builder() { @@ -156,117 +144,57 @@ public static Builder builder() { /** * HTTP status code */ - public BadRequestResponse withStatusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - - /** - * HTTP status code - */ - public BadRequestResponse withStatusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public BadRequestResponse withStatusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public BadRequestResponse withError(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public BadRequestResponse withError(Optional error) { - Utils.checkNotNull(error, "error"); + public BadRequestResponse withError(@Nullable String error) { this.error = error; return this; } - /** - * The type of error returned - */ - public BadRequestResponse withTypeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - /** * The type of error returned */ - public BadRequestResponse withTypeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public BadRequestResponse withTypeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** - * A human-readable message providing more details about the error. - */ - public BadRequestResponse withMessage(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - /** * A human-readable message providing more details about the error. */ - public BadRequestResponse withMessage(Optional message) { - Utils.checkNotNull(message, "message"); + public BadRequestResponse withMessage(@Nullable String message) { this.message = message; return this; } - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public BadRequestResponse withDetail(Detail detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public BadRequestResponse withDetail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public BadRequestResponse withDetail(@Nullable Detail detail) { this.detail = detail; return this; } - /** - * Link to documentation of error type - */ - public BadRequestResponse withRef(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public BadRequestResponse withRef(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public BadRequestResponse withRef(@Nullable String ref) { this.ref = ref; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -306,138 +234,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional statusCode = Optional.empty(); + private Double statusCode; - private Optional error = Optional.empty(); + private String error; - private Optional typeName = Optional.empty(); + private String typeName; - private Optional message = Optional.empty(); + private String message; - private Optional detail = Optional.empty(); + private Detail detail; - private Optional ref = Optional.empty(); + private String ref; private Builder() { // force use of static builder() method } - /** * HTTP status code */ - public Builder statusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - /** - * HTTP status code - */ - public Builder statusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public Builder statusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public Builder error(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public Builder error(Optional error) { - Utils.checkNotNull(error, "error"); + public Builder error(@Nullable String error) { this.error = error; return this; } - /** * The type of error returned */ - public Builder typeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - - /** - * The type of error returned - */ - public Builder typeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public Builder typeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** * A human-readable message providing more details about the error. */ - public Builder message(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - - /** - * A human-readable message providing more details about the error. - */ - public Builder message(Optional message) { - Utils.checkNotNull(message, "message"); + public Builder message(@Nullable String message) { this.message = message; return this; } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public Builder detail(Detail detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public Builder detail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public Builder detail(@Nullable Detail detail) { this.detail = detail; return this; } - - /** - * Link to documentation of error type - */ - public Builder ref(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public Builder ref(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public Builder ref(@Nullable String ref) { this.ref = ref; return this; } public BadRequestResponse build() { - return new BadRequestResponse( statusCode, error, typeName, message, detail, ref); diff --git a/src/main/java/com/apideck/unify/models/errors/NotFoundResponse.java b/src/main/java/com/apideck/unify/models/errors/NotFoundResponse.java index 522c3175..625dad41 100644 --- a/src/main/java/com/apideck/unify/models/errors/NotFoundResponse.java +++ b/src/main/java/com/apideck/unify/models/errors/NotFoundResponse.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.RuntimeException; @@ -28,58 +29,52 @@ public class NotFoundResponse extends RuntimeException { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status_code") - private Optional statusCode; + private Double statusCode; /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("error") - private Optional error; + private String error; /** * The type of error returned */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type_name") - private Optional typeName; + private String typeName; /** * A human-readable message providing more details about the error. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") - private Optional message; + private String message; /** * Contains parameter or domain specific information related to the error and why it occurred. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("detail") - private Optional detail; + private NotFoundResponseDetail detail; /** * Link to documentation of error type */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("ref") - private Optional ref; + private String ref; @JsonCreator public NotFoundResponse( - @JsonProperty("status_code") Optional statusCode, - @JsonProperty("error") Optional error, - @JsonProperty("type_name") Optional typeName, - @JsonProperty("message") Optional message, - @JsonProperty("detail") Optional detail, - @JsonProperty("ref") Optional ref) { + @JsonProperty("status_code") @Nullable Double statusCode, + @JsonProperty("error") @Nullable String error, + @JsonProperty("type_name") @Nullable String typeName, + @JsonProperty("message") @Nullable String message, + @JsonProperty("detail") @Nullable NotFoundResponseDetail detail, + @JsonProperty("ref") @Nullable String ref) { super(Utils.valueOrElse(message, "API error occurred")); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(error, "error"); - Utils.checkNotNull(typeName, "typeName"); - Utils.checkNotNull(message, "message"); - Utils.checkNotNull(detail, "detail"); - Utils.checkNotNull(ref, "ref"); this.statusCode = statusCode; this.error = error; this.typeName = typeName; @@ -89,40 +84,36 @@ public NotFoundResponse( } public NotFoundResponse() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * HTTP status code */ - @JsonIgnore public Optional statusCode() { - return statusCode; + return Optional.ofNullable(this.statusCode); } /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - @JsonIgnore public Optional error() { - return error; + return Optional.ofNullable(this.error); } /** * The type of error returned */ - @JsonIgnore public Optional typeName() { - return typeName; + return Optional.ofNullable(this.typeName); } /** * A human-readable message providing more details about the error. */ - @JsonIgnore public Optional message() { - return message; + return Optional.ofNullable(this.message); } @JsonIgnore @@ -134,18 +125,15 @@ public String getMessage() { /** * Contains parameter or domain specific information related to the error and why it occurred. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional detail() { - return (Optional) detail; + return Optional.ofNullable(this.detail); } /** * Link to documentation of error type */ - @JsonIgnore public Optional ref() { - return ref; + return Optional.ofNullable(this.ref); } public static Builder builder() { @@ -156,117 +144,57 @@ public static Builder builder() { /** * HTTP status code */ - public NotFoundResponse withStatusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - - /** - * HTTP status code - */ - public NotFoundResponse withStatusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public NotFoundResponse withStatusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public NotFoundResponse withError(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public NotFoundResponse withError(Optional error) { - Utils.checkNotNull(error, "error"); + public NotFoundResponse withError(@Nullable String error) { this.error = error; return this; } - /** - * The type of error returned - */ - public NotFoundResponse withTypeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - /** * The type of error returned */ - public NotFoundResponse withTypeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public NotFoundResponse withTypeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** - * A human-readable message providing more details about the error. - */ - public NotFoundResponse withMessage(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - /** * A human-readable message providing more details about the error. */ - public NotFoundResponse withMessage(Optional message) { - Utils.checkNotNull(message, "message"); + public NotFoundResponse withMessage(@Nullable String message) { this.message = message; return this; } - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public NotFoundResponse withDetail(NotFoundResponseDetail detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public NotFoundResponse withDetail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public NotFoundResponse withDetail(@Nullable NotFoundResponseDetail detail) { this.detail = detail; return this; } - /** - * Link to documentation of error type - */ - public NotFoundResponse withRef(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public NotFoundResponse withRef(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public NotFoundResponse withRef(@Nullable String ref) { this.ref = ref; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -306,138 +234,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional statusCode = Optional.empty(); + private Double statusCode; - private Optional error = Optional.empty(); + private String error; - private Optional typeName = Optional.empty(); + private String typeName; - private Optional message = Optional.empty(); + private String message; - private Optional detail = Optional.empty(); + private NotFoundResponseDetail detail; - private Optional ref = Optional.empty(); + private String ref; private Builder() { // force use of static builder() method } - /** * HTTP status code */ - public Builder statusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - /** - * HTTP status code - */ - public Builder statusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public Builder statusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public Builder error(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public Builder error(Optional error) { - Utils.checkNotNull(error, "error"); + public Builder error(@Nullable String error) { this.error = error; return this; } - /** * The type of error returned */ - public Builder typeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - - /** - * The type of error returned - */ - public Builder typeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public Builder typeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** * A human-readable message providing more details about the error. */ - public Builder message(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - - /** - * A human-readable message providing more details about the error. - */ - public Builder message(Optional message) { - Utils.checkNotNull(message, "message"); + public Builder message(@Nullable String message) { this.message = message; return this; } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public Builder detail(NotFoundResponseDetail detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public Builder detail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public Builder detail(@Nullable NotFoundResponseDetail detail) { this.detail = detail; return this; } - - /** - * Link to documentation of error type - */ - public Builder ref(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public Builder ref(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public Builder ref(@Nullable String ref) { this.ref = ref; return this; } public NotFoundResponse build() { - return new NotFoundResponse( statusCode, error, typeName, message, detail, ref); diff --git a/src/main/java/com/apideck/unify/models/errors/PaymentRequiredResponse.java b/src/main/java/com/apideck/unify/models/errors/PaymentRequiredResponse.java index 9ff44021..121de55f 100644 --- a/src/main/java/com/apideck/unify/models/errors/PaymentRequiredResponse.java +++ b/src/main/java/com/apideck/unify/models/errors/PaymentRequiredResponse.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.RuntimeException; @@ -28,58 +29,52 @@ public class PaymentRequiredResponse extends RuntimeException { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status_code") - private Optional statusCode; + private Double statusCode; /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("error") - private Optional error; + private String error; /** * The type of error returned */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type_name") - private Optional typeName; + private String typeName; /** * A human-readable message providing more details about the error. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") - private Optional message; + private String message; /** * Contains parameter or domain specific information related to the error and why it occurred. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("detail") - private Optional detail; + private String detail; /** * Link to documentation of error type */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("ref") - private Optional ref; + private String ref; @JsonCreator public PaymentRequiredResponse( - @JsonProperty("status_code") Optional statusCode, - @JsonProperty("error") Optional error, - @JsonProperty("type_name") Optional typeName, - @JsonProperty("message") Optional message, - @JsonProperty("detail") Optional detail, - @JsonProperty("ref") Optional ref) { + @JsonProperty("status_code") @Nullable Double statusCode, + @JsonProperty("error") @Nullable String error, + @JsonProperty("type_name") @Nullable String typeName, + @JsonProperty("message") @Nullable String message, + @JsonProperty("detail") @Nullable String detail, + @JsonProperty("ref") @Nullable String ref) { super(Utils.valueOrElse(message, "API error occurred")); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(error, "error"); - Utils.checkNotNull(typeName, "typeName"); - Utils.checkNotNull(message, "message"); - Utils.checkNotNull(detail, "detail"); - Utils.checkNotNull(ref, "ref"); this.statusCode = statusCode; this.error = error; this.typeName = typeName; @@ -89,40 +84,36 @@ public PaymentRequiredResponse( } public PaymentRequiredResponse() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * HTTP status code */ - @JsonIgnore public Optional statusCode() { - return statusCode; + return Optional.ofNullable(this.statusCode); } /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - @JsonIgnore public Optional error() { - return error; + return Optional.ofNullable(this.error); } /** * The type of error returned */ - @JsonIgnore public Optional typeName() { - return typeName; + return Optional.ofNullable(this.typeName); } /** * A human-readable message providing more details about the error. */ - @JsonIgnore public Optional message() { - return message; + return Optional.ofNullable(this.message); } @JsonIgnore @@ -134,17 +125,15 @@ public String getMessage() { /** * Contains parameter or domain specific information related to the error and why it occurred. */ - @JsonIgnore public Optional detail() { - return detail; + return Optional.ofNullable(this.detail); } /** * Link to documentation of error type */ - @JsonIgnore public Optional ref() { - return ref; + return Optional.ofNullable(this.ref); } public static Builder builder() { @@ -155,117 +144,57 @@ public static Builder builder() { /** * HTTP status code */ - public PaymentRequiredResponse withStatusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - - /** - * HTTP status code - */ - public PaymentRequiredResponse withStatusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public PaymentRequiredResponse withStatusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public PaymentRequiredResponse withError(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public PaymentRequiredResponse withError(Optional error) { - Utils.checkNotNull(error, "error"); + public PaymentRequiredResponse withError(@Nullable String error) { this.error = error; return this; } - /** - * The type of error returned - */ - public PaymentRequiredResponse withTypeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - /** * The type of error returned */ - public PaymentRequiredResponse withTypeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public PaymentRequiredResponse withTypeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** - * A human-readable message providing more details about the error. - */ - public PaymentRequiredResponse withMessage(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - /** * A human-readable message providing more details about the error. */ - public PaymentRequiredResponse withMessage(Optional message) { - Utils.checkNotNull(message, "message"); + public PaymentRequiredResponse withMessage(@Nullable String message) { this.message = message; return this; } - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public PaymentRequiredResponse withDetail(String detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public PaymentRequiredResponse withDetail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public PaymentRequiredResponse withDetail(@Nullable String detail) { this.detail = detail; return this; } - /** - * Link to documentation of error type - */ - public PaymentRequiredResponse withRef(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public PaymentRequiredResponse withRef(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public PaymentRequiredResponse withRef(@Nullable String ref) { this.ref = ref; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -305,138 +234,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional statusCode = Optional.empty(); + private Double statusCode; - private Optional error = Optional.empty(); + private String error; - private Optional typeName = Optional.empty(); + private String typeName; - private Optional message = Optional.empty(); + private String message; - private Optional detail = Optional.empty(); + private String detail; - private Optional ref = Optional.empty(); + private String ref; private Builder() { // force use of static builder() method } - /** * HTTP status code */ - public Builder statusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - /** - * HTTP status code - */ - public Builder statusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public Builder statusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public Builder error(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public Builder error(Optional error) { - Utils.checkNotNull(error, "error"); + public Builder error(@Nullable String error) { this.error = error; return this; } - /** * The type of error returned */ - public Builder typeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - - /** - * The type of error returned - */ - public Builder typeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public Builder typeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** * A human-readable message providing more details about the error. */ - public Builder message(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - - /** - * A human-readable message providing more details about the error. - */ - public Builder message(Optional message) { - Utils.checkNotNull(message, "message"); + public Builder message(@Nullable String message) { this.message = message; return this; } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public Builder detail(String detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public Builder detail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public Builder detail(@Nullable String detail) { this.detail = detail; return this; } - - /** - * Link to documentation of error type - */ - public Builder ref(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public Builder ref(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public Builder ref(@Nullable String ref) { this.ref = ref; return this; } public PaymentRequiredResponse build() { - return new PaymentRequiredResponse( statusCode, error, typeName, message, detail, ref); diff --git a/src/main/java/com/apideck/unify/models/errors/UnauthorizedResponse.java b/src/main/java/com/apideck/unify/models/errors/UnauthorizedResponse.java index b869364f..a138f6c0 100644 --- a/src/main/java/com/apideck/unify/models/errors/UnauthorizedResponse.java +++ b/src/main/java/com/apideck/unify/models/errors/UnauthorizedResponse.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.RuntimeException; @@ -28,58 +29,52 @@ public class UnauthorizedResponse extends RuntimeException { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status_code") - private Optional statusCode; + private Double statusCode; /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("error") - private Optional error; + private String error; /** * The type of error returned */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type_name") - private Optional typeName; + private String typeName; /** * A human-readable message providing more details about the error. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") - private Optional message; + private String message; /** * Contains parameter or domain specific information related to the error and why it occurred. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("detail") - private Optional detail; + private UnauthorizedResponseDetail detail; /** * Link to documentation of error type */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("ref") - private Optional ref; + private String ref; @JsonCreator public UnauthorizedResponse( - @JsonProperty("status_code") Optional statusCode, - @JsonProperty("error") Optional error, - @JsonProperty("type_name") Optional typeName, - @JsonProperty("message") Optional message, - @JsonProperty("detail") Optional detail, - @JsonProperty("ref") Optional ref) { + @JsonProperty("status_code") @Nullable Double statusCode, + @JsonProperty("error") @Nullable String error, + @JsonProperty("type_name") @Nullable String typeName, + @JsonProperty("message") @Nullable String message, + @JsonProperty("detail") @Nullable UnauthorizedResponseDetail detail, + @JsonProperty("ref") @Nullable String ref) { super(Utils.valueOrElse(message, "API error occurred")); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(error, "error"); - Utils.checkNotNull(typeName, "typeName"); - Utils.checkNotNull(message, "message"); - Utils.checkNotNull(detail, "detail"); - Utils.checkNotNull(ref, "ref"); this.statusCode = statusCode; this.error = error; this.typeName = typeName; @@ -89,40 +84,36 @@ public UnauthorizedResponse( } public UnauthorizedResponse() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * HTTP status code */ - @JsonIgnore public Optional statusCode() { - return statusCode; + return Optional.ofNullable(this.statusCode); } /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - @JsonIgnore public Optional error() { - return error; + return Optional.ofNullable(this.error); } /** * The type of error returned */ - @JsonIgnore public Optional typeName() { - return typeName; + return Optional.ofNullable(this.typeName); } /** * A human-readable message providing more details about the error. */ - @JsonIgnore public Optional message() { - return message; + return Optional.ofNullable(this.message); } @JsonIgnore @@ -134,18 +125,15 @@ public String getMessage() { /** * Contains parameter or domain specific information related to the error and why it occurred. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional detail() { - return (Optional) detail; + return Optional.ofNullable(this.detail); } /** * Link to documentation of error type */ - @JsonIgnore public Optional ref() { - return ref; + return Optional.ofNullable(this.ref); } public static Builder builder() { @@ -156,117 +144,57 @@ public static Builder builder() { /** * HTTP status code */ - public UnauthorizedResponse withStatusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - - /** - * HTTP status code - */ - public UnauthorizedResponse withStatusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public UnauthorizedResponse withStatusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public UnauthorizedResponse withError(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public UnauthorizedResponse withError(Optional error) { - Utils.checkNotNull(error, "error"); + public UnauthorizedResponse withError(@Nullable String error) { this.error = error; return this; } - /** - * The type of error returned - */ - public UnauthorizedResponse withTypeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - /** * The type of error returned */ - public UnauthorizedResponse withTypeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public UnauthorizedResponse withTypeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** - * A human-readable message providing more details about the error. - */ - public UnauthorizedResponse withMessage(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - /** * A human-readable message providing more details about the error. */ - public UnauthorizedResponse withMessage(Optional message) { - Utils.checkNotNull(message, "message"); + public UnauthorizedResponse withMessage(@Nullable String message) { this.message = message; return this; } - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public UnauthorizedResponse withDetail(UnauthorizedResponseDetail detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public UnauthorizedResponse withDetail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public UnauthorizedResponse withDetail(@Nullable UnauthorizedResponseDetail detail) { this.detail = detail; return this; } - /** - * Link to documentation of error type - */ - public UnauthorizedResponse withRef(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public UnauthorizedResponse withRef(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public UnauthorizedResponse withRef(@Nullable String ref) { this.ref = ref; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -306,138 +234,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional statusCode = Optional.empty(); + private Double statusCode; - private Optional error = Optional.empty(); + private String error; - private Optional typeName = Optional.empty(); + private String typeName; - private Optional message = Optional.empty(); + private String message; - private Optional detail = Optional.empty(); + private UnauthorizedResponseDetail detail; - private Optional ref = Optional.empty(); + private String ref; private Builder() { // force use of static builder() method } - /** * HTTP status code */ - public Builder statusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - /** - * HTTP status code - */ - public Builder statusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public Builder statusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public Builder error(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public Builder error(Optional error) { - Utils.checkNotNull(error, "error"); + public Builder error(@Nullable String error) { this.error = error; return this; } - /** * The type of error returned */ - public Builder typeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - - /** - * The type of error returned - */ - public Builder typeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public Builder typeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** * A human-readable message providing more details about the error. */ - public Builder message(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - - /** - * A human-readable message providing more details about the error. - */ - public Builder message(Optional message) { - Utils.checkNotNull(message, "message"); + public Builder message(@Nullable String message) { this.message = message; return this; } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public Builder detail(UnauthorizedResponseDetail detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public Builder detail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public Builder detail(@Nullable UnauthorizedResponseDetail detail) { this.detail = detail; return this; } - - /** - * Link to documentation of error type - */ - public Builder ref(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public Builder ref(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public Builder ref(@Nullable String ref) { this.ref = ref; return this; } public UnauthorizedResponse build() { - return new UnauthorizedResponse( statusCode, error, typeName, message, detail, ref); diff --git a/src/main/java/com/apideck/unify/models/errors/UnprocessableResponse.java b/src/main/java/com/apideck/unify/models/errors/UnprocessableResponse.java index 0cc9083b..1b5ef4b4 100644 --- a/src/main/java/com/apideck/unify/models/errors/UnprocessableResponse.java +++ b/src/main/java/com/apideck/unify/models/errors/UnprocessableResponse.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; +import jakarta.annotation.Nullable; import java.lang.Double; import java.lang.Override; import java.lang.RuntimeException; @@ -28,58 +29,52 @@ public class UnprocessableResponse extends RuntimeException { */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("status_code") - private Optional statusCode; + private Double statusCode; /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("error") - private Optional error; + private String error; /** * The type of error returned */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("type_name") - private Optional typeName; + private String typeName; /** * A human-readable message providing more details about the error. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("message") - private Optional message; + private String message; /** * Contains parameter or domain specific information related to the error and why it occurred. */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("detail") - private Optional detail; + private UnprocessableResponseDetail detail; /** * Link to documentation of error type */ @JsonInclude(Include.NON_ABSENT) @JsonProperty("ref") - private Optional ref; + private String ref; @JsonCreator public UnprocessableResponse( - @JsonProperty("status_code") Optional statusCode, - @JsonProperty("error") Optional error, - @JsonProperty("type_name") Optional typeName, - @JsonProperty("message") Optional message, - @JsonProperty("detail") Optional detail, - @JsonProperty("ref") Optional ref) { + @JsonProperty("status_code") @Nullable Double statusCode, + @JsonProperty("error") @Nullable String error, + @JsonProperty("type_name") @Nullable String typeName, + @JsonProperty("message") @Nullable String message, + @JsonProperty("detail") @Nullable UnprocessableResponseDetail detail, + @JsonProperty("ref") @Nullable String ref) { super(Utils.valueOrElse(message, "API error occurred")); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(error, "error"); - Utils.checkNotNull(typeName, "typeName"); - Utils.checkNotNull(message, "message"); - Utils.checkNotNull(detail, "detail"); - Utils.checkNotNull(ref, "ref"); this.statusCode = statusCode; this.error = error; this.typeName = typeName; @@ -89,40 +84,36 @@ public UnprocessableResponse( } public UnprocessableResponse() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * HTTP status code */ - @JsonIgnore public Optional statusCode() { - return statusCode; + return Optional.ofNullable(this.statusCode); } /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - @JsonIgnore public Optional error() { - return error; + return Optional.ofNullable(this.error); } /** * The type of error returned */ - @JsonIgnore public Optional typeName() { - return typeName; + return Optional.ofNullable(this.typeName); } /** * A human-readable message providing more details about the error. */ - @JsonIgnore public Optional message() { - return message; + return Optional.ofNullable(this.message); } @JsonIgnore @@ -134,18 +125,15 @@ public String getMessage() { /** * Contains parameter or domain specific information related to the error and why it occurred. */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional detail() { - return (Optional) detail; + return Optional.ofNullable(this.detail); } /** * Link to documentation of error type */ - @JsonIgnore public Optional ref() { - return ref; + return Optional.ofNullable(this.ref); } public static Builder builder() { @@ -156,117 +144,57 @@ public static Builder builder() { /** * HTTP status code */ - public UnprocessableResponse withStatusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - - /** - * HTTP status code - */ - public UnprocessableResponse withStatusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public UnprocessableResponse withStatusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public UnprocessableResponse withError(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public UnprocessableResponse withError(Optional error) { - Utils.checkNotNull(error, "error"); + public UnprocessableResponse withError(@Nullable String error) { this.error = error; return this; } - /** - * The type of error returned - */ - public UnprocessableResponse withTypeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - /** * The type of error returned */ - public UnprocessableResponse withTypeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public UnprocessableResponse withTypeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** - * A human-readable message providing more details about the error. - */ - public UnprocessableResponse withMessage(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - /** * A human-readable message providing more details about the error. */ - public UnprocessableResponse withMessage(Optional message) { - Utils.checkNotNull(message, "message"); + public UnprocessableResponse withMessage(@Nullable String message) { this.message = message; return this; } - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public UnprocessableResponse withDetail(UnprocessableResponseDetail detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public UnprocessableResponse withDetail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public UnprocessableResponse withDetail(@Nullable UnprocessableResponseDetail detail) { this.detail = detail; return this; } - /** - * Link to documentation of error type - */ - public UnprocessableResponse withRef(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public UnprocessableResponse withRef(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public UnprocessableResponse withRef(@Nullable String ref) { this.ref = ref; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -306,138 +234,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional statusCode = Optional.empty(); + private Double statusCode; - private Optional error = Optional.empty(); + private String error; - private Optional typeName = Optional.empty(); + private String typeName; - private Optional message = Optional.empty(); + private String message; - private Optional detail = Optional.empty(); + private UnprocessableResponseDetail detail; - private Optional ref = Optional.empty(); + private String ref; private Builder() { // force use of static builder() method } - /** * HTTP status code */ - public Builder statusCode(double statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); - this.statusCode = Optional.ofNullable(statusCode); - return this; - } - - /** - * HTTP status code - */ - public Builder statusCode(Optional statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); + public Builder statusCode(@Nullable Double statusCode) { this.statusCode = statusCode; return this; } - - /** - * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) - */ - public Builder error(String error) { - Utils.checkNotNull(error, "error"); - this.error = Optional.ofNullable(error); - return this; - } - /** * Contains an explanation of the status_code as defined in HTTP/1.1 standard (RFC 7231) */ - public Builder error(Optional error) { - Utils.checkNotNull(error, "error"); + public Builder error(@Nullable String error) { this.error = error; return this; } - /** * The type of error returned */ - public Builder typeName(String typeName) { - Utils.checkNotNull(typeName, "typeName"); - this.typeName = Optional.ofNullable(typeName); - return this; - } - - /** - * The type of error returned - */ - public Builder typeName(Optional typeName) { - Utils.checkNotNull(typeName, "typeName"); + public Builder typeName(@Nullable String typeName) { this.typeName = typeName; return this; } - /** * A human-readable message providing more details about the error. */ - public Builder message(String message) { - Utils.checkNotNull(message, "message"); - this.message = Optional.ofNullable(message); - return this; - } - - /** - * A human-readable message providing more details about the error. - */ - public Builder message(Optional message) { - Utils.checkNotNull(message, "message"); + public Builder message(@Nullable String message) { this.message = message; return this; } - /** * Contains parameter or domain specific information related to the error and why it occurred. */ - public Builder detail(UnprocessableResponseDetail detail) { - Utils.checkNotNull(detail, "detail"); - this.detail = Optional.ofNullable(detail); - return this; - } - - /** - * Contains parameter or domain specific information related to the error and why it occurred. - */ - public Builder detail(Optional detail) { - Utils.checkNotNull(detail, "detail"); + public Builder detail(@Nullable UnprocessableResponseDetail detail) { this.detail = detail; return this; } - - /** - * Link to documentation of error type - */ - public Builder ref(String ref) { - Utils.checkNotNull(ref, "ref"); - this.ref = Optional.ofNullable(ref); - return this; - } - /** * Link to documentation of error type */ - public Builder ref(Optional ref) { - Utils.checkNotNull(ref, "ref"); + public Builder ref(@Nullable String ref) { this.ref = ref; return this; } public UnprocessableResponse build() { - return new UnprocessableResponse( statusCode, error, typeName, message, detail, ref); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneRequest.java index a0a5a836..53f5d53f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneRequest.java @@ -8,13 +8,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,37 +24,37 @@ public class AccountingAgedCreditorsOneRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private AgedReportFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -65,91 +64,77 @@ public class AccountingAgedCreditorsOneRequest { @JsonCreator public AccountingAgedCreditorsOneRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable AgedReportFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingAgedCreditorsOneRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -160,134 +145,65 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingAgedCreditorsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingAgedCreditorsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingAgedCreditorsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingAgedCreditorsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingAgedCreditorsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingAgedCreditorsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingAgedCreditorsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingAgedCreditorsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingAgedCreditorsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingAgedCreditorsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingAgedCreditorsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingAgedCreditorsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Apply filters - */ - public AccountingAgedCreditorsOneRequest withFilter(AgedReportFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingAgedCreditorsOneRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingAgedCreditorsOneRequest withFilter(@Nullable AgedReportFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingAgedCreditorsOneRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingAgedCreditorsOneRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingAgedCreditorsOneRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingAgedCreditorsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingAgedCreditorsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingAgedCreditorsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -331,162 +247,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional filter = Optional.empty(); + private AgedReportFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Apply filters - */ - public Builder filter(AgedReportFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable AgedReportFilter filter) { this.filter = filter; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingAgedCreditorsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingAgedCreditorsOneRequest( raw, consumerId, appId, serviceId, filter, passThrough, @@ -494,10 +329,10 @@ public AccountingAgedCreditorsOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneRequestBuilder.java index e367775d..ee83f7bf 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingAgedCreditorsOneRequestBuilder { - - private AccountingAgedCreditorsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingAgedCreditorsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingAgedCreditorsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingAgedCreditorsOneRequestBuilder request(AccountingAgedCreditorsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingAgedCreditorsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingAgedCreditorsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingAgedCreditorsOneRequestBuilder request(@Nonnull AccountingAgedCreditorsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingAgedCreditorsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingAgedCreditorsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingAgedCreditorsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneResponse.java index e4d1e2de..70e47b88 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAgedCreditorsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingAgedCreditorsOneResponse implements Response { /** * Aged Creditors */ - private Optional getAgedCreditorsResponse; + private GetAgedCreditorsResponse getAgedCreditorsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingAgedCreditorsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getAgedCreditorsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getAgedCreditorsResponse, "getAgedCreditorsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetAgedCreditorsResponse getAgedCreditorsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getAgedCreditorsResponse = getAgedCreditorsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingAgedCreditorsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Aged Creditors */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getAgedCreditorsResponse() { - return (Optional) getAgedCreditorsResponse; + return Optional.ofNullable(this.getAgedCreditorsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingAgedCreditorsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingAgedCreditorsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingAgedCreditorsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingAgedCreditorsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Aged Creditors + * Raw HTTP response; suitable for custom response parsing */ - public AccountingAgedCreditorsOneResponse withGetAgedCreditorsResponse(GetAgedCreditorsResponse getAgedCreditorsResponse) { - Utils.checkNotNull(getAgedCreditorsResponse, "getAgedCreditorsResponse"); - this.getAgedCreditorsResponse = Optional.ofNullable(getAgedCreditorsResponse); + public AccountingAgedCreditorsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingAgedCreditorsOneResponse withGetAgedCreditorsResponse(GetAgedCr /** * Aged Creditors */ - public AccountingAgedCreditorsOneResponse withGetAgedCreditorsResponse(Optional getAgedCreditorsResponse) { - Utils.checkNotNull(getAgedCreditorsResponse, "getAgedCreditorsResponse"); + public AccountingAgedCreditorsOneResponse withGetAgedCreditorsResponse(@Nullable GetAgedCreditorsResponse getAgedCreditorsResponse) { this.getAgedCreditorsResponse = getAgedCreditorsResponse; return this; } - /** - * Unexpected error - */ - public AccountingAgedCreditorsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingAgedCreditorsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingAgedCreditorsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getAgedCreditorsResponse = Optional.empty(); + private GetAgedCreditorsResponse getAgedCreditorsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Aged Creditors - */ - public Builder getAgedCreditorsResponse(GetAgedCreditorsResponse getAgedCreditorsResponse) { - Utils.checkNotNull(getAgedCreditorsResponse, "getAgedCreditorsResponse"); - this.getAgedCreditorsResponse = Optional.ofNullable(getAgedCreditorsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Aged Creditors */ - public Builder getAgedCreditorsResponse(Optional getAgedCreditorsResponse) { - Utils.checkNotNull(getAgedCreditorsResponse, "getAgedCreditorsResponse"); + public Builder getAgedCreditorsResponse(@Nullable GetAgedCreditorsResponse getAgedCreditorsResponse) { this.getAgedCreditorsResponse = getAgedCreditorsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingAgedCreditorsOneResponse build() { - return new AccountingAgedCreditorsOneResponse( contentType, statusCode, rawResponse, getAgedCreditorsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneRequest.java index e5eaf5e7..05d6692a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneRequest.java @@ -8,13 +8,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,37 +24,37 @@ public class AccountingAgedDebtorsOneRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private AgedReportFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -65,91 +64,77 @@ public class AccountingAgedDebtorsOneRequest { @JsonCreator public AccountingAgedDebtorsOneRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable AgedReportFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingAgedDebtorsOneRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -160,134 +145,65 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingAgedDebtorsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingAgedDebtorsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingAgedDebtorsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingAgedDebtorsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingAgedDebtorsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingAgedDebtorsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingAgedDebtorsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingAgedDebtorsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingAgedDebtorsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingAgedDebtorsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingAgedDebtorsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingAgedDebtorsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Apply filters - */ - public AccountingAgedDebtorsOneRequest withFilter(AgedReportFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingAgedDebtorsOneRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingAgedDebtorsOneRequest withFilter(@Nullable AgedReportFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingAgedDebtorsOneRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingAgedDebtorsOneRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingAgedDebtorsOneRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingAgedDebtorsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingAgedDebtorsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingAgedDebtorsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -331,162 +247,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional filter = Optional.empty(); + private AgedReportFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Apply filters - */ - public Builder filter(AgedReportFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable AgedReportFilter filter) { this.filter = filter; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingAgedDebtorsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingAgedDebtorsOneRequest( raw, consumerId, appId, serviceId, filter, passThrough, @@ -494,10 +329,10 @@ public AccountingAgedDebtorsOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneRequestBuilder.java index d75aa42d..cb07b980 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingAgedDebtorsOneRequestBuilder { - - private AccountingAgedDebtorsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingAgedDebtorsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingAgedDebtorsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingAgedDebtorsOneRequestBuilder request(AccountingAgedDebtorsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingAgedDebtorsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingAgedDebtorsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingAgedDebtorsOneRequestBuilder request(@Nonnull AccountingAgedDebtorsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingAgedDebtorsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingAgedDebtorsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingAgedDebtorsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneResponse.java index bbe16d48..61fff12e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAgedDebtorsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingAgedDebtorsOneResponse implements Response { /** * Aged Debtors */ - private Optional getAgedDebtorsResponse; + private GetAgedDebtorsResponse getAgedDebtorsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingAgedDebtorsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getAgedDebtorsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getAgedDebtorsResponse, "getAgedDebtorsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetAgedDebtorsResponse getAgedDebtorsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getAgedDebtorsResponse = getAgedDebtorsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingAgedDebtorsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Aged Debtors */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getAgedDebtorsResponse() { - return (Optional) getAgedDebtorsResponse; + return Optional.ofNullable(this.getAgedDebtorsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingAgedDebtorsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingAgedDebtorsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingAgedDebtorsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingAgedDebtorsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Aged Debtors + * Raw HTTP response; suitable for custom response parsing */ - public AccountingAgedDebtorsOneResponse withGetAgedDebtorsResponse(GetAgedDebtorsResponse getAgedDebtorsResponse) { - Utils.checkNotNull(getAgedDebtorsResponse, "getAgedDebtorsResponse"); - this.getAgedDebtorsResponse = Optional.ofNullable(getAgedDebtorsResponse); + public AccountingAgedDebtorsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingAgedDebtorsOneResponse withGetAgedDebtorsResponse(GetAgedDebtor /** * Aged Debtors */ - public AccountingAgedDebtorsOneResponse withGetAgedDebtorsResponse(Optional getAgedDebtorsResponse) { - Utils.checkNotNull(getAgedDebtorsResponse, "getAgedDebtorsResponse"); + public AccountingAgedDebtorsOneResponse withGetAgedDebtorsResponse(@Nullable GetAgedDebtorsResponse getAgedDebtorsResponse) { this.getAgedDebtorsResponse = getAgedDebtorsResponse; return this; } - /** - * Unexpected error - */ - public AccountingAgedDebtorsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingAgedDebtorsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingAgedDebtorsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getAgedDebtorsResponse = Optional.empty(); + private GetAgedDebtorsResponse getAgedDebtorsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Aged Debtors - */ - public Builder getAgedDebtorsResponse(GetAgedDebtorsResponse getAgedDebtorsResponse) { - Utils.checkNotNull(getAgedDebtorsResponse, "getAgedDebtorsResponse"); - this.getAgedDebtorsResponse = Optional.ofNullable(getAgedDebtorsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Aged Debtors */ - public Builder getAgedDebtorsResponse(Optional getAgedDebtorsResponse) { - Utils.checkNotNull(getAgedDebtorsResponse, "getAgedDebtorsResponse"); + public Builder getAgedDebtorsResponse(@Nullable GetAgedDebtorsResponse getAgedDebtorsResponse) { this.getAgedDebtorsResponse = getAgedDebtorsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingAgedDebtorsOneResponse build() { - return new AccountingAgedDebtorsOneResponse( contentType, statusCode, rawResponse, getAgedDebtorsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllRequest.java index 35a09ac1..619144c1 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; @@ -35,25 +36,25 @@ public class AccountingAttachmentsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -65,7 +66,7 @@ public class AccountingAttachmentsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -75,113 +76,101 @@ public class AccountingAttachmentsAllRequest { @JsonCreator public AccountingAttachmentsAllRequest( - AttachmentReferenceType referenceType, - String referenceId, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - JsonNullable fields) { - Utils.checkNotNull(referenceType, "referenceType"); - Utils.checkNotNull(referenceId, "referenceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(fields, "fields"); - this.referenceType = referenceType; - this.referenceId = referenceId; - this.raw = raw; + @Nonnull AttachmentReferenceType referenceType, + @Nonnull String referenceId, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable JsonNullable fields) { + this.referenceType = Optional.ofNullable(referenceType) + .orElseThrow(() -> new IllegalArgumentException("referenceType cannot be null")); + this.referenceId = Optional.ofNullable(referenceId) + .orElseThrow(() -> new IllegalArgumentException("referenceId cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; - this.fields = fields; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingAttachmentsAllRequest( - AttachmentReferenceType referenceType, - String referenceId) { - this(referenceType, referenceId, Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined()); + @Nonnull AttachmentReferenceType referenceType, + @Nonnull String referenceId) { + this(referenceType, referenceId, null, + null, null, null, + null, null, null); } /** * The reference type of the document. */ - @JsonIgnore public AttachmentReferenceType referenceType() { - return referenceType; + return this.referenceType; } /** * The reference id of the object to retrieve. */ - @JsonIgnore public String referenceId() { - return referenceId; + return this.referenceId; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -192,27 +181,17 @@ public static Builder builder() { /** * The reference type of the document. */ - public AccountingAttachmentsAllRequest withReferenceType(AttachmentReferenceType referenceType) { - Utils.checkNotNull(referenceType, "referenceType"); - this.referenceType = referenceType; + public AccountingAttachmentsAllRequest withReferenceType(@Nonnull AttachmentReferenceType referenceType) { + this.referenceType = Utils.checkNotNull(referenceType, "referenceType"); return this; } - /** - * The reference id of the object to retrieve. - */ - public AccountingAttachmentsAllRequest withReferenceId(String referenceId) { - Utils.checkNotNull(referenceId, "referenceId"); - this.referenceId = referenceId; - return this; - } /** - * Include raw response. Mostly used for debugging purposes + * The reference id of the object to retrieve. */ - public AccountingAttachmentsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public AccountingAttachmentsAllRequest withReferenceId(@Nonnull String referenceId) { + this.referenceId = Utils.checkNotNull(referenceId, "referenceId"); return this; } @@ -220,93 +199,44 @@ public AccountingAttachmentsAllRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingAttachmentsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingAttachmentsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingAttachmentsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingAttachmentsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingAttachmentsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingAttachmentsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingAttachmentsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingAttachmentsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingAttachmentsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingAttachmentsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingAttachmentsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingAttachmentsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingAttachmentsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingAttachmentsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingAttachmentsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -314,29 +244,20 @@ public AccountingAttachmentsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingAttachmentsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingAttachmentsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingAttachmentsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingAttachmentsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingAttachmentsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -388,185 +309,97 @@ public final static class Builder { private String referenceId; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * The reference type of the document. */ - public Builder referenceType(AttachmentReferenceType referenceType) { - Utils.checkNotNull(referenceType, "referenceType"); - this.referenceType = referenceType; + public Builder referenceType(@Nonnull AttachmentReferenceType referenceType) { + this.referenceType = Utils.checkNotNull(referenceType, "referenceType"); return this; } - /** * The reference id of the object to retrieve. */ - public Builder referenceId(String referenceId) { - Utils.checkNotNull(referenceId, "referenceId"); - this.referenceId = referenceId; - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public Builder referenceId(@Nonnull String referenceId) { + this.referenceId = Utils.checkNotNull(referenceId, "referenceId"); return this; } /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingAttachmentsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingAttachmentsAllRequest( referenceType, referenceId, raw, consumerId, appId, serviceId, @@ -574,16 +407,16 @@ public AccountingAttachmentsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllRequestBuilder.java index e926d4d1..446cdcac 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingAttachmentsAllRequestBuilder { - - private AccountingAttachmentsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingAttachmentsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingAttachmentsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingAttachmentsAllRequestBuilder request(AccountingAttachmentsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingAttachmentsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingAttachmentsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingAttachmentsAllRequestBuilder request(@Nonnull AccountingAttachmentsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingAttachmentsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingAttachmentsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingAttachmentsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingAttachmentsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingAttachmentsAllOperation( - sdkConfiguration, - options); + AccountingAttachmentsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingAttachmentsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingAttachmentsAllRequest::withCursor, + AccountingAttachmentsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllResponse.java index 24597f76..8e139907 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingAttachmentsAllResponse implements Response { /** * Attachments */ - private Optional getAttachmentsResponse; + private GetAttachmentsResponse getAttachmentsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingAttachmentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getAttachmentsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getAttachmentsResponse, "getAttachmentsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetAttachmentsResponse getAttachmentsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getAttachmentsResponse = getAttachmentsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingAttachmentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Attachments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getAttachmentsResponse() { - return (Optional) getAttachmentsResponse; + return Optional.ofNullable(this.getAttachmentsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingAttachmentsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingAttachmentsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingAttachmentsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingAttachmentsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Attachments + * Raw HTTP response; suitable for custom response parsing */ - public AccountingAttachmentsAllResponse withGetAttachmentsResponse(GetAttachmentsResponse getAttachmentsResponse) { - Utils.checkNotNull(getAttachmentsResponse, "getAttachmentsResponse"); - this.getAttachmentsResponse = Optional.ofNullable(getAttachmentsResponse); + public AccountingAttachmentsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingAttachmentsAllResponse withGetAttachmentsResponse(GetAttachment /** * Attachments */ - public AccountingAttachmentsAllResponse withGetAttachmentsResponse(Optional getAttachmentsResponse) { - Utils.checkNotNull(getAttachmentsResponse, "getAttachmentsResponse"); + public AccountingAttachmentsAllResponse withGetAttachmentsResponse(@Nullable GetAttachmentsResponse getAttachmentsResponse) { this.getAttachmentsResponse = getAttachmentsResponse; return this; } - /** - * Unexpected error - */ - public AccountingAttachmentsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingAttachmentsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingAttachmentsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getAttachmentsResponse = Optional.empty(); + private GetAttachmentsResponse getAttachmentsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Attachments - */ - public Builder getAttachmentsResponse(GetAttachmentsResponse getAttachmentsResponse) { - Utils.checkNotNull(getAttachmentsResponse, "getAttachmentsResponse"); - this.getAttachmentsResponse = Optional.ofNullable(getAttachmentsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Attachments */ - public Builder getAttachmentsResponse(Optional getAttachmentsResponse) { - Utils.checkNotNull(getAttachmentsResponse, "getAttachmentsResponse"); + public Builder getAttachmentsResponse(@Nullable GetAttachmentsResponse getAttachmentsResponse) { this.getAttachmentsResponse = getAttachmentsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingAttachmentsAllResponse build() { - return new AccountingAttachmentsAllResponse( contentType, statusCode, rawResponse, getAttachmentsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteRequest.java index ce65a9d0..2530bfae 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -39,114 +40,104 @@ public class AccountingAttachmentsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingAttachmentsDeleteRequest( - AttachmentReferenceType referenceType, - String referenceId, - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(referenceType, "referenceType"); - Utils.checkNotNull(referenceId, "referenceId"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.referenceType = referenceType; - this.referenceId = referenceId; - this.id = id; + @Nonnull AttachmentReferenceType referenceType, + @Nonnull String referenceId, + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.referenceType = Optional.ofNullable(referenceType) + .orElseThrow(() -> new IllegalArgumentException("referenceType cannot be null")); + this.referenceId = Optional.ofNullable(referenceId) + .orElseThrow(() -> new IllegalArgumentException("referenceId cannot be null")); + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingAttachmentsDeleteRequest( - AttachmentReferenceType referenceType, - String referenceId, - String id) { + @Nonnull AttachmentReferenceType referenceType, + @Nonnull String referenceId, + @Nonnull String id) { this(referenceType, referenceId, id, - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + null, null, null, + null); } /** * The reference type of the document. */ - @JsonIgnore public AttachmentReferenceType referenceType() { - return referenceType; + return this.referenceType; } /** * The reference id of the object to retrieve. */ - @JsonIgnore public String referenceId() { - return referenceId; + return this.referenceId; } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -157,36 +148,26 @@ public static Builder builder() { /** * The reference type of the document. */ - public AccountingAttachmentsDeleteRequest withReferenceType(AttachmentReferenceType referenceType) { - Utils.checkNotNull(referenceType, "referenceType"); - this.referenceType = referenceType; + public AccountingAttachmentsDeleteRequest withReferenceType(@Nonnull AttachmentReferenceType referenceType) { + this.referenceType = Utils.checkNotNull(referenceType, "referenceType"); return this; } + /** * The reference id of the object to retrieve. */ - public AccountingAttachmentsDeleteRequest withReferenceId(String referenceId) { - Utils.checkNotNull(referenceId, "referenceId"); - this.referenceId = referenceId; + public AccountingAttachmentsDeleteRequest withReferenceId(@Nonnull String referenceId) { + this.referenceId = Utils.checkNotNull(referenceId, "referenceId"); return this; } - /** - * ID of the record you are acting upon. - */ - public AccountingAttachmentsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** - * ID of the consumer which you want to get or push data from + * ID of the record you are acting upon. */ - public AccountingAttachmentsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingAttachmentsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -194,69 +175,39 @@ public AccountingAttachmentsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingAttachmentsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingAttachmentsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingAttachmentsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingAttachmentsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingAttachmentsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingAttachmentsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingAttachmentsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingAttachmentsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingAttachmentsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingAttachmentsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingAttachmentsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -305,129 +256,75 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * The reference type of the document. */ - public Builder referenceType(AttachmentReferenceType referenceType) { - Utils.checkNotNull(referenceType, "referenceType"); - this.referenceType = referenceType; + public Builder referenceType(@Nonnull AttachmentReferenceType referenceType) { + this.referenceType = Utils.checkNotNull(referenceType, "referenceType"); return this; } - /** * The reference id of the object to retrieve. */ - public Builder referenceId(String referenceId) { - Utils.checkNotNull(referenceId, "referenceId"); - this.referenceId = referenceId; + public Builder referenceId(@Nonnull String referenceId) { + this.referenceId = Utils.checkNotNull(referenceId, "referenceId"); return this; } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingAttachmentsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingAttachmentsDeleteRequest( referenceType, referenceId, id, consumerId, appId, serviceId, @@ -435,10 +332,10 @@ public AccountingAttachmentsDeleteRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteRequestBuilder.java index 055b7be1..7760f961 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingAttachmentsDeleteRequestBuilder { - - private AccountingAttachmentsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingAttachmentsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingAttachmentsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingAttachmentsDeleteRequestBuilder request(AccountingAttachmentsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingAttachmentsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingAttachmentsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingAttachmentsDeleteRequestBuilder request(@Nonnull AccountingAttachmentsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingAttachmentsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingAttachmentsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingAttachmentsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteResponse.java index d8b57c4f..761c71c1 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingAttachmentsDeleteResponse implements Response { /** * Attachments */ - private Optional deleteAttachmentResponse; + private DeleteAttachmentResponse deleteAttachmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingAttachmentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteAttachmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteAttachmentResponse, "deleteAttachmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteAttachmentResponse deleteAttachmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteAttachmentResponse = deleteAttachmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingAttachmentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Attachments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteAttachmentResponse() { - return (Optional) deleteAttachmentResponse; + return Optional.ofNullable(this.deleteAttachmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingAttachmentsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingAttachmentsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingAttachmentsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingAttachmentsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Attachments + * Raw HTTP response; suitable for custom response parsing */ - public AccountingAttachmentsDeleteResponse withDeleteAttachmentResponse(DeleteAttachmentResponse deleteAttachmentResponse) { - Utils.checkNotNull(deleteAttachmentResponse, "deleteAttachmentResponse"); - this.deleteAttachmentResponse = Optional.ofNullable(deleteAttachmentResponse); + public AccountingAttachmentsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingAttachmentsDeleteResponse withDeleteAttachmentResponse(DeleteAt /** * Attachments */ - public AccountingAttachmentsDeleteResponse withDeleteAttachmentResponse(Optional deleteAttachmentResponse) { - Utils.checkNotNull(deleteAttachmentResponse, "deleteAttachmentResponse"); + public AccountingAttachmentsDeleteResponse withDeleteAttachmentResponse(@Nullable DeleteAttachmentResponse deleteAttachmentResponse) { this.deleteAttachmentResponse = deleteAttachmentResponse; return this; } - /** - * Unexpected error - */ - public AccountingAttachmentsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingAttachmentsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingAttachmentsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteAttachmentResponse = Optional.empty(); + private DeleteAttachmentResponse deleteAttachmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Attachments - */ - public Builder deleteAttachmentResponse(DeleteAttachmentResponse deleteAttachmentResponse) { - Utils.checkNotNull(deleteAttachmentResponse, "deleteAttachmentResponse"); - this.deleteAttachmentResponse = Optional.ofNullable(deleteAttachmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Attachments */ - public Builder deleteAttachmentResponse(Optional deleteAttachmentResponse) { - Utils.checkNotNull(deleteAttachmentResponse, "deleteAttachmentResponse"); + public Builder deleteAttachmentResponse(@Nullable DeleteAttachmentResponse deleteAttachmentResponse) { this.deleteAttachmentResponse = deleteAttachmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingAttachmentsDeleteResponse build() { - return new AccountingAttachmentsDeleteResponse( contentType, statusCode, rawResponse, deleteAttachmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadRequest.java index 71d5e621..d1bed254 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadRequest.java @@ -7,7 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -37,19 +38,19 @@ public class AccountingAttachmentsDownloadRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -59,92 +60,82 @@ public class AccountingAttachmentsDownloadRequest { @JsonCreator public AccountingAttachmentsDownloadRequest( - AttachmentReferenceType referenceType, - String referenceId, - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable fields) { - Utils.checkNotNull(referenceType, "referenceType"); - Utils.checkNotNull(referenceId, "referenceId"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(fields, "fields"); - this.referenceType = referenceType; - this.referenceId = referenceId; - this.id = id; + @Nonnull AttachmentReferenceType referenceType, + @Nonnull String referenceId, + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable fields) { + this.referenceType = Optional.ofNullable(referenceType) + .orElseThrow(() -> new IllegalArgumentException("referenceType cannot be null")); + this.referenceId = Optional.ofNullable(referenceId) + .orElseThrow(() -> new IllegalArgumentException("referenceId cannot be null")); + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingAttachmentsDownloadRequest( - AttachmentReferenceType referenceType, - String referenceId, - String id) { + @Nonnull AttachmentReferenceType referenceType, + @Nonnull String referenceId, + @Nonnull String id) { this(referenceType, referenceId, id, - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + null, null, null, + null); } /** * The reference type of the document. */ - @JsonIgnore public AttachmentReferenceType referenceType() { - return referenceType; + return this.referenceType; } /** * The reference id of the object to retrieve. */ - @JsonIgnore public String referenceId() { - return referenceId; + return this.referenceId; } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -155,36 +146,26 @@ public static Builder builder() { /** * The reference type of the document. */ - public AccountingAttachmentsDownloadRequest withReferenceType(AttachmentReferenceType referenceType) { - Utils.checkNotNull(referenceType, "referenceType"); - this.referenceType = referenceType; + public AccountingAttachmentsDownloadRequest withReferenceType(@Nonnull AttachmentReferenceType referenceType) { + this.referenceType = Utils.checkNotNull(referenceType, "referenceType"); return this; } + /** * The reference id of the object to retrieve. */ - public AccountingAttachmentsDownloadRequest withReferenceId(String referenceId) { - Utils.checkNotNull(referenceId, "referenceId"); - this.referenceId = referenceId; + public AccountingAttachmentsDownloadRequest withReferenceId(@Nonnull String referenceId) { + this.referenceId = Utils.checkNotNull(referenceId, "referenceId"); return this; } - /** - * ID of the record you are acting upon. - */ - public AccountingAttachmentsDownloadRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** - * ID of the consumer which you want to get or push data from + * ID of the record you are acting upon. */ - public AccountingAttachmentsDownloadRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingAttachmentsDownloadRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -192,67 +173,38 @@ public AccountingAttachmentsDownloadRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingAttachmentsDownloadRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingAttachmentsDownloadRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingAttachmentsDownloadRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingAttachmentsDownloadRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingAttachmentsDownloadRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingAttachmentsDownloadRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingAttachmentsDownloadRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingAttachmentsDownloadRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingAttachmentsDownloadRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingAttachmentsDownloadRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingAttachmentsDownloadRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -302,126 +254,75 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * The reference type of the document. */ - public Builder referenceType(AttachmentReferenceType referenceType) { - Utils.checkNotNull(referenceType, "referenceType"); - this.referenceType = referenceType; + public Builder referenceType(@Nonnull AttachmentReferenceType referenceType) { + this.referenceType = Utils.checkNotNull(referenceType, "referenceType"); return this; } - /** * The reference id of the object to retrieve. */ - public Builder referenceId(String referenceId) { - Utils.checkNotNull(referenceId, "referenceId"); - this.referenceId = referenceId; + public Builder referenceId(@Nonnull String referenceId) { + this.referenceId = Utils.checkNotNull(referenceId, "referenceId"); return this; } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingAttachmentsDownloadRequest build() { - return new AccountingAttachmentsDownloadRequest( referenceType, referenceId, id, consumerId, appId, serviceId, diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadRequestBuilder.java index 23f38e52..c86395ff 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingAttachmentsDownloadRequestBuilder { - - private AccountingAttachmentsDownloadRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingAttachmentsDownloadRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingAttachmentsDownloadRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingAttachmentsDownloadRequestBuilder request(AccountingAttachmentsDownloadRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingAttachmentsDownloadRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingAttachmentsDownloadRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingAttachmentsDownloadRequestBuilder request(@Nonnull AccountingAttachmentsDownloadRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingAttachmentsDownloadRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingAttachmentsDownloadResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingAttachmentsDownloadOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadResponse.java index fc638b28..8d82b423 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsDownloadResponse.java @@ -7,12 +7,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -36,80 +35,70 @@ public class AccountingAttachmentsDownloadResponse implements Response { /** * Attachment Download */ - private Optional getAttachmentDownloadResponse; + private InputStream getAttachmentDownloadResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingAttachmentsDownloadResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getAttachmentDownloadResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getAttachmentDownloadResponse, "getAttachmentDownloadResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable InputStream getAttachmentDownloadResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getAttachmentDownloadResponse = getAttachmentDownloadResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingAttachmentsDownloadResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Attachment Download */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getAttachmentDownloadResponse() { - return (Optional) getAttachmentDownloadResponse; + return Optional.ofNullable(this.getAttachmentDownloadResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -120,36 +109,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingAttachmentsDownloadResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingAttachmentsDownloadResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingAttachmentsDownloadResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingAttachmentsDownloadResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Attachment Download + * Raw HTTP response; suitable for custom response parsing */ - public AccountingAttachmentsDownloadResponse withGetAttachmentDownloadResponse(InputStream getAttachmentDownloadResponse) { - Utils.checkNotNull(getAttachmentDownloadResponse, "getAttachmentDownloadResponse"); - this.getAttachmentDownloadResponse = Optional.ofNullable(getAttachmentDownloadResponse); + public AccountingAttachmentsDownloadResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -157,31 +136,21 @@ public AccountingAttachmentsDownloadResponse withGetAttachmentDownloadResponse(I /** * Attachment Download */ - public AccountingAttachmentsDownloadResponse withGetAttachmentDownloadResponse(Optional getAttachmentDownloadResponse) { - Utils.checkNotNull(getAttachmentDownloadResponse, "getAttachmentDownloadResponse"); + public AccountingAttachmentsDownloadResponse withGetAttachmentDownloadResponse(@Nullable InputStream getAttachmentDownloadResponse) { this.getAttachmentDownloadResponse = getAttachmentDownloadResponse; return this; } - /** - * Unexpected error - */ - public AccountingAttachmentsDownloadResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingAttachmentsDownloadResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingAttachmentsDownloadResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -221,88 +190,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getAttachmentDownloadResponse = Optional.empty(); + private InputStream getAttachmentDownloadResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Attachment Download - */ - public Builder getAttachmentDownloadResponse(InputStream getAttachmentDownloadResponse) { - Utils.checkNotNull(getAttachmentDownloadResponse, "getAttachmentDownloadResponse"); - this.getAttachmentDownloadResponse = Optional.ofNullable(getAttachmentDownloadResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Attachment Download */ - public Builder getAttachmentDownloadResponse(Optional getAttachmentDownloadResponse) { - Utils.checkNotNull(getAttachmentDownloadResponse, "getAttachmentDownloadResponse"); + public Builder getAttachmentDownloadResponse(@Nullable InputStream getAttachmentDownloadResponse) { this.getAttachmentDownloadResponse = getAttachmentDownloadResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingAttachmentsDownloadResponse build() { - return new AccountingAttachmentsDownloadResponse( contentType, statusCode, rawResponse, getAttachmentDownloadResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneRequest.java index d10a7baf..462f0ee8 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -40,25 +41,25 @@ public class AccountingAttachmentsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -68,103 +69,92 @@ public class AccountingAttachmentsOneRequest { @JsonCreator public AccountingAttachmentsOneRequest( - AttachmentReferenceType referenceType, - String referenceId, - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(referenceType, "referenceType"); - Utils.checkNotNull(referenceId, "referenceId"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.referenceType = referenceType; - this.referenceId = referenceId; - this.id = id; + @Nonnull AttachmentReferenceType referenceType, + @Nonnull String referenceId, + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.referenceType = Optional.ofNullable(referenceType) + .orElseThrow(() -> new IllegalArgumentException("referenceType cannot be null")); + this.referenceId = Optional.ofNullable(referenceId) + .orElseThrow(() -> new IllegalArgumentException("referenceId cannot be null")); + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingAttachmentsOneRequest( - AttachmentReferenceType referenceType, - String referenceId, - String id) { + @Nonnull AttachmentReferenceType referenceType, + @Nonnull String referenceId, + @Nonnull String id) { this(referenceType, referenceId, id, - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + null, null, null, + null, null); } /** * The reference type of the document. */ - @JsonIgnore public AttachmentReferenceType referenceType() { - return referenceType; + return this.referenceType; } /** * The reference id of the object to retrieve. */ - @JsonIgnore public String referenceId() { - return referenceId; + return this.referenceId; } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -175,36 +165,26 @@ public static Builder builder() { /** * The reference type of the document. */ - public AccountingAttachmentsOneRequest withReferenceType(AttachmentReferenceType referenceType) { - Utils.checkNotNull(referenceType, "referenceType"); - this.referenceType = referenceType; + public AccountingAttachmentsOneRequest withReferenceType(@Nonnull AttachmentReferenceType referenceType) { + this.referenceType = Utils.checkNotNull(referenceType, "referenceType"); return this; } + /** * The reference id of the object to retrieve. */ - public AccountingAttachmentsOneRequest withReferenceId(String referenceId) { - Utils.checkNotNull(referenceId, "referenceId"); - this.referenceId = referenceId; + public AccountingAttachmentsOneRequest withReferenceId(@Nonnull String referenceId) { + this.referenceId = Utils.checkNotNull(referenceId, "referenceId"); return this; } - /** - * ID of the record you are acting upon. - */ - public AccountingAttachmentsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** - * ID of the consumer which you want to get or push data from + * ID of the record you are acting upon. */ - public AccountingAttachmentsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingAttachmentsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -212,86 +192,47 @@ public AccountingAttachmentsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingAttachmentsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingAttachmentsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingAttachmentsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingAttachmentsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingAttachmentsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingAttachmentsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingAttachmentsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingAttachmentsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingAttachmentsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingAttachmentsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingAttachmentsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingAttachmentsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingAttachmentsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingAttachmentsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -343,150 +284,85 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * The reference type of the document. */ - public Builder referenceType(AttachmentReferenceType referenceType) { - Utils.checkNotNull(referenceType, "referenceType"); - this.referenceType = referenceType; + public Builder referenceType(@Nonnull AttachmentReferenceType referenceType) { + this.referenceType = Utils.checkNotNull(referenceType, "referenceType"); return this; } - /** * The reference id of the object to retrieve. */ - public Builder referenceId(String referenceId) { - Utils.checkNotNull(referenceId, "referenceId"); - this.referenceId = referenceId; + public Builder referenceId(@Nonnull String referenceId) { + this.referenceId = Utils.checkNotNull(referenceId, "referenceId"); return this; } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingAttachmentsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingAttachmentsOneRequest( referenceType, referenceId, id, consumerId, appId, serviceId, @@ -494,10 +370,10 @@ public AccountingAttachmentsOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneRequestBuilder.java index 1c107c68..54375810 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingAttachmentsOneRequestBuilder { - - private AccountingAttachmentsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingAttachmentsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingAttachmentsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingAttachmentsOneRequestBuilder request(AccountingAttachmentsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingAttachmentsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingAttachmentsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingAttachmentsOneRequestBuilder request(@Nonnull AccountingAttachmentsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingAttachmentsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingAttachmentsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingAttachmentsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneResponse.java index 2dd38ced..5d2f3ffd 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingAttachmentsOneResponse implements Response { /** * Attachments */ - private Optional getAttachmentResponse; + private GetAttachmentResponse getAttachmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingAttachmentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getAttachmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getAttachmentResponse, "getAttachmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetAttachmentResponse getAttachmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getAttachmentResponse = getAttachmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingAttachmentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Attachments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getAttachmentResponse() { - return (Optional) getAttachmentResponse; + return Optional.ofNullable(this.getAttachmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingAttachmentsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingAttachmentsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingAttachmentsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingAttachmentsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Attachments + * Raw HTTP response; suitable for custom response parsing */ - public AccountingAttachmentsOneResponse withGetAttachmentResponse(GetAttachmentResponse getAttachmentResponse) { - Utils.checkNotNull(getAttachmentResponse, "getAttachmentResponse"); - this.getAttachmentResponse = Optional.ofNullable(getAttachmentResponse); + public AccountingAttachmentsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingAttachmentsOneResponse withGetAttachmentResponse(GetAttachmentR /** * Attachments */ - public AccountingAttachmentsOneResponse withGetAttachmentResponse(Optional getAttachmentResponse) { - Utils.checkNotNull(getAttachmentResponse, "getAttachmentResponse"); + public AccountingAttachmentsOneResponse withGetAttachmentResponse(@Nullable GetAttachmentResponse getAttachmentResponse) { this.getAttachmentResponse = getAttachmentResponse; return this; } - /** - * Unexpected error - */ - public AccountingAttachmentsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingAttachmentsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingAttachmentsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getAttachmentResponse = Optional.empty(); + private GetAttachmentResponse getAttachmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Attachments - */ - public Builder getAttachmentResponse(GetAttachmentResponse getAttachmentResponse) { - Utils.checkNotNull(getAttachmentResponse, "getAttachmentResponse"); - this.getAttachmentResponse = Optional.ofNullable(getAttachmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Attachments */ - public Builder getAttachmentResponse(Optional getAttachmentResponse) { - Utils.checkNotNull(getAttachmentResponse, "getAttachmentResponse"); + public Builder getAttachmentResponse(@Nullable GetAttachmentResponse getAttachmentResponse) { this.getAttachmentResponse = getAttachmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingAttachmentsOneResponse build() { - return new AccountingAttachmentsOneResponse( contentType, statusCode, rawResponse, getAttachmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadRequest.java index e2191ee2..ee775ee3 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -33,31 +34,31 @@ public class AccountingAttachmentsUploadRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * Metadata to attach to the attachment file (JSON string) */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-metadata") - private Optional xApideckMetadata; + private String xApideckMetadata; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=*/*") @@ -65,100 +66,88 @@ public class AccountingAttachmentsUploadRequest { @JsonCreator public AccountingAttachmentsUploadRequest( - AttachmentReferenceType referenceType, - String referenceId, - Optional raw, - Optional xApideckMetadata, - Optional consumerId, - Optional appId, - Optional serviceId, - byte[] requestBody) { - Utils.checkNotNull(referenceType, "referenceType"); - Utils.checkNotNull(referenceId, "referenceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(xApideckMetadata, "xApideckMetadata"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(requestBody, "requestBody"); - this.referenceType = referenceType; - this.referenceId = referenceId; - this.raw = raw; + @Nonnull AttachmentReferenceType referenceType, + @Nonnull String referenceId, + @Nullable Boolean raw, + @Nullable String xApideckMetadata, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull byte[] requestBody) { + this.referenceType = Optional.ofNullable(referenceType) + .orElseThrow(() -> new IllegalArgumentException("referenceType cannot be null")); + this.referenceId = Optional.ofNullable(referenceId) + .orElseThrow(() -> new IllegalArgumentException("referenceId cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.xApideckMetadata = xApideckMetadata; this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.requestBody = requestBody; + this.requestBody = Optional.ofNullable(requestBody) + .orElseThrow(() -> new IllegalArgumentException("requestBody cannot be null")); } public AccountingAttachmentsUploadRequest( - AttachmentReferenceType referenceType, - String referenceId, - byte[] requestBody) { - this(referenceType, referenceId, Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), requestBody); + @Nonnull AttachmentReferenceType referenceType, + @Nonnull String referenceId, + @Nonnull byte[] requestBody) { + this(referenceType, referenceId, null, + null, null, null, + null, requestBody); } /** * The reference type of the document. */ - @JsonIgnore public AttachmentReferenceType referenceType() { - return referenceType; + return this.referenceType; } /** * The reference id of the object to retrieve. */ - @JsonIgnore public String referenceId() { - return referenceId; + return this.referenceId; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * Metadata to attach to the attachment file (JSON string) */ - @JsonIgnore public Optional xApideckMetadata() { - return xApideckMetadata; + return Optional.ofNullable(this.xApideckMetadata); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public byte[] requestBody() { - return requestBody; + return this.requestBody; } public static Builder builder() { @@ -169,27 +158,17 @@ public static Builder builder() { /** * The reference type of the document. */ - public AccountingAttachmentsUploadRequest withReferenceType(AttachmentReferenceType referenceType) { - Utils.checkNotNull(referenceType, "referenceType"); - this.referenceType = referenceType; + public AccountingAttachmentsUploadRequest withReferenceType(@Nonnull AttachmentReferenceType referenceType) { + this.referenceType = Utils.checkNotNull(referenceType, "referenceType"); return this; } - /** - * The reference id of the object to retrieve. - */ - public AccountingAttachmentsUploadRequest withReferenceId(String referenceId) { - Utils.checkNotNull(referenceId, "referenceId"); - this.referenceId = referenceId; - return this; - } /** - * Include raw response. Mostly used for debugging purposes + * The reference id of the object to retrieve. */ - public AccountingAttachmentsUploadRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public AccountingAttachmentsUploadRequest withReferenceId(@Nonnull String referenceId) { + this.referenceId = Utils.checkNotNull(referenceId, "referenceId"); return this; } @@ -197,94 +176,54 @@ public AccountingAttachmentsUploadRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingAttachmentsUploadRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingAttachmentsUploadRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * Metadata to attach to the attachment file (JSON string) - */ - public AccountingAttachmentsUploadRequest withXApideckMetadata(String xApideckMetadata) { - Utils.checkNotNull(xApideckMetadata, "xApideckMetadata"); - this.xApideckMetadata = Optional.ofNullable(xApideckMetadata); - return this; - } - /** * Metadata to attach to the attachment file (JSON string) */ - public AccountingAttachmentsUploadRequest withXApideckMetadata(Optional xApideckMetadata) { - Utils.checkNotNull(xApideckMetadata, "xApideckMetadata"); + public AccountingAttachmentsUploadRequest withXApideckMetadata(@Nullable String xApideckMetadata) { this.xApideckMetadata = xApideckMetadata; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingAttachmentsUploadRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingAttachmentsUploadRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingAttachmentsUploadRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingAttachmentsUploadRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingAttachmentsUploadRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingAttachmentsUploadRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingAttachmentsUploadRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingAttachmentsUploadRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingAttachmentsUploadRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingAttachmentsUploadRequest withRequestBody(byte[] requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = requestBody; + + public AccountingAttachmentsUploadRequest withRequestBody(@Nonnull byte[] requestBody) { + this.requestBody = Utils.checkNotNull(requestBody, "requestBody"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -333,15 +272,15 @@ public final static class Builder { private String referenceId; - private Optional raw; + private Boolean raw; - private Optional xApideckMetadata = Optional.empty(); + private String xApideckMetadata; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private byte[] requestBody; @@ -349,133 +288,68 @@ private Builder() { // force use of static builder() method } - /** * The reference type of the document. */ - public Builder referenceType(AttachmentReferenceType referenceType) { - Utils.checkNotNull(referenceType, "referenceType"); - this.referenceType = referenceType; + public Builder referenceType(@Nonnull AttachmentReferenceType referenceType) { + this.referenceType = Utils.checkNotNull(referenceType, "referenceType"); return this; } - /** * The reference id of the object to retrieve. */ - public Builder referenceId(String referenceId) { - Utils.checkNotNull(referenceId, "referenceId"); - this.referenceId = referenceId; + public Builder referenceId(@Nonnull String referenceId) { + this.referenceId = Utils.checkNotNull(referenceId, "referenceId"); return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * Metadata to attach to the attachment file (JSON string) - */ - public Builder xApideckMetadata(String xApideckMetadata) { - Utils.checkNotNull(xApideckMetadata, "xApideckMetadata"); - this.xApideckMetadata = Optional.ofNullable(xApideckMetadata); - return this; - } - /** * Metadata to attach to the attachment file (JSON string) */ - public Builder xApideckMetadata(Optional xApideckMetadata) { - Utils.checkNotNull(xApideckMetadata, "xApideckMetadata"); + public Builder xApideckMetadata(@Nullable String xApideckMetadata) { this.xApideckMetadata = xApideckMetadata; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder requestBody(byte[] requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = requestBody; + public Builder requestBody(@Nonnull byte[] requestBody) { + this.requestBody = Utils.checkNotNull(requestBody, "requestBody"); return this; } public AccountingAttachmentsUploadRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingAttachmentsUploadRequest( referenceType, referenceId, raw, xApideckMetadata, consumerId, appId, @@ -483,10 +357,10 @@ public AccountingAttachmentsUploadRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadRequestBuilder.java index 24185632..3be2a087 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadRequestBuilder.java @@ -10,62 +10,54 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class AccountingAttachmentsUploadRequestBuilder { - - private AccountingAttachmentsUploadRequest request; - private Optional serverURL = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingAttachmentsUploadRequest request; + private String serverURL; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingAttachmentsUploadRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingAttachmentsUploadRequestBuilder request(AccountingAttachmentsUploadRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; + public AccountingAttachmentsUploadRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - public AccountingAttachmentsUploadRequestBuilder serverURL(String serverURL) { - Utils.checkNotNull(serverURL, "serverURL"); - this.serverURL = Optional.of(serverURL); + + public AccountingAttachmentsUploadRequestBuilder request(@Nonnull AccountingAttachmentsUploadRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } - public AccountingAttachmentsUploadRequestBuilder serverURL(Optional serverURL) { - Utils.checkNotNull(serverURL, "serverURL"); + public AccountingAttachmentsUploadRequestBuilder serverURL(@Nullable String serverURL) { this.serverURL = serverURL; return this; } - - public AccountingAttachmentsUploadRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); - return this; - } - public AccountingAttachmentsUploadRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; - return this; + private AccountingAttachmentsUploadRequest _buildRequest() { + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingAttachmentsUploadResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingAttachmentsUploadOperation( sdkConfiguration, serverURL, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadResponse.java index 3d8d5f1c..318d21aa 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingAttachmentsUploadResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingAttachmentsUploadResponse implements Response { /** * Attachments */ - private Optional createAttachmentResponse; + private CreateAttachmentResponse createAttachmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingAttachmentsUploadResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createAttachmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createAttachmentResponse, "createAttachmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateAttachmentResponse createAttachmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createAttachmentResponse = createAttachmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingAttachmentsUploadResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Attachments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createAttachmentResponse() { - return (Optional) createAttachmentResponse; + return Optional.ofNullable(this.createAttachmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingAttachmentsUploadResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingAttachmentsUploadResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingAttachmentsUploadResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingAttachmentsUploadResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Attachments + * Raw HTTP response; suitable for custom response parsing */ - public AccountingAttachmentsUploadResponse withCreateAttachmentResponse(CreateAttachmentResponse createAttachmentResponse) { - Utils.checkNotNull(createAttachmentResponse, "createAttachmentResponse"); - this.createAttachmentResponse = Optional.ofNullable(createAttachmentResponse); + public AccountingAttachmentsUploadResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingAttachmentsUploadResponse withCreateAttachmentResponse(CreateAt /** * Attachments */ - public AccountingAttachmentsUploadResponse withCreateAttachmentResponse(Optional createAttachmentResponse) { - Utils.checkNotNull(createAttachmentResponse, "createAttachmentResponse"); + public AccountingAttachmentsUploadResponse withCreateAttachmentResponse(@Nullable CreateAttachmentResponse createAttachmentResponse) { this.createAttachmentResponse = createAttachmentResponse; return this; } - /** - * Unexpected error - */ - public AccountingAttachmentsUploadResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingAttachmentsUploadResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingAttachmentsUploadResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createAttachmentResponse = Optional.empty(); + private CreateAttachmentResponse createAttachmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Attachments - */ - public Builder createAttachmentResponse(CreateAttachmentResponse createAttachmentResponse) { - Utils.checkNotNull(createAttachmentResponse, "createAttachmentResponse"); - this.createAttachmentResponse = Optional.ofNullable(createAttachmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Attachments */ - public Builder createAttachmentResponse(Optional createAttachmentResponse) { - Utils.checkNotNull(createAttachmentResponse, "createAttachmentResponse"); + public Builder createAttachmentResponse(@Nullable CreateAttachmentResponse createAttachmentResponse) { this.createAttachmentResponse = createAttachmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingAttachmentsUploadResponse build() { - return new AccountingAttachmentsUploadResponse( contentType, statusCode, rawResponse, createAttachmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneRequest.java index 90e67a27..9e699bed 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneRequest.java @@ -8,13 +8,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; @@ -24,113 +23,100 @@ public class AccountingBalanceSheetOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private BalanceSheetFilter filter; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingBalanceSheetOneRequest( - Optional consumerId, - Optional appId, - Optional serviceId, - Optional> passThrough, - Optional filter, - Optional raw) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(raw, "raw"); + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Map passThrough, + @Nullable BalanceSheetFilter filter, + @Nullable Boolean raw) { this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; this.passThrough = passThrough; this.filter = filter; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingBalanceSheetOneRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -141,117 +127,57 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public AccountingBalanceSheetOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBalanceSheetOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBalanceSheetOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBalanceSheetOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBalanceSheetOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBalanceSheetOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBalanceSheetOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBalanceSheetOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBalanceSheetOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingBalanceSheetOneRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingBalanceSheetOneRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingBalanceSheetOneRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** - * Apply filters - */ - public AccountingBalanceSheetOneRequest withFilter(BalanceSheetFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingBalanceSheetOneRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingBalanceSheetOneRequest withFilter(@Nullable BalanceSheetFilter filter) { this.filter = filter; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBalanceSheetOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBalanceSheetOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBalanceSheetOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -291,151 +217,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private Optional filter = Optional.empty(); + private BalanceSheetFilter filter; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - - /** - * Apply filters - */ - public Builder filter(BalanceSheetFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable BalanceSheetFilter filter) { this.filter = filter; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingBalanceSheetOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBalanceSheetOneRequest( consumerId, appId, serviceId, passThrough, filter, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneRequestBuilder.java index 4a552883..4a0b6298 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBalanceSheetOneRequestBuilder { - - private AccountingBalanceSheetOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBalanceSheetOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBalanceSheetOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBalanceSheetOneRequestBuilder request(AccountingBalanceSheetOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBalanceSheetOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBalanceSheetOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBalanceSheetOneRequestBuilder request(@Nonnull AccountingBalanceSheetOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBalanceSheetOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBalanceSheetOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBalanceSheetOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneResponse.java index c8dbbd70..29f2cb4e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBalanceSheetOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBalanceSheetOneResponse implements Response { /** * BalanceSheet */ - private Optional getBalanceSheetResponse; + private GetBalanceSheetResponse getBalanceSheetResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBalanceSheetOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getBalanceSheetResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getBalanceSheetResponse, "getBalanceSheetResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetBalanceSheetResponse getBalanceSheetResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getBalanceSheetResponse = getBalanceSheetResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBalanceSheetOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * BalanceSheet */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getBalanceSheetResponse() { - return (Optional) getBalanceSheetResponse; + return Optional.ofNullable(this.getBalanceSheetResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBalanceSheetOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBalanceSheetOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBalanceSheetOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBalanceSheetOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * BalanceSheet + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBalanceSheetOneResponse withGetBalanceSheetResponse(GetBalanceSheetResponse getBalanceSheetResponse) { - Utils.checkNotNull(getBalanceSheetResponse, "getBalanceSheetResponse"); - this.getBalanceSheetResponse = Optional.ofNullable(getBalanceSheetResponse); + public AccountingBalanceSheetOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBalanceSheetOneResponse withGetBalanceSheetResponse(GetBalanceS /** * BalanceSheet */ - public AccountingBalanceSheetOneResponse withGetBalanceSheetResponse(Optional getBalanceSheetResponse) { - Utils.checkNotNull(getBalanceSheetResponse, "getBalanceSheetResponse"); + public AccountingBalanceSheetOneResponse withGetBalanceSheetResponse(@Nullable GetBalanceSheetResponse getBalanceSheetResponse) { this.getBalanceSheetResponse = getBalanceSheetResponse; return this; } - /** - * Unexpected error - */ - public AccountingBalanceSheetOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBalanceSheetOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBalanceSheetOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getBalanceSheetResponse = Optional.empty(); + private GetBalanceSheetResponse getBalanceSheetResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * BalanceSheet - */ - public Builder getBalanceSheetResponse(GetBalanceSheetResponse getBalanceSheetResponse) { - Utils.checkNotNull(getBalanceSheetResponse, "getBalanceSheetResponse"); - this.getBalanceSheetResponse = Optional.ofNullable(getBalanceSheetResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * BalanceSheet */ - public Builder getBalanceSheetResponse(Optional getBalanceSheetResponse) { - Utils.checkNotNull(getBalanceSheetResponse, "getBalanceSheetResponse"); + public Builder getBalanceSheetResponse(@Nullable GetBalanceSheetResponse getBalanceSheetResponse) { this.getBalanceSheetResponse = getBalanceSheetResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBalanceSheetOneResponse build() { - return new AccountingBalanceSheetOneResponse( contentType, statusCode, rawResponse, getBalanceSheetResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddRequest.java index fd9ba736..7dc2abe5 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingBankFeedAccountsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingBankFeedAccountsAddRequest { @JsonCreator public AccountingBankFeedAccountsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - BankFeedAccountInput bankFeedAccount) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(bankFeedAccount, "bankFeedAccount"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull BankFeedAccountInput bankFeedAccount) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.bankFeedAccount = bankFeedAccount; + this.bankFeedAccount = Optional.ofNullable(bankFeedAccount) + .orElseThrow(() -> new IllegalArgumentException("bankFeedAccount cannot be null")); } public AccountingBankFeedAccountsAddRequest( - BankFeedAccountInput bankFeedAccount) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), bankFeedAccount); + @Nonnull BankFeedAccountInput bankFeedAccount) { + this(null, null, null, + null, bankFeedAccount); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public BankFeedAccountInput bankFeedAccount() { - return bankFeedAccount; + return this.bankFeedAccount; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBankFeedAccountsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBankFeedAccountsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBankFeedAccountsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBankFeedAccountsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingBankFeedAccountsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBankFeedAccountsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBankFeedAccountsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBankFeedAccountsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBankFeedAccountsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBankFeedAccountsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBankFeedAccountsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBankFeedAccountsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingBankFeedAccountsAddRequest withBankFeedAccount(BankFeedAccountInput bankFeedAccount) { - Utils.checkNotNull(bankFeedAccount, "bankFeedAccount"); - this.bankFeedAccount = bankFeedAccount; + + public AccountingBankFeedAccountsAddRequest withBankFeedAccount(@Nonnull BankFeedAccountInput bankFeedAccount) { + this.bankFeedAccount = Utils.checkNotNull(bankFeedAccount, "bankFeedAccount"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private BankFeedAccountInput bankFeedAccount; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder bankFeedAccount(BankFeedAccountInput bankFeedAccount) { - Utils.checkNotNull(bankFeedAccount, "bankFeedAccount"); - this.bankFeedAccount = bankFeedAccount; + public Builder bankFeedAccount(@Nonnull BankFeedAccountInput bankFeedAccount) { + this.bankFeedAccount = Utils.checkNotNull(bankFeedAccount, "bankFeedAccount"); return this; } public AccountingBankFeedAccountsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBankFeedAccountsAddRequest( raw, consumerId, appId, serviceId, bankFeedAccount); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddRequestBuilder.java index 5e11ad46..6de7ccd1 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBankFeedAccountsAddRequestBuilder { - - private AccountingBankFeedAccountsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBankFeedAccountsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBankFeedAccountsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBankFeedAccountsAddRequestBuilder request(AccountingBankFeedAccountsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBankFeedAccountsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBankFeedAccountsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBankFeedAccountsAddRequestBuilder request(@Nonnull AccountingBankFeedAccountsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBankFeedAccountsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBankFeedAccountsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBankFeedAccountsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddResponse.java index c0e5d420..dd5d92cd 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBankFeedAccountsAddResponse implements Response { /** * Bank Feed Accounts */ - private Optional createBankFeedAccountResponse; + private CreateBankFeedAccountResponse createBankFeedAccountResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBankFeedAccountsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createBankFeedAccountResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createBankFeedAccountResponse, "createBankFeedAccountResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateBankFeedAccountResponse createBankFeedAccountResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createBankFeedAccountResponse = createBankFeedAccountResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBankFeedAccountsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bank Feed Accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createBankFeedAccountResponse() { - return (Optional) createBankFeedAccountResponse; + return Optional.ofNullable(this.createBankFeedAccountResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBankFeedAccountsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBankFeedAccountsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBankFeedAccountsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBankFeedAccountsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bank Feed Accounts + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBankFeedAccountsAddResponse withCreateBankFeedAccountResponse(CreateBankFeedAccountResponse createBankFeedAccountResponse) { - Utils.checkNotNull(createBankFeedAccountResponse, "createBankFeedAccountResponse"); - this.createBankFeedAccountResponse = Optional.ofNullable(createBankFeedAccountResponse); + public AccountingBankFeedAccountsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBankFeedAccountsAddResponse withCreateBankFeedAccountResponse(C /** * Bank Feed Accounts */ - public AccountingBankFeedAccountsAddResponse withCreateBankFeedAccountResponse(Optional createBankFeedAccountResponse) { - Utils.checkNotNull(createBankFeedAccountResponse, "createBankFeedAccountResponse"); + public AccountingBankFeedAccountsAddResponse withCreateBankFeedAccountResponse(@Nullable CreateBankFeedAccountResponse createBankFeedAccountResponse) { this.createBankFeedAccountResponse = createBankFeedAccountResponse; return this; } - /** - * Unexpected error - */ - public AccountingBankFeedAccountsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBankFeedAccountsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBankFeedAccountsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createBankFeedAccountResponse = Optional.empty(); + private CreateBankFeedAccountResponse createBankFeedAccountResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bank Feed Accounts - */ - public Builder createBankFeedAccountResponse(CreateBankFeedAccountResponse createBankFeedAccountResponse) { - Utils.checkNotNull(createBankFeedAccountResponse, "createBankFeedAccountResponse"); - this.createBankFeedAccountResponse = Optional.ofNullable(createBankFeedAccountResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bank Feed Accounts */ - public Builder createBankFeedAccountResponse(Optional createBankFeedAccountResponse) { - Utils.checkNotNull(createBankFeedAccountResponse, "createBankFeedAccountResponse"); + public Builder createBankFeedAccountResponse(@Nullable CreateBankFeedAccountResponse createBankFeedAccountResponse) { this.createBankFeedAccountResponse = createBankFeedAccountResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBankFeedAccountsAddResponse build() { - return new AccountingBankFeedAccountsAddResponse( contentType, statusCode, rawResponse, createBankFeedAccountResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllRequest.java index 62d11134..6ef3dadc 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class AccountingBankFeedAccountsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class AccountingBankFeedAccountsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class AccountingBankFeedAccountsAllRequest { @JsonCreator public AccountingBankFeedAccountsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingBankFeedAccountsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBankFeedAccountsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBankFeedAccountsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBankFeedAccountsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBankFeedAccountsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingBankFeedAccountsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBankFeedAccountsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBankFeedAccountsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBankFeedAccountsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBankFeedAccountsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBankFeedAccountsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBankFeedAccountsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBankFeedAccountsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingBankFeedAccountsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingBankFeedAccountsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingBankFeedAccountsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingBankFeedAccountsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public AccountingBankFeedAccountsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingBankFeedAccountsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingBankFeedAccountsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingBankFeedAccountsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingBankFeedAccountsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingBankFeedAccountsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingBankFeedAccountsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingBankFeedAccountsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingBankFeedAccountsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingBankFeedAccountsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingBankFeedAccountsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public AccountingBankFeedAccountsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllRequestBuilder.java index 8db1cff0..d210f31b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingBankFeedAccountsAllRequestBuilder { - - private AccountingBankFeedAccountsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBankFeedAccountsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBankFeedAccountsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBankFeedAccountsAllRequestBuilder request(AccountingBankFeedAccountsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBankFeedAccountsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBankFeedAccountsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBankFeedAccountsAllRequestBuilder request(@Nonnull AccountingBankFeedAccountsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBankFeedAccountsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBankFeedAccountsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBankFeedAccountsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingBankFeedAccountsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingBankFeedAccountsAllOperation( - sdkConfiguration, - options); + AccountingBankFeedAccountsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingBankFeedAccountsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingBankFeedAccountsAllRequest::withCursor, + AccountingBankFeedAccountsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllResponse.java index d55e1ccd..4d0c4155 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBankFeedAccountsAllResponse implements Response { /** * Bank Feed Accounts */ - private Optional getBankFeedAccountsResponse; + private GetBankFeedAccountsResponse getBankFeedAccountsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBankFeedAccountsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getBankFeedAccountsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getBankFeedAccountsResponse, "getBankFeedAccountsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetBankFeedAccountsResponse getBankFeedAccountsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getBankFeedAccountsResponse = getBankFeedAccountsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBankFeedAccountsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bank Feed Accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getBankFeedAccountsResponse() { - return (Optional) getBankFeedAccountsResponse; + return Optional.ofNullable(this.getBankFeedAccountsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBankFeedAccountsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBankFeedAccountsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBankFeedAccountsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBankFeedAccountsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bank Feed Accounts + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBankFeedAccountsAllResponse withGetBankFeedAccountsResponse(GetBankFeedAccountsResponse getBankFeedAccountsResponse) { - Utils.checkNotNull(getBankFeedAccountsResponse, "getBankFeedAccountsResponse"); - this.getBankFeedAccountsResponse = Optional.ofNullable(getBankFeedAccountsResponse); + public AccountingBankFeedAccountsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBankFeedAccountsAllResponse withGetBankFeedAccountsResponse(Get /** * Bank Feed Accounts */ - public AccountingBankFeedAccountsAllResponse withGetBankFeedAccountsResponse(Optional getBankFeedAccountsResponse) { - Utils.checkNotNull(getBankFeedAccountsResponse, "getBankFeedAccountsResponse"); + public AccountingBankFeedAccountsAllResponse withGetBankFeedAccountsResponse(@Nullable GetBankFeedAccountsResponse getBankFeedAccountsResponse) { this.getBankFeedAccountsResponse = getBankFeedAccountsResponse; return this; } - /** - * Unexpected error - */ - public AccountingBankFeedAccountsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBankFeedAccountsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBankFeedAccountsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getBankFeedAccountsResponse = Optional.empty(); + private GetBankFeedAccountsResponse getBankFeedAccountsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bank Feed Accounts - */ - public Builder getBankFeedAccountsResponse(GetBankFeedAccountsResponse getBankFeedAccountsResponse) { - Utils.checkNotNull(getBankFeedAccountsResponse, "getBankFeedAccountsResponse"); - this.getBankFeedAccountsResponse = Optional.ofNullable(getBankFeedAccountsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bank Feed Accounts */ - public Builder getBankFeedAccountsResponse(Optional getBankFeedAccountsResponse) { - Utils.checkNotNull(getBankFeedAccountsResponse, "getBankFeedAccountsResponse"); + public Builder getBankFeedAccountsResponse(@Nullable GetBankFeedAccountsResponse getBankFeedAccountsResponse) { this.getBankFeedAccountsResponse = getBankFeedAccountsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBankFeedAccountsAllResponse build() { - return new AccountingBankFeedAccountsAllResponse( contentType, statusCode, rawResponse, getBankFeedAccountsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteRequest.java index 27a72ae1..81ca8d71 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingBankFeedAccountsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingBankFeedAccountsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingBankFeedAccountsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBankFeedAccountsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBankFeedAccountsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBankFeedAccountsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingBankFeedAccountsDeleteRequest withConsumerId(String consumerId) /** * ID of the consumer which you want to get or push data from */ - public AccountingBankFeedAccountsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBankFeedAccountsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBankFeedAccountsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBankFeedAccountsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBankFeedAccountsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBankFeedAccountsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBankFeedAccountsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBankFeedAccountsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBankFeedAccountsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBankFeedAccountsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBankFeedAccountsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingBankFeedAccountsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBankFeedAccountsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteRequestBuilder.java index 9c0a6724..a6d55a18 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBankFeedAccountsDeleteRequestBuilder { - - private AccountingBankFeedAccountsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBankFeedAccountsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBankFeedAccountsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBankFeedAccountsDeleteRequestBuilder request(AccountingBankFeedAccountsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBankFeedAccountsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBankFeedAccountsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBankFeedAccountsDeleteRequestBuilder request(@Nonnull AccountingBankFeedAccountsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBankFeedAccountsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBankFeedAccountsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBankFeedAccountsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteResponse.java index f86ed2bc..ea98debf 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBankFeedAccountsDeleteResponse implements Response { /** * Bank Feed Accounts */ - private Optional deleteBankFeedAccountResponse; + private DeleteBankFeedAccountResponse deleteBankFeedAccountResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBankFeedAccountsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteBankFeedAccountResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteBankFeedAccountResponse, "deleteBankFeedAccountResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteBankFeedAccountResponse deleteBankFeedAccountResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteBankFeedAccountResponse = deleteBankFeedAccountResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBankFeedAccountsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bank Feed Accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteBankFeedAccountResponse() { - return (Optional) deleteBankFeedAccountResponse; + return Optional.ofNullable(this.deleteBankFeedAccountResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBankFeedAccountsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBankFeedAccountsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBankFeedAccountsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBankFeedAccountsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bank Feed Accounts + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBankFeedAccountsDeleteResponse withDeleteBankFeedAccountResponse(DeleteBankFeedAccountResponse deleteBankFeedAccountResponse) { - Utils.checkNotNull(deleteBankFeedAccountResponse, "deleteBankFeedAccountResponse"); - this.deleteBankFeedAccountResponse = Optional.ofNullable(deleteBankFeedAccountResponse); + public AccountingBankFeedAccountsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBankFeedAccountsDeleteResponse withDeleteBankFeedAccountRespons /** * Bank Feed Accounts */ - public AccountingBankFeedAccountsDeleteResponse withDeleteBankFeedAccountResponse(Optional deleteBankFeedAccountResponse) { - Utils.checkNotNull(deleteBankFeedAccountResponse, "deleteBankFeedAccountResponse"); + public AccountingBankFeedAccountsDeleteResponse withDeleteBankFeedAccountResponse(@Nullable DeleteBankFeedAccountResponse deleteBankFeedAccountResponse) { this.deleteBankFeedAccountResponse = deleteBankFeedAccountResponse; return this; } - /** - * Unexpected error - */ - public AccountingBankFeedAccountsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBankFeedAccountsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBankFeedAccountsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteBankFeedAccountResponse = Optional.empty(); + private DeleteBankFeedAccountResponse deleteBankFeedAccountResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bank Feed Accounts - */ - public Builder deleteBankFeedAccountResponse(DeleteBankFeedAccountResponse deleteBankFeedAccountResponse) { - Utils.checkNotNull(deleteBankFeedAccountResponse, "deleteBankFeedAccountResponse"); - this.deleteBankFeedAccountResponse = Optional.ofNullable(deleteBankFeedAccountResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bank Feed Accounts */ - public Builder deleteBankFeedAccountResponse(Optional deleteBankFeedAccountResponse) { - Utils.checkNotNull(deleteBankFeedAccountResponse, "deleteBankFeedAccountResponse"); + public Builder deleteBankFeedAccountResponse(@Nullable DeleteBankFeedAccountResponse deleteBankFeedAccountResponse) { this.deleteBankFeedAccountResponse = deleteBankFeedAccountResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBankFeedAccountsDeleteResponse build() { - return new AccountingBankFeedAccountsDeleteResponse( contentType, statusCode, rawResponse, deleteBankFeedAccountResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneRequest.java index de17ca5b..df1eeddb 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingBankFeedAccountsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingBankFeedAccountsOneRequest { @JsonCreator public AccountingBankFeedAccountsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingBankFeedAccountsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBankFeedAccountsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBankFeedAccountsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBankFeedAccountsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingBankFeedAccountsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingBankFeedAccountsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBankFeedAccountsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBankFeedAccountsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBankFeedAccountsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBankFeedAccountsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBankFeedAccountsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBankFeedAccountsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBankFeedAccountsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBankFeedAccountsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBankFeedAccountsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBankFeedAccountsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingBankFeedAccountsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingBankFeedAccountsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingBankFeedAccountsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingBankFeedAccountsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBankFeedAccountsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneRequestBuilder.java index 708d6faf..f199736b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBankFeedAccountsOneRequestBuilder { - - private AccountingBankFeedAccountsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBankFeedAccountsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBankFeedAccountsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBankFeedAccountsOneRequestBuilder request(AccountingBankFeedAccountsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBankFeedAccountsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBankFeedAccountsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBankFeedAccountsOneRequestBuilder request(@Nonnull AccountingBankFeedAccountsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBankFeedAccountsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBankFeedAccountsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBankFeedAccountsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneResponse.java index 37f6462b..f53c6eba 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBankFeedAccountsOneResponse implements Response { /** * Bank Feed Accounts */ - private Optional getBankFeedAccountResponse; + private GetBankFeedAccountResponse getBankFeedAccountResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBankFeedAccountsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getBankFeedAccountResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getBankFeedAccountResponse, "getBankFeedAccountResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetBankFeedAccountResponse getBankFeedAccountResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getBankFeedAccountResponse = getBankFeedAccountResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBankFeedAccountsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bank Feed Accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getBankFeedAccountResponse() { - return (Optional) getBankFeedAccountResponse; + return Optional.ofNullable(this.getBankFeedAccountResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBankFeedAccountsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBankFeedAccountsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBankFeedAccountsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBankFeedAccountsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bank Feed Accounts + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBankFeedAccountsOneResponse withGetBankFeedAccountResponse(GetBankFeedAccountResponse getBankFeedAccountResponse) { - Utils.checkNotNull(getBankFeedAccountResponse, "getBankFeedAccountResponse"); - this.getBankFeedAccountResponse = Optional.ofNullable(getBankFeedAccountResponse); + public AccountingBankFeedAccountsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBankFeedAccountsOneResponse withGetBankFeedAccountResponse(GetB /** * Bank Feed Accounts */ - public AccountingBankFeedAccountsOneResponse withGetBankFeedAccountResponse(Optional getBankFeedAccountResponse) { - Utils.checkNotNull(getBankFeedAccountResponse, "getBankFeedAccountResponse"); + public AccountingBankFeedAccountsOneResponse withGetBankFeedAccountResponse(@Nullable GetBankFeedAccountResponse getBankFeedAccountResponse) { this.getBankFeedAccountResponse = getBankFeedAccountResponse; return this; } - /** - * Unexpected error - */ - public AccountingBankFeedAccountsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBankFeedAccountsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBankFeedAccountsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getBankFeedAccountResponse = Optional.empty(); + private GetBankFeedAccountResponse getBankFeedAccountResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bank Feed Accounts - */ - public Builder getBankFeedAccountResponse(GetBankFeedAccountResponse getBankFeedAccountResponse) { - Utils.checkNotNull(getBankFeedAccountResponse, "getBankFeedAccountResponse"); - this.getBankFeedAccountResponse = Optional.ofNullable(getBankFeedAccountResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bank Feed Accounts */ - public Builder getBankFeedAccountResponse(Optional getBankFeedAccountResponse) { - Utils.checkNotNull(getBankFeedAccountResponse, "getBankFeedAccountResponse"); + public Builder getBankFeedAccountResponse(@Nullable GetBankFeedAccountResponse getBankFeedAccountResponse) { this.getBankFeedAccountResponse = getBankFeedAccountResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBankFeedAccountsOneResponse build() { - return new AccountingBankFeedAccountsOneResponse( contentType, statusCode, rawResponse, getBankFeedAccountResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateRequest.java index b3d95cea..069d6502 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingBankFeedAccountsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingBankFeedAccountsUpdateRequest { @JsonCreator public AccountingBankFeedAccountsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - BankFeedAccountInput bankFeedAccount) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(bankFeedAccount, "bankFeedAccount"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull BankFeedAccountInput bankFeedAccount) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.bankFeedAccount = bankFeedAccount; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.bankFeedAccount = Optional.ofNullable(bankFeedAccount) + .orElseThrow(() -> new IllegalArgumentException("bankFeedAccount cannot be null")); } public AccountingBankFeedAccountsUpdateRequest( - String id, - BankFeedAccountInput bankFeedAccount) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), bankFeedAccount); + @Nonnull String id, + @Nonnull BankFeedAccountInput bankFeedAccount) { + this(id, null, null, + null, null, bankFeedAccount); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public BankFeedAccountInput bankFeedAccount() { - return bankFeedAccount; + return this.bankFeedAccount; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBankFeedAccountsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBankFeedAccountsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBankFeedAccountsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingBankFeedAccountsUpdateRequest withConsumerId(String consumerId) /** * ID of the consumer which you want to get or push data from */ - public AccountingBankFeedAccountsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBankFeedAccountsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBankFeedAccountsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBankFeedAccountsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBankFeedAccountsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBankFeedAccountsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBankFeedAccountsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBankFeedAccountsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBankFeedAccountsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBankFeedAccountsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBankFeedAccountsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingBankFeedAccountsUpdateRequest withBankFeedAccount(BankFeedAccountInput bankFeedAccount) { - Utils.checkNotNull(bankFeedAccount, "bankFeedAccount"); - this.bankFeedAccount = bankFeedAccount; + + public AccountingBankFeedAccountsUpdateRequest withBankFeedAccount(@Nonnull BankFeedAccountInput bankFeedAccount) { + this.bankFeedAccount = Utils.checkNotNull(bankFeedAccount, "bankFeedAccount"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private BankFeedAccountInput bankFeedAccount; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder bankFeedAccount(BankFeedAccountInput bankFeedAccount) { - Utils.checkNotNull(bankFeedAccount, "bankFeedAccount"); - this.bankFeedAccount = bankFeedAccount; + public Builder bankFeedAccount(@Nonnull BankFeedAccountInput bankFeedAccount) { + this.bankFeedAccount = Utils.checkNotNull(bankFeedAccount, "bankFeedAccount"); return this; } public AccountingBankFeedAccountsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBankFeedAccountsUpdateRequest( id, consumerId, appId, serviceId, raw, bankFeedAccount); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateRequestBuilder.java index a1f498ed..86f30438 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBankFeedAccountsUpdateRequestBuilder { - - private AccountingBankFeedAccountsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBankFeedAccountsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBankFeedAccountsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBankFeedAccountsUpdateRequestBuilder request(AccountingBankFeedAccountsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBankFeedAccountsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBankFeedAccountsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBankFeedAccountsUpdateRequestBuilder request(@Nonnull AccountingBankFeedAccountsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBankFeedAccountsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBankFeedAccountsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBankFeedAccountsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateResponse.java index bcc4a58a..a3562e04 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedAccountsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBankFeedAccountsUpdateResponse implements Response { /** * Bank Feed Accounts */ - private Optional updateBankFeedAccountResponse; + private UpdateBankFeedAccountResponse updateBankFeedAccountResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBankFeedAccountsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateBankFeedAccountResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateBankFeedAccountResponse, "updateBankFeedAccountResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateBankFeedAccountResponse updateBankFeedAccountResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateBankFeedAccountResponse = updateBankFeedAccountResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBankFeedAccountsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bank Feed Accounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateBankFeedAccountResponse() { - return (Optional) updateBankFeedAccountResponse; + return Optional.ofNullable(this.updateBankFeedAccountResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBankFeedAccountsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBankFeedAccountsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBankFeedAccountsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBankFeedAccountsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bank Feed Accounts + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBankFeedAccountsUpdateResponse withUpdateBankFeedAccountResponse(UpdateBankFeedAccountResponse updateBankFeedAccountResponse) { - Utils.checkNotNull(updateBankFeedAccountResponse, "updateBankFeedAccountResponse"); - this.updateBankFeedAccountResponse = Optional.ofNullable(updateBankFeedAccountResponse); + public AccountingBankFeedAccountsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBankFeedAccountsUpdateResponse withUpdateBankFeedAccountRespons /** * Bank Feed Accounts */ - public AccountingBankFeedAccountsUpdateResponse withUpdateBankFeedAccountResponse(Optional updateBankFeedAccountResponse) { - Utils.checkNotNull(updateBankFeedAccountResponse, "updateBankFeedAccountResponse"); + public AccountingBankFeedAccountsUpdateResponse withUpdateBankFeedAccountResponse(@Nullable UpdateBankFeedAccountResponse updateBankFeedAccountResponse) { this.updateBankFeedAccountResponse = updateBankFeedAccountResponse; return this; } - /** - * Unexpected error - */ - public AccountingBankFeedAccountsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBankFeedAccountsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBankFeedAccountsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateBankFeedAccountResponse = Optional.empty(); + private UpdateBankFeedAccountResponse updateBankFeedAccountResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bank Feed Accounts - */ - public Builder updateBankFeedAccountResponse(UpdateBankFeedAccountResponse updateBankFeedAccountResponse) { - Utils.checkNotNull(updateBankFeedAccountResponse, "updateBankFeedAccountResponse"); - this.updateBankFeedAccountResponse = Optional.ofNullable(updateBankFeedAccountResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bank Feed Accounts */ - public Builder updateBankFeedAccountResponse(Optional updateBankFeedAccountResponse) { - Utils.checkNotNull(updateBankFeedAccountResponse, "updateBankFeedAccountResponse"); + public Builder updateBankFeedAccountResponse(@Nullable UpdateBankFeedAccountResponse updateBankFeedAccountResponse) { this.updateBankFeedAccountResponse = updateBankFeedAccountResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBankFeedAccountsUpdateResponse build() { - return new AccountingBankFeedAccountsUpdateResponse( contentType, statusCode, rawResponse, updateBankFeedAccountResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddRequest.java index ce9604a8..501d5f11 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingBankFeedStatementsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingBankFeedStatementsAddRequest { @JsonCreator public AccountingBankFeedStatementsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - BankFeedStatementInput bankFeedStatement) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(bankFeedStatement, "bankFeedStatement"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull BankFeedStatementInput bankFeedStatement) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.bankFeedStatement = bankFeedStatement; + this.bankFeedStatement = Optional.ofNullable(bankFeedStatement) + .orElseThrow(() -> new IllegalArgumentException("bankFeedStatement cannot be null")); } public AccountingBankFeedStatementsAddRequest( - BankFeedStatementInput bankFeedStatement) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), bankFeedStatement); + @Nonnull BankFeedStatementInput bankFeedStatement) { + this(null, null, null, + null, bankFeedStatement); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public BankFeedStatementInput bankFeedStatement() { - return bankFeedStatement; + return this.bankFeedStatement; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBankFeedStatementsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBankFeedStatementsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBankFeedStatementsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBankFeedStatementsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingBankFeedStatementsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBankFeedStatementsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBankFeedStatementsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBankFeedStatementsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBankFeedStatementsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBankFeedStatementsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBankFeedStatementsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBankFeedStatementsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingBankFeedStatementsAddRequest withBankFeedStatement(BankFeedStatementInput bankFeedStatement) { - Utils.checkNotNull(bankFeedStatement, "bankFeedStatement"); - this.bankFeedStatement = bankFeedStatement; + + public AccountingBankFeedStatementsAddRequest withBankFeedStatement(@Nonnull BankFeedStatementInput bankFeedStatement) { + this.bankFeedStatement = Utils.checkNotNull(bankFeedStatement, "bankFeedStatement"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private BankFeedStatementInput bankFeedStatement; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder bankFeedStatement(BankFeedStatementInput bankFeedStatement) { - Utils.checkNotNull(bankFeedStatement, "bankFeedStatement"); - this.bankFeedStatement = bankFeedStatement; + public Builder bankFeedStatement(@Nonnull BankFeedStatementInput bankFeedStatement) { + this.bankFeedStatement = Utils.checkNotNull(bankFeedStatement, "bankFeedStatement"); return this; } public AccountingBankFeedStatementsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBankFeedStatementsAddRequest( raw, consumerId, appId, serviceId, bankFeedStatement); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddRequestBuilder.java index ccd13d6c..4b87e2ec 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBankFeedStatementsAddRequestBuilder { - - private AccountingBankFeedStatementsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBankFeedStatementsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBankFeedStatementsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBankFeedStatementsAddRequestBuilder request(AccountingBankFeedStatementsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBankFeedStatementsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBankFeedStatementsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBankFeedStatementsAddRequestBuilder request(@Nonnull AccountingBankFeedStatementsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBankFeedStatementsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBankFeedStatementsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBankFeedStatementsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddResponse.java index 577ba7f7..328ce953 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBankFeedStatementsAddResponse implements Response { /** * Bank Feed Statements */ - private Optional createBankFeedStatementResponse; + private CreateBankFeedStatementResponse createBankFeedStatementResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBankFeedStatementsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createBankFeedStatementResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createBankFeedStatementResponse, "createBankFeedStatementResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateBankFeedStatementResponse createBankFeedStatementResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createBankFeedStatementResponse = createBankFeedStatementResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBankFeedStatementsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bank Feed Statements */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createBankFeedStatementResponse() { - return (Optional) createBankFeedStatementResponse; + return Optional.ofNullable(this.createBankFeedStatementResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBankFeedStatementsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBankFeedStatementsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBankFeedStatementsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBankFeedStatementsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bank Feed Statements + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBankFeedStatementsAddResponse withCreateBankFeedStatementResponse(CreateBankFeedStatementResponse createBankFeedStatementResponse) { - Utils.checkNotNull(createBankFeedStatementResponse, "createBankFeedStatementResponse"); - this.createBankFeedStatementResponse = Optional.ofNullable(createBankFeedStatementResponse); + public AccountingBankFeedStatementsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBankFeedStatementsAddResponse withCreateBankFeedStatementRespon /** * Bank Feed Statements */ - public AccountingBankFeedStatementsAddResponse withCreateBankFeedStatementResponse(Optional createBankFeedStatementResponse) { - Utils.checkNotNull(createBankFeedStatementResponse, "createBankFeedStatementResponse"); + public AccountingBankFeedStatementsAddResponse withCreateBankFeedStatementResponse(@Nullable CreateBankFeedStatementResponse createBankFeedStatementResponse) { this.createBankFeedStatementResponse = createBankFeedStatementResponse; return this; } - /** - * Unexpected error - */ - public AccountingBankFeedStatementsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBankFeedStatementsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBankFeedStatementsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createBankFeedStatementResponse = Optional.empty(); + private CreateBankFeedStatementResponse createBankFeedStatementResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bank Feed Statements - */ - public Builder createBankFeedStatementResponse(CreateBankFeedStatementResponse createBankFeedStatementResponse) { - Utils.checkNotNull(createBankFeedStatementResponse, "createBankFeedStatementResponse"); - this.createBankFeedStatementResponse = Optional.ofNullable(createBankFeedStatementResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bank Feed Statements */ - public Builder createBankFeedStatementResponse(Optional createBankFeedStatementResponse) { - Utils.checkNotNull(createBankFeedStatementResponse, "createBankFeedStatementResponse"); + public Builder createBankFeedStatementResponse(@Nullable CreateBankFeedStatementResponse createBankFeedStatementResponse) { this.createBankFeedStatementResponse = createBankFeedStatementResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBankFeedStatementsAddResponse build() { - return new AccountingBankFeedStatementsAddResponse( contentType, statusCode, rawResponse, createBankFeedStatementResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllRequest.java index 589f6654..232d2b06 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class AccountingBankFeedStatementsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class AccountingBankFeedStatementsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class AccountingBankFeedStatementsAllRequest { @JsonCreator public AccountingBankFeedStatementsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingBankFeedStatementsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBankFeedStatementsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBankFeedStatementsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBankFeedStatementsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBankFeedStatementsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingBankFeedStatementsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBankFeedStatementsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBankFeedStatementsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBankFeedStatementsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBankFeedStatementsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBankFeedStatementsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBankFeedStatementsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBankFeedStatementsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingBankFeedStatementsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingBankFeedStatementsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingBankFeedStatementsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingBankFeedStatementsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public AccountingBankFeedStatementsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingBankFeedStatementsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingBankFeedStatementsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingBankFeedStatementsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingBankFeedStatementsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingBankFeedStatementsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingBankFeedStatementsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingBankFeedStatementsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingBankFeedStatementsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingBankFeedStatementsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingBankFeedStatementsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public AccountingBankFeedStatementsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllRequestBuilder.java index 4aead69a..af0c346f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingBankFeedStatementsAllRequestBuilder { - - private AccountingBankFeedStatementsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBankFeedStatementsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBankFeedStatementsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBankFeedStatementsAllRequestBuilder request(AccountingBankFeedStatementsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBankFeedStatementsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBankFeedStatementsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBankFeedStatementsAllRequestBuilder request(@Nonnull AccountingBankFeedStatementsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBankFeedStatementsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBankFeedStatementsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBankFeedStatementsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingBankFeedStatementsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingBankFeedStatementsAllOperation( - sdkConfiguration, - options); + AccountingBankFeedStatementsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingBankFeedStatementsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingBankFeedStatementsAllRequest::withCursor, + AccountingBankFeedStatementsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllResponse.java index e1ee79e3..6f42d00f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBankFeedStatementsAllResponse implements Response { /** * Bank Feed Statements */ - private Optional getBankFeedStatementsResponse; + private GetBankFeedStatementsResponse getBankFeedStatementsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBankFeedStatementsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getBankFeedStatementsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getBankFeedStatementsResponse, "getBankFeedStatementsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetBankFeedStatementsResponse getBankFeedStatementsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getBankFeedStatementsResponse = getBankFeedStatementsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBankFeedStatementsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bank Feed Statements */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getBankFeedStatementsResponse() { - return (Optional) getBankFeedStatementsResponse; + return Optional.ofNullable(this.getBankFeedStatementsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBankFeedStatementsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBankFeedStatementsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBankFeedStatementsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBankFeedStatementsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bank Feed Statements + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBankFeedStatementsAllResponse withGetBankFeedStatementsResponse(GetBankFeedStatementsResponse getBankFeedStatementsResponse) { - Utils.checkNotNull(getBankFeedStatementsResponse, "getBankFeedStatementsResponse"); - this.getBankFeedStatementsResponse = Optional.ofNullable(getBankFeedStatementsResponse); + public AccountingBankFeedStatementsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBankFeedStatementsAllResponse withGetBankFeedStatementsResponse /** * Bank Feed Statements */ - public AccountingBankFeedStatementsAllResponse withGetBankFeedStatementsResponse(Optional getBankFeedStatementsResponse) { - Utils.checkNotNull(getBankFeedStatementsResponse, "getBankFeedStatementsResponse"); + public AccountingBankFeedStatementsAllResponse withGetBankFeedStatementsResponse(@Nullable GetBankFeedStatementsResponse getBankFeedStatementsResponse) { this.getBankFeedStatementsResponse = getBankFeedStatementsResponse; return this; } - /** - * Unexpected error - */ - public AccountingBankFeedStatementsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBankFeedStatementsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBankFeedStatementsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getBankFeedStatementsResponse = Optional.empty(); + private GetBankFeedStatementsResponse getBankFeedStatementsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bank Feed Statements - */ - public Builder getBankFeedStatementsResponse(GetBankFeedStatementsResponse getBankFeedStatementsResponse) { - Utils.checkNotNull(getBankFeedStatementsResponse, "getBankFeedStatementsResponse"); - this.getBankFeedStatementsResponse = Optional.ofNullable(getBankFeedStatementsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bank Feed Statements */ - public Builder getBankFeedStatementsResponse(Optional getBankFeedStatementsResponse) { - Utils.checkNotNull(getBankFeedStatementsResponse, "getBankFeedStatementsResponse"); + public Builder getBankFeedStatementsResponse(@Nullable GetBankFeedStatementsResponse getBankFeedStatementsResponse) { this.getBankFeedStatementsResponse = getBankFeedStatementsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBankFeedStatementsAllResponse build() { - return new AccountingBankFeedStatementsAllResponse( contentType, statusCode, rawResponse, getBankFeedStatementsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteRequest.java index 621a3aea..69056614 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingBankFeedStatementsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingBankFeedStatementsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingBankFeedStatementsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBankFeedStatementsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBankFeedStatementsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBankFeedStatementsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingBankFeedStatementsDeleteRequest withConsumerId(String consumerI /** * ID of the consumer which you want to get or push data from */ - public AccountingBankFeedStatementsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBankFeedStatementsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBankFeedStatementsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBankFeedStatementsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBankFeedStatementsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBankFeedStatementsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBankFeedStatementsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBankFeedStatementsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBankFeedStatementsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBankFeedStatementsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBankFeedStatementsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingBankFeedStatementsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBankFeedStatementsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteRequestBuilder.java index 05ba9b0d..aa74f846 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBankFeedStatementsDeleteRequestBuilder { - - private AccountingBankFeedStatementsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBankFeedStatementsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBankFeedStatementsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBankFeedStatementsDeleteRequestBuilder request(AccountingBankFeedStatementsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBankFeedStatementsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBankFeedStatementsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBankFeedStatementsDeleteRequestBuilder request(@Nonnull AccountingBankFeedStatementsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBankFeedStatementsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBankFeedStatementsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBankFeedStatementsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteResponse.java index 770f2827..9262fd46 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBankFeedStatementsDeleteResponse implements Response { /** * Bank Feed Statements */ - private Optional deleteBankFeedStatementResponse; + private DeleteBankFeedStatementResponse deleteBankFeedStatementResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBankFeedStatementsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteBankFeedStatementResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteBankFeedStatementResponse, "deleteBankFeedStatementResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteBankFeedStatementResponse deleteBankFeedStatementResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteBankFeedStatementResponse = deleteBankFeedStatementResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBankFeedStatementsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bank Feed Statements */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteBankFeedStatementResponse() { - return (Optional) deleteBankFeedStatementResponse; + return Optional.ofNullable(this.deleteBankFeedStatementResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBankFeedStatementsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBankFeedStatementsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBankFeedStatementsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBankFeedStatementsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bank Feed Statements + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBankFeedStatementsDeleteResponse withDeleteBankFeedStatementResponse(DeleteBankFeedStatementResponse deleteBankFeedStatementResponse) { - Utils.checkNotNull(deleteBankFeedStatementResponse, "deleteBankFeedStatementResponse"); - this.deleteBankFeedStatementResponse = Optional.ofNullable(deleteBankFeedStatementResponse); + public AccountingBankFeedStatementsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBankFeedStatementsDeleteResponse withDeleteBankFeedStatementRes /** * Bank Feed Statements */ - public AccountingBankFeedStatementsDeleteResponse withDeleteBankFeedStatementResponse(Optional deleteBankFeedStatementResponse) { - Utils.checkNotNull(deleteBankFeedStatementResponse, "deleteBankFeedStatementResponse"); + public AccountingBankFeedStatementsDeleteResponse withDeleteBankFeedStatementResponse(@Nullable DeleteBankFeedStatementResponse deleteBankFeedStatementResponse) { this.deleteBankFeedStatementResponse = deleteBankFeedStatementResponse; return this; } - /** - * Unexpected error - */ - public AccountingBankFeedStatementsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBankFeedStatementsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBankFeedStatementsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteBankFeedStatementResponse = Optional.empty(); + private DeleteBankFeedStatementResponse deleteBankFeedStatementResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bank Feed Statements - */ - public Builder deleteBankFeedStatementResponse(DeleteBankFeedStatementResponse deleteBankFeedStatementResponse) { - Utils.checkNotNull(deleteBankFeedStatementResponse, "deleteBankFeedStatementResponse"); - this.deleteBankFeedStatementResponse = Optional.ofNullable(deleteBankFeedStatementResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bank Feed Statements */ - public Builder deleteBankFeedStatementResponse(Optional deleteBankFeedStatementResponse) { - Utils.checkNotNull(deleteBankFeedStatementResponse, "deleteBankFeedStatementResponse"); + public Builder deleteBankFeedStatementResponse(@Nullable DeleteBankFeedStatementResponse deleteBankFeedStatementResponse) { this.deleteBankFeedStatementResponse = deleteBankFeedStatementResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBankFeedStatementsDeleteResponse build() { - return new AccountingBankFeedStatementsDeleteResponse( contentType, statusCode, rawResponse, deleteBankFeedStatementResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneRequest.java index 23506591..9c10388e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingBankFeedStatementsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingBankFeedStatementsOneRequest { @JsonCreator public AccountingBankFeedStatementsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingBankFeedStatementsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBankFeedStatementsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBankFeedStatementsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBankFeedStatementsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingBankFeedStatementsOneRequest withConsumerId(String consumerId) /** * ID of the consumer which you want to get or push data from */ - public AccountingBankFeedStatementsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBankFeedStatementsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBankFeedStatementsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBankFeedStatementsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBankFeedStatementsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBankFeedStatementsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBankFeedStatementsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBankFeedStatementsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBankFeedStatementsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBankFeedStatementsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBankFeedStatementsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingBankFeedStatementsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingBankFeedStatementsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingBankFeedStatementsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingBankFeedStatementsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBankFeedStatementsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneRequestBuilder.java index 1ed6cc0f..edd2fb24 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBankFeedStatementsOneRequestBuilder { - - private AccountingBankFeedStatementsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBankFeedStatementsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBankFeedStatementsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBankFeedStatementsOneRequestBuilder request(AccountingBankFeedStatementsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBankFeedStatementsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBankFeedStatementsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBankFeedStatementsOneRequestBuilder request(@Nonnull AccountingBankFeedStatementsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBankFeedStatementsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBankFeedStatementsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBankFeedStatementsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneResponse.java index d84093ec..cd2a3a5c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBankFeedStatementsOneResponse implements Response { /** * Bank Feed Statements */ - private Optional getBankFeedStatementResponse; + private GetBankFeedStatementResponse getBankFeedStatementResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBankFeedStatementsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getBankFeedStatementResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getBankFeedStatementResponse, "getBankFeedStatementResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetBankFeedStatementResponse getBankFeedStatementResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getBankFeedStatementResponse = getBankFeedStatementResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBankFeedStatementsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bank Feed Statements */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getBankFeedStatementResponse() { - return (Optional) getBankFeedStatementResponse; + return Optional.ofNullable(this.getBankFeedStatementResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBankFeedStatementsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBankFeedStatementsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBankFeedStatementsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBankFeedStatementsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bank Feed Statements + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBankFeedStatementsOneResponse withGetBankFeedStatementResponse(GetBankFeedStatementResponse getBankFeedStatementResponse) { - Utils.checkNotNull(getBankFeedStatementResponse, "getBankFeedStatementResponse"); - this.getBankFeedStatementResponse = Optional.ofNullable(getBankFeedStatementResponse); + public AccountingBankFeedStatementsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBankFeedStatementsOneResponse withGetBankFeedStatementResponse( /** * Bank Feed Statements */ - public AccountingBankFeedStatementsOneResponse withGetBankFeedStatementResponse(Optional getBankFeedStatementResponse) { - Utils.checkNotNull(getBankFeedStatementResponse, "getBankFeedStatementResponse"); + public AccountingBankFeedStatementsOneResponse withGetBankFeedStatementResponse(@Nullable GetBankFeedStatementResponse getBankFeedStatementResponse) { this.getBankFeedStatementResponse = getBankFeedStatementResponse; return this; } - /** - * Unexpected error - */ - public AccountingBankFeedStatementsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBankFeedStatementsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBankFeedStatementsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getBankFeedStatementResponse = Optional.empty(); + private GetBankFeedStatementResponse getBankFeedStatementResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bank Feed Statements - */ - public Builder getBankFeedStatementResponse(GetBankFeedStatementResponse getBankFeedStatementResponse) { - Utils.checkNotNull(getBankFeedStatementResponse, "getBankFeedStatementResponse"); - this.getBankFeedStatementResponse = Optional.ofNullable(getBankFeedStatementResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bank Feed Statements */ - public Builder getBankFeedStatementResponse(Optional getBankFeedStatementResponse) { - Utils.checkNotNull(getBankFeedStatementResponse, "getBankFeedStatementResponse"); + public Builder getBankFeedStatementResponse(@Nullable GetBankFeedStatementResponse getBankFeedStatementResponse) { this.getBankFeedStatementResponse = getBankFeedStatementResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBankFeedStatementsOneResponse build() { - return new AccountingBankFeedStatementsOneResponse( contentType, statusCode, rawResponse, getBankFeedStatementResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateRequest.java index 211029a5..e4dbb389 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingBankFeedStatementsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingBankFeedStatementsUpdateRequest { @JsonCreator public AccountingBankFeedStatementsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - BankFeedStatementInput bankFeedStatement) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(bankFeedStatement, "bankFeedStatement"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull BankFeedStatementInput bankFeedStatement) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.bankFeedStatement = bankFeedStatement; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.bankFeedStatement = Optional.ofNullable(bankFeedStatement) + .orElseThrow(() -> new IllegalArgumentException("bankFeedStatement cannot be null")); } public AccountingBankFeedStatementsUpdateRequest( - String id, - BankFeedStatementInput bankFeedStatement) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), bankFeedStatement); + @Nonnull String id, + @Nonnull BankFeedStatementInput bankFeedStatement) { + this(id, null, null, + null, null, bankFeedStatement); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public BankFeedStatementInput bankFeedStatement() { - return bankFeedStatement; + return this.bankFeedStatement; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBankFeedStatementsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBankFeedStatementsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBankFeedStatementsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingBankFeedStatementsUpdateRequest withConsumerId(String consumerI /** * ID of the consumer which you want to get or push data from */ - public AccountingBankFeedStatementsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBankFeedStatementsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBankFeedStatementsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBankFeedStatementsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBankFeedStatementsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBankFeedStatementsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBankFeedStatementsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBankFeedStatementsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBankFeedStatementsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBankFeedStatementsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBankFeedStatementsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingBankFeedStatementsUpdateRequest withBankFeedStatement(BankFeedStatementInput bankFeedStatement) { - Utils.checkNotNull(bankFeedStatement, "bankFeedStatement"); - this.bankFeedStatement = bankFeedStatement; + + public AccountingBankFeedStatementsUpdateRequest withBankFeedStatement(@Nonnull BankFeedStatementInput bankFeedStatement) { + this.bankFeedStatement = Utils.checkNotNull(bankFeedStatement, "bankFeedStatement"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private BankFeedStatementInput bankFeedStatement; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder bankFeedStatement(BankFeedStatementInput bankFeedStatement) { - Utils.checkNotNull(bankFeedStatement, "bankFeedStatement"); - this.bankFeedStatement = bankFeedStatement; + public Builder bankFeedStatement(@Nonnull BankFeedStatementInput bankFeedStatement) { + this.bankFeedStatement = Utils.checkNotNull(bankFeedStatement, "bankFeedStatement"); return this; } public AccountingBankFeedStatementsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBankFeedStatementsUpdateRequest( id, consumerId, appId, serviceId, raw, bankFeedStatement); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateRequestBuilder.java index cc3185a3..18787900 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBankFeedStatementsUpdateRequestBuilder { - - private AccountingBankFeedStatementsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBankFeedStatementsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBankFeedStatementsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBankFeedStatementsUpdateRequestBuilder request(AccountingBankFeedStatementsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBankFeedStatementsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBankFeedStatementsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBankFeedStatementsUpdateRequestBuilder request(@Nonnull AccountingBankFeedStatementsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBankFeedStatementsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBankFeedStatementsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBankFeedStatementsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateResponse.java index 60b0f8e4..f8ea1927 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBankFeedStatementsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBankFeedStatementsUpdateResponse implements Response { /** * Bank Feed Statements */ - private Optional updateBankFeedStatementResponse; + private UpdateBankFeedStatementResponse updateBankFeedStatementResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBankFeedStatementsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateBankFeedStatementResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateBankFeedStatementResponse, "updateBankFeedStatementResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateBankFeedStatementResponse updateBankFeedStatementResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateBankFeedStatementResponse = updateBankFeedStatementResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBankFeedStatementsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bank Feed Statements */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateBankFeedStatementResponse() { - return (Optional) updateBankFeedStatementResponse; + return Optional.ofNullable(this.updateBankFeedStatementResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBankFeedStatementsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBankFeedStatementsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBankFeedStatementsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBankFeedStatementsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bank Feed Statements + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBankFeedStatementsUpdateResponse withUpdateBankFeedStatementResponse(UpdateBankFeedStatementResponse updateBankFeedStatementResponse) { - Utils.checkNotNull(updateBankFeedStatementResponse, "updateBankFeedStatementResponse"); - this.updateBankFeedStatementResponse = Optional.ofNullable(updateBankFeedStatementResponse); + public AccountingBankFeedStatementsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBankFeedStatementsUpdateResponse withUpdateBankFeedStatementRes /** * Bank Feed Statements */ - public AccountingBankFeedStatementsUpdateResponse withUpdateBankFeedStatementResponse(Optional updateBankFeedStatementResponse) { - Utils.checkNotNull(updateBankFeedStatementResponse, "updateBankFeedStatementResponse"); + public AccountingBankFeedStatementsUpdateResponse withUpdateBankFeedStatementResponse(@Nullable UpdateBankFeedStatementResponse updateBankFeedStatementResponse) { this.updateBankFeedStatementResponse = updateBankFeedStatementResponse; return this; } - /** - * Unexpected error - */ - public AccountingBankFeedStatementsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBankFeedStatementsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBankFeedStatementsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateBankFeedStatementResponse = Optional.empty(); + private UpdateBankFeedStatementResponse updateBankFeedStatementResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bank Feed Statements - */ - public Builder updateBankFeedStatementResponse(UpdateBankFeedStatementResponse updateBankFeedStatementResponse) { - Utils.checkNotNull(updateBankFeedStatementResponse, "updateBankFeedStatementResponse"); - this.updateBankFeedStatementResponse = Optional.ofNullable(updateBankFeedStatementResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bank Feed Statements */ - public Builder updateBankFeedStatementResponse(Optional updateBankFeedStatementResponse) { - Utils.checkNotNull(updateBankFeedStatementResponse, "updateBankFeedStatementResponse"); + public Builder updateBankFeedStatementResponse(@Nullable UpdateBankFeedStatementResponse updateBankFeedStatementResponse) { this.updateBankFeedStatementResponse = updateBankFeedStatementResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBankFeedStatementsUpdateResponse build() { - return new AccountingBankFeedStatementsUpdateResponse( contentType, statusCode, rawResponse, updateBankFeedStatementResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddRequest.java index 11c4b88e..f36c24f0 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingBillPaymentsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingBillPaymentsAddRequest { @JsonCreator public AccountingBillPaymentsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - BillPaymentInput billPayment) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(billPayment, "billPayment"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull BillPaymentInput billPayment) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.billPayment = billPayment; + this.billPayment = Optional.ofNullable(billPayment) + .orElseThrow(() -> new IllegalArgumentException("billPayment cannot be null")); } public AccountingBillPaymentsAddRequest( - BillPaymentInput billPayment) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), billPayment); + @Nonnull BillPaymentInput billPayment) { + this(null, null, null, + null, billPayment); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public BillPaymentInput billPayment() { - return billPayment; + return this.billPayment; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBillPaymentsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBillPaymentsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBillPaymentsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBillPaymentsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingBillPaymentsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBillPaymentsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBillPaymentsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBillPaymentsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBillPaymentsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBillPaymentsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBillPaymentsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBillPaymentsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingBillPaymentsAddRequest withBillPayment(BillPaymentInput billPayment) { - Utils.checkNotNull(billPayment, "billPayment"); - this.billPayment = billPayment; + + public AccountingBillPaymentsAddRequest withBillPayment(@Nonnull BillPaymentInput billPayment) { + this.billPayment = Utils.checkNotNull(billPayment, "billPayment"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private BillPaymentInput billPayment; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder billPayment(BillPaymentInput billPayment) { - Utils.checkNotNull(billPayment, "billPayment"); - this.billPayment = billPayment; + public Builder billPayment(@Nonnull BillPaymentInput billPayment) { + this.billPayment = Utils.checkNotNull(billPayment, "billPayment"); return this; } public AccountingBillPaymentsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBillPaymentsAddRequest( raw, consumerId, appId, serviceId, billPayment); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddRequestBuilder.java index b6d519e3..1add980d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBillPaymentsAddRequestBuilder { - - private AccountingBillPaymentsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBillPaymentsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBillPaymentsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBillPaymentsAddRequestBuilder request(AccountingBillPaymentsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBillPaymentsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBillPaymentsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBillPaymentsAddRequestBuilder request(@Nonnull AccountingBillPaymentsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBillPaymentsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBillPaymentsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBillPaymentsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddResponse.java index 069e0517..ae90c03d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBillPaymentsAddResponse implements Response { /** * Bill Payment created */ - private Optional createBillPaymentResponse; + private CreateBillPaymentResponse createBillPaymentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBillPaymentsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createBillPaymentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createBillPaymentResponse, "createBillPaymentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateBillPaymentResponse createBillPaymentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createBillPaymentResponse = createBillPaymentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBillPaymentsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bill Payment created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createBillPaymentResponse() { - return (Optional) createBillPaymentResponse; + return Optional.ofNullable(this.createBillPaymentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBillPaymentsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBillPaymentsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBillPaymentsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBillPaymentsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bill Payment created + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBillPaymentsAddResponse withCreateBillPaymentResponse(CreateBillPaymentResponse createBillPaymentResponse) { - Utils.checkNotNull(createBillPaymentResponse, "createBillPaymentResponse"); - this.createBillPaymentResponse = Optional.ofNullable(createBillPaymentResponse); + public AccountingBillPaymentsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBillPaymentsAddResponse withCreateBillPaymentResponse(CreateBil /** * Bill Payment created */ - public AccountingBillPaymentsAddResponse withCreateBillPaymentResponse(Optional createBillPaymentResponse) { - Utils.checkNotNull(createBillPaymentResponse, "createBillPaymentResponse"); + public AccountingBillPaymentsAddResponse withCreateBillPaymentResponse(@Nullable CreateBillPaymentResponse createBillPaymentResponse) { this.createBillPaymentResponse = createBillPaymentResponse; return this; } - /** - * Unexpected error - */ - public AccountingBillPaymentsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBillPaymentsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBillPaymentsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createBillPaymentResponse = Optional.empty(); + private CreateBillPaymentResponse createBillPaymentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bill Payment created - */ - public Builder createBillPaymentResponse(CreateBillPaymentResponse createBillPaymentResponse) { - Utils.checkNotNull(createBillPaymentResponse, "createBillPaymentResponse"); - this.createBillPaymentResponse = Optional.ofNullable(createBillPaymentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bill Payment created */ - public Builder createBillPaymentResponse(Optional createBillPaymentResponse) { - Utils.checkNotNull(createBillPaymentResponse, "createBillPaymentResponse"); + public Builder createBillPaymentResponse(@Nullable CreateBillPaymentResponse createBillPaymentResponse) { this.createBillPaymentResponse = createBillPaymentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBillPaymentsAddResponse build() { - return new AccountingBillPaymentsAddResponse( contentType, statusCode, rawResponse, createBillPaymentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllRequest.java index 0531ac47..f532de10 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingBillPaymentsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class AccountingBillPaymentsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private PaymentsFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private PaymentsSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class AccountingBillPaymentsAllRequest { @JsonCreator public AccountingBillPaymentsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable PaymentsFilter filter, + @Nullable PaymentsSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingBillPaymentsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBillPaymentsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBillPaymentsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBillPaymentsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBillPaymentsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingBillPaymentsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBillPaymentsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBillPaymentsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBillPaymentsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBillPaymentsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBillPaymentsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBillPaymentsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBillPaymentsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingBillPaymentsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingBillPaymentsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingBillPaymentsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingBillPaymentsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public AccountingBillPaymentsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingBillPaymentsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingBillPaymentsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingBillPaymentsAllRequest withFilter(PaymentsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingBillPaymentsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingBillPaymentsAllRequest withFilter(@Nullable PaymentsFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingBillPaymentsAllRequest withSort(PaymentsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingBillPaymentsAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingBillPaymentsAllRequest withSort(@Nullable PaymentsSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingBillPaymentsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingBillPaymentsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingBillPaymentsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingBillPaymentsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingBillPaymentsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingBillPaymentsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private PaymentsFilter filter; - private Optional sort = Optional.empty(); + private PaymentsSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(PaymentsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable PaymentsFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(PaymentsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable PaymentsSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingBillPaymentsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingBillPaymentsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public AccountingBillPaymentsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllRequestBuilder.java index 10e5f3a3..ae01b976 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingBillPaymentsAllRequestBuilder { - - private AccountingBillPaymentsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBillPaymentsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBillPaymentsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBillPaymentsAllRequestBuilder request(AccountingBillPaymentsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBillPaymentsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBillPaymentsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBillPaymentsAllRequestBuilder request(@Nonnull AccountingBillPaymentsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBillPaymentsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBillPaymentsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBillPaymentsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingBillPaymentsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingBillPaymentsAllOperation( - sdkConfiguration, - options); + AccountingBillPaymentsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingBillPaymentsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingBillPaymentsAllRequest::withCursor, + AccountingBillPaymentsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllResponse.java index d1069b44..aac91467 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBillPaymentsAllResponse implements Response { /** * Bill Payments */ - private Optional getBillPaymentsResponse; + private GetBillPaymentsResponse getBillPaymentsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBillPaymentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getBillPaymentsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getBillPaymentsResponse, "getBillPaymentsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetBillPaymentsResponse getBillPaymentsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getBillPaymentsResponse = getBillPaymentsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBillPaymentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bill Payments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getBillPaymentsResponse() { - return (Optional) getBillPaymentsResponse; + return Optional.ofNullable(this.getBillPaymentsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBillPaymentsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBillPaymentsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBillPaymentsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBillPaymentsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bill Payments + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBillPaymentsAllResponse withGetBillPaymentsResponse(GetBillPaymentsResponse getBillPaymentsResponse) { - Utils.checkNotNull(getBillPaymentsResponse, "getBillPaymentsResponse"); - this.getBillPaymentsResponse = Optional.ofNullable(getBillPaymentsResponse); + public AccountingBillPaymentsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBillPaymentsAllResponse withGetBillPaymentsResponse(GetBillPaym /** * Bill Payments */ - public AccountingBillPaymentsAllResponse withGetBillPaymentsResponse(Optional getBillPaymentsResponse) { - Utils.checkNotNull(getBillPaymentsResponse, "getBillPaymentsResponse"); + public AccountingBillPaymentsAllResponse withGetBillPaymentsResponse(@Nullable GetBillPaymentsResponse getBillPaymentsResponse) { this.getBillPaymentsResponse = getBillPaymentsResponse; return this; } - /** - * Unexpected error - */ - public AccountingBillPaymentsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBillPaymentsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBillPaymentsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getBillPaymentsResponse = Optional.empty(); + private GetBillPaymentsResponse getBillPaymentsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bill Payments - */ - public Builder getBillPaymentsResponse(GetBillPaymentsResponse getBillPaymentsResponse) { - Utils.checkNotNull(getBillPaymentsResponse, "getBillPaymentsResponse"); - this.getBillPaymentsResponse = Optional.ofNullable(getBillPaymentsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bill Payments */ - public Builder getBillPaymentsResponse(Optional getBillPaymentsResponse) { - Utils.checkNotNull(getBillPaymentsResponse, "getBillPaymentsResponse"); + public Builder getBillPaymentsResponse(@Nullable GetBillPaymentsResponse getBillPaymentsResponse) { this.getBillPaymentsResponse = getBillPaymentsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBillPaymentsAllResponse build() { - return new AccountingBillPaymentsAllResponse( contentType, statusCode, rawResponse, getBillPaymentsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteRequest.java index 2275c03f..ec545182 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingBillPaymentsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingBillPaymentsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingBillPaymentsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBillPaymentsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBillPaymentsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBillPaymentsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingBillPaymentsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingBillPaymentsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBillPaymentsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBillPaymentsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBillPaymentsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBillPaymentsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBillPaymentsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBillPaymentsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBillPaymentsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBillPaymentsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBillPaymentsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBillPaymentsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingBillPaymentsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBillPaymentsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteRequestBuilder.java index a48af9b0..e0b9bbe0 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBillPaymentsDeleteRequestBuilder { - - private AccountingBillPaymentsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBillPaymentsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBillPaymentsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBillPaymentsDeleteRequestBuilder request(AccountingBillPaymentsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBillPaymentsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBillPaymentsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBillPaymentsDeleteRequestBuilder request(@Nonnull AccountingBillPaymentsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBillPaymentsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBillPaymentsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBillPaymentsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteResponse.java index 71903270..c988849f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBillPaymentsDeleteResponse implements Response { /** * Bill Payment deleted */ - private Optional deleteBillPaymentResponse; + private DeleteBillPaymentResponse deleteBillPaymentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBillPaymentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteBillPaymentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteBillPaymentResponse, "deleteBillPaymentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteBillPaymentResponse deleteBillPaymentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteBillPaymentResponse = deleteBillPaymentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBillPaymentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bill Payment deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteBillPaymentResponse() { - return (Optional) deleteBillPaymentResponse; + return Optional.ofNullable(this.deleteBillPaymentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBillPaymentsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBillPaymentsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBillPaymentsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBillPaymentsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bill Payment deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBillPaymentsDeleteResponse withDeleteBillPaymentResponse(DeleteBillPaymentResponse deleteBillPaymentResponse) { - Utils.checkNotNull(deleteBillPaymentResponse, "deleteBillPaymentResponse"); - this.deleteBillPaymentResponse = Optional.ofNullable(deleteBillPaymentResponse); + public AccountingBillPaymentsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBillPaymentsDeleteResponse withDeleteBillPaymentResponse(Delete /** * Bill Payment deleted */ - public AccountingBillPaymentsDeleteResponse withDeleteBillPaymentResponse(Optional deleteBillPaymentResponse) { - Utils.checkNotNull(deleteBillPaymentResponse, "deleteBillPaymentResponse"); + public AccountingBillPaymentsDeleteResponse withDeleteBillPaymentResponse(@Nullable DeleteBillPaymentResponse deleteBillPaymentResponse) { this.deleteBillPaymentResponse = deleteBillPaymentResponse; return this; } - /** - * Unexpected error - */ - public AccountingBillPaymentsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBillPaymentsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBillPaymentsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteBillPaymentResponse = Optional.empty(); + private DeleteBillPaymentResponse deleteBillPaymentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bill Payment deleted - */ - public Builder deleteBillPaymentResponse(DeleteBillPaymentResponse deleteBillPaymentResponse) { - Utils.checkNotNull(deleteBillPaymentResponse, "deleteBillPaymentResponse"); - this.deleteBillPaymentResponse = Optional.ofNullable(deleteBillPaymentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bill Payment deleted */ - public Builder deleteBillPaymentResponse(Optional deleteBillPaymentResponse) { - Utils.checkNotNull(deleteBillPaymentResponse, "deleteBillPaymentResponse"); + public Builder deleteBillPaymentResponse(@Nullable DeleteBillPaymentResponse deleteBillPaymentResponse) { this.deleteBillPaymentResponse = deleteBillPaymentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBillPaymentsDeleteResponse build() { - return new AccountingBillPaymentsDeleteResponse( contentType, statusCode, rawResponse, deleteBillPaymentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneRequest.java index 3e893b6c..6cd230fb 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingBillPaymentsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingBillPaymentsOneRequest { @JsonCreator public AccountingBillPaymentsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingBillPaymentsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBillPaymentsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBillPaymentsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBillPaymentsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingBillPaymentsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingBillPaymentsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBillPaymentsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBillPaymentsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBillPaymentsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBillPaymentsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBillPaymentsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBillPaymentsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBillPaymentsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBillPaymentsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBillPaymentsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBillPaymentsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingBillPaymentsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingBillPaymentsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingBillPaymentsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingBillPaymentsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBillPaymentsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneRequestBuilder.java index d676bbe0..e9ae5a8a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBillPaymentsOneRequestBuilder { - - private AccountingBillPaymentsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBillPaymentsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBillPaymentsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBillPaymentsOneRequestBuilder request(AccountingBillPaymentsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBillPaymentsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBillPaymentsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBillPaymentsOneRequestBuilder request(@Nonnull AccountingBillPaymentsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBillPaymentsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBillPaymentsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBillPaymentsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneResponse.java index 259a4804..0664244c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBillPaymentsOneResponse implements Response { /** * Bill Payment */ - private Optional getBillPaymentResponse; + private GetBillPaymentResponse getBillPaymentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBillPaymentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getBillPaymentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getBillPaymentResponse, "getBillPaymentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetBillPaymentResponse getBillPaymentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getBillPaymentResponse = getBillPaymentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBillPaymentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bill Payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getBillPaymentResponse() { - return (Optional) getBillPaymentResponse; + return Optional.ofNullable(this.getBillPaymentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBillPaymentsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBillPaymentsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBillPaymentsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBillPaymentsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bill Payment + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBillPaymentsOneResponse withGetBillPaymentResponse(GetBillPaymentResponse getBillPaymentResponse) { - Utils.checkNotNull(getBillPaymentResponse, "getBillPaymentResponse"); - this.getBillPaymentResponse = Optional.ofNullable(getBillPaymentResponse); + public AccountingBillPaymentsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBillPaymentsOneResponse withGetBillPaymentResponse(GetBillPayme /** * Bill Payment */ - public AccountingBillPaymentsOneResponse withGetBillPaymentResponse(Optional getBillPaymentResponse) { - Utils.checkNotNull(getBillPaymentResponse, "getBillPaymentResponse"); + public AccountingBillPaymentsOneResponse withGetBillPaymentResponse(@Nullable GetBillPaymentResponse getBillPaymentResponse) { this.getBillPaymentResponse = getBillPaymentResponse; return this; } - /** - * Unexpected error - */ - public AccountingBillPaymentsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBillPaymentsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBillPaymentsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getBillPaymentResponse = Optional.empty(); + private GetBillPaymentResponse getBillPaymentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bill Payment - */ - public Builder getBillPaymentResponse(GetBillPaymentResponse getBillPaymentResponse) { - Utils.checkNotNull(getBillPaymentResponse, "getBillPaymentResponse"); - this.getBillPaymentResponse = Optional.ofNullable(getBillPaymentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bill Payment */ - public Builder getBillPaymentResponse(Optional getBillPaymentResponse) { - Utils.checkNotNull(getBillPaymentResponse, "getBillPaymentResponse"); + public Builder getBillPaymentResponse(@Nullable GetBillPaymentResponse getBillPaymentResponse) { this.getBillPaymentResponse = getBillPaymentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBillPaymentsOneResponse build() { - return new AccountingBillPaymentsOneResponse( contentType, statusCode, rawResponse, getBillPaymentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateRequest.java index 5dfa5f3b..c8a1ee30 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingBillPaymentsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingBillPaymentsUpdateRequest { @JsonCreator public AccountingBillPaymentsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - BillPaymentInput billPayment) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(billPayment, "billPayment"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull BillPaymentInput billPayment) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.billPayment = billPayment; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.billPayment = Optional.ofNullable(billPayment) + .orElseThrow(() -> new IllegalArgumentException("billPayment cannot be null")); } public AccountingBillPaymentsUpdateRequest( - String id, - BillPaymentInput billPayment) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), billPayment); + @Nonnull String id, + @Nonnull BillPaymentInput billPayment) { + this(id, null, null, + null, null, billPayment); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public BillPaymentInput billPayment() { - return billPayment; + return this.billPayment; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBillPaymentsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBillPaymentsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBillPaymentsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingBillPaymentsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingBillPaymentsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBillPaymentsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBillPaymentsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBillPaymentsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBillPaymentsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBillPaymentsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBillPaymentsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBillPaymentsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBillPaymentsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBillPaymentsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBillPaymentsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingBillPaymentsUpdateRequest withBillPayment(BillPaymentInput billPayment) { - Utils.checkNotNull(billPayment, "billPayment"); - this.billPayment = billPayment; + + public AccountingBillPaymentsUpdateRequest withBillPayment(@Nonnull BillPaymentInput billPayment) { + this.billPayment = Utils.checkNotNull(billPayment, "billPayment"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private BillPaymentInput billPayment; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder billPayment(BillPaymentInput billPayment) { - Utils.checkNotNull(billPayment, "billPayment"); - this.billPayment = billPayment; + public Builder billPayment(@Nonnull BillPaymentInput billPayment) { + this.billPayment = Utils.checkNotNull(billPayment, "billPayment"); return this; } public AccountingBillPaymentsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBillPaymentsUpdateRequest( id, consumerId, appId, serviceId, raw, billPayment); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateRequestBuilder.java index 09b6bd3b..19762db6 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBillPaymentsUpdateRequestBuilder { - - private AccountingBillPaymentsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBillPaymentsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBillPaymentsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBillPaymentsUpdateRequestBuilder request(AccountingBillPaymentsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBillPaymentsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBillPaymentsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBillPaymentsUpdateRequestBuilder request(@Nonnull AccountingBillPaymentsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBillPaymentsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBillPaymentsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBillPaymentsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateResponse.java index 0f47db0f..d0a5150b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillPaymentsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBillPaymentsUpdateResponse implements Response { /** * Bill Payment updated */ - private Optional updateBillPaymentResponse; + private UpdateBillPaymentResponse updateBillPaymentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBillPaymentsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateBillPaymentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateBillPaymentResponse, "updateBillPaymentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateBillPaymentResponse updateBillPaymentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateBillPaymentResponse = updateBillPaymentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBillPaymentsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bill Payment updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateBillPaymentResponse() { - return (Optional) updateBillPaymentResponse; + return Optional.ofNullable(this.updateBillPaymentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBillPaymentsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBillPaymentsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBillPaymentsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBillPaymentsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bill Payment updated + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBillPaymentsUpdateResponse withUpdateBillPaymentResponse(UpdateBillPaymentResponse updateBillPaymentResponse) { - Utils.checkNotNull(updateBillPaymentResponse, "updateBillPaymentResponse"); - this.updateBillPaymentResponse = Optional.ofNullable(updateBillPaymentResponse); + public AccountingBillPaymentsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBillPaymentsUpdateResponse withUpdateBillPaymentResponse(Update /** * Bill Payment updated */ - public AccountingBillPaymentsUpdateResponse withUpdateBillPaymentResponse(Optional updateBillPaymentResponse) { - Utils.checkNotNull(updateBillPaymentResponse, "updateBillPaymentResponse"); + public AccountingBillPaymentsUpdateResponse withUpdateBillPaymentResponse(@Nullable UpdateBillPaymentResponse updateBillPaymentResponse) { this.updateBillPaymentResponse = updateBillPaymentResponse; return this; } - /** - * Unexpected error - */ - public AccountingBillPaymentsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBillPaymentsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBillPaymentsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateBillPaymentResponse = Optional.empty(); + private UpdateBillPaymentResponse updateBillPaymentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bill Payment updated - */ - public Builder updateBillPaymentResponse(UpdateBillPaymentResponse updateBillPaymentResponse) { - Utils.checkNotNull(updateBillPaymentResponse, "updateBillPaymentResponse"); - this.updateBillPaymentResponse = Optional.ofNullable(updateBillPaymentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bill Payment updated */ - public Builder updateBillPaymentResponse(Optional updateBillPaymentResponse) { - Utils.checkNotNull(updateBillPaymentResponse, "updateBillPaymentResponse"); + public Builder updateBillPaymentResponse(@Nullable UpdateBillPaymentResponse updateBillPaymentResponse) { this.updateBillPaymentResponse = updateBillPaymentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBillPaymentsUpdateResponse build() { - return new AccountingBillPaymentsUpdateResponse( contentType, statusCode, rawResponse, updateBillPaymentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddRequest.java index 33bbd0b4..607f1cbf 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingBillsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingBillsAddRequest { @JsonCreator public AccountingBillsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - BillInput bill) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(bill, "bill"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull BillInput bill) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.bill = bill; + this.bill = Optional.ofNullable(bill) + .orElseThrow(() -> new IllegalArgumentException("bill cannot be null")); } public AccountingBillsAddRequest( - BillInput bill) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), bill); + @Nonnull BillInput bill) { + this(null, null, null, + null, bill); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public BillInput bill() { - return bill; + return this.bill; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBillsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBillsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBillsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBillsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingBillsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBillsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBillsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBillsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBillsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBillsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBillsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBillsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingBillsAddRequest withBill(BillInput bill) { - Utils.checkNotNull(bill, "bill"); - this.bill = bill; + + public AccountingBillsAddRequest withBill(@Nonnull BillInput bill) { + this.bill = Utils.checkNotNull(bill, "bill"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private BillInput bill; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder bill(BillInput bill) { - Utils.checkNotNull(bill, "bill"); - this.bill = bill; + public Builder bill(@Nonnull BillInput bill) { + this.bill = Utils.checkNotNull(bill, "bill"); return this; } public AccountingBillsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBillsAddRequest( raw, consumerId, appId, serviceId, bill); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddRequestBuilder.java index 85163da5..eac12942 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBillsAddRequestBuilder { - - private AccountingBillsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBillsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBillsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBillsAddRequestBuilder request(AccountingBillsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBillsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBillsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBillsAddRequestBuilder request(@Nonnull AccountingBillsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBillsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBillsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBillsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddResponse.java index dfd73b58..3ff15ec3 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBillsAddResponse implements Response { /** * Bill created */ - private Optional createBillResponse; + private CreateBillResponse createBillResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBillsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createBillResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createBillResponse, "createBillResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateBillResponse createBillResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createBillResponse = createBillResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBillsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bill created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createBillResponse() { - return (Optional) createBillResponse; + return Optional.ofNullable(this.createBillResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBillsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBillsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBillsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBillsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bill created + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBillsAddResponse withCreateBillResponse(CreateBillResponse createBillResponse) { - Utils.checkNotNull(createBillResponse, "createBillResponse"); - this.createBillResponse = Optional.ofNullable(createBillResponse); + public AccountingBillsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBillsAddResponse withCreateBillResponse(CreateBillResponse crea /** * Bill created */ - public AccountingBillsAddResponse withCreateBillResponse(Optional createBillResponse) { - Utils.checkNotNull(createBillResponse, "createBillResponse"); + public AccountingBillsAddResponse withCreateBillResponse(@Nullable CreateBillResponse createBillResponse) { this.createBillResponse = createBillResponse; return this; } - /** - * Unexpected error - */ - public AccountingBillsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBillsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBillsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createBillResponse = Optional.empty(); + private CreateBillResponse createBillResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bill created - */ - public Builder createBillResponse(CreateBillResponse createBillResponse) { - Utils.checkNotNull(createBillResponse, "createBillResponse"); - this.createBillResponse = Optional.ofNullable(createBillResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bill created */ - public Builder createBillResponse(Optional createBillResponse) { - Utils.checkNotNull(createBillResponse, "createBillResponse"); + public Builder createBillResponse(@Nullable CreateBillResponse createBillResponse) { this.createBillResponse = createBillResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBillsAddResponse build() { - return new AccountingBillsAddResponse( contentType, statusCode, rawResponse, createBillResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllRequest.java index 6d8419cb..cce86bec 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingBillsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class AccountingBillsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private BillsFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private BillsSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class AccountingBillsAllRequest { @JsonCreator public AccountingBillsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable BillsFilter filter, + @Nullable BillsSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingBillsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBillsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBillsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBillsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBillsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingBillsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBillsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBillsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBillsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBillsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBillsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBillsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBillsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingBillsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingBillsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingBillsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingBillsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public AccountingBillsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingBillsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingBillsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingBillsAllRequest withFilter(BillsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingBillsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingBillsAllRequest withFilter(@Nullable BillsFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingBillsAllRequest withSort(BillsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingBillsAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingBillsAllRequest withSort(@Nullable BillsSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingBillsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingBillsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingBillsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingBillsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingBillsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingBillsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private BillsFilter filter; - private Optional sort = Optional.empty(); + private BillsSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(BillsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable BillsFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(BillsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable BillsSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingBillsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingBillsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public AccountingBillsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllRequestBuilder.java index 185e802b..e59d9595 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingBillsAllRequestBuilder { - - private AccountingBillsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBillsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBillsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBillsAllRequestBuilder request(AccountingBillsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBillsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBillsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBillsAllRequestBuilder request(@Nonnull AccountingBillsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBillsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBillsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBillsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingBillsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingBillsAllOperation( - sdkConfiguration, - options); + AccountingBillsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingBillsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingBillsAllRequest::withCursor, + AccountingBillsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllResponse.java index 1a72267b..74e5a572 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBillsAllResponse implements Response { /** * Bills */ - private Optional getBillsResponse; + private GetBillsResponse getBillsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBillsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getBillsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getBillsResponse, "getBillsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetBillsResponse getBillsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getBillsResponse = getBillsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBillsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bills */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getBillsResponse() { - return (Optional) getBillsResponse; + return Optional.ofNullable(this.getBillsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBillsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBillsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBillsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBillsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bills + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBillsAllResponse withGetBillsResponse(GetBillsResponse getBillsResponse) { - Utils.checkNotNull(getBillsResponse, "getBillsResponse"); - this.getBillsResponse = Optional.ofNullable(getBillsResponse); + public AccountingBillsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBillsAllResponse withGetBillsResponse(GetBillsResponse getBills /** * Bills */ - public AccountingBillsAllResponse withGetBillsResponse(Optional getBillsResponse) { - Utils.checkNotNull(getBillsResponse, "getBillsResponse"); + public AccountingBillsAllResponse withGetBillsResponse(@Nullable GetBillsResponse getBillsResponse) { this.getBillsResponse = getBillsResponse; return this; } - /** - * Unexpected error - */ - public AccountingBillsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBillsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBillsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getBillsResponse = Optional.empty(); + private GetBillsResponse getBillsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bills - */ - public Builder getBillsResponse(GetBillsResponse getBillsResponse) { - Utils.checkNotNull(getBillsResponse, "getBillsResponse"); - this.getBillsResponse = Optional.ofNullable(getBillsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bills */ - public Builder getBillsResponse(Optional getBillsResponse) { - Utils.checkNotNull(getBillsResponse, "getBillsResponse"); + public Builder getBillsResponse(@Nullable GetBillsResponse getBillsResponse) { this.getBillsResponse = getBillsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBillsAllResponse build() { - return new AccountingBillsAllResponse( contentType, statusCode, rawResponse, getBillsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteRequest.java index f5178261..addc8815 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingBillsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingBillsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingBillsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBillsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBillsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBillsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingBillsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingBillsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBillsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBillsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBillsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBillsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBillsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBillsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBillsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBillsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBillsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBillsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingBillsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBillsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteRequestBuilder.java index 12c65b8a..fbad1a81 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBillsDeleteRequestBuilder { - - private AccountingBillsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBillsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBillsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBillsDeleteRequestBuilder request(AccountingBillsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBillsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBillsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBillsDeleteRequestBuilder request(@Nonnull AccountingBillsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBillsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBillsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBillsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteResponse.java index a11b5f5d..2830f928 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBillsDeleteResponse implements Response { /** * Bill deleted */ - private Optional deleteBillResponse; + private DeleteBillResponse deleteBillResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBillsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteBillResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteBillResponse, "deleteBillResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteBillResponse deleteBillResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteBillResponse = deleteBillResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBillsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bill deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteBillResponse() { - return (Optional) deleteBillResponse; + return Optional.ofNullable(this.deleteBillResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBillsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBillsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBillsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBillsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bill deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBillsDeleteResponse withDeleteBillResponse(DeleteBillResponse deleteBillResponse) { - Utils.checkNotNull(deleteBillResponse, "deleteBillResponse"); - this.deleteBillResponse = Optional.ofNullable(deleteBillResponse); + public AccountingBillsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBillsDeleteResponse withDeleteBillResponse(DeleteBillResponse d /** * Bill deleted */ - public AccountingBillsDeleteResponse withDeleteBillResponse(Optional deleteBillResponse) { - Utils.checkNotNull(deleteBillResponse, "deleteBillResponse"); + public AccountingBillsDeleteResponse withDeleteBillResponse(@Nullable DeleteBillResponse deleteBillResponse) { this.deleteBillResponse = deleteBillResponse; return this; } - /** - * Unexpected error - */ - public AccountingBillsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBillsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBillsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteBillResponse = Optional.empty(); + private DeleteBillResponse deleteBillResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bill deleted - */ - public Builder deleteBillResponse(DeleteBillResponse deleteBillResponse) { - Utils.checkNotNull(deleteBillResponse, "deleteBillResponse"); - this.deleteBillResponse = Optional.ofNullable(deleteBillResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bill deleted */ - public Builder deleteBillResponse(Optional deleteBillResponse) { - Utils.checkNotNull(deleteBillResponse, "deleteBillResponse"); + public Builder deleteBillResponse(@Nullable DeleteBillResponse deleteBillResponse) { this.deleteBillResponse = deleteBillResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBillsDeleteResponse build() { - return new AccountingBillsDeleteResponse( contentType, statusCode, rawResponse, deleteBillResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneRequest.java index f089fc86..250fdfb2 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingBillsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingBillsOneRequest { @JsonCreator public AccountingBillsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingBillsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBillsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBillsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBillsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingBillsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingBillsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBillsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBillsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBillsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBillsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBillsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBillsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBillsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBillsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBillsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBillsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingBillsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingBillsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingBillsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingBillsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBillsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneRequestBuilder.java index f2af9070..656af2a5 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBillsOneRequestBuilder { - - private AccountingBillsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBillsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBillsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBillsOneRequestBuilder request(AccountingBillsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBillsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBillsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBillsOneRequestBuilder request(@Nonnull AccountingBillsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBillsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBillsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBillsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneResponse.java index 7ce22442..1c8684cf 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBillsOneResponse implements Response { /** * Bill */ - private Optional getBillResponse; + private GetBillResponse getBillResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBillsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getBillResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getBillResponse, "getBillResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetBillResponse getBillResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getBillResponse = getBillResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBillsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bill */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getBillResponse() { - return (Optional) getBillResponse; + return Optional.ofNullable(this.getBillResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBillsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBillsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBillsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBillsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bill + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBillsOneResponse withGetBillResponse(GetBillResponse getBillResponse) { - Utils.checkNotNull(getBillResponse, "getBillResponse"); - this.getBillResponse = Optional.ofNullable(getBillResponse); + public AccountingBillsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBillsOneResponse withGetBillResponse(GetBillResponse getBillRes /** * Bill */ - public AccountingBillsOneResponse withGetBillResponse(Optional getBillResponse) { - Utils.checkNotNull(getBillResponse, "getBillResponse"); + public AccountingBillsOneResponse withGetBillResponse(@Nullable GetBillResponse getBillResponse) { this.getBillResponse = getBillResponse; return this; } - /** - * Unexpected error - */ - public AccountingBillsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBillsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBillsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getBillResponse = Optional.empty(); + private GetBillResponse getBillResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bill - */ - public Builder getBillResponse(GetBillResponse getBillResponse) { - Utils.checkNotNull(getBillResponse, "getBillResponse"); - this.getBillResponse = Optional.ofNullable(getBillResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bill */ - public Builder getBillResponse(Optional getBillResponse) { - Utils.checkNotNull(getBillResponse, "getBillResponse"); + public Builder getBillResponse(@Nullable GetBillResponse getBillResponse) { this.getBillResponse = getBillResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBillsOneResponse build() { - return new AccountingBillsOneResponse( contentType, statusCode, rawResponse, getBillResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateRequest.java index 7b94fbb0..68782fa8 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingBillsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingBillsUpdateRequest { @JsonCreator public AccountingBillsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - BillInput bill) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(bill, "bill"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull BillInput bill) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.bill = bill; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.bill = Optional.ofNullable(bill) + .orElseThrow(() -> new IllegalArgumentException("bill cannot be null")); } public AccountingBillsUpdateRequest( - String id, - BillInput bill) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), bill); + @Nonnull String id, + @Nonnull BillInput bill) { + this(id, null, null, + null, null, bill); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public BillInput bill() { - return bill; + return this.bill; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingBillsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingBillsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingBillsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingBillsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingBillsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingBillsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingBillsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingBillsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingBillsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingBillsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingBillsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingBillsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingBillsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingBillsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingBillsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingBillsUpdateRequest withBill(BillInput bill) { - Utils.checkNotNull(bill, "bill"); - this.bill = bill; + + public AccountingBillsUpdateRequest withBill(@Nonnull BillInput bill) { + this.bill = Utils.checkNotNull(bill, "bill"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private BillInput bill; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder bill(BillInput bill) { - Utils.checkNotNull(bill, "bill"); - this.bill = bill; + public Builder bill(@Nonnull BillInput bill) { + this.bill = Utils.checkNotNull(bill, "bill"); return this; } public AccountingBillsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingBillsUpdateRequest( id, consumerId, appId, serviceId, raw, bill); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateRequestBuilder.java index c6781b81..9928d46f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingBillsUpdateRequestBuilder { - - private AccountingBillsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingBillsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingBillsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingBillsUpdateRequestBuilder request(AccountingBillsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingBillsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingBillsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingBillsUpdateRequestBuilder request(@Nonnull AccountingBillsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingBillsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingBillsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingBillsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateResponse.java index 4e02cc03..061d2667 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingBillsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingBillsUpdateResponse implements Response { /** * Bill Updated */ - private Optional updateBillResponse; + private UpdateBillResponse updateBillResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingBillsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateBillResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateBillResponse, "updateBillResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateBillResponse updateBillResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateBillResponse = updateBillResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingBillsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Bill Updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateBillResponse() { - return (Optional) updateBillResponse; + return Optional.ofNullable(this.updateBillResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingBillsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingBillsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingBillsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingBillsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Bill Updated + * Raw HTTP response; suitable for custom response parsing */ - public AccountingBillsUpdateResponse withUpdateBillResponse(UpdateBillResponse updateBillResponse) { - Utils.checkNotNull(updateBillResponse, "updateBillResponse"); - this.updateBillResponse = Optional.ofNullable(updateBillResponse); + public AccountingBillsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingBillsUpdateResponse withUpdateBillResponse(UpdateBillResponse u /** * Bill Updated */ - public AccountingBillsUpdateResponse withUpdateBillResponse(Optional updateBillResponse) { - Utils.checkNotNull(updateBillResponse, "updateBillResponse"); + public AccountingBillsUpdateResponse withUpdateBillResponse(@Nullable UpdateBillResponse updateBillResponse) { this.updateBillResponse = updateBillResponse; return this; } - /** - * Unexpected error - */ - public AccountingBillsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingBillsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingBillsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateBillResponse = Optional.empty(); + private UpdateBillResponse updateBillResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Bill Updated - */ - public Builder updateBillResponse(UpdateBillResponse updateBillResponse) { - Utils.checkNotNull(updateBillResponse, "updateBillResponse"); - this.updateBillResponse = Optional.ofNullable(updateBillResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Bill Updated */ - public Builder updateBillResponse(Optional updateBillResponse) { - Utils.checkNotNull(updateBillResponse, "updateBillResponse"); + public Builder updateBillResponse(@Nullable UpdateBillResponse updateBillResponse) { this.updateBillResponse = updateBillResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingBillsUpdateResponse build() { - return new AccountingBillsUpdateResponse( contentType, statusCode, rawResponse, updateBillResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllRequest.java index 4e3d92ac..ee5091cd 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllRequest.java @@ -3,12 +3,13 @@ */ package com.apideck.unify.models.operations; +import com.apideck.unify.models.components.CategoriesFilter; import com.apideck.unify.utils.LazySingletonValue; import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; @@ -22,25 +23,25 @@ public class AccountingCategoriesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -52,7 +53,7 @@ public class AccountingCategoriesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -60,198 +61,144 @@ public class AccountingCategoriesAllRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=fields") private JsonNullable fields; + /** + * Apply filters + */ + @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") + private CategoriesFilter filter; + @JsonCreator public AccountingCategoriesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable JsonNullable fields, + @Nullable CategoriesFilter filter) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; - this.fields = fields; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); + this.filter = filter; } public AccountingCategoriesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } - public static Builder builder() { - return new Builder(); - } - - /** - * Include raw response. Mostly used for debugging purposes + * Apply filters */ - public AccountingCategoriesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; + public Optional filter() { + return Optional.ofNullable(this.filter); + } + + public static Builder builder() { + return new Builder(); } /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCategoriesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCategoriesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCategoriesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingCategoriesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCategoriesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCategoriesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCategoriesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCategoriesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCategoriesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCategoriesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCategoriesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingCategoriesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingCategoriesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingCategoriesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingCategoriesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -259,30 +206,30 @@ public AccountingCategoriesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingCategoriesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingCategoriesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingCategoriesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingCategoriesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } + /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. + * Apply filters */ - public AccountingCategoriesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; + public AccountingCategoriesAllRequest withFilter(@Nullable CategoriesFilter filter) { + this.filter = filter; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -299,7 +246,8 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && Utils.enhancedDeepEquals(this.cursor, other.cursor) && Utils.enhancedDeepEquals(this.limit, other.limit) && - Utils.enhancedDeepEquals(this.fields, other.fields); + Utils.enhancedDeepEquals(this.fields, other.fields) && + Utils.enhancedDeepEquals(this.filter, other.filter); } @Override @@ -307,7 +255,7 @@ public int hashCode() { return Utils.enhancedHash( raw, consumerId, appId, serviceId, cursor, limit, - fields); + fields, filter); } @Override @@ -319,188 +267,115 @@ public String toString() { "serviceId", serviceId, "cursor", cursor, "limit", limit, - "fields", fields); + "fields", fields, + "filter", filter); } @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; + + private String consumerId; - private Optional consumerId = Optional.empty(); + private String appId; - private Optional appId = Optional.empty(); + private String serviceId; - private Optional serviceId = Optional.empty(); + private JsonNullable cursor; - private JsonNullable cursor = JsonNullable.undefined(); + private Long limit; - private Optional limit; + private JsonNullable fields; - private JsonNullable fields = JsonNullable.undefined(); + private CategoriesFilter filter; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. + * Apply filters */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; + public Builder filter(@Nullable CategoriesFilter filter) { + this.filter = filter; return this; } public AccountingCategoriesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingCategoriesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, - fields); + fields, filter); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllRequestBuilder.java index 7acea3e5..894e4989 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingCategoriesAllRequestBuilder { - - private AccountingCategoriesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCategoriesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCategoriesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCategoriesAllRequestBuilder request(AccountingCategoriesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCategoriesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCategoriesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCategoriesAllRequestBuilder request(@Nonnull AccountingCategoriesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCategoriesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCategoriesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCategoriesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingCategoriesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingCategoriesAllOperation( - sdkConfiguration, - options); + AccountingCategoriesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingCategoriesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingCategoriesAllRequest::withCursor, + AccountingCategoriesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllResponse.java index d9895511..c4fad754 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCategoriesAllResponse implements Response { /** * Categories */ - private Optional getCategoriesResponse; + private GetCategoriesResponse getCategoriesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCategoriesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCategoriesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCategoriesResponse, "getCategoriesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCategoriesResponse getCategoriesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCategoriesResponse = getCategoriesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCategoriesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Categories */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCategoriesResponse() { - return (Optional) getCategoriesResponse; + return Optional.ofNullable(this.getCategoriesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCategoriesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCategoriesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCategoriesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCategoriesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Categories + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCategoriesAllResponse withGetCategoriesResponse(GetCategoriesResponse getCategoriesResponse) { - Utils.checkNotNull(getCategoriesResponse, "getCategoriesResponse"); - this.getCategoriesResponse = Optional.ofNullable(getCategoriesResponse); + public AccountingCategoriesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCategoriesAllResponse withGetCategoriesResponse(GetCategoriesRe /** * Categories */ - public AccountingCategoriesAllResponse withGetCategoriesResponse(Optional getCategoriesResponse) { - Utils.checkNotNull(getCategoriesResponse, "getCategoriesResponse"); + public AccountingCategoriesAllResponse withGetCategoriesResponse(@Nullable GetCategoriesResponse getCategoriesResponse) { this.getCategoriesResponse = getCategoriesResponse; return this; } - /** - * Unexpected error - */ - public AccountingCategoriesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCategoriesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCategoriesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCategoriesResponse = Optional.empty(); + private GetCategoriesResponse getCategoriesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Categories - */ - public Builder getCategoriesResponse(GetCategoriesResponse getCategoriesResponse) { - Utils.checkNotNull(getCategoriesResponse, "getCategoriesResponse"); - this.getCategoriesResponse = Optional.ofNullable(getCategoriesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Categories */ - public Builder getCategoriesResponse(Optional getCategoriesResponse) { - Utils.checkNotNull(getCategoriesResponse, "getCategoriesResponse"); + public Builder getCategoriesResponse(@Nullable GetCategoriesResponse getCategoriesResponse) { this.getCategoriesResponse = getCategoriesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCategoriesAllResponse build() { - return new AccountingCategoriesAllResponse( contentType, statusCode, rawResponse, getCategoriesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneRequest.java index 9617c718..7e0cae69 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneRequest.java @@ -3,12 +3,14 @@ */ package com.apideck.unify.models.operations; +import com.apideck.unify.models.components.CategoriesFilter; import com.apideck.unify.utils.LazySingletonValue; import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +29,25 @@ public class AccountingCategoriesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -53,80 +55,87 @@ public class AccountingCategoriesOneRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=fields") private JsonNullable fields; + /** + * Apply filters + */ + @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") + private CategoriesFilter filter; + @JsonCreator public AccountingCategoriesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields, + @Nullable CategoriesFilter filter) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); + this.filter = filter; } public AccountingCategoriesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; + } + + /** + * Apply filters + */ + public Optional filter() { + return Optional.ofNullable(this.filter); } public static Builder builder() { @@ -137,18 +146,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingCategoriesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCategoriesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingCategoriesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,87 +155,57 @@ public AccountingCategoriesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingCategoriesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCategoriesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCategoriesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCategoriesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCategoriesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCategoriesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCategoriesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCategoriesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCategoriesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCategoriesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCategoriesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingCategoriesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingCategoriesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } + /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. + * Apply filters */ - public AccountingCategoriesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; + public AccountingCategoriesOneRequest withFilter(@Nullable CategoriesFilter filter) { + this.filter = filter; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -252,14 +221,16 @@ public boolean equals(java.lang.Object o) { Utils.enhancedDeepEquals(this.appId, other.appId) && Utils.enhancedDeepEquals(this.serviceId, other.serviceId) && Utils.enhancedDeepEquals(this.raw, other.raw) && - Utils.enhancedDeepEquals(this.fields, other.fields); + Utils.enhancedDeepEquals(this.fields, other.fields) && + Utils.enhancedDeepEquals(this.filter, other.filter); } @Override public int hashCode() { return Utils.enhancedHash( id, consumerId, appId, - serviceId, raw, fields); + serviceId, raw, fields, + filter); } @Override @@ -270,7 +241,8 @@ public String toString() { "appId", appId, "serviceId", serviceId, "raw", raw, - "fields", fields); + "fields", fields, + "filter", filter); } @SuppressWarnings("UnusedReturnValue") @@ -278,140 +250,90 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; + + private String appId; - private Optional appId = Optional.empty(); + private String serviceId; - private Optional serviceId = Optional.empty(); + private Boolean raw; - private Optional raw; + private JsonNullable fields; - private JsonNullable fields = JsonNullable.undefined(); + private CategoriesFilter filter; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. + * Apply filters */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; + public Builder filter(@Nullable CategoriesFilter filter) { + this.filter = filter; return this; } public AccountingCategoriesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingCategoriesOneRequest( id, consumerId, appId, - serviceId, raw, fields); + serviceId, raw, fields, + filter); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneRequestBuilder.java index 3e600a80..849560eb 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingCategoriesOneRequestBuilder { - - private AccountingCategoriesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCategoriesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCategoriesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCategoriesOneRequestBuilder request(AccountingCategoriesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCategoriesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCategoriesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCategoriesOneRequestBuilder request(@Nonnull AccountingCategoriesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCategoriesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCategoriesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCategoriesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneResponse.java index e9534d22..c8624353 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCategoriesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCategoriesOneResponse implements Response { /** * Category */ - private Optional getCategoryResponse; + private GetCategoryResponse getCategoryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCategoriesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCategoryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCategoryResponse, "getCategoryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCategoryResponse getCategoryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCategoryResponse = getCategoryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCategoriesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Category */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCategoryResponse() { - return (Optional) getCategoryResponse; + return Optional.ofNullable(this.getCategoryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCategoriesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCategoriesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCategoriesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCategoriesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Category + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCategoriesOneResponse withGetCategoryResponse(GetCategoryResponse getCategoryResponse) { - Utils.checkNotNull(getCategoryResponse, "getCategoryResponse"); - this.getCategoryResponse = Optional.ofNullable(getCategoryResponse); + public AccountingCategoriesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCategoriesOneResponse withGetCategoryResponse(GetCategoryRespon /** * Category */ - public AccountingCategoriesOneResponse withGetCategoryResponse(Optional getCategoryResponse) { - Utils.checkNotNull(getCategoryResponse, "getCategoryResponse"); + public AccountingCategoriesOneResponse withGetCategoryResponse(@Nullable GetCategoryResponse getCategoryResponse) { this.getCategoryResponse = getCategoryResponse; return this; } - /** - * Unexpected error - */ - public AccountingCategoriesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCategoriesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCategoriesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCategoryResponse = Optional.empty(); + private GetCategoryResponse getCategoryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Category - */ - public Builder getCategoryResponse(GetCategoryResponse getCategoryResponse) { - Utils.checkNotNull(getCategoryResponse, "getCategoryResponse"); - this.getCategoryResponse = Optional.ofNullable(getCategoryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Category */ - public Builder getCategoryResponse(Optional getCategoryResponse) { - Utils.checkNotNull(getCategoryResponse, "getCategoryResponse"); + public Builder getCategoryResponse(@Nullable GetCategoryResponse getCategoryResponse) { this.getCategoryResponse = getCategoryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCategoriesOneResponse build() { - return new AccountingCategoriesOneResponse( contentType, statusCode, rawResponse, getCategoryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneRequest.java index 8dbca5e2..4ddf53ac 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneRequest.java @@ -7,8 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +21,25 @@ public class AccountingCompanyInfoOneRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -49,66 +49,58 @@ public class AccountingCompanyInfoOneRequest { @JsonCreator public AccountingCompanyInfoOneRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingCompanyInfoOneRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -119,96 +111,47 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCompanyInfoOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCompanyInfoOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCompanyInfoOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCompanyInfoOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingCompanyInfoOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCompanyInfoOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCompanyInfoOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCompanyInfoOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCompanyInfoOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCompanyInfoOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCompanyInfoOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCompanyInfoOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingCompanyInfoOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingCompanyInfoOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingCompanyInfoOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -247,130 +190,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingCompanyInfoOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingCompanyInfoOneRequest( raw, consumerId, appId, serviceId, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneRequestBuilder.java index 81510b40..496c4113 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingCompanyInfoOneRequestBuilder { - - private AccountingCompanyInfoOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCompanyInfoOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCompanyInfoOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCompanyInfoOneRequestBuilder request(AccountingCompanyInfoOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCompanyInfoOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCompanyInfoOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCompanyInfoOneRequestBuilder request(@Nonnull AccountingCompanyInfoOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCompanyInfoOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCompanyInfoOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCompanyInfoOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneResponse.java index 84a1d5fd..3f6852c3 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCompanyInfoOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCompanyInfoOneResponse implements Response { /** * CompanyInfo */ - private Optional getCompanyInfoResponse; + private GetCompanyInfoResponse getCompanyInfoResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCompanyInfoOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCompanyInfoResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCompanyInfoResponse, "getCompanyInfoResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCompanyInfoResponse getCompanyInfoResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCompanyInfoResponse = getCompanyInfoResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCompanyInfoOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * CompanyInfo */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCompanyInfoResponse() { - return (Optional) getCompanyInfoResponse; + return Optional.ofNullable(this.getCompanyInfoResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCompanyInfoOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCompanyInfoOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCompanyInfoOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCompanyInfoOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * CompanyInfo + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCompanyInfoOneResponse withGetCompanyInfoResponse(GetCompanyInfoResponse getCompanyInfoResponse) { - Utils.checkNotNull(getCompanyInfoResponse, "getCompanyInfoResponse"); - this.getCompanyInfoResponse = Optional.ofNullable(getCompanyInfoResponse); + public AccountingCompanyInfoOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCompanyInfoOneResponse withGetCompanyInfoResponse(GetCompanyInf /** * CompanyInfo */ - public AccountingCompanyInfoOneResponse withGetCompanyInfoResponse(Optional getCompanyInfoResponse) { - Utils.checkNotNull(getCompanyInfoResponse, "getCompanyInfoResponse"); + public AccountingCompanyInfoOneResponse withGetCompanyInfoResponse(@Nullable GetCompanyInfoResponse getCompanyInfoResponse) { this.getCompanyInfoResponse = getCompanyInfoResponse; return this; } - /** - * Unexpected error - */ - public AccountingCompanyInfoOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCompanyInfoOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCompanyInfoOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCompanyInfoResponse = Optional.empty(); + private GetCompanyInfoResponse getCompanyInfoResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * CompanyInfo - */ - public Builder getCompanyInfoResponse(GetCompanyInfoResponse getCompanyInfoResponse) { - Utils.checkNotNull(getCompanyInfoResponse, "getCompanyInfoResponse"); - this.getCompanyInfoResponse = Optional.ofNullable(getCompanyInfoResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * CompanyInfo */ - public Builder getCompanyInfoResponse(Optional getCompanyInfoResponse) { - Utils.checkNotNull(getCompanyInfoResponse, "getCompanyInfoResponse"); + public Builder getCompanyInfoResponse(@Nullable GetCompanyInfoResponse getCompanyInfoResponse) { this.getCompanyInfoResponse = getCompanyInfoResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCompanyInfoOneResponse build() { - return new AccountingCompanyInfoOneResponse( contentType, statusCode, rawResponse, getCompanyInfoResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddRequest.java index f624629d..3f1a5d6f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingCreditNotesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingCreditNotesAddRequest { @JsonCreator public AccountingCreditNotesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - CreditNoteInput creditNote) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(creditNote, "creditNote"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull CreditNoteInput creditNote) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.creditNote = creditNote; + this.creditNote = Optional.ofNullable(creditNote) + .orElseThrow(() -> new IllegalArgumentException("creditNote cannot be null")); } public AccountingCreditNotesAddRequest( - CreditNoteInput creditNote) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), creditNote); + @Nonnull CreditNoteInput creditNote) { + this(null, null, null, + null, creditNote); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public CreditNoteInput creditNote() { - return creditNote; + return this.creditNote; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCreditNotesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCreditNotesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCreditNotesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCreditNotesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingCreditNotesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCreditNotesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCreditNotesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCreditNotesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCreditNotesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCreditNotesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCreditNotesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCreditNotesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingCreditNotesAddRequest withCreditNote(CreditNoteInput creditNote) { - Utils.checkNotNull(creditNote, "creditNote"); - this.creditNote = creditNote; + + public AccountingCreditNotesAddRequest withCreditNote(@Nonnull CreditNoteInput creditNote) { + this.creditNote = Utils.checkNotNull(creditNote, "creditNote"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private CreditNoteInput creditNote; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder creditNote(CreditNoteInput creditNote) { - Utils.checkNotNull(creditNote, "creditNote"); - this.creditNote = creditNote; + public Builder creditNote(@Nonnull CreditNoteInput creditNote) { + this.creditNote = Utils.checkNotNull(creditNote, "creditNote"); return this; } public AccountingCreditNotesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingCreditNotesAddRequest( raw, consumerId, appId, serviceId, creditNote); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddRequestBuilder.java index 5a8fc886..701782fc 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingCreditNotesAddRequestBuilder { - - private AccountingCreditNotesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCreditNotesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCreditNotesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCreditNotesAddRequestBuilder request(AccountingCreditNotesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCreditNotesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCreditNotesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCreditNotesAddRequestBuilder request(@Nonnull AccountingCreditNotesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCreditNotesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCreditNotesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCreditNotesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddResponse.java index 77433c4c..732b7e27 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCreditNotesAddResponse implements Response { /** * Credit Note created */ - private Optional createCreditNoteResponse; + private CreateCreditNoteResponse createCreditNoteResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCreditNotesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createCreditNoteResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createCreditNoteResponse, "createCreditNoteResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateCreditNoteResponse createCreditNoteResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createCreditNoteResponse = createCreditNoteResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCreditNotesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Credit Note created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createCreditNoteResponse() { - return (Optional) createCreditNoteResponse; + return Optional.ofNullable(this.createCreditNoteResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCreditNotesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCreditNotesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCreditNotesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCreditNotesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Credit Note created + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCreditNotesAddResponse withCreateCreditNoteResponse(CreateCreditNoteResponse createCreditNoteResponse) { - Utils.checkNotNull(createCreditNoteResponse, "createCreditNoteResponse"); - this.createCreditNoteResponse = Optional.ofNullable(createCreditNoteResponse); + public AccountingCreditNotesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCreditNotesAddResponse withCreateCreditNoteResponse(CreateCredi /** * Credit Note created */ - public AccountingCreditNotesAddResponse withCreateCreditNoteResponse(Optional createCreditNoteResponse) { - Utils.checkNotNull(createCreditNoteResponse, "createCreditNoteResponse"); + public AccountingCreditNotesAddResponse withCreateCreditNoteResponse(@Nullable CreateCreditNoteResponse createCreditNoteResponse) { this.createCreditNoteResponse = createCreditNoteResponse; return this; } - /** - * Unexpected error - */ - public AccountingCreditNotesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCreditNotesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCreditNotesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createCreditNoteResponse = Optional.empty(); + private CreateCreditNoteResponse createCreditNoteResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Credit Note created - */ - public Builder createCreditNoteResponse(CreateCreditNoteResponse createCreditNoteResponse) { - Utils.checkNotNull(createCreditNoteResponse, "createCreditNoteResponse"); - this.createCreditNoteResponse = Optional.ofNullable(createCreditNoteResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Credit Note created */ - public Builder createCreditNoteResponse(Optional createCreditNoteResponse) { - Utils.checkNotNull(createCreditNoteResponse, "createCreditNoteResponse"); + public Builder createCreditNoteResponse(@Nullable CreateCreditNoteResponse createCreditNoteResponse) { this.createCreditNoteResponse = createCreditNoteResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCreditNotesAddResponse build() { - return new AccountingCreditNotesAddResponse( contentType, statusCode, rawResponse, createCreditNoteResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllRequest.java index 623a3807..80d2d96d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingCreditNotesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class AccountingCreditNotesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private CreditNotesFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private CreditNotesSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class AccountingCreditNotesAllRequest { @JsonCreator public AccountingCreditNotesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable CreditNotesFilter filter, + @Nullable CreditNotesSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingCreditNotesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCreditNotesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCreditNotesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCreditNotesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCreditNotesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingCreditNotesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCreditNotesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCreditNotesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCreditNotesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCreditNotesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCreditNotesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCreditNotesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCreditNotesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingCreditNotesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingCreditNotesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingCreditNotesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingCreditNotesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public AccountingCreditNotesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingCreditNotesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingCreditNotesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingCreditNotesAllRequest withFilter(CreditNotesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingCreditNotesAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingCreditNotesAllRequest withFilter(@Nullable CreditNotesFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingCreditNotesAllRequest withSort(CreditNotesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingCreditNotesAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingCreditNotesAllRequest withSort(@Nullable CreditNotesSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingCreditNotesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingCreditNotesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingCreditNotesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingCreditNotesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingCreditNotesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingCreditNotesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private CreditNotesFilter filter; - private Optional sort = Optional.empty(); + private CreditNotesSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(CreditNotesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable CreditNotesFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(CreditNotesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable CreditNotesSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingCreditNotesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingCreditNotesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public AccountingCreditNotesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllRequestBuilder.java index 01c685bf..6e1a723e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingCreditNotesAllRequestBuilder { - - private AccountingCreditNotesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCreditNotesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCreditNotesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCreditNotesAllRequestBuilder request(AccountingCreditNotesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCreditNotesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCreditNotesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCreditNotesAllRequestBuilder request(@Nonnull AccountingCreditNotesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCreditNotesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCreditNotesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCreditNotesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingCreditNotesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingCreditNotesAllOperation( - sdkConfiguration, - options); + AccountingCreditNotesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingCreditNotesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingCreditNotesAllRequest::withCursor, + AccountingCreditNotesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllResponse.java index 6e81e974..9e7e3a46 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCreditNotesAllResponse implements Response { /** * Credit Notes */ - private Optional getCreditNotesResponse; + private GetCreditNotesResponse getCreditNotesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCreditNotesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCreditNotesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCreditNotesResponse, "getCreditNotesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCreditNotesResponse getCreditNotesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCreditNotesResponse = getCreditNotesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCreditNotesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Credit Notes */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCreditNotesResponse() { - return (Optional) getCreditNotesResponse; + return Optional.ofNullable(this.getCreditNotesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCreditNotesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCreditNotesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCreditNotesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCreditNotesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Credit Notes + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCreditNotesAllResponse withGetCreditNotesResponse(GetCreditNotesResponse getCreditNotesResponse) { - Utils.checkNotNull(getCreditNotesResponse, "getCreditNotesResponse"); - this.getCreditNotesResponse = Optional.ofNullable(getCreditNotesResponse); + public AccountingCreditNotesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCreditNotesAllResponse withGetCreditNotesResponse(GetCreditNote /** * Credit Notes */ - public AccountingCreditNotesAllResponse withGetCreditNotesResponse(Optional getCreditNotesResponse) { - Utils.checkNotNull(getCreditNotesResponse, "getCreditNotesResponse"); + public AccountingCreditNotesAllResponse withGetCreditNotesResponse(@Nullable GetCreditNotesResponse getCreditNotesResponse) { this.getCreditNotesResponse = getCreditNotesResponse; return this; } - /** - * Unexpected error - */ - public AccountingCreditNotesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCreditNotesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCreditNotesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCreditNotesResponse = Optional.empty(); + private GetCreditNotesResponse getCreditNotesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Credit Notes - */ - public Builder getCreditNotesResponse(GetCreditNotesResponse getCreditNotesResponse) { - Utils.checkNotNull(getCreditNotesResponse, "getCreditNotesResponse"); - this.getCreditNotesResponse = Optional.ofNullable(getCreditNotesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Credit Notes */ - public Builder getCreditNotesResponse(Optional getCreditNotesResponse) { - Utils.checkNotNull(getCreditNotesResponse, "getCreditNotesResponse"); + public Builder getCreditNotesResponse(@Nullable GetCreditNotesResponse getCreditNotesResponse) { this.getCreditNotesResponse = getCreditNotesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCreditNotesAllResponse build() { - return new AccountingCreditNotesAllResponse( contentType, statusCode, rawResponse, getCreditNotesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteRequest.java index 6ff9509b..b55c47b6 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingCreditNotesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingCreditNotesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingCreditNotesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingCreditNotesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCreditNotesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingCreditNotesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingCreditNotesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingCreditNotesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCreditNotesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCreditNotesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCreditNotesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCreditNotesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCreditNotesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCreditNotesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCreditNotesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCreditNotesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCreditNotesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCreditNotesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingCreditNotesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingCreditNotesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteRequestBuilder.java index 19d9caad..bcc01b69 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingCreditNotesDeleteRequestBuilder { - - private AccountingCreditNotesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCreditNotesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCreditNotesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCreditNotesDeleteRequestBuilder request(AccountingCreditNotesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCreditNotesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCreditNotesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCreditNotesDeleteRequestBuilder request(@Nonnull AccountingCreditNotesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCreditNotesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCreditNotesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCreditNotesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteResponse.java index 2624d459..dc689849 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCreditNotesDeleteResponse implements Response { /** * Credit Note deleted */ - private Optional deleteCreditNoteResponse; + private DeleteCreditNoteResponse deleteCreditNoteResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCreditNotesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteCreditNoteResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteCreditNoteResponse, "deleteCreditNoteResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteCreditNoteResponse deleteCreditNoteResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteCreditNoteResponse = deleteCreditNoteResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCreditNotesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Credit Note deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteCreditNoteResponse() { - return (Optional) deleteCreditNoteResponse; + return Optional.ofNullable(this.deleteCreditNoteResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCreditNotesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCreditNotesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCreditNotesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCreditNotesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Credit Note deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCreditNotesDeleteResponse withDeleteCreditNoteResponse(DeleteCreditNoteResponse deleteCreditNoteResponse) { - Utils.checkNotNull(deleteCreditNoteResponse, "deleteCreditNoteResponse"); - this.deleteCreditNoteResponse = Optional.ofNullable(deleteCreditNoteResponse); + public AccountingCreditNotesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCreditNotesDeleteResponse withDeleteCreditNoteResponse(DeleteCr /** * Credit Note deleted */ - public AccountingCreditNotesDeleteResponse withDeleteCreditNoteResponse(Optional deleteCreditNoteResponse) { - Utils.checkNotNull(deleteCreditNoteResponse, "deleteCreditNoteResponse"); + public AccountingCreditNotesDeleteResponse withDeleteCreditNoteResponse(@Nullable DeleteCreditNoteResponse deleteCreditNoteResponse) { this.deleteCreditNoteResponse = deleteCreditNoteResponse; return this; } - /** - * Unexpected error - */ - public AccountingCreditNotesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCreditNotesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCreditNotesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteCreditNoteResponse = Optional.empty(); + private DeleteCreditNoteResponse deleteCreditNoteResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Credit Note deleted - */ - public Builder deleteCreditNoteResponse(DeleteCreditNoteResponse deleteCreditNoteResponse) { - Utils.checkNotNull(deleteCreditNoteResponse, "deleteCreditNoteResponse"); - this.deleteCreditNoteResponse = Optional.ofNullable(deleteCreditNoteResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Credit Note deleted */ - public Builder deleteCreditNoteResponse(Optional deleteCreditNoteResponse) { - Utils.checkNotNull(deleteCreditNoteResponse, "deleteCreditNoteResponse"); + public Builder deleteCreditNoteResponse(@Nullable DeleteCreditNoteResponse deleteCreditNoteResponse) { this.deleteCreditNoteResponse = deleteCreditNoteResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCreditNotesDeleteResponse build() { - return new AccountingCreditNotesDeleteResponse( contentType, statusCode, rawResponse, deleteCreditNoteResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneRequest.java index 3ebfcf10..4145a6c6 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingCreditNotesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingCreditNotesOneRequest { @JsonCreator public AccountingCreditNotesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingCreditNotesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingCreditNotesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCreditNotesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingCreditNotesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingCreditNotesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingCreditNotesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCreditNotesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCreditNotesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCreditNotesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCreditNotesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCreditNotesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCreditNotesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCreditNotesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCreditNotesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCreditNotesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCreditNotesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingCreditNotesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingCreditNotesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingCreditNotesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingCreditNotesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingCreditNotesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneRequestBuilder.java index 0017182d..825977b9 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingCreditNotesOneRequestBuilder { - - private AccountingCreditNotesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCreditNotesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCreditNotesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCreditNotesOneRequestBuilder request(AccountingCreditNotesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCreditNotesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCreditNotesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCreditNotesOneRequestBuilder request(@Nonnull AccountingCreditNotesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCreditNotesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCreditNotesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCreditNotesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneResponse.java index 251cf4eb..1dc520a3 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCreditNotesOneResponse implements Response { /** * Credit Note */ - private Optional getCreditNoteResponse; + private GetCreditNoteResponse getCreditNoteResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCreditNotesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCreditNoteResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCreditNoteResponse, "getCreditNoteResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCreditNoteResponse getCreditNoteResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCreditNoteResponse = getCreditNoteResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCreditNotesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Credit Note */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCreditNoteResponse() { - return (Optional) getCreditNoteResponse; + return Optional.ofNullable(this.getCreditNoteResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCreditNotesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCreditNotesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCreditNotesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCreditNotesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Credit Note + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCreditNotesOneResponse withGetCreditNoteResponse(GetCreditNoteResponse getCreditNoteResponse) { - Utils.checkNotNull(getCreditNoteResponse, "getCreditNoteResponse"); - this.getCreditNoteResponse = Optional.ofNullable(getCreditNoteResponse); + public AccountingCreditNotesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCreditNotesOneResponse withGetCreditNoteResponse(GetCreditNoteR /** * Credit Note */ - public AccountingCreditNotesOneResponse withGetCreditNoteResponse(Optional getCreditNoteResponse) { - Utils.checkNotNull(getCreditNoteResponse, "getCreditNoteResponse"); + public AccountingCreditNotesOneResponse withGetCreditNoteResponse(@Nullable GetCreditNoteResponse getCreditNoteResponse) { this.getCreditNoteResponse = getCreditNoteResponse; return this; } - /** - * Unexpected error - */ - public AccountingCreditNotesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCreditNotesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCreditNotesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCreditNoteResponse = Optional.empty(); + private GetCreditNoteResponse getCreditNoteResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Credit Note - */ - public Builder getCreditNoteResponse(GetCreditNoteResponse getCreditNoteResponse) { - Utils.checkNotNull(getCreditNoteResponse, "getCreditNoteResponse"); - this.getCreditNoteResponse = Optional.ofNullable(getCreditNoteResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Credit Note */ - public Builder getCreditNoteResponse(Optional getCreditNoteResponse) { - Utils.checkNotNull(getCreditNoteResponse, "getCreditNoteResponse"); + public Builder getCreditNoteResponse(@Nullable GetCreditNoteResponse getCreditNoteResponse) { this.getCreditNoteResponse = getCreditNoteResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCreditNotesOneResponse build() { - return new AccountingCreditNotesOneResponse( contentType, statusCode, rawResponse, getCreditNoteResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateRequest.java index 81d19d8b..1a4fc38d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingCreditNotesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingCreditNotesUpdateRequest { @JsonCreator public AccountingCreditNotesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - CreditNoteInput creditNote) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(creditNote, "creditNote"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull CreditNoteInput creditNote) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.creditNote = creditNote; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.creditNote = Optional.ofNullable(creditNote) + .orElseThrow(() -> new IllegalArgumentException("creditNote cannot be null")); } public AccountingCreditNotesUpdateRequest( - String id, - CreditNoteInput creditNote) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), creditNote); + @Nonnull String id, + @Nonnull CreditNoteInput creditNote) { + this(id, null, null, + null, null, creditNote); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public CreditNoteInput creditNote() { - return creditNote; + return this.creditNote; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingCreditNotesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCreditNotesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingCreditNotesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingCreditNotesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingCreditNotesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCreditNotesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCreditNotesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCreditNotesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCreditNotesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCreditNotesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCreditNotesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCreditNotesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCreditNotesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCreditNotesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCreditNotesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingCreditNotesUpdateRequest withCreditNote(CreditNoteInput creditNote) { - Utils.checkNotNull(creditNote, "creditNote"); - this.creditNote = creditNote; + + public AccountingCreditNotesUpdateRequest withCreditNote(@Nonnull CreditNoteInput creditNote) { + this.creditNote = Utils.checkNotNull(creditNote, "creditNote"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private CreditNoteInput creditNote; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder creditNote(CreditNoteInput creditNote) { - Utils.checkNotNull(creditNote, "creditNote"); - this.creditNote = creditNote; + public Builder creditNote(@Nonnull CreditNoteInput creditNote) { + this.creditNote = Utils.checkNotNull(creditNote, "creditNote"); return this; } public AccountingCreditNotesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingCreditNotesUpdateRequest( id, consumerId, appId, serviceId, raw, creditNote); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateRequestBuilder.java index 7d41f79f..d401309f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingCreditNotesUpdateRequestBuilder { - - private AccountingCreditNotesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCreditNotesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCreditNotesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCreditNotesUpdateRequestBuilder request(AccountingCreditNotesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCreditNotesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCreditNotesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCreditNotesUpdateRequestBuilder request(@Nonnull AccountingCreditNotesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCreditNotesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCreditNotesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCreditNotesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateResponse.java index 9747eae3..08f75a93 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCreditNotesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCreditNotesUpdateResponse implements Response { /** * Credit Note updated */ - private Optional updateCreditNoteResponse; + private UpdateCreditNoteResponse updateCreditNoteResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCreditNotesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateCreditNoteResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateCreditNoteResponse, "updateCreditNoteResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateCreditNoteResponse updateCreditNoteResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateCreditNoteResponse = updateCreditNoteResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCreditNotesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Credit Note updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateCreditNoteResponse() { - return (Optional) updateCreditNoteResponse; + return Optional.ofNullable(this.updateCreditNoteResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCreditNotesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCreditNotesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCreditNotesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCreditNotesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Credit Note updated + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCreditNotesUpdateResponse withUpdateCreditNoteResponse(UpdateCreditNoteResponse updateCreditNoteResponse) { - Utils.checkNotNull(updateCreditNoteResponse, "updateCreditNoteResponse"); - this.updateCreditNoteResponse = Optional.ofNullable(updateCreditNoteResponse); + public AccountingCreditNotesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCreditNotesUpdateResponse withUpdateCreditNoteResponse(UpdateCr /** * Credit Note updated */ - public AccountingCreditNotesUpdateResponse withUpdateCreditNoteResponse(Optional updateCreditNoteResponse) { - Utils.checkNotNull(updateCreditNoteResponse, "updateCreditNoteResponse"); + public AccountingCreditNotesUpdateResponse withUpdateCreditNoteResponse(@Nullable UpdateCreditNoteResponse updateCreditNoteResponse) { this.updateCreditNoteResponse = updateCreditNoteResponse; return this; } - /** - * Unexpected error - */ - public AccountingCreditNotesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCreditNotesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCreditNotesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateCreditNoteResponse = Optional.empty(); + private UpdateCreditNoteResponse updateCreditNoteResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Credit Note updated - */ - public Builder updateCreditNoteResponse(UpdateCreditNoteResponse updateCreditNoteResponse) { - Utils.checkNotNull(updateCreditNoteResponse, "updateCreditNoteResponse"); - this.updateCreditNoteResponse = Optional.ofNullable(updateCreditNoteResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Credit Note updated */ - public Builder updateCreditNoteResponse(Optional updateCreditNoteResponse) { - Utils.checkNotNull(updateCreditNoteResponse, "updateCreditNoteResponse"); + public Builder updateCreditNoteResponse(@Nullable UpdateCreditNoteResponse updateCreditNoteResponse) { this.updateCreditNoteResponse = updateCreditNoteResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCreditNotesUpdateResponse build() { - return new AccountingCreditNotesUpdateResponse( contentType, statusCode, rawResponse, updateCreditNoteResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddRequest.java index fffa3c03..7d7a10e3 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingCustomersAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingCustomersAddRequest { @JsonCreator public AccountingCustomersAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - CustomerInput customer) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(customer, "customer"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull CustomerInput customer) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.customer = customer; + this.customer = Optional.ofNullable(customer) + .orElseThrow(() -> new IllegalArgumentException("customer cannot be null")); } public AccountingCustomersAddRequest( - CustomerInput customer) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), customer); + @Nonnull CustomerInput customer) { + this(null, null, null, + null, customer); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public CustomerInput customer() { - return customer; + return this.customer; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCustomersAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCustomersAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCustomersAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCustomersAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingCustomersAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCustomersAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCustomersAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCustomersAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCustomersAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCustomersAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCustomersAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCustomersAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingCustomersAddRequest withCustomer(CustomerInput customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; + + public AccountingCustomersAddRequest withCustomer(@Nonnull CustomerInput customer) { + this.customer = Utils.checkNotNull(customer, "customer"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private CustomerInput customer; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder customer(CustomerInput customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; + public Builder customer(@Nonnull CustomerInput customer) { + this.customer = Utils.checkNotNull(customer, "customer"); return this; } public AccountingCustomersAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingCustomersAddRequest( raw, consumerId, appId, serviceId, customer); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddRequestBuilder.java index 10c24a86..125e4955 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingCustomersAddRequestBuilder { - - private AccountingCustomersAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCustomersAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCustomersAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCustomersAddRequestBuilder request(AccountingCustomersAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCustomersAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCustomersAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCustomersAddRequestBuilder request(@Nonnull AccountingCustomersAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCustomersAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCustomersAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCustomersAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddResponse.java index a41b32ff..5f2e25fe 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCustomersAddResponse implements Response { /** * Customers */ - private Optional createCustomerResponse; + private CreateCustomerResponse createCustomerResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCustomersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createCustomerResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createCustomerResponse, "createCustomerResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateCustomerResponse createCustomerResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createCustomerResponse = createCustomerResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCustomersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Customers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createCustomerResponse() { - return (Optional) createCustomerResponse; + return Optional.ofNullable(this.createCustomerResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCustomersAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCustomersAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCustomersAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCustomersAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Customers + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCustomersAddResponse withCreateCustomerResponse(CreateCustomerResponse createCustomerResponse) { - Utils.checkNotNull(createCustomerResponse, "createCustomerResponse"); - this.createCustomerResponse = Optional.ofNullable(createCustomerResponse); + public AccountingCustomersAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCustomersAddResponse withCreateCustomerResponse(CreateCustomerR /** * Customers */ - public AccountingCustomersAddResponse withCreateCustomerResponse(Optional createCustomerResponse) { - Utils.checkNotNull(createCustomerResponse, "createCustomerResponse"); + public AccountingCustomersAddResponse withCreateCustomerResponse(@Nullable CreateCustomerResponse createCustomerResponse) { this.createCustomerResponse = createCustomerResponse; return this; } - /** - * Unexpected error - */ - public AccountingCustomersAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCustomersAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCustomersAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createCustomerResponse = Optional.empty(); + private CreateCustomerResponse createCustomerResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Customers - */ - public Builder createCustomerResponse(CreateCustomerResponse createCustomerResponse) { - Utils.checkNotNull(createCustomerResponse, "createCustomerResponse"); - this.createCustomerResponse = Optional.ofNullable(createCustomerResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Customers */ - public Builder createCustomerResponse(Optional createCustomerResponse) { - Utils.checkNotNull(createCustomerResponse, "createCustomerResponse"); + public Builder createCustomerResponse(@Nullable CreateCustomerResponse createCustomerResponse) { this.createCustomerResponse = createCustomerResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCustomersAddResponse build() { - return new AccountingCustomersAddResponse( contentType, statusCode, rawResponse, createCustomerResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllRequest.java index bc16e85a..b6e95a9c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingCustomersAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class AccountingCustomersAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private CustomersFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private CustomersSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class AccountingCustomersAllRequest { @JsonCreator public AccountingCustomersAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable CustomersFilter filter, + @Nullable CustomersSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingCustomersAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCustomersAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCustomersAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCustomersAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCustomersAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingCustomersAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCustomersAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCustomersAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCustomersAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCustomersAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCustomersAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCustomersAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCustomersAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingCustomersAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingCustomersAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingCustomersAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingCustomersAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public AccountingCustomersAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingCustomersAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingCustomersAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingCustomersAllRequest withFilter(CustomersFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingCustomersAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingCustomersAllRequest withFilter(@Nullable CustomersFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingCustomersAllRequest withSort(CustomersSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingCustomersAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingCustomersAllRequest withSort(@Nullable CustomersSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingCustomersAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingCustomersAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingCustomersAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingCustomersAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingCustomersAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingCustomersAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private CustomersFilter filter; - private Optional sort = Optional.empty(); + private CustomersSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(CustomersFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable CustomersFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(CustomersSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable CustomersSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingCustomersAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingCustomersAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public AccountingCustomersAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllRequestBuilder.java index 6f0496b6..c5ccdfc5 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingCustomersAllRequestBuilder { - - private AccountingCustomersAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCustomersAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCustomersAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCustomersAllRequestBuilder request(AccountingCustomersAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCustomersAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCustomersAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCustomersAllRequestBuilder request(@Nonnull AccountingCustomersAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCustomersAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCustomersAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCustomersAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingCustomersAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingCustomersAllOperation( - sdkConfiguration, - options); + AccountingCustomersAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingCustomersAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingCustomersAllRequest::withCursor, + AccountingCustomersAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllResponse.java index 8be7ffb4..a424f519 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCustomersAllResponse implements Response { /** * Customers */ - private Optional getCustomersResponse; + private GetCustomersResponse getCustomersResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCustomersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCustomersResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCustomersResponse, "getCustomersResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCustomersResponse getCustomersResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCustomersResponse = getCustomersResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCustomersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Customers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCustomersResponse() { - return (Optional) getCustomersResponse; + return Optional.ofNullable(this.getCustomersResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCustomersAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCustomersAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCustomersAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCustomersAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Customers + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCustomersAllResponse withGetCustomersResponse(GetCustomersResponse getCustomersResponse) { - Utils.checkNotNull(getCustomersResponse, "getCustomersResponse"); - this.getCustomersResponse = Optional.ofNullable(getCustomersResponse); + public AccountingCustomersAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCustomersAllResponse withGetCustomersResponse(GetCustomersRespo /** * Customers */ - public AccountingCustomersAllResponse withGetCustomersResponse(Optional getCustomersResponse) { - Utils.checkNotNull(getCustomersResponse, "getCustomersResponse"); + public AccountingCustomersAllResponse withGetCustomersResponse(@Nullable GetCustomersResponse getCustomersResponse) { this.getCustomersResponse = getCustomersResponse; return this; } - /** - * Unexpected error - */ - public AccountingCustomersAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCustomersAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCustomersAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCustomersResponse = Optional.empty(); + private GetCustomersResponse getCustomersResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Customers - */ - public Builder getCustomersResponse(GetCustomersResponse getCustomersResponse) { - Utils.checkNotNull(getCustomersResponse, "getCustomersResponse"); - this.getCustomersResponse = Optional.ofNullable(getCustomersResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Customers */ - public Builder getCustomersResponse(Optional getCustomersResponse) { - Utils.checkNotNull(getCustomersResponse, "getCustomersResponse"); + public Builder getCustomersResponse(@Nullable GetCustomersResponse getCustomersResponse) { this.getCustomersResponse = getCustomersResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCustomersAllResponse build() { - return new AccountingCustomersAllResponse( contentType, statusCode, rawResponse, getCustomersResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteRequest.java index 5b358a86..4b4aee22 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingCustomersDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingCustomersDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingCustomersDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingCustomersDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCustomersDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingCustomersDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingCustomersDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingCustomersDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCustomersDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCustomersDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCustomersDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCustomersDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCustomersDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCustomersDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCustomersDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCustomersDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCustomersDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCustomersDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingCustomersDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingCustomersDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteRequestBuilder.java index 87415ba2..4c2b6734 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingCustomersDeleteRequestBuilder { - - private AccountingCustomersDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCustomersDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCustomersDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCustomersDeleteRequestBuilder request(AccountingCustomersDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCustomersDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCustomersDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCustomersDeleteRequestBuilder request(@Nonnull AccountingCustomersDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCustomersDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCustomersDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCustomersDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteResponse.java index 15abf3d7..8e0d2916 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCustomersDeleteResponse implements Response { /** * Customers */ - private Optional deleteCustomerResponse; + private DeleteCustomerResponse deleteCustomerResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCustomersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteCustomerResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteCustomerResponse, "deleteCustomerResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteCustomerResponse deleteCustomerResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteCustomerResponse = deleteCustomerResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCustomersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Customers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteCustomerResponse() { - return (Optional) deleteCustomerResponse; + return Optional.ofNullable(this.deleteCustomerResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCustomersDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCustomersDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCustomersDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCustomersDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Customers + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCustomersDeleteResponse withDeleteCustomerResponse(DeleteCustomerResponse deleteCustomerResponse) { - Utils.checkNotNull(deleteCustomerResponse, "deleteCustomerResponse"); - this.deleteCustomerResponse = Optional.ofNullable(deleteCustomerResponse); + public AccountingCustomersDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCustomersDeleteResponse withDeleteCustomerResponse(DeleteCustom /** * Customers */ - public AccountingCustomersDeleteResponse withDeleteCustomerResponse(Optional deleteCustomerResponse) { - Utils.checkNotNull(deleteCustomerResponse, "deleteCustomerResponse"); + public AccountingCustomersDeleteResponse withDeleteCustomerResponse(@Nullable DeleteCustomerResponse deleteCustomerResponse) { this.deleteCustomerResponse = deleteCustomerResponse; return this; } - /** - * Unexpected error - */ - public AccountingCustomersDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCustomersDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCustomersDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteCustomerResponse = Optional.empty(); + private DeleteCustomerResponse deleteCustomerResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Customers - */ - public Builder deleteCustomerResponse(DeleteCustomerResponse deleteCustomerResponse) { - Utils.checkNotNull(deleteCustomerResponse, "deleteCustomerResponse"); - this.deleteCustomerResponse = Optional.ofNullable(deleteCustomerResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Customers */ - public Builder deleteCustomerResponse(Optional deleteCustomerResponse) { - Utils.checkNotNull(deleteCustomerResponse, "deleteCustomerResponse"); + public Builder deleteCustomerResponse(@Nullable DeleteCustomerResponse deleteCustomerResponse) { this.deleteCustomerResponse = deleteCustomerResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCustomersDeleteResponse build() { - return new AccountingCustomersDeleteResponse( contentType, statusCode, rawResponse, deleteCustomerResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneRequest.java index 17358dcb..f210aa1b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingCustomersOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingCustomersOneRequest { @JsonCreator public AccountingCustomersOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingCustomersOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingCustomersOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCustomersOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingCustomersOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingCustomersOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingCustomersOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCustomersOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCustomersOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCustomersOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCustomersOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCustomersOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCustomersOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCustomersOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCustomersOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCustomersOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCustomersOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingCustomersOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingCustomersOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingCustomersOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingCustomersOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingCustomersOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneRequestBuilder.java index 4d7b0e63..20e8b0ce 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingCustomersOneRequestBuilder { - - private AccountingCustomersOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCustomersOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCustomersOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCustomersOneRequestBuilder request(AccountingCustomersOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCustomersOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCustomersOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCustomersOneRequestBuilder request(@Nonnull AccountingCustomersOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCustomersOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCustomersOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCustomersOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneResponse.java index 60b8acea..835fb9a8 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCustomersOneResponse implements Response { /** * Customer */ - private Optional getCustomerResponse; + private GetCustomerResponse getCustomerResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCustomersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCustomerResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCustomerResponse, "getCustomerResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCustomerResponse getCustomerResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCustomerResponse = getCustomerResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCustomersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Customer */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCustomerResponse() { - return (Optional) getCustomerResponse; + return Optional.ofNullable(this.getCustomerResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCustomersOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCustomersOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCustomersOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCustomersOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Customer + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCustomersOneResponse withGetCustomerResponse(GetCustomerResponse getCustomerResponse) { - Utils.checkNotNull(getCustomerResponse, "getCustomerResponse"); - this.getCustomerResponse = Optional.ofNullable(getCustomerResponse); + public AccountingCustomersOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCustomersOneResponse withGetCustomerResponse(GetCustomerRespons /** * Customer */ - public AccountingCustomersOneResponse withGetCustomerResponse(Optional getCustomerResponse) { - Utils.checkNotNull(getCustomerResponse, "getCustomerResponse"); + public AccountingCustomersOneResponse withGetCustomerResponse(@Nullable GetCustomerResponse getCustomerResponse) { this.getCustomerResponse = getCustomerResponse; return this; } - /** - * Unexpected error - */ - public AccountingCustomersOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCustomersOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCustomersOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCustomerResponse = Optional.empty(); + private GetCustomerResponse getCustomerResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Customer - */ - public Builder getCustomerResponse(GetCustomerResponse getCustomerResponse) { - Utils.checkNotNull(getCustomerResponse, "getCustomerResponse"); - this.getCustomerResponse = Optional.ofNullable(getCustomerResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Customer */ - public Builder getCustomerResponse(Optional getCustomerResponse) { - Utils.checkNotNull(getCustomerResponse, "getCustomerResponse"); + public Builder getCustomerResponse(@Nullable GetCustomerResponse getCustomerResponse) { this.getCustomerResponse = getCustomerResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCustomersOneResponse build() { - return new AccountingCustomersOneResponse( contentType, statusCode, rawResponse, getCustomerResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateRequest.java index 290e36ea..5014c99d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingCustomersUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingCustomersUpdateRequest { @JsonCreator public AccountingCustomersUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - CustomerInput customer) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(customer, "customer"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull CustomerInput customer) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.customer = customer; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.customer = Optional.ofNullable(customer) + .orElseThrow(() -> new IllegalArgumentException("customer cannot be null")); } public AccountingCustomersUpdateRequest( - String id, - CustomerInput customer) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), customer); + @Nonnull String id, + @Nonnull CustomerInput customer) { + this(id, null, null, + null, null, customer); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public CustomerInput customer() { - return customer; + return this.customer; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingCustomersUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingCustomersUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingCustomersUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingCustomersUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingCustomersUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingCustomersUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingCustomersUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingCustomersUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingCustomersUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingCustomersUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingCustomersUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingCustomersUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingCustomersUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingCustomersUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingCustomersUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingCustomersUpdateRequest withCustomer(CustomerInput customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; + + public AccountingCustomersUpdateRequest withCustomer(@Nonnull CustomerInput customer) { + this.customer = Utils.checkNotNull(customer, "customer"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private CustomerInput customer; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder customer(CustomerInput customer) { - Utils.checkNotNull(customer, "customer"); - this.customer = customer; + public Builder customer(@Nonnull CustomerInput customer) { + this.customer = Utils.checkNotNull(customer, "customer"); return this; } public AccountingCustomersUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingCustomersUpdateRequest( id, consumerId, appId, serviceId, raw, customer); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateRequestBuilder.java index c4c19720..b936591b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingCustomersUpdateRequestBuilder { - - private AccountingCustomersUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingCustomersUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingCustomersUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingCustomersUpdateRequestBuilder request(AccountingCustomersUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingCustomersUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingCustomersUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingCustomersUpdateRequestBuilder request(@Nonnull AccountingCustomersUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingCustomersUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingCustomersUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingCustomersUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateResponse.java index 06fe3f16..6dbaa020 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingCustomersUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingCustomersUpdateResponse implements Response { /** * Customers */ - private Optional updateCustomerResponse; + private UpdateCustomerResponse updateCustomerResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingCustomersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateCustomerResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateCustomerResponse, "updateCustomerResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateCustomerResponse updateCustomerResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateCustomerResponse = updateCustomerResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingCustomersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Customers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateCustomerResponse() { - return (Optional) updateCustomerResponse; + return Optional.ofNullable(this.updateCustomerResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingCustomersUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingCustomersUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingCustomersUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingCustomersUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Customers + * Raw HTTP response; suitable for custom response parsing */ - public AccountingCustomersUpdateResponse withUpdateCustomerResponse(UpdateCustomerResponse updateCustomerResponse) { - Utils.checkNotNull(updateCustomerResponse, "updateCustomerResponse"); - this.updateCustomerResponse = Optional.ofNullable(updateCustomerResponse); + public AccountingCustomersUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingCustomersUpdateResponse withUpdateCustomerResponse(UpdateCustom /** * Customers */ - public AccountingCustomersUpdateResponse withUpdateCustomerResponse(Optional updateCustomerResponse) { - Utils.checkNotNull(updateCustomerResponse, "updateCustomerResponse"); + public AccountingCustomersUpdateResponse withUpdateCustomerResponse(@Nullable UpdateCustomerResponse updateCustomerResponse) { this.updateCustomerResponse = updateCustomerResponse; return this; } - /** - * Unexpected error - */ - public AccountingCustomersUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingCustomersUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingCustomersUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateCustomerResponse = Optional.empty(); + private UpdateCustomerResponse updateCustomerResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Customers - */ - public Builder updateCustomerResponse(UpdateCustomerResponse updateCustomerResponse) { - Utils.checkNotNull(updateCustomerResponse, "updateCustomerResponse"); - this.updateCustomerResponse = Optional.ofNullable(updateCustomerResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Customers */ - public Builder updateCustomerResponse(Optional updateCustomerResponse) { - Utils.checkNotNull(updateCustomerResponse, "updateCustomerResponse"); + public Builder updateCustomerResponse(@Nullable UpdateCustomerResponse updateCustomerResponse) { this.updateCustomerResponse = updateCustomerResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingCustomersUpdateResponse build() { - return new AccountingCustomersUpdateResponse( contentType, statusCode, rawResponse, updateCustomerResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddRequest.java index f611cdc1..367dc27b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingDepartmentsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingDepartmentsAddRequest { @JsonCreator public AccountingDepartmentsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - AccountingDepartmentInput accountingDepartment) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(accountingDepartment, "accountingDepartment"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull AccountingDepartmentInput accountingDepartment) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.accountingDepartment = accountingDepartment; + this.accountingDepartment = Optional.ofNullable(accountingDepartment) + .orElseThrow(() -> new IllegalArgumentException("accountingDepartment cannot be null")); } public AccountingDepartmentsAddRequest( - AccountingDepartmentInput accountingDepartment) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), accountingDepartment); + @Nonnull AccountingDepartmentInput accountingDepartment) { + this(null, null, null, + null, accountingDepartment); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public AccountingDepartmentInput accountingDepartment() { - return accountingDepartment; + return this.accountingDepartment; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingDepartmentsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingDepartmentsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingDepartmentsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingDepartmentsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingDepartmentsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingDepartmentsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingDepartmentsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingDepartmentsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingDepartmentsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingDepartmentsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingDepartmentsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingDepartmentsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingDepartmentsAddRequest withAccountingDepartment(AccountingDepartmentInput accountingDepartment) { - Utils.checkNotNull(accountingDepartment, "accountingDepartment"); - this.accountingDepartment = accountingDepartment; + + public AccountingDepartmentsAddRequest withAccountingDepartment(@Nonnull AccountingDepartmentInput accountingDepartment) { + this.accountingDepartment = Utils.checkNotNull(accountingDepartment, "accountingDepartment"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private AccountingDepartmentInput accountingDepartment; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder accountingDepartment(AccountingDepartmentInput accountingDepartment) { - Utils.checkNotNull(accountingDepartment, "accountingDepartment"); - this.accountingDepartment = accountingDepartment; + public Builder accountingDepartment(@Nonnull AccountingDepartmentInput accountingDepartment) { + this.accountingDepartment = Utils.checkNotNull(accountingDepartment, "accountingDepartment"); return this; } public AccountingDepartmentsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingDepartmentsAddRequest( raw, consumerId, appId, serviceId, accountingDepartment); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddRequestBuilder.java index cc75e4ed..9c5de12c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingDepartmentsAddRequestBuilder { - - private AccountingDepartmentsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingDepartmentsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingDepartmentsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingDepartmentsAddRequestBuilder request(AccountingDepartmentsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingDepartmentsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingDepartmentsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingDepartmentsAddRequestBuilder request(@Nonnull AccountingDepartmentsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingDepartmentsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingDepartmentsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingDepartmentsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddResponse.java index 3c9f62b9..60b33bb9 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingDepartmentsAddResponse implements Response { /** * Department */ - private Optional createAccountingDepartmentResponse; + private CreateAccountingDepartmentResponse createAccountingDepartmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingDepartmentsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createAccountingDepartmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createAccountingDepartmentResponse, "createAccountingDepartmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateAccountingDepartmentResponse createAccountingDepartmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createAccountingDepartmentResponse = createAccountingDepartmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingDepartmentsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Department */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createAccountingDepartmentResponse() { - return (Optional) createAccountingDepartmentResponse; + return Optional.ofNullable(this.createAccountingDepartmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingDepartmentsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingDepartmentsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingDepartmentsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingDepartmentsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Department + * Raw HTTP response; suitable for custom response parsing */ - public AccountingDepartmentsAddResponse withCreateAccountingDepartmentResponse(CreateAccountingDepartmentResponse createAccountingDepartmentResponse) { - Utils.checkNotNull(createAccountingDepartmentResponse, "createAccountingDepartmentResponse"); - this.createAccountingDepartmentResponse = Optional.ofNullable(createAccountingDepartmentResponse); + public AccountingDepartmentsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingDepartmentsAddResponse withCreateAccountingDepartmentResponse(C /** * Department */ - public AccountingDepartmentsAddResponse withCreateAccountingDepartmentResponse(Optional createAccountingDepartmentResponse) { - Utils.checkNotNull(createAccountingDepartmentResponse, "createAccountingDepartmentResponse"); + public AccountingDepartmentsAddResponse withCreateAccountingDepartmentResponse(@Nullable CreateAccountingDepartmentResponse createAccountingDepartmentResponse) { this.createAccountingDepartmentResponse = createAccountingDepartmentResponse; return this; } - /** - * Unexpected error - */ - public AccountingDepartmentsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingDepartmentsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingDepartmentsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createAccountingDepartmentResponse = Optional.empty(); + private CreateAccountingDepartmentResponse createAccountingDepartmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Department - */ - public Builder createAccountingDepartmentResponse(CreateAccountingDepartmentResponse createAccountingDepartmentResponse) { - Utils.checkNotNull(createAccountingDepartmentResponse, "createAccountingDepartmentResponse"); - this.createAccountingDepartmentResponse = Optional.ofNullable(createAccountingDepartmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Department */ - public Builder createAccountingDepartmentResponse(Optional createAccountingDepartmentResponse) { - Utils.checkNotNull(createAccountingDepartmentResponse, "createAccountingDepartmentResponse"); + public Builder createAccountingDepartmentResponse(@Nullable CreateAccountingDepartmentResponse createAccountingDepartmentResponse) { this.createAccountingDepartmentResponse = createAccountingDepartmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingDepartmentsAddResponse build() { - return new AccountingDepartmentsAddResponse( contentType, statusCode, rawResponse, createAccountingDepartmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllRequest.java index a1e00cf1..ee6f529b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllRequest.java @@ -8,13 +8,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,25 +23,25 @@ public class AccountingDepartmentsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -54,7 +53,7 @@ public class AccountingDepartmentsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -66,105 +65,92 @@ public class AccountingDepartmentsAllRequest { * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private AccountingDepartmentsFilter filter; @JsonCreator public AccountingDepartmentsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - JsonNullable fields, - Optional filter) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(filter, "filter"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable JsonNullable fields, + @Nullable AccountingDepartmentsFilter filter) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; - this.fields = fields; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); this.filter = filter; } public AccountingDepartmentsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } public static Builder builder() { @@ -175,103 +161,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingDepartmentsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingDepartmentsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingDepartmentsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingDepartmentsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingDepartmentsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingDepartmentsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingDepartmentsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingDepartmentsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingDepartmentsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingDepartmentsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingDepartmentsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingDepartmentsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingDepartmentsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingDepartmentsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingDepartmentsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingDepartmentsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -279,36 +206,17 @@ public AccountingDepartmentsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingDepartmentsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingDepartmentsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingDepartmentsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = JsonNullable.of(fields); - return this; - } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingDepartmentsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** - * Apply filters - */ - public AccountingDepartmentsAllRequest withFilter(AccountingDepartmentsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); + public AccountingDepartmentsAllRequest withFields(@Nullable String fields) { + this.fields = JsonNullable.of(fields); return this; } @@ -316,12 +224,12 @@ public AccountingDepartmentsAllRequest withFilter(AccountingDepartmentsFilter fi /** * Apply filters */ - public AccountingDepartmentsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingDepartmentsAllRequest withFilter(@Nullable AccountingDepartmentsFilter filter) { this.filter = filter; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -366,186 +274,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; - private Optional filter = Optional.empty(); + private AccountingDepartmentsFilter filter; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** * Apply filters */ - public Builder filter(AccountingDepartmentsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable AccountingDepartmentsFilter filter) { this.filter = filter; return this; } public AccountingDepartmentsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingDepartmentsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -553,16 +366,16 @@ public AccountingDepartmentsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllRequestBuilder.java index 613aada0..0e62df3a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingDepartmentsAllRequestBuilder { - - private AccountingDepartmentsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingDepartmentsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingDepartmentsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingDepartmentsAllRequestBuilder request(AccountingDepartmentsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingDepartmentsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingDepartmentsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingDepartmentsAllRequestBuilder request(@Nonnull AccountingDepartmentsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingDepartmentsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingDepartmentsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingDepartmentsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingDepartmentsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingDepartmentsAllOperation( - sdkConfiguration, - options); + AccountingDepartmentsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingDepartmentsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingDepartmentsAllRequest::withCursor, + AccountingDepartmentsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllResponse.java index 10db9565..c34df675 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingDepartmentsAllResponse implements Response { /** * Departments */ - private Optional getAccountingDepartmentsResponse; + private GetAccountingDepartmentsResponse getAccountingDepartmentsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingDepartmentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getAccountingDepartmentsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getAccountingDepartmentsResponse, "getAccountingDepartmentsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetAccountingDepartmentsResponse getAccountingDepartmentsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getAccountingDepartmentsResponse = getAccountingDepartmentsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingDepartmentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Departments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getAccountingDepartmentsResponse() { - return (Optional) getAccountingDepartmentsResponse; + return Optional.ofNullable(this.getAccountingDepartmentsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingDepartmentsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingDepartmentsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingDepartmentsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingDepartmentsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Departments + * Raw HTTP response; suitable for custom response parsing */ - public AccountingDepartmentsAllResponse withGetAccountingDepartmentsResponse(GetAccountingDepartmentsResponse getAccountingDepartmentsResponse) { - Utils.checkNotNull(getAccountingDepartmentsResponse, "getAccountingDepartmentsResponse"); - this.getAccountingDepartmentsResponse = Optional.ofNullable(getAccountingDepartmentsResponse); + public AccountingDepartmentsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingDepartmentsAllResponse withGetAccountingDepartmentsResponse(Get /** * Departments */ - public AccountingDepartmentsAllResponse withGetAccountingDepartmentsResponse(Optional getAccountingDepartmentsResponse) { - Utils.checkNotNull(getAccountingDepartmentsResponse, "getAccountingDepartmentsResponse"); + public AccountingDepartmentsAllResponse withGetAccountingDepartmentsResponse(@Nullable GetAccountingDepartmentsResponse getAccountingDepartmentsResponse) { this.getAccountingDepartmentsResponse = getAccountingDepartmentsResponse; return this; } - /** - * Unexpected error - */ - public AccountingDepartmentsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingDepartmentsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingDepartmentsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getAccountingDepartmentsResponse = Optional.empty(); + private GetAccountingDepartmentsResponse getAccountingDepartmentsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Departments - */ - public Builder getAccountingDepartmentsResponse(GetAccountingDepartmentsResponse getAccountingDepartmentsResponse) { - Utils.checkNotNull(getAccountingDepartmentsResponse, "getAccountingDepartmentsResponse"); - this.getAccountingDepartmentsResponse = Optional.ofNullable(getAccountingDepartmentsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Departments */ - public Builder getAccountingDepartmentsResponse(Optional getAccountingDepartmentsResponse) { - Utils.checkNotNull(getAccountingDepartmentsResponse, "getAccountingDepartmentsResponse"); + public Builder getAccountingDepartmentsResponse(@Nullable GetAccountingDepartmentsResponse getAccountingDepartmentsResponse) { this.getAccountingDepartmentsResponse = getAccountingDepartmentsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingDepartmentsAllResponse build() { - return new AccountingDepartmentsAllResponse( contentType, statusCode, rawResponse, getAccountingDepartmentsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteRequest.java index 6ad61025..cab42aaa 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingDepartmentsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingDepartmentsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingDepartmentsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingDepartmentsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingDepartmentsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingDepartmentsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingDepartmentsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingDepartmentsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingDepartmentsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingDepartmentsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingDepartmentsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingDepartmentsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingDepartmentsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingDepartmentsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingDepartmentsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingDepartmentsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingDepartmentsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingDepartmentsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingDepartmentsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingDepartmentsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteRequestBuilder.java index 7524b506..296b44f0 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingDepartmentsDeleteRequestBuilder { - - private AccountingDepartmentsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingDepartmentsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingDepartmentsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingDepartmentsDeleteRequestBuilder request(AccountingDepartmentsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingDepartmentsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingDepartmentsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingDepartmentsDeleteRequestBuilder request(@Nonnull AccountingDepartmentsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingDepartmentsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingDepartmentsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingDepartmentsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteResponse.java index ffa5f572..049fd8e9 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingDepartmentsDeleteResponse implements Response { /** * Department deleted */ - private Optional deleteAccountingDepartmentResponse; + private DeleteAccountingDepartmentResponse deleteAccountingDepartmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingDepartmentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteAccountingDepartmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteAccountingDepartmentResponse, "deleteAccountingDepartmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteAccountingDepartmentResponse deleteAccountingDepartmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteAccountingDepartmentResponse = deleteAccountingDepartmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingDepartmentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Department deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteAccountingDepartmentResponse() { - return (Optional) deleteAccountingDepartmentResponse; + return Optional.ofNullable(this.deleteAccountingDepartmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingDepartmentsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingDepartmentsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingDepartmentsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingDepartmentsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Department deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingDepartmentsDeleteResponse withDeleteAccountingDepartmentResponse(DeleteAccountingDepartmentResponse deleteAccountingDepartmentResponse) { - Utils.checkNotNull(deleteAccountingDepartmentResponse, "deleteAccountingDepartmentResponse"); - this.deleteAccountingDepartmentResponse = Optional.ofNullable(deleteAccountingDepartmentResponse); + public AccountingDepartmentsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingDepartmentsDeleteResponse withDeleteAccountingDepartmentRespons /** * Department deleted */ - public AccountingDepartmentsDeleteResponse withDeleteAccountingDepartmentResponse(Optional deleteAccountingDepartmentResponse) { - Utils.checkNotNull(deleteAccountingDepartmentResponse, "deleteAccountingDepartmentResponse"); + public AccountingDepartmentsDeleteResponse withDeleteAccountingDepartmentResponse(@Nullable DeleteAccountingDepartmentResponse deleteAccountingDepartmentResponse) { this.deleteAccountingDepartmentResponse = deleteAccountingDepartmentResponse; return this; } - /** - * Unexpected error - */ - public AccountingDepartmentsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingDepartmentsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingDepartmentsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteAccountingDepartmentResponse = Optional.empty(); + private DeleteAccountingDepartmentResponse deleteAccountingDepartmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Department deleted - */ - public Builder deleteAccountingDepartmentResponse(DeleteAccountingDepartmentResponse deleteAccountingDepartmentResponse) { - Utils.checkNotNull(deleteAccountingDepartmentResponse, "deleteAccountingDepartmentResponse"); - this.deleteAccountingDepartmentResponse = Optional.ofNullable(deleteAccountingDepartmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Department deleted */ - public Builder deleteAccountingDepartmentResponse(Optional deleteAccountingDepartmentResponse) { - Utils.checkNotNull(deleteAccountingDepartmentResponse, "deleteAccountingDepartmentResponse"); + public Builder deleteAccountingDepartmentResponse(@Nullable DeleteAccountingDepartmentResponse deleteAccountingDepartmentResponse) { this.deleteAccountingDepartmentResponse = deleteAccountingDepartmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingDepartmentsDeleteResponse build() { - return new AccountingDepartmentsDeleteResponse( contentType, statusCode, rawResponse, deleteAccountingDepartmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneRequest.java index 05bba628..ceba1395 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingDepartmentsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingDepartmentsOneRequest { @JsonCreator public AccountingDepartmentsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingDepartmentsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingDepartmentsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingDepartmentsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingDepartmentsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingDepartmentsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingDepartmentsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingDepartmentsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingDepartmentsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingDepartmentsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingDepartmentsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingDepartmentsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingDepartmentsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingDepartmentsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingDepartmentsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingDepartmentsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingDepartmentsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingDepartmentsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingDepartmentsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingDepartmentsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingDepartmentsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingDepartmentsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneRequestBuilder.java index 7efeb430..a4e1a4a9 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingDepartmentsOneRequestBuilder { - - private AccountingDepartmentsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingDepartmentsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingDepartmentsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingDepartmentsOneRequestBuilder request(AccountingDepartmentsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingDepartmentsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingDepartmentsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingDepartmentsOneRequestBuilder request(@Nonnull AccountingDepartmentsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingDepartmentsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingDepartmentsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingDepartmentsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneResponse.java index 2191e3f6..cc77d06f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingDepartmentsOneResponse implements Response { /** * Location */ - private Optional getAccountingDepartmentResponse; + private GetAccountingDepartmentResponse getAccountingDepartmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingDepartmentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getAccountingDepartmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getAccountingDepartmentResponse, "getAccountingDepartmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetAccountingDepartmentResponse getAccountingDepartmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getAccountingDepartmentResponse = getAccountingDepartmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingDepartmentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Location */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getAccountingDepartmentResponse() { - return (Optional) getAccountingDepartmentResponse; + return Optional.ofNullable(this.getAccountingDepartmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingDepartmentsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingDepartmentsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingDepartmentsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingDepartmentsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Location + * Raw HTTP response; suitable for custom response parsing */ - public AccountingDepartmentsOneResponse withGetAccountingDepartmentResponse(GetAccountingDepartmentResponse getAccountingDepartmentResponse) { - Utils.checkNotNull(getAccountingDepartmentResponse, "getAccountingDepartmentResponse"); - this.getAccountingDepartmentResponse = Optional.ofNullable(getAccountingDepartmentResponse); + public AccountingDepartmentsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingDepartmentsOneResponse withGetAccountingDepartmentResponse(GetA /** * Location */ - public AccountingDepartmentsOneResponse withGetAccountingDepartmentResponse(Optional getAccountingDepartmentResponse) { - Utils.checkNotNull(getAccountingDepartmentResponse, "getAccountingDepartmentResponse"); + public AccountingDepartmentsOneResponse withGetAccountingDepartmentResponse(@Nullable GetAccountingDepartmentResponse getAccountingDepartmentResponse) { this.getAccountingDepartmentResponse = getAccountingDepartmentResponse; return this; } - /** - * Unexpected error - */ - public AccountingDepartmentsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingDepartmentsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingDepartmentsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getAccountingDepartmentResponse = Optional.empty(); + private GetAccountingDepartmentResponse getAccountingDepartmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Location - */ - public Builder getAccountingDepartmentResponse(GetAccountingDepartmentResponse getAccountingDepartmentResponse) { - Utils.checkNotNull(getAccountingDepartmentResponse, "getAccountingDepartmentResponse"); - this.getAccountingDepartmentResponse = Optional.ofNullable(getAccountingDepartmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Location */ - public Builder getAccountingDepartmentResponse(Optional getAccountingDepartmentResponse) { - Utils.checkNotNull(getAccountingDepartmentResponse, "getAccountingDepartmentResponse"); + public Builder getAccountingDepartmentResponse(@Nullable GetAccountingDepartmentResponse getAccountingDepartmentResponse) { this.getAccountingDepartmentResponse = getAccountingDepartmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingDepartmentsOneResponse build() { - return new AccountingDepartmentsOneResponse( contentType, statusCode, rawResponse, getAccountingDepartmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateRequest.java index 0e0b8de9..38159287 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingDepartmentsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingDepartmentsUpdateRequest { @JsonCreator public AccountingDepartmentsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - AccountingDepartmentInput accountingDepartment) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(accountingDepartment, "accountingDepartment"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull AccountingDepartmentInput accountingDepartment) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.accountingDepartment = accountingDepartment; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.accountingDepartment = Optional.ofNullable(accountingDepartment) + .orElseThrow(() -> new IllegalArgumentException("accountingDepartment cannot be null")); } public AccountingDepartmentsUpdateRequest( - String id, - AccountingDepartmentInput accountingDepartment) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), accountingDepartment); + @Nonnull String id, + @Nonnull AccountingDepartmentInput accountingDepartment) { + this(id, null, null, + null, null, accountingDepartment); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public AccountingDepartmentInput accountingDepartment() { - return accountingDepartment; + return this.accountingDepartment; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingDepartmentsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingDepartmentsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingDepartmentsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingDepartmentsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingDepartmentsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingDepartmentsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingDepartmentsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingDepartmentsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingDepartmentsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingDepartmentsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingDepartmentsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingDepartmentsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingDepartmentsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingDepartmentsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingDepartmentsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingDepartmentsUpdateRequest withAccountingDepartment(AccountingDepartmentInput accountingDepartment) { - Utils.checkNotNull(accountingDepartment, "accountingDepartment"); - this.accountingDepartment = accountingDepartment; + + public AccountingDepartmentsUpdateRequest withAccountingDepartment(@Nonnull AccountingDepartmentInput accountingDepartment) { + this.accountingDepartment = Utils.checkNotNull(accountingDepartment, "accountingDepartment"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private AccountingDepartmentInput accountingDepartment; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder accountingDepartment(AccountingDepartmentInput accountingDepartment) { - Utils.checkNotNull(accountingDepartment, "accountingDepartment"); - this.accountingDepartment = accountingDepartment; + public Builder accountingDepartment(@Nonnull AccountingDepartmentInput accountingDepartment) { + this.accountingDepartment = Utils.checkNotNull(accountingDepartment, "accountingDepartment"); return this; } public AccountingDepartmentsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingDepartmentsUpdateRequest( id, consumerId, appId, serviceId, raw, accountingDepartment); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateRequestBuilder.java index 1cf3c995..7986b087 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingDepartmentsUpdateRequestBuilder { - - private AccountingDepartmentsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingDepartmentsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingDepartmentsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingDepartmentsUpdateRequestBuilder request(AccountingDepartmentsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingDepartmentsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingDepartmentsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingDepartmentsUpdateRequestBuilder request(@Nonnull AccountingDepartmentsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingDepartmentsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingDepartmentsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingDepartmentsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateResponse.java index 8a0a9cf6..e7e8a461 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingDepartmentsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingDepartmentsUpdateResponse implements Response { /** * Department */ - private Optional updateAccountingDepartmentResponse; + private UpdateAccountingDepartmentResponse updateAccountingDepartmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingDepartmentsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateAccountingDepartmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateAccountingDepartmentResponse, "updateAccountingDepartmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateAccountingDepartmentResponse updateAccountingDepartmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateAccountingDepartmentResponse = updateAccountingDepartmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingDepartmentsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Department */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateAccountingDepartmentResponse() { - return (Optional) updateAccountingDepartmentResponse; + return Optional.ofNullable(this.updateAccountingDepartmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingDepartmentsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingDepartmentsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingDepartmentsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingDepartmentsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Department + * Raw HTTP response; suitable for custom response parsing */ - public AccountingDepartmentsUpdateResponse withUpdateAccountingDepartmentResponse(UpdateAccountingDepartmentResponse updateAccountingDepartmentResponse) { - Utils.checkNotNull(updateAccountingDepartmentResponse, "updateAccountingDepartmentResponse"); - this.updateAccountingDepartmentResponse = Optional.ofNullable(updateAccountingDepartmentResponse); + public AccountingDepartmentsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingDepartmentsUpdateResponse withUpdateAccountingDepartmentRespons /** * Department */ - public AccountingDepartmentsUpdateResponse withUpdateAccountingDepartmentResponse(Optional updateAccountingDepartmentResponse) { - Utils.checkNotNull(updateAccountingDepartmentResponse, "updateAccountingDepartmentResponse"); + public AccountingDepartmentsUpdateResponse withUpdateAccountingDepartmentResponse(@Nullable UpdateAccountingDepartmentResponse updateAccountingDepartmentResponse) { this.updateAccountingDepartmentResponse = updateAccountingDepartmentResponse; return this; } - /** - * Unexpected error - */ - public AccountingDepartmentsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingDepartmentsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingDepartmentsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateAccountingDepartmentResponse = Optional.empty(); + private UpdateAccountingDepartmentResponse updateAccountingDepartmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Department - */ - public Builder updateAccountingDepartmentResponse(UpdateAccountingDepartmentResponse updateAccountingDepartmentResponse) { - Utils.checkNotNull(updateAccountingDepartmentResponse, "updateAccountingDepartmentResponse"); - this.updateAccountingDepartmentResponse = Optional.ofNullable(updateAccountingDepartmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Department */ - public Builder updateAccountingDepartmentResponse(Optional updateAccountingDepartmentResponse) { - Utils.checkNotNull(updateAccountingDepartmentResponse, "updateAccountingDepartmentResponse"); + public Builder updateAccountingDepartmentResponse(@Nullable UpdateAccountingDepartmentResponse updateAccountingDepartmentResponse) { this.updateAccountingDepartmentResponse = updateAccountingDepartmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingDepartmentsUpdateResponse build() { - return new AccountingDepartmentsUpdateResponse( contentType, statusCode, rawResponse, updateAccountingDepartmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddRequest.java index 16cec487..d52de42e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingExpensesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingExpensesAddRequest { @JsonCreator public AccountingExpensesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - ExpenseInput expense) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(expense, "expense"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull ExpenseInput expense) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.expense = expense; + this.expense = Optional.ofNullable(expense) + .orElseThrow(() -> new IllegalArgumentException("expense cannot be null")); } public AccountingExpensesAddRequest( - ExpenseInput expense) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), expense); + @Nonnull ExpenseInput expense) { + this(null, null, null, + null, expense); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public ExpenseInput expense() { - return expense; + return this.expense; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingExpensesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingExpensesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingExpensesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingExpensesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingExpensesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingExpensesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingExpensesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingExpensesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingExpensesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingExpensesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingExpensesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingExpensesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingExpensesAddRequest withExpense(ExpenseInput expense) { - Utils.checkNotNull(expense, "expense"); - this.expense = expense; + + public AccountingExpensesAddRequest withExpense(@Nonnull ExpenseInput expense) { + this.expense = Utils.checkNotNull(expense, "expense"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private ExpenseInput expense; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder expense(ExpenseInput expense) { - Utils.checkNotNull(expense, "expense"); - this.expense = expense; + public Builder expense(@Nonnull ExpenseInput expense) { + this.expense = Utils.checkNotNull(expense, "expense"); return this; } public AccountingExpensesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingExpensesAddRequest( raw, consumerId, appId, serviceId, expense); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddRequestBuilder.java index aa987fed..d70f5f44 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingExpensesAddRequestBuilder { - - private AccountingExpensesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingExpensesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingExpensesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingExpensesAddRequestBuilder request(AccountingExpensesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingExpensesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingExpensesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingExpensesAddRequestBuilder request(@Nonnull AccountingExpensesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingExpensesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingExpensesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingExpensesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddResponse.java index 5f89077d..93fdf816 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingExpensesAddResponse implements Response { /** * Expenses */ - private Optional createExpenseResponse; + private CreateExpenseResponse createExpenseResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingExpensesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createExpenseResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createExpenseResponse, "createExpenseResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateExpenseResponse createExpenseResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createExpenseResponse = createExpenseResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingExpensesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Expenses */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createExpenseResponse() { - return (Optional) createExpenseResponse; + return Optional.ofNullable(this.createExpenseResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingExpensesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingExpensesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingExpensesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingExpensesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Expenses + * Raw HTTP response; suitable for custom response parsing */ - public AccountingExpensesAddResponse withCreateExpenseResponse(CreateExpenseResponse createExpenseResponse) { - Utils.checkNotNull(createExpenseResponse, "createExpenseResponse"); - this.createExpenseResponse = Optional.ofNullable(createExpenseResponse); + public AccountingExpensesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingExpensesAddResponse withCreateExpenseResponse(CreateExpenseResp /** * Expenses */ - public AccountingExpensesAddResponse withCreateExpenseResponse(Optional createExpenseResponse) { - Utils.checkNotNull(createExpenseResponse, "createExpenseResponse"); + public AccountingExpensesAddResponse withCreateExpenseResponse(@Nullable CreateExpenseResponse createExpenseResponse) { this.createExpenseResponse = createExpenseResponse; return this; } - /** - * Unexpected error - */ - public AccountingExpensesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingExpensesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingExpensesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createExpenseResponse = Optional.empty(); + private CreateExpenseResponse createExpenseResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Expenses - */ - public Builder createExpenseResponse(CreateExpenseResponse createExpenseResponse) { - Utils.checkNotNull(createExpenseResponse, "createExpenseResponse"); - this.createExpenseResponse = Optional.ofNullable(createExpenseResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Expenses */ - public Builder createExpenseResponse(Optional createExpenseResponse) { - Utils.checkNotNull(createExpenseResponse, "createExpenseResponse"); + public Builder createExpenseResponse(@Nullable CreateExpenseResponse createExpenseResponse) { this.createExpenseResponse = createExpenseResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingExpensesAddResponse build() { - return new AccountingExpensesAddResponse( contentType, statusCode, rawResponse, createExpenseResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllRequest.java index e5a1ca96..f1423492 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllRequest.java @@ -7,8 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; @@ -22,25 +22,25 @@ public class AccountingExpensesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -52,81 +52,72 @@ public class AccountingExpensesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; @JsonCreator public AccountingExpensesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); } public AccountingExpensesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } public static Builder builder() { @@ -137,103 +128,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingExpensesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingExpensesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingExpensesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingExpensesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingExpensesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingExpensesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingExpensesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingExpensesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingExpensesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingExpensesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingExpensesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingExpensesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingExpensesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingExpensesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingExpensesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingExpensesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -241,12 +173,12 @@ public AccountingExpensesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingExpensesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingExpensesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -286,160 +218,87 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } public AccountingExpensesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingExpensesAllRequest( raw, consumerId, appId, serviceId, cursor, limit); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllRequestBuilder.java index 91f2c419..439c796e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingExpensesAllRequestBuilder { - - private AccountingExpensesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingExpensesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingExpensesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingExpensesAllRequestBuilder request(AccountingExpensesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingExpensesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingExpensesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingExpensesAllRequestBuilder request(@Nonnull AccountingExpensesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingExpensesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingExpensesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingExpensesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingExpensesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingExpensesAllOperation( - sdkConfiguration, - options); + AccountingExpensesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingExpensesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingExpensesAllRequest::withCursor, + AccountingExpensesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllResponse.java index 2d80b587..983a8450 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingExpensesAllResponse implements Response { /** * Expenses */ - private Optional getExpensesResponse; + private GetExpensesResponse getExpensesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingExpensesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getExpensesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getExpensesResponse, "getExpensesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetExpensesResponse getExpensesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getExpensesResponse = getExpensesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingExpensesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Expenses */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getExpensesResponse() { - return (Optional) getExpensesResponse; + return Optional.ofNullable(this.getExpensesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingExpensesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingExpensesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingExpensesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingExpensesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Expenses + * Raw HTTP response; suitable for custom response parsing */ - public AccountingExpensesAllResponse withGetExpensesResponse(GetExpensesResponse getExpensesResponse) { - Utils.checkNotNull(getExpensesResponse, "getExpensesResponse"); - this.getExpensesResponse = Optional.ofNullable(getExpensesResponse); + public AccountingExpensesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingExpensesAllResponse withGetExpensesResponse(GetExpensesResponse /** * Expenses */ - public AccountingExpensesAllResponse withGetExpensesResponse(Optional getExpensesResponse) { - Utils.checkNotNull(getExpensesResponse, "getExpensesResponse"); + public AccountingExpensesAllResponse withGetExpensesResponse(@Nullable GetExpensesResponse getExpensesResponse) { this.getExpensesResponse = getExpensesResponse; return this; } - /** - * Unexpected error - */ - public AccountingExpensesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingExpensesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingExpensesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getExpensesResponse = Optional.empty(); + private GetExpensesResponse getExpensesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Expenses - */ - public Builder getExpensesResponse(GetExpensesResponse getExpensesResponse) { - Utils.checkNotNull(getExpensesResponse, "getExpensesResponse"); - this.getExpensesResponse = Optional.ofNullable(getExpensesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Expenses */ - public Builder getExpensesResponse(Optional getExpensesResponse) { - Utils.checkNotNull(getExpensesResponse, "getExpensesResponse"); + public Builder getExpensesResponse(@Nullable GetExpensesResponse getExpensesResponse) { this.getExpensesResponse = getExpensesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingExpensesAllResponse build() { - return new AccountingExpensesAllResponse( contentType, statusCode, rawResponse, getExpensesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteRequest.java index af9bd127..5b9a52b4 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingExpensesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingExpensesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingExpensesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingExpensesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingExpensesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingExpensesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingExpensesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingExpensesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingExpensesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingExpensesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingExpensesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingExpensesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingExpensesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingExpensesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingExpensesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingExpensesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingExpensesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingExpensesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingExpensesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingExpensesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteRequestBuilder.java index 485a790b..c084a4c0 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingExpensesDeleteRequestBuilder { - - private AccountingExpensesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingExpensesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingExpensesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingExpensesDeleteRequestBuilder request(AccountingExpensesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingExpensesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingExpensesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingExpensesDeleteRequestBuilder request(@Nonnull AccountingExpensesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingExpensesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingExpensesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingExpensesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteResponse.java index 67247bc3..d2920b07 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingExpensesDeleteResponse implements Response { /** * Expenses */ - private Optional deleteExpenseResponse; + private DeleteExpenseResponse deleteExpenseResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingExpensesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteExpenseResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteExpenseResponse, "deleteExpenseResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteExpenseResponse deleteExpenseResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteExpenseResponse = deleteExpenseResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingExpensesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Expenses */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteExpenseResponse() { - return (Optional) deleteExpenseResponse; + return Optional.ofNullable(this.deleteExpenseResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingExpensesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingExpensesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingExpensesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingExpensesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Expenses + * Raw HTTP response; suitable for custom response parsing */ - public AccountingExpensesDeleteResponse withDeleteExpenseResponse(DeleteExpenseResponse deleteExpenseResponse) { - Utils.checkNotNull(deleteExpenseResponse, "deleteExpenseResponse"); - this.deleteExpenseResponse = Optional.ofNullable(deleteExpenseResponse); + public AccountingExpensesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingExpensesDeleteResponse withDeleteExpenseResponse(DeleteExpenseR /** * Expenses */ - public AccountingExpensesDeleteResponse withDeleteExpenseResponse(Optional deleteExpenseResponse) { - Utils.checkNotNull(deleteExpenseResponse, "deleteExpenseResponse"); + public AccountingExpensesDeleteResponse withDeleteExpenseResponse(@Nullable DeleteExpenseResponse deleteExpenseResponse) { this.deleteExpenseResponse = deleteExpenseResponse; return this; } - /** - * Unexpected error - */ - public AccountingExpensesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingExpensesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingExpensesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteExpenseResponse = Optional.empty(); + private DeleteExpenseResponse deleteExpenseResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Expenses - */ - public Builder deleteExpenseResponse(DeleteExpenseResponse deleteExpenseResponse) { - Utils.checkNotNull(deleteExpenseResponse, "deleteExpenseResponse"); - this.deleteExpenseResponse = Optional.ofNullable(deleteExpenseResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Expenses */ - public Builder deleteExpenseResponse(Optional deleteExpenseResponse) { - Utils.checkNotNull(deleteExpenseResponse, "deleteExpenseResponse"); + public Builder deleteExpenseResponse(@Nullable DeleteExpenseResponse deleteExpenseResponse) { this.deleteExpenseResponse = deleteExpenseResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingExpensesDeleteResponse build() { - return new AccountingExpensesDeleteResponse( contentType, statusCode, rawResponse, deleteExpenseResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneRequest.java index d8fcd0e2..044c99c1 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingExpensesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingExpensesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingExpensesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingExpensesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingExpensesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingExpensesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingExpensesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingExpensesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingExpensesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingExpensesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingExpensesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingExpensesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingExpensesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingExpensesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingExpensesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingExpensesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingExpensesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingExpensesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingExpensesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingExpensesOneRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneRequestBuilder.java index 0890aa85..86c04b6c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingExpensesOneRequestBuilder { - - private AccountingExpensesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingExpensesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingExpensesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingExpensesOneRequestBuilder request(AccountingExpensesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingExpensesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingExpensesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingExpensesOneRequestBuilder request(@Nonnull AccountingExpensesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingExpensesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingExpensesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingExpensesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneResponse.java index 7bd03f06..e32a5a57 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingExpensesOneResponse implements Response { /** * Expenses */ - private Optional getExpenseResponse; + private GetExpenseResponse getExpenseResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingExpensesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getExpenseResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getExpenseResponse, "getExpenseResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetExpenseResponse getExpenseResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getExpenseResponse = getExpenseResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingExpensesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Expenses */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getExpenseResponse() { - return (Optional) getExpenseResponse; + return Optional.ofNullable(this.getExpenseResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingExpensesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingExpensesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingExpensesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingExpensesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Expenses + * Raw HTTP response; suitable for custom response parsing */ - public AccountingExpensesOneResponse withGetExpenseResponse(GetExpenseResponse getExpenseResponse) { - Utils.checkNotNull(getExpenseResponse, "getExpenseResponse"); - this.getExpenseResponse = Optional.ofNullable(getExpenseResponse); + public AccountingExpensesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingExpensesOneResponse withGetExpenseResponse(GetExpenseResponse g /** * Expenses */ - public AccountingExpensesOneResponse withGetExpenseResponse(Optional getExpenseResponse) { - Utils.checkNotNull(getExpenseResponse, "getExpenseResponse"); + public AccountingExpensesOneResponse withGetExpenseResponse(@Nullable GetExpenseResponse getExpenseResponse) { this.getExpenseResponse = getExpenseResponse; return this; } - /** - * Unexpected error - */ - public AccountingExpensesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingExpensesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingExpensesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getExpenseResponse = Optional.empty(); + private GetExpenseResponse getExpenseResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Expenses - */ - public Builder getExpenseResponse(GetExpenseResponse getExpenseResponse) { - Utils.checkNotNull(getExpenseResponse, "getExpenseResponse"); - this.getExpenseResponse = Optional.ofNullable(getExpenseResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Expenses */ - public Builder getExpenseResponse(Optional getExpenseResponse) { - Utils.checkNotNull(getExpenseResponse, "getExpenseResponse"); + public Builder getExpenseResponse(@Nullable GetExpenseResponse getExpenseResponse) { this.getExpenseResponse = getExpenseResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingExpensesOneResponse build() { - return new AccountingExpensesOneResponse( contentType, statusCode, rawResponse, getExpenseResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateRequest.java index ca237fd8..fa91f091 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingExpensesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingExpensesUpdateRequest { @JsonCreator public AccountingExpensesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - ExpenseInput expense) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(expense, "expense"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull ExpenseInput expense) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.expense = expense; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.expense = Optional.ofNullable(expense) + .orElseThrow(() -> new IllegalArgumentException("expense cannot be null")); } public AccountingExpensesUpdateRequest( - String id, - ExpenseInput expense) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), expense); + @Nonnull String id, + @Nonnull ExpenseInput expense) { + this(id, null, null, + null, null, expense); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public ExpenseInput expense() { - return expense; + return this.expense; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingExpensesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingExpensesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingExpensesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingExpensesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingExpensesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingExpensesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingExpensesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingExpensesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingExpensesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingExpensesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingExpensesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingExpensesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingExpensesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingExpensesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingExpensesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingExpensesUpdateRequest withExpense(ExpenseInput expense) { - Utils.checkNotNull(expense, "expense"); - this.expense = expense; + + public AccountingExpensesUpdateRequest withExpense(@Nonnull ExpenseInput expense) { + this.expense = Utils.checkNotNull(expense, "expense"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private ExpenseInput expense; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder expense(ExpenseInput expense) { - Utils.checkNotNull(expense, "expense"); - this.expense = expense; + public Builder expense(@Nonnull ExpenseInput expense) { + this.expense = Utils.checkNotNull(expense, "expense"); return this; } public AccountingExpensesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingExpensesUpdateRequest( id, consumerId, appId, serviceId, raw, expense); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateRequestBuilder.java index 9c3d0b65..507b700c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingExpensesUpdateRequestBuilder { - - private AccountingExpensesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingExpensesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingExpensesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingExpensesUpdateRequestBuilder request(AccountingExpensesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingExpensesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingExpensesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingExpensesUpdateRequestBuilder request(@Nonnull AccountingExpensesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingExpensesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingExpensesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingExpensesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateResponse.java index 8b539534..bb7fda1a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingExpensesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingExpensesUpdateResponse implements Response { /** * Expenses */ - private Optional updateExpenseResponse; + private UpdateExpenseResponse updateExpenseResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingExpensesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateExpenseResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateExpenseResponse, "updateExpenseResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateExpenseResponse updateExpenseResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateExpenseResponse = updateExpenseResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingExpensesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Expenses */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateExpenseResponse() { - return (Optional) updateExpenseResponse; + return Optional.ofNullable(this.updateExpenseResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingExpensesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingExpensesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingExpensesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingExpensesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Expenses + * Raw HTTP response; suitable for custom response parsing */ - public AccountingExpensesUpdateResponse withUpdateExpenseResponse(UpdateExpenseResponse updateExpenseResponse) { - Utils.checkNotNull(updateExpenseResponse, "updateExpenseResponse"); - this.updateExpenseResponse = Optional.ofNullable(updateExpenseResponse); + public AccountingExpensesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingExpensesUpdateResponse withUpdateExpenseResponse(UpdateExpenseR /** * Expenses */ - public AccountingExpensesUpdateResponse withUpdateExpenseResponse(Optional updateExpenseResponse) { - Utils.checkNotNull(updateExpenseResponse, "updateExpenseResponse"); + public AccountingExpensesUpdateResponse withUpdateExpenseResponse(@Nullable UpdateExpenseResponse updateExpenseResponse) { this.updateExpenseResponse = updateExpenseResponse; return this; } - /** - * Unexpected error - */ - public AccountingExpensesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingExpensesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingExpensesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateExpenseResponse = Optional.empty(); + private UpdateExpenseResponse updateExpenseResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Expenses - */ - public Builder updateExpenseResponse(UpdateExpenseResponse updateExpenseResponse) { - Utils.checkNotNull(updateExpenseResponse, "updateExpenseResponse"); - this.updateExpenseResponse = Optional.ofNullable(updateExpenseResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Expenses */ - public Builder updateExpenseResponse(Optional updateExpenseResponse) { - Utils.checkNotNull(updateExpenseResponse, "updateExpenseResponse"); + public Builder updateExpenseResponse(@Nullable UpdateExpenseResponse updateExpenseResponse) { this.updateExpenseResponse = updateExpenseResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingExpensesUpdateResponse build() { - return new AccountingExpensesUpdateResponse( contentType, statusCode, rawResponse, updateExpenseResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddRequest.java index b860ab45..d3b73416 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingInvoiceItemsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingInvoiceItemsAddRequest { @JsonCreator public AccountingInvoiceItemsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - InvoiceItemInput invoiceItem) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(invoiceItem, "invoiceItem"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull InvoiceItemInput invoiceItem) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.invoiceItem = invoiceItem; + this.invoiceItem = Optional.ofNullable(invoiceItem) + .orElseThrow(() -> new IllegalArgumentException("invoiceItem cannot be null")); } public AccountingInvoiceItemsAddRequest( - InvoiceItemInput invoiceItem) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), invoiceItem); + @Nonnull InvoiceItemInput invoiceItem) { + this(null, null, null, + null, invoiceItem); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public InvoiceItemInput invoiceItem() { - return invoiceItem; + return this.invoiceItem; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingInvoiceItemsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingInvoiceItemsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingInvoiceItemsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingInvoiceItemsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingInvoiceItemsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingInvoiceItemsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingInvoiceItemsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingInvoiceItemsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingInvoiceItemsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingInvoiceItemsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingInvoiceItemsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingInvoiceItemsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingInvoiceItemsAddRequest withInvoiceItem(InvoiceItemInput invoiceItem) { - Utils.checkNotNull(invoiceItem, "invoiceItem"); - this.invoiceItem = invoiceItem; + + public AccountingInvoiceItemsAddRequest withInvoiceItem(@Nonnull InvoiceItemInput invoiceItem) { + this.invoiceItem = Utils.checkNotNull(invoiceItem, "invoiceItem"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private InvoiceItemInput invoiceItem; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder invoiceItem(InvoiceItemInput invoiceItem) { - Utils.checkNotNull(invoiceItem, "invoiceItem"); - this.invoiceItem = invoiceItem; + public Builder invoiceItem(@Nonnull InvoiceItemInput invoiceItem) { + this.invoiceItem = Utils.checkNotNull(invoiceItem, "invoiceItem"); return this; } public AccountingInvoiceItemsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingInvoiceItemsAddRequest( raw, consumerId, appId, serviceId, invoiceItem); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddRequestBuilder.java index 26a5180c..0cdbf83f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingInvoiceItemsAddRequestBuilder { - - private AccountingInvoiceItemsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingInvoiceItemsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingInvoiceItemsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingInvoiceItemsAddRequestBuilder request(AccountingInvoiceItemsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingInvoiceItemsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingInvoiceItemsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingInvoiceItemsAddRequestBuilder request(@Nonnull AccountingInvoiceItemsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingInvoiceItemsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingInvoiceItemsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingInvoiceItemsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddResponse.java index 1d6f1de0..3e06b73c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingInvoiceItemsAddResponse implements Response { /** * InvoiceItems */ - private Optional createInvoiceItemResponse; + private CreateInvoiceItemResponse createInvoiceItemResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingInvoiceItemsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createInvoiceItemResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createInvoiceItemResponse, "createInvoiceItemResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateInvoiceItemResponse createInvoiceItemResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createInvoiceItemResponse = createInvoiceItemResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingInvoiceItemsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * InvoiceItems */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createInvoiceItemResponse() { - return (Optional) createInvoiceItemResponse; + return Optional.ofNullable(this.createInvoiceItemResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingInvoiceItemsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingInvoiceItemsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingInvoiceItemsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingInvoiceItemsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * InvoiceItems + * Raw HTTP response; suitable for custom response parsing */ - public AccountingInvoiceItemsAddResponse withCreateInvoiceItemResponse(CreateInvoiceItemResponse createInvoiceItemResponse) { - Utils.checkNotNull(createInvoiceItemResponse, "createInvoiceItemResponse"); - this.createInvoiceItemResponse = Optional.ofNullable(createInvoiceItemResponse); + public AccountingInvoiceItemsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingInvoiceItemsAddResponse withCreateInvoiceItemResponse(CreateInv /** * InvoiceItems */ - public AccountingInvoiceItemsAddResponse withCreateInvoiceItemResponse(Optional createInvoiceItemResponse) { - Utils.checkNotNull(createInvoiceItemResponse, "createInvoiceItemResponse"); + public AccountingInvoiceItemsAddResponse withCreateInvoiceItemResponse(@Nullable CreateInvoiceItemResponse createInvoiceItemResponse) { this.createInvoiceItemResponse = createInvoiceItemResponse; return this; } - /** - * Unexpected error - */ - public AccountingInvoiceItemsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingInvoiceItemsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingInvoiceItemsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createInvoiceItemResponse = Optional.empty(); + private CreateInvoiceItemResponse createInvoiceItemResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * InvoiceItems - */ - public Builder createInvoiceItemResponse(CreateInvoiceItemResponse createInvoiceItemResponse) { - Utils.checkNotNull(createInvoiceItemResponse, "createInvoiceItemResponse"); - this.createInvoiceItemResponse = Optional.ofNullable(createInvoiceItemResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * InvoiceItems */ - public Builder createInvoiceItemResponse(Optional createInvoiceItemResponse) { - Utils.checkNotNull(createInvoiceItemResponse, "createInvoiceItemResponse"); + public Builder createInvoiceItemResponse(@Nullable CreateInvoiceItemResponse createInvoiceItemResponse) { this.createInvoiceItemResponse = createInvoiceItemResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingInvoiceItemsAddResponse build() { - return new AccountingInvoiceItemsAddResponse( contentType, statusCode, rawResponse, createInvoiceItemResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllRequest.java index 979f3090..e15e217c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingInvoiceItemsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class AccountingInvoiceItemsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private InvoiceItemsFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private InvoiceItemsSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class AccountingInvoiceItemsAllRequest { @JsonCreator public AccountingInvoiceItemsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable InvoiceItemsFilter filter, + @Nullable InvoiceItemsSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingInvoiceItemsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingInvoiceItemsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingInvoiceItemsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingInvoiceItemsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingInvoiceItemsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingInvoiceItemsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingInvoiceItemsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingInvoiceItemsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingInvoiceItemsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingInvoiceItemsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingInvoiceItemsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingInvoiceItemsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingInvoiceItemsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingInvoiceItemsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingInvoiceItemsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingInvoiceItemsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingInvoiceItemsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public AccountingInvoiceItemsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingInvoiceItemsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingInvoiceItemsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingInvoiceItemsAllRequest withFilter(InvoiceItemsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingInvoiceItemsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingInvoiceItemsAllRequest withFilter(@Nullable InvoiceItemsFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingInvoiceItemsAllRequest withSort(InvoiceItemsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingInvoiceItemsAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingInvoiceItemsAllRequest withSort(@Nullable InvoiceItemsSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingInvoiceItemsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingInvoiceItemsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingInvoiceItemsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingInvoiceItemsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingInvoiceItemsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingInvoiceItemsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private InvoiceItemsFilter filter; - private Optional sort = Optional.empty(); + private InvoiceItemsSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(InvoiceItemsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable InvoiceItemsFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(InvoiceItemsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable InvoiceItemsSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingInvoiceItemsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingInvoiceItemsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public AccountingInvoiceItemsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllRequestBuilder.java index bd18087f..0dc33910 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingInvoiceItemsAllRequestBuilder { - - private AccountingInvoiceItemsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingInvoiceItemsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingInvoiceItemsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingInvoiceItemsAllRequestBuilder request(AccountingInvoiceItemsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingInvoiceItemsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingInvoiceItemsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingInvoiceItemsAllRequestBuilder request(@Nonnull AccountingInvoiceItemsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingInvoiceItemsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingInvoiceItemsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingInvoiceItemsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingInvoiceItemsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingInvoiceItemsAllOperation( - sdkConfiguration, - options); + AccountingInvoiceItemsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingInvoiceItemsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingInvoiceItemsAllRequest::withCursor, + AccountingInvoiceItemsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllResponse.java index 15c3f571..2eee3364 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingInvoiceItemsAllResponse implements Response { /** * InvoiceItems */ - private Optional getInvoiceItemsResponse; + private GetInvoiceItemsResponse getInvoiceItemsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingInvoiceItemsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getInvoiceItemsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getInvoiceItemsResponse, "getInvoiceItemsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetInvoiceItemsResponse getInvoiceItemsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getInvoiceItemsResponse = getInvoiceItemsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingInvoiceItemsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * InvoiceItems */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getInvoiceItemsResponse() { - return (Optional) getInvoiceItemsResponse; + return Optional.ofNullable(this.getInvoiceItemsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingInvoiceItemsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingInvoiceItemsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingInvoiceItemsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingInvoiceItemsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * InvoiceItems + * Raw HTTP response; suitable for custom response parsing */ - public AccountingInvoiceItemsAllResponse withGetInvoiceItemsResponse(GetInvoiceItemsResponse getInvoiceItemsResponse) { - Utils.checkNotNull(getInvoiceItemsResponse, "getInvoiceItemsResponse"); - this.getInvoiceItemsResponse = Optional.ofNullable(getInvoiceItemsResponse); + public AccountingInvoiceItemsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingInvoiceItemsAllResponse withGetInvoiceItemsResponse(GetInvoiceI /** * InvoiceItems */ - public AccountingInvoiceItemsAllResponse withGetInvoiceItemsResponse(Optional getInvoiceItemsResponse) { - Utils.checkNotNull(getInvoiceItemsResponse, "getInvoiceItemsResponse"); + public AccountingInvoiceItemsAllResponse withGetInvoiceItemsResponse(@Nullable GetInvoiceItemsResponse getInvoiceItemsResponse) { this.getInvoiceItemsResponse = getInvoiceItemsResponse; return this; } - /** - * Unexpected error - */ - public AccountingInvoiceItemsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingInvoiceItemsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingInvoiceItemsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getInvoiceItemsResponse = Optional.empty(); + private GetInvoiceItemsResponse getInvoiceItemsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * InvoiceItems - */ - public Builder getInvoiceItemsResponse(GetInvoiceItemsResponse getInvoiceItemsResponse) { - Utils.checkNotNull(getInvoiceItemsResponse, "getInvoiceItemsResponse"); - this.getInvoiceItemsResponse = Optional.ofNullable(getInvoiceItemsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * InvoiceItems */ - public Builder getInvoiceItemsResponse(Optional getInvoiceItemsResponse) { - Utils.checkNotNull(getInvoiceItemsResponse, "getInvoiceItemsResponse"); + public Builder getInvoiceItemsResponse(@Nullable GetInvoiceItemsResponse getInvoiceItemsResponse) { this.getInvoiceItemsResponse = getInvoiceItemsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingInvoiceItemsAllResponse build() { - return new AccountingInvoiceItemsAllResponse( contentType, statusCode, rawResponse, getInvoiceItemsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteRequest.java index 6cc81916..b6fbcbc7 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingInvoiceItemsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingInvoiceItemsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingInvoiceItemsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingInvoiceItemsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingInvoiceItemsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingInvoiceItemsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingInvoiceItemsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingInvoiceItemsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingInvoiceItemsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingInvoiceItemsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingInvoiceItemsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingInvoiceItemsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingInvoiceItemsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingInvoiceItemsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingInvoiceItemsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingInvoiceItemsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingInvoiceItemsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingInvoiceItemsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingInvoiceItemsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingInvoiceItemsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteRequestBuilder.java index 26bb53c1..1eb6369d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingInvoiceItemsDeleteRequestBuilder { - - private AccountingInvoiceItemsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingInvoiceItemsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingInvoiceItemsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingInvoiceItemsDeleteRequestBuilder request(AccountingInvoiceItemsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingInvoiceItemsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingInvoiceItemsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingInvoiceItemsDeleteRequestBuilder request(@Nonnull AccountingInvoiceItemsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingInvoiceItemsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingInvoiceItemsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingInvoiceItemsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteResponse.java index 9d1e5806..1964bc37 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingInvoiceItemsDeleteResponse implements Response { /** * InvoiceItems */ - private Optional deleteTaxRateResponse; + private DeleteTaxRateResponse deleteTaxRateResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingInvoiceItemsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteTaxRateResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteTaxRateResponse, "deleteTaxRateResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteTaxRateResponse deleteTaxRateResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteTaxRateResponse = deleteTaxRateResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingInvoiceItemsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * InvoiceItems */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteTaxRateResponse() { - return (Optional) deleteTaxRateResponse; + return Optional.ofNullable(this.deleteTaxRateResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingInvoiceItemsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingInvoiceItemsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingInvoiceItemsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingInvoiceItemsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * InvoiceItems + * Raw HTTP response; suitable for custom response parsing */ - public AccountingInvoiceItemsDeleteResponse withDeleteTaxRateResponse(DeleteTaxRateResponse deleteTaxRateResponse) { - Utils.checkNotNull(deleteTaxRateResponse, "deleteTaxRateResponse"); - this.deleteTaxRateResponse = Optional.ofNullable(deleteTaxRateResponse); + public AccountingInvoiceItemsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingInvoiceItemsDeleteResponse withDeleteTaxRateResponse(DeleteTaxR /** * InvoiceItems */ - public AccountingInvoiceItemsDeleteResponse withDeleteTaxRateResponse(Optional deleteTaxRateResponse) { - Utils.checkNotNull(deleteTaxRateResponse, "deleteTaxRateResponse"); + public AccountingInvoiceItemsDeleteResponse withDeleteTaxRateResponse(@Nullable DeleteTaxRateResponse deleteTaxRateResponse) { this.deleteTaxRateResponse = deleteTaxRateResponse; return this; } - /** - * Unexpected error - */ - public AccountingInvoiceItemsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingInvoiceItemsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingInvoiceItemsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteTaxRateResponse = Optional.empty(); + private DeleteTaxRateResponse deleteTaxRateResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * InvoiceItems - */ - public Builder deleteTaxRateResponse(DeleteTaxRateResponse deleteTaxRateResponse) { - Utils.checkNotNull(deleteTaxRateResponse, "deleteTaxRateResponse"); - this.deleteTaxRateResponse = Optional.ofNullable(deleteTaxRateResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * InvoiceItems */ - public Builder deleteTaxRateResponse(Optional deleteTaxRateResponse) { - Utils.checkNotNull(deleteTaxRateResponse, "deleteTaxRateResponse"); + public Builder deleteTaxRateResponse(@Nullable DeleteTaxRateResponse deleteTaxRateResponse) { this.deleteTaxRateResponse = deleteTaxRateResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingInvoiceItemsDeleteResponse build() { - return new AccountingInvoiceItemsDeleteResponse( contentType, statusCode, rawResponse, deleteTaxRateResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneRequest.java index ce249c4c..54b19cd2 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneRequest.java @@ -8,12 +8,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -29,25 +29,25 @@ public class AccountingInvoiceItemsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -59,95 +59,83 @@ public class AccountingInvoiceItemsOneRequest { * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private InvoiceItemFilter filter; @JsonCreator public AccountingInvoiceItemsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields, - Optional filter) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(filter, "filter"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields, + @Nullable InvoiceItemFilter filter) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); this.filter = filter; } public AccountingInvoiceItemsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } public static Builder builder() { @@ -158,18 +146,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingInvoiceItemsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingInvoiceItemsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingInvoiceItemsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -177,93 +155,44 @@ public AccountingInvoiceItemsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingInvoiceItemsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingInvoiceItemsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingInvoiceItemsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingInvoiceItemsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingInvoiceItemsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingInvoiceItemsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingInvoiceItemsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingInvoiceItemsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingInvoiceItemsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingInvoiceItemsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingInvoiceItemsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingInvoiceItemsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = JsonNullable.of(fields); - return this; - } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingInvoiceItemsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** - * Apply filters - */ - public AccountingInvoiceItemsOneRequest withFilter(InvoiceItemFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); + public AccountingInvoiceItemsOneRequest withFields(@Nullable String fields) { + this.fields = JsonNullable.of(fields); return this; } @@ -271,12 +200,12 @@ public AccountingInvoiceItemsOneRequest withFilter(InvoiceItemFilter filter) { /** * Apply filters */ - public AccountingInvoiceItemsOneRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingInvoiceItemsOneRequest withFilter(@Nullable InvoiceItemFilter filter) { this.filter = filter; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -321,151 +250,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; - private Optional filter = Optional.empty(); + private InvoiceItemFilter filter; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - - /** - * Apply filters - */ - public Builder filter(InvoiceItemFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable InvoiceItemFilter filter) { this.filter = filter; return this; } public AccountingInvoiceItemsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingInvoiceItemsOneRequest( id, consumerId, appId, serviceId, raw, fields, @@ -473,10 +330,10 @@ public AccountingInvoiceItemsOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneRequestBuilder.java index 1c989fa2..0fe72620 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingInvoiceItemsOneRequestBuilder { - - private AccountingInvoiceItemsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingInvoiceItemsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingInvoiceItemsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingInvoiceItemsOneRequestBuilder request(AccountingInvoiceItemsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingInvoiceItemsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingInvoiceItemsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingInvoiceItemsOneRequestBuilder request(@Nonnull AccountingInvoiceItemsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingInvoiceItemsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingInvoiceItemsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingInvoiceItemsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneResponse.java index 0d35d419..40da9192 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingInvoiceItemsOneResponse implements Response { /** * InvoiceItems */ - private Optional getInvoiceItemResponse; + private GetInvoiceItemResponse getInvoiceItemResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingInvoiceItemsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getInvoiceItemResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getInvoiceItemResponse, "getInvoiceItemResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetInvoiceItemResponse getInvoiceItemResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getInvoiceItemResponse = getInvoiceItemResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingInvoiceItemsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * InvoiceItems */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getInvoiceItemResponse() { - return (Optional) getInvoiceItemResponse; + return Optional.ofNullable(this.getInvoiceItemResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingInvoiceItemsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingInvoiceItemsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingInvoiceItemsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingInvoiceItemsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * InvoiceItems + * Raw HTTP response; suitable for custom response parsing */ - public AccountingInvoiceItemsOneResponse withGetInvoiceItemResponse(GetInvoiceItemResponse getInvoiceItemResponse) { - Utils.checkNotNull(getInvoiceItemResponse, "getInvoiceItemResponse"); - this.getInvoiceItemResponse = Optional.ofNullable(getInvoiceItemResponse); + public AccountingInvoiceItemsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingInvoiceItemsOneResponse withGetInvoiceItemResponse(GetInvoiceIt /** * InvoiceItems */ - public AccountingInvoiceItemsOneResponse withGetInvoiceItemResponse(Optional getInvoiceItemResponse) { - Utils.checkNotNull(getInvoiceItemResponse, "getInvoiceItemResponse"); + public AccountingInvoiceItemsOneResponse withGetInvoiceItemResponse(@Nullable GetInvoiceItemResponse getInvoiceItemResponse) { this.getInvoiceItemResponse = getInvoiceItemResponse; return this; } - /** - * Unexpected error - */ - public AccountingInvoiceItemsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingInvoiceItemsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingInvoiceItemsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getInvoiceItemResponse = Optional.empty(); + private GetInvoiceItemResponse getInvoiceItemResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * InvoiceItems - */ - public Builder getInvoiceItemResponse(GetInvoiceItemResponse getInvoiceItemResponse) { - Utils.checkNotNull(getInvoiceItemResponse, "getInvoiceItemResponse"); - this.getInvoiceItemResponse = Optional.ofNullable(getInvoiceItemResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * InvoiceItems */ - public Builder getInvoiceItemResponse(Optional getInvoiceItemResponse) { - Utils.checkNotNull(getInvoiceItemResponse, "getInvoiceItemResponse"); + public Builder getInvoiceItemResponse(@Nullable GetInvoiceItemResponse getInvoiceItemResponse) { this.getInvoiceItemResponse = getInvoiceItemResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingInvoiceItemsOneResponse build() { - return new AccountingInvoiceItemsOneResponse( contentType, statusCode, rawResponse, getInvoiceItemResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateRequest.java index 82212ce7..e7054792 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingInvoiceItemsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingInvoiceItemsUpdateRequest { @JsonCreator public AccountingInvoiceItemsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - InvoiceItemInput invoiceItem) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(invoiceItem, "invoiceItem"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull InvoiceItemInput invoiceItem) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.invoiceItem = invoiceItem; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.invoiceItem = Optional.ofNullable(invoiceItem) + .orElseThrow(() -> new IllegalArgumentException("invoiceItem cannot be null")); } public AccountingInvoiceItemsUpdateRequest( - String id, - InvoiceItemInput invoiceItem) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), invoiceItem); + @Nonnull String id, + @Nonnull InvoiceItemInput invoiceItem) { + this(id, null, null, + null, null, invoiceItem); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public InvoiceItemInput invoiceItem() { - return invoiceItem; + return this.invoiceItem; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingInvoiceItemsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingInvoiceItemsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingInvoiceItemsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingInvoiceItemsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingInvoiceItemsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingInvoiceItemsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingInvoiceItemsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingInvoiceItemsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingInvoiceItemsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingInvoiceItemsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingInvoiceItemsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingInvoiceItemsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingInvoiceItemsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingInvoiceItemsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingInvoiceItemsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingInvoiceItemsUpdateRequest withInvoiceItem(InvoiceItemInput invoiceItem) { - Utils.checkNotNull(invoiceItem, "invoiceItem"); - this.invoiceItem = invoiceItem; + + public AccountingInvoiceItemsUpdateRequest withInvoiceItem(@Nonnull InvoiceItemInput invoiceItem) { + this.invoiceItem = Utils.checkNotNull(invoiceItem, "invoiceItem"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private InvoiceItemInput invoiceItem; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder invoiceItem(InvoiceItemInput invoiceItem) { - Utils.checkNotNull(invoiceItem, "invoiceItem"); - this.invoiceItem = invoiceItem; + public Builder invoiceItem(@Nonnull InvoiceItemInput invoiceItem) { + this.invoiceItem = Utils.checkNotNull(invoiceItem, "invoiceItem"); return this; } public AccountingInvoiceItemsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingInvoiceItemsUpdateRequest( id, consumerId, appId, serviceId, raw, invoiceItem); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateRequestBuilder.java index d214dcde..ae5cb466 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingInvoiceItemsUpdateRequestBuilder { - - private AccountingInvoiceItemsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingInvoiceItemsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingInvoiceItemsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingInvoiceItemsUpdateRequestBuilder request(AccountingInvoiceItemsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingInvoiceItemsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingInvoiceItemsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingInvoiceItemsUpdateRequestBuilder request(@Nonnull AccountingInvoiceItemsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingInvoiceItemsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingInvoiceItemsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingInvoiceItemsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateResponse.java index 51622813..481d238a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoiceItemsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingInvoiceItemsUpdateResponse implements Response { /** * InvoiceItems */ - private Optional updateInvoiceItemsResponse; + private UpdateInvoiceItemsResponse updateInvoiceItemsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingInvoiceItemsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateInvoiceItemsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateInvoiceItemsResponse, "updateInvoiceItemsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateInvoiceItemsResponse updateInvoiceItemsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateInvoiceItemsResponse = updateInvoiceItemsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingInvoiceItemsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * InvoiceItems */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateInvoiceItemsResponse() { - return (Optional) updateInvoiceItemsResponse; + return Optional.ofNullable(this.updateInvoiceItemsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingInvoiceItemsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingInvoiceItemsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingInvoiceItemsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingInvoiceItemsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * InvoiceItems + * Raw HTTP response; suitable for custom response parsing */ - public AccountingInvoiceItemsUpdateResponse withUpdateInvoiceItemsResponse(UpdateInvoiceItemsResponse updateInvoiceItemsResponse) { - Utils.checkNotNull(updateInvoiceItemsResponse, "updateInvoiceItemsResponse"); - this.updateInvoiceItemsResponse = Optional.ofNullable(updateInvoiceItemsResponse); + public AccountingInvoiceItemsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingInvoiceItemsUpdateResponse withUpdateInvoiceItemsResponse(Updat /** * InvoiceItems */ - public AccountingInvoiceItemsUpdateResponse withUpdateInvoiceItemsResponse(Optional updateInvoiceItemsResponse) { - Utils.checkNotNull(updateInvoiceItemsResponse, "updateInvoiceItemsResponse"); + public AccountingInvoiceItemsUpdateResponse withUpdateInvoiceItemsResponse(@Nullable UpdateInvoiceItemsResponse updateInvoiceItemsResponse) { this.updateInvoiceItemsResponse = updateInvoiceItemsResponse; return this; } - /** - * Unexpected error - */ - public AccountingInvoiceItemsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingInvoiceItemsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingInvoiceItemsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateInvoiceItemsResponse = Optional.empty(); + private UpdateInvoiceItemsResponse updateInvoiceItemsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * InvoiceItems - */ - public Builder updateInvoiceItemsResponse(UpdateInvoiceItemsResponse updateInvoiceItemsResponse) { - Utils.checkNotNull(updateInvoiceItemsResponse, "updateInvoiceItemsResponse"); - this.updateInvoiceItemsResponse = Optional.ofNullable(updateInvoiceItemsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * InvoiceItems */ - public Builder updateInvoiceItemsResponse(Optional updateInvoiceItemsResponse) { - Utils.checkNotNull(updateInvoiceItemsResponse, "updateInvoiceItemsResponse"); + public Builder updateInvoiceItemsResponse(@Nullable UpdateInvoiceItemsResponse updateInvoiceItemsResponse) { this.updateInvoiceItemsResponse = updateInvoiceItemsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingInvoiceItemsUpdateResponse build() { - return new AccountingInvoiceItemsUpdateResponse( contentType, statusCode, rawResponse, updateInvoiceItemsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddRequest.java index 80222989..79014cd3 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingInvoicesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingInvoicesAddRequest { @JsonCreator public AccountingInvoicesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - InvoiceInput invoice) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(invoice, "invoice"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull InvoiceInput invoice) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.invoice = invoice; + this.invoice = Optional.ofNullable(invoice) + .orElseThrow(() -> new IllegalArgumentException("invoice cannot be null")); } public AccountingInvoicesAddRequest( - InvoiceInput invoice) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), invoice); + @Nonnull InvoiceInput invoice) { + this(null, null, null, + null, invoice); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public InvoiceInput invoice() { - return invoice; + return this.invoice; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingInvoicesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingInvoicesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingInvoicesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingInvoicesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingInvoicesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingInvoicesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingInvoicesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingInvoicesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingInvoicesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingInvoicesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingInvoicesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingInvoicesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingInvoicesAddRequest withInvoice(InvoiceInput invoice) { - Utils.checkNotNull(invoice, "invoice"); - this.invoice = invoice; + + public AccountingInvoicesAddRequest withInvoice(@Nonnull InvoiceInput invoice) { + this.invoice = Utils.checkNotNull(invoice, "invoice"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private InvoiceInput invoice; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder invoice(InvoiceInput invoice) { - Utils.checkNotNull(invoice, "invoice"); - this.invoice = invoice; + public Builder invoice(@Nonnull InvoiceInput invoice) { + this.invoice = Utils.checkNotNull(invoice, "invoice"); return this; } public AccountingInvoicesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingInvoicesAddRequest( raw, consumerId, appId, serviceId, invoice); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddRequestBuilder.java index 975aa14b..d1c28e10 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingInvoicesAddRequestBuilder { - - private AccountingInvoicesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingInvoicesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingInvoicesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingInvoicesAddRequestBuilder request(AccountingInvoicesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingInvoicesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingInvoicesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingInvoicesAddRequestBuilder request(@Nonnull AccountingInvoicesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingInvoicesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingInvoicesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingInvoicesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddResponse.java index d97e7742..b28a22ce 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingInvoicesAddResponse implements Response { /** * Invoice created */ - private Optional createInvoiceResponse; + private CreateInvoiceResponse createInvoiceResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingInvoicesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createInvoiceResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createInvoiceResponse, "createInvoiceResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateInvoiceResponse createInvoiceResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createInvoiceResponse = createInvoiceResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingInvoicesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Invoice created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createInvoiceResponse() { - return (Optional) createInvoiceResponse; + return Optional.ofNullable(this.createInvoiceResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingInvoicesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingInvoicesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingInvoicesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingInvoicesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Invoice created + * Raw HTTP response; suitable for custom response parsing */ - public AccountingInvoicesAddResponse withCreateInvoiceResponse(CreateInvoiceResponse createInvoiceResponse) { - Utils.checkNotNull(createInvoiceResponse, "createInvoiceResponse"); - this.createInvoiceResponse = Optional.ofNullable(createInvoiceResponse); + public AccountingInvoicesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingInvoicesAddResponse withCreateInvoiceResponse(CreateInvoiceResp /** * Invoice created */ - public AccountingInvoicesAddResponse withCreateInvoiceResponse(Optional createInvoiceResponse) { - Utils.checkNotNull(createInvoiceResponse, "createInvoiceResponse"); + public AccountingInvoicesAddResponse withCreateInvoiceResponse(@Nullable CreateInvoiceResponse createInvoiceResponse) { this.createInvoiceResponse = createInvoiceResponse; return this; } - /** - * Unexpected error - */ - public AccountingInvoicesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingInvoicesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingInvoicesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createInvoiceResponse = Optional.empty(); + private CreateInvoiceResponse createInvoiceResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Invoice created - */ - public Builder createInvoiceResponse(CreateInvoiceResponse createInvoiceResponse) { - Utils.checkNotNull(createInvoiceResponse, "createInvoiceResponse"); - this.createInvoiceResponse = Optional.ofNullable(createInvoiceResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Invoice created */ - public Builder createInvoiceResponse(Optional createInvoiceResponse) { - Utils.checkNotNull(createInvoiceResponse, "createInvoiceResponse"); + public Builder createInvoiceResponse(@Nullable CreateInvoiceResponse createInvoiceResponse) { this.createInvoiceResponse = createInvoiceResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingInvoicesAddResponse build() { - return new AccountingInvoicesAddResponse( contentType, statusCode, rawResponse, createInvoiceResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllRequest.java index a21a52d7..de99705f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingInvoicesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class AccountingInvoicesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private InvoicesFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private InvoicesSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class AccountingInvoicesAllRequest { @JsonCreator public AccountingInvoicesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable InvoicesFilter filter, + @Nullable InvoicesSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingInvoicesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingInvoicesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingInvoicesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingInvoicesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingInvoicesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingInvoicesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingInvoicesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingInvoicesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingInvoicesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingInvoicesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingInvoicesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingInvoicesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingInvoicesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingInvoicesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingInvoicesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingInvoicesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingInvoicesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public AccountingInvoicesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingInvoicesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingInvoicesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingInvoicesAllRequest withFilter(InvoicesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingInvoicesAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingInvoicesAllRequest withFilter(@Nullable InvoicesFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingInvoicesAllRequest withSort(InvoicesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingInvoicesAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingInvoicesAllRequest withSort(@Nullable InvoicesSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingInvoicesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingInvoicesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingInvoicesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingInvoicesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingInvoicesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingInvoicesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private InvoicesFilter filter; - private Optional sort = Optional.empty(); + private InvoicesSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(InvoicesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable InvoicesFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(InvoicesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable InvoicesSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingInvoicesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingInvoicesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public AccountingInvoicesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllRequestBuilder.java index b2798608..d469d267 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingInvoicesAllRequestBuilder { - - private AccountingInvoicesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingInvoicesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingInvoicesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingInvoicesAllRequestBuilder request(AccountingInvoicesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingInvoicesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingInvoicesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingInvoicesAllRequestBuilder request(@Nonnull AccountingInvoicesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingInvoicesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingInvoicesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingInvoicesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingInvoicesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingInvoicesAllOperation( - sdkConfiguration, - options); + AccountingInvoicesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingInvoicesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingInvoicesAllRequest::withCursor, + AccountingInvoicesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllResponse.java index 97a16037..87cb4d84 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingInvoicesAllResponse implements Response { /** * Invoices */ - private Optional getInvoicesResponse; + private GetInvoicesResponse getInvoicesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingInvoicesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getInvoicesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getInvoicesResponse, "getInvoicesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetInvoicesResponse getInvoicesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getInvoicesResponse = getInvoicesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingInvoicesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Invoices */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getInvoicesResponse() { - return (Optional) getInvoicesResponse; + return Optional.ofNullable(this.getInvoicesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingInvoicesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingInvoicesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingInvoicesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingInvoicesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Invoices + * Raw HTTP response; suitable for custom response parsing */ - public AccountingInvoicesAllResponse withGetInvoicesResponse(GetInvoicesResponse getInvoicesResponse) { - Utils.checkNotNull(getInvoicesResponse, "getInvoicesResponse"); - this.getInvoicesResponse = Optional.ofNullable(getInvoicesResponse); + public AccountingInvoicesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingInvoicesAllResponse withGetInvoicesResponse(GetInvoicesResponse /** * Invoices */ - public AccountingInvoicesAllResponse withGetInvoicesResponse(Optional getInvoicesResponse) { - Utils.checkNotNull(getInvoicesResponse, "getInvoicesResponse"); + public AccountingInvoicesAllResponse withGetInvoicesResponse(@Nullable GetInvoicesResponse getInvoicesResponse) { this.getInvoicesResponse = getInvoicesResponse; return this; } - /** - * Unexpected error - */ - public AccountingInvoicesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingInvoicesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingInvoicesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getInvoicesResponse = Optional.empty(); + private GetInvoicesResponse getInvoicesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Invoices - */ - public Builder getInvoicesResponse(GetInvoicesResponse getInvoicesResponse) { - Utils.checkNotNull(getInvoicesResponse, "getInvoicesResponse"); - this.getInvoicesResponse = Optional.ofNullable(getInvoicesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Invoices */ - public Builder getInvoicesResponse(Optional getInvoicesResponse) { - Utils.checkNotNull(getInvoicesResponse, "getInvoicesResponse"); + public Builder getInvoicesResponse(@Nullable GetInvoicesResponse getInvoicesResponse) { this.getInvoicesResponse = getInvoicesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingInvoicesAllResponse build() { - return new AccountingInvoicesAllResponse( contentType, statusCode, rawResponse, getInvoicesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteRequest.java index 694b703b..b675d4da 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingInvoicesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingInvoicesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingInvoicesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingInvoicesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingInvoicesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingInvoicesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingInvoicesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingInvoicesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingInvoicesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingInvoicesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingInvoicesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingInvoicesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingInvoicesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingInvoicesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingInvoicesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingInvoicesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingInvoicesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingInvoicesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingInvoicesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingInvoicesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteRequestBuilder.java index 66503a7c..68e204a9 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingInvoicesDeleteRequestBuilder { - - private AccountingInvoicesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingInvoicesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingInvoicesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingInvoicesDeleteRequestBuilder request(AccountingInvoicesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingInvoicesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingInvoicesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingInvoicesDeleteRequestBuilder request(@Nonnull AccountingInvoicesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingInvoicesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingInvoicesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingInvoicesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteResponse.java index 1c7db802..4ddc893f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingInvoicesDeleteResponse implements Response { /** * Invoice deleted */ - private Optional deleteInvoiceResponse; + private DeleteInvoiceResponse deleteInvoiceResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingInvoicesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteInvoiceResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteInvoiceResponse, "deleteInvoiceResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteInvoiceResponse deleteInvoiceResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteInvoiceResponse = deleteInvoiceResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingInvoicesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Invoice deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteInvoiceResponse() { - return (Optional) deleteInvoiceResponse; + return Optional.ofNullable(this.deleteInvoiceResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingInvoicesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingInvoicesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingInvoicesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingInvoicesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Invoice deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingInvoicesDeleteResponse withDeleteInvoiceResponse(DeleteInvoiceResponse deleteInvoiceResponse) { - Utils.checkNotNull(deleteInvoiceResponse, "deleteInvoiceResponse"); - this.deleteInvoiceResponse = Optional.ofNullable(deleteInvoiceResponse); + public AccountingInvoicesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingInvoicesDeleteResponse withDeleteInvoiceResponse(DeleteInvoiceR /** * Invoice deleted */ - public AccountingInvoicesDeleteResponse withDeleteInvoiceResponse(Optional deleteInvoiceResponse) { - Utils.checkNotNull(deleteInvoiceResponse, "deleteInvoiceResponse"); + public AccountingInvoicesDeleteResponse withDeleteInvoiceResponse(@Nullable DeleteInvoiceResponse deleteInvoiceResponse) { this.deleteInvoiceResponse = deleteInvoiceResponse; return this; } - /** - * Unexpected error - */ - public AccountingInvoicesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingInvoicesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingInvoicesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteInvoiceResponse = Optional.empty(); + private DeleteInvoiceResponse deleteInvoiceResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Invoice deleted - */ - public Builder deleteInvoiceResponse(DeleteInvoiceResponse deleteInvoiceResponse) { - Utils.checkNotNull(deleteInvoiceResponse, "deleteInvoiceResponse"); - this.deleteInvoiceResponse = Optional.ofNullable(deleteInvoiceResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Invoice deleted */ - public Builder deleteInvoiceResponse(Optional deleteInvoiceResponse) { - Utils.checkNotNull(deleteInvoiceResponse, "deleteInvoiceResponse"); + public Builder deleteInvoiceResponse(@Nullable DeleteInvoiceResponse deleteInvoiceResponse) { this.deleteInvoiceResponse = deleteInvoiceResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingInvoicesDeleteResponse build() { - return new AccountingInvoicesDeleteResponse( contentType, statusCode, rawResponse, deleteInvoiceResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneRequest.java index 8ed07cf0..8c4d55b3 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingInvoicesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingInvoicesOneRequest { @JsonCreator public AccountingInvoicesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingInvoicesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingInvoicesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingInvoicesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingInvoicesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingInvoicesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingInvoicesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingInvoicesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingInvoicesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingInvoicesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingInvoicesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingInvoicesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingInvoicesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingInvoicesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingInvoicesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingInvoicesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingInvoicesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingInvoicesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingInvoicesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingInvoicesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingInvoicesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingInvoicesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneRequestBuilder.java index ff07e31f..a0a8969d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingInvoicesOneRequestBuilder { - - private AccountingInvoicesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingInvoicesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingInvoicesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingInvoicesOneRequestBuilder request(AccountingInvoicesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingInvoicesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingInvoicesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingInvoicesOneRequestBuilder request(@Nonnull AccountingInvoicesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingInvoicesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingInvoicesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingInvoicesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneResponse.java index efe4874a..0e05203f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingInvoicesOneResponse implements Response { /** * Invoice */ - private Optional getInvoiceResponse; + private GetInvoiceResponse getInvoiceResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingInvoicesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getInvoiceResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getInvoiceResponse, "getInvoiceResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetInvoiceResponse getInvoiceResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getInvoiceResponse = getInvoiceResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingInvoicesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Invoice */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getInvoiceResponse() { - return (Optional) getInvoiceResponse; + return Optional.ofNullable(this.getInvoiceResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingInvoicesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingInvoicesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingInvoicesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingInvoicesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Invoice + * Raw HTTP response; suitable for custom response parsing */ - public AccountingInvoicesOneResponse withGetInvoiceResponse(GetInvoiceResponse getInvoiceResponse) { - Utils.checkNotNull(getInvoiceResponse, "getInvoiceResponse"); - this.getInvoiceResponse = Optional.ofNullable(getInvoiceResponse); + public AccountingInvoicesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingInvoicesOneResponse withGetInvoiceResponse(GetInvoiceResponse g /** * Invoice */ - public AccountingInvoicesOneResponse withGetInvoiceResponse(Optional getInvoiceResponse) { - Utils.checkNotNull(getInvoiceResponse, "getInvoiceResponse"); + public AccountingInvoicesOneResponse withGetInvoiceResponse(@Nullable GetInvoiceResponse getInvoiceResponse) { this.getInvoiceResponse = getInvoiceResponse; return this; } - /** - * Unexpected error - */ - public AccountingInvoicesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingInvoicesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingInvoicesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getInvoiceResponse = Optional.empty(); + private GetInvoiceResponse getInvoiceResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Invoice - */ - public Builder getInvoiceResponse(GetInvoiceResponse getInvoiceResponse) { - Utils.checkNotNull(getInvoiceResponse, "getInvoiceResponse"); - this.getInvoiceResponse = Optional.ofNullable(getInvoiceResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Invoice */ - public Builder getInvoiceResponse(Optional getInvoiceResponse) { - Utils.checkNotNull(getInvoiceResponse, "getInvoiceResponse"); + public Builder getInvoiceResponse(@Nullable GetInvoiceResponse getInvoiceResponse) { this.getInvoiceResponse = getInvoiceResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingInvoicesOneResponse build() { - return new AccountingInvoicesOneResponse( contentType, statusCode, rawResponse, getInvoiceResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateRequest.java index c945da3c..66e62215 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingInvoicesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingInvoicesUpdateRequest { @JsonCreator public AccountingInvoicesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - InvoiceInput invoice) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(invoice, "invoice"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull InvoiceInput invoice) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.invoice = invoice; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.invoice = Optional.ofNullable(invoice) + .orElseThrow(() -> new IllegalArgumentException("invoice cannot be null")); } public AccountingInvoicesUpdateRequest( - String id, - InvoiceInput invoice) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), invoice); + @Nonnull String id, + @Nonnull InvoiceInput invoice) { + this(id, null, null, + null, null, invoice); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public InvoiceInput invoice() { - return invoice; + return this.invoice; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingInvoicesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingInvoicesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingInvoicesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingInvoicesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingInvoicesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingInvoicesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingInvoicesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingInvoicesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingInvoicesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingInvoicesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingInvoicesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingInvoicesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingInvoicesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingInvoicesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingInvoicesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingInvoicesUpdateRequest withInvoice(InvoiceInput invoice) { - Utils.checkNotNull(invoice, "invoice"); - this.invoice = invoice; + + public AccountingInvoicesUpdateRequest withInvoice(@Nonnull InvoiceInput invoice) { + this.invoice = Utils.checkNotNull(invoice, "invoice"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private InvoiceInput invoice; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder invoice(InvoiceInput invoice) { - Utils.checkNotNull(invoice, "invoice"); - this.invoice = invoice; + public Builder invoice(@Nonnull InvoiceInput invoice) { + this.invoice = Utils.checkNotNull(invoice, "invoice"); return this; } public AccountingInvoicesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingInvoicesUpdateRequest( id, consumerId, appId, serviceId, raw, invoice); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateRequestBuilder.java index 0bc206b5..543bb707 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingInvoicesUpdateRequestBuilder { - - private AccountingInvoicesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingInvoicesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingInvoicesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingInvoicesUpdateRequestBuilder request(AccountingInvoicesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingInvoicesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingInvoicesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingInvoicesUpdateRequestBuilder request(@Nonnull AccountingInvoicesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingInvoicesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingInvoicesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingInvoicesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateResponse.java index aef367dc..16d81b6b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingInvoicesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingInvoicesUpdateResponse implements Response { /** * Invoice updated */ - private Optional updateInvoiceResponse; + private UpdateInvoiceResponse updateInvoiceResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingInvoicesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateInvoiceResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateInvoiceResponse, "updateInvoiceResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateInvoiceResponse updateInvoiceResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateInvoiceResponse = updateInvoiceResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingInvoicesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Invoice updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateInvoiceResponse() { - return (Optional) updateInvoiceResponse; + return Optional.ofNullable(this.updateInvoiceResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingInvoicesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingInvoicesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingInvoicesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingInvoicesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Invoice updated + * Raw HTTP response; suitable for custom response parsing */ - public AccountingInvoicesUpdateResponse withUpdateInvoiceResponse(UpdateInvoiceResponse updateInvoiceResponse) { - Utils.checkNotNull(updateInvoiceResponse, "updateInvoiceResponse"); - this.updateInvoiceResponse = Optional.ofNullable(updateInvoiceResponse); + public AccountingInvoicesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingInvoicesUpdateResponse withUpdateInvoiceResponse(UpdateInvoiceR /** * Invoice updated */ - public AccountingInvoicesUpdateResponse withUpdateInvoiceResponse(Optional updateInvoiceResponse) { - Utils.checkNotNull(updateInvoiceResponse, "updateInvoiceResponse"); + public AccountingInvoicesUpdateResponse withUpdateInvoiceResponse(@Nullable UpdateInvoiceResponse updateInvoiceResponse) { this.updateInvoiceResponse = updateInvoiceResponse; return this; } - /** - * Unexpected error - */ - public AccountingInvoicesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingInvoicesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingInvoicesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateInvoiceResponse = Optional.empty(); + private UpdateInvoiceResponse updateInvoiceResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Invoice updated - */ - public Builder updateInvoiceResponse(UpdateInvoiceResponse updateInvoiceResponse) { - Utils.checkNotNull(updateInvoiceResponse, "updateInvoiceResponse"); - this.updateInvoiceResponse = Optional.ofNullable(updateInvoiceResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Invoice updated */ - public Builder updateInvoiceResponse(Optional updateInvoiceResponse) { - Utils.checkNotNull(updateInvoiceResponse, "updateInvoiceResponse"); + public Builder updateInvoiceResponse(@Nullable UpdateInvoiceResponse updateInvoiceResponse) { this.updateInvoiceResponse = updateInvoiceResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingInvoicesUpdateResponse build() { - return new AccountingInvoicesUpdateResponse( contentType, statusCode, rawResponse, updateInvoiceResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddRequest.java index f41eb2ca..ded8b9d9 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingJournalEntriesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingJournalEntriesAddRequest { @JsonCreator public AccountingJournalEntriesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JournalEntryInput journalEntry) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(journalEntry, "journalEntry"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull JournalEntryInput journalEntry) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.journalEntry = journalEntry; + this.journalEntry = Optional.ofNullable(journalEntry) + .orElseThrow(() -> new IllegalArgumentException("journalEntry cannot be null")); } public AccountingJournalEntriesAddRequest( - JournalEntryInput journalEntry) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), journalEntry); + @Nonnull JournalEntryInput journalEntry) { + this(null, null, null, + null, journalEntry); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public JournalEntryInput journalEntry() { - return journalEntry; + return this.journalEntry; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingJournalEntriesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingJournalEntriesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingJournalEntriesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingJournalEntriesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingJournalEntriesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingJournalEntriesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingJournalEntriesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingJournalEntriesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingJournalEntriesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingJournalEntriesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingJournalEntriesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingJournalEntriesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingJournalEntriesAddRequest withJournalEntry(JournalEntryInput journalEntry) { - Utils.checkNotNull(journalEntry, "journalEntry"); - this.journalEntry = journalEntry; + + public AccountingJournalEntriesAddRequest withJournalEntry(@Nonnull JournalEntryInput journalEntry) { + this.journalEntry = Utils.checkNotNull(journalEntry, "journalEntry"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private JournalEntryInput journalEntry; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder journalEntry(JournalEntryInput journalEntry) { - Utils.checkNotNull(journalEntry, "journalEntry"); - this.journalEntry = journalEntry; + public Builder journalEntry(@Nonnull JournalEntryInput journalEntry) { + this.journalEntry = Utils.checkNotNull(journalEntry, "journalEntry"); return this; } public AccountingJournalEntriesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingJournalEntriesAddRequest( raw, consumerId, appId, serviceId, journalEntry); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddRequestBuilder.java index 1eb7e175..78eadcc8 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingJournalEntriesAddRequestBuilder { - - private AccountingJournalEntriesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingJournalEntriesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingJournalEntriesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingJournalEntriesAddRequestBuilder request(AccountingJournalEntriesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingJournalEntriesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingJournalEntriesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingJournalEntriesAddRequestBuilder request(@Nonnull AccountingJournalEntriesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingJournalEntriesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingJournalEntriesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingJournalEntriesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddResponse.java index 6d28d7d0..a562ab38 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingJournalEntriesAddResponse implements Response { /** * JournalEntries */ - private Optional createJournalEntryResponse; + private CreateJournalEntryResponse createJournalEntryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingJournalEntriesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createJournalEntryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createJournalEntryResponse, "createJournalEntryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateJournalEntryResponse createJournalEntryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createJournalEntryResponse = createJournalEntryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingJournalEntriesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * JournalEntries */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createJournalEntryResponse() { - return (Optional) createJournalEntryResponse; + return Optional.ofNullable(this.createJournalEntryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingJournalEntriesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingJournalEntriesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingJournalEntriesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingJournalEntriesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * JournalEntries + * Raw HTTP response; suitable for custom response parsing */ - public AccountingJournalEntriesAddResponse withCreateJournalEntryResponse(CreateJournalEntryResponse createJournalEntryResponse) { - Utils.checkNotNull(createJournalEntryResponse, "createJournalEntryResponse"); - this.createJournalEntryResponse = Optional.ofNullable(createJournalEntryResponse); + public AccountingJournalEntriesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingJournalEntriesAddResponse withCreateJournalEntryResponse(Create /** * JournalEntries */ - public AccountingJournalEntriesAddResponse withCreateJournalEntryResponse(Optional createJournalEntryResponse) { - Utils.checkNotNull(createJournalEntryResponse, "createJournalEntryResponse"); + public AccountingJournalEntriesAddResponse withCreateJournalEntryResponse(@Nullable CreateJournalEntryResponse createJournalEntryResponse) { this.createJournalEntryResponse = createJournalEntryResponse; return this; } - /** - * Unexpected error - */ - public AccountingJournalEntriesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingJournalEntriesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingJournalEntriesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createJournalEntryResponse = Optional.empty(); + private CreateJournalEntryResponse createJournalEntryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * JournalEntries - */ - public Builder createJournalEntryResponse(CreateJournalEntryResponse createJournalEntryResponse) { - Utils.checkNotNull(createJournalEntryResponse, "createJournalEntryResponse"); - this.createJournalEntryResponse = Optional.ofNullable(createJournalEntryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * JournalEntries */ - public Builder createJournalEntryResponse(Optional createJournalEntryResponse) { - Utils.checkNotNull(createJournalEntryResponse, "createJournalEntryResponse"); + public Builder createJournalEntryResponse(@Nullable CreateJournalEntryResponse createJournalEntryResponse) { this.createJournalEntryResponse = createJournalEntryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingJournalEntriesAddResponse build() { - return new AccountingJournalEntriesAddResponse( contentType, statusCode, rawResponse, createJournalEntryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllRequest.java index e10c597a..239d4dff 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingJournalEntriesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class AccountingJournalEntriesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private JournalEntriesFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private JournalEntriesSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class AccountingJournalEntriesAllRequest { @JsonCreator public AccountingJournalEntriesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable JournalEntriesFilter filter, + @Nullable JournalEntriesSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingJournalEntriesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingJournalEntriesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingJournalEntriesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingJournalEntriesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingJournalEntriesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingJournalEntriesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingJournalEntriesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingJournalEntriesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingJournalEntriesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingJournalEntriesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingJournalEntriesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingJournalEntriesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingJournalEntriesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingJournalEntriesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingJournalEntriesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingJournalEntriesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingJournalEntriesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public AccountingJournalEntriesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingJournalEntriesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingJournalEntriesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingJournalEntriesAllRequest withFilter(JournalEntriesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingJournalEntriesAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingJournalEntriesAllRequest withFilter(@Nullable JournalEntriesFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingJournalEntriesAllRequest withSort(JournalEntriesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingJournalEntriesAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingJournalEntriesAllRequest withSort(@Nullable JournalEntriesSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingJournalEntriesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingJournalEntriesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingJournalEntriesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingJournalEntriesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingJournalEntriesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingJournalEntriesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private JournalEntriesFilter filter; - private Optional sort = Optional.empty(); + private JournalEntriesSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(JournalEntriesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable JournalEntriesFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(JournalEntriesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable JournalEntriesSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingJournalEntriesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingJournalEntriesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public AccountingJournalEntriesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllRequestBuilder.java index 59b61256..364b2f69 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingJournalEntriesAllRequestBuilder { - - private AccountingJournalEntriesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingJournalEntriesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingJournalEntriesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingJournalEntriesAllRequestBuilder request(AccountingJournalEntriesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingJournalEntriesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingJournalEntriesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingJournalEntriesAllRequestBuilder request(@Nonnull AccountingJournalEntriesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingJournalEntriesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingJournalEntriesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingJournalEntriesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingJournalEntriesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingJournalEntriesAllOperation( - sdkConfiguration, - options); + AccountingJournalEntriesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingJournalEntriesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingJournalEntriesAllRequest::withCursor, + AccountingJournalEntriesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllResponse.java index 18e98290..a5e738f7 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingJournalEntriesAllResponse implements Response { /** * JournalEntry */ - private Optional getJournalEntriesResponse; + private GetJournalEntriesResponse getJournalEntriesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingJournalEntriesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getJournalEntriesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getJournalEntriesResponse, "getJournalEntriesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetJournalEntriesResponse getJournalEntriesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getJournalEntriesResponse = getJournalEntriesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingJournalEntriesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * JournalEntry */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getJournalEntriesResponse() { - return (Optional) getJournalEntriesResponse; + return Optional.ofNullable(this.getJournalEntriesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingJournalEntriesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingJournalEntriesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingJournalEntriesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingJournalEntriesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * JournalEntry + * Raw HTTP response; suitable for custom response parsing */ - public AccountingJournalEntriesAllResponse withGetJournalEntriesResponse(GetJournalEntriesResponse getJournalEntriesResponse) { - Utils.checkNotNull(getJournalEntriesResponse, "getJournalEntriesResponse"); - this.getJournalEntriesResponse = Optional.ofNullable(getJournalEntriesResponse); + public AccountingJournalEntriesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingJournalEntriesAllResponse withGetJournalEntriesResponse(GetJour /** * JournalEntry */ - public AccountingJournalEntriesAllResponse withGetJournalEntriesResponse(Optional getJournalEntriesResponse) { - Utils.checkNotNull(getJournalEntriesResponse, "getJournalEntriesResponse"); + public AccountingJournalEntriesAllResponse withGetJournalEntriesResponse(@Nullable GetJournalEntriesResponse getJournalEntriesResponse) { this.getJournalEntriesResponse = getJournalEntriesResponse; return this; } - /** - * Unexpected error - */ - public AccountingJournalEntriesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingJournalEntriesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingJournalEntriesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getJournalEntriesResponse = Optional.empty(); + private GetJournalEntriesResponse getJournalEntriesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * JournalEntry - */ - public Builder getJournalEntriesResponse(GetJournalEntriesResponse getJournalEntriesResponse) { - Utils.checkNotNull(getJournalEntriesResponse, "getJournalEntriesResponse"); - this.getJournalEntriesResponse = Optional.ofNullable(getJournalEntriesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * JournalEntry */ - public Builder getJournalEntriesResponse(Optional getJournalEntriesResponse) { - Utils.checkNotNull(getJournalEntriesResponse, "getJournalEntriesResponse"); + public Builder getJournalEntriesResponse(@Nullable GetJournalEntriesResponse getJournalEntriesResponse) { this.getJournalEntriesResponse = getJournalEntriesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingJournalEntriesAllResponse build() { - return new AccountingJournalEntriesAllResponse( contentType, statusCode, rawResponse, getJournalEntriesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteRequest.java index 27ba0b00..5f09a7ea 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingJournalEntriesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingJournalEntriesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingJournalEntriesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingJournalEntriesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingJournalEntriesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingJournalEntriesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingJournalEntriesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingJournalEntriesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingJournalEntriesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingJournalEntriesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingJournalEntriesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingJournalEntriesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingJournalEntriesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingJournalEntriesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingJournalEntriesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingJournalEntriesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingJournalEntriesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingJournalEntriesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingJournalEntriesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingJournalEntriesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteRequestBuilder.java index a8817fa5..7a3a0015 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingJournalEntriesDeleteRequestBuilder { - - private AccountingJournalEntriesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingJournalEntriesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingJournalEntriesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingJournalEntriesDeleteRequestBuilder request(AccountingJournalEntriesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingJournalEntriesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingJournalEntriesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingJournalEntriesDeleteRequestBuilder request(@Nonnull AccountingJournalEntriesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingJournalEntriesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingJournalEntriesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingJournalEntriesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteResponse.java index 76ea9ca2..2818c771 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingJournalEntriesDeleteResponse implements Response { /** * JournalEntries */ - private Optional deleteJournalEntryResponse; + private DeleteJournalEntryResponse deleteJournalEntryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingJournalEntriesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteJournalEntryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteJournalEntryResponse, "deleteJournalEntryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteJournalEntryResponse deleteJournalEntryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteJournalEntryResponse = deleteJournalEntryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingJournalEntriesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * JournalEntries */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteJournalEntryResponse() { - return (Optional) deleteJournalEntryResponse; + return Optional.ofNullable(this.deleteJournalEntryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingJournalEntriesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingJournalEntriesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingJournalEntriesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingJournalEntriesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * JournalEntries + * Raw HTTP response; suitable for custom response parsing */ - public AccountingJournalEntriesDeleteResponse withDeleteJournalEntryResponse(DeleteJournalEntryResponse deleteJournalEntryResponse) { - Utils.checkNotNull(deleteJournalEntryResponse, "deleteJournalEntryResponse"); - this.deleteJournalEntryResponse = Optional.ofNullable(deleteJournalEntryResponse); + public AccountingJournalEntriesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingJournalEntriesDeleteResponse withDeleteJournalEntryResponse(Del /** * JournalEntries */ - public AccountingJournalEntriesDeleteResponse withDeleteJournalEntryResponse(Optional deleteJournalEntryResponse) { - Utils.checkNotNull(deleteJournalEntryResponse, "deleteJournalEntryResponse"); + public AccountingJournalEntriesDeleteResponse withDeleteJournalEntryResponse(@Nullable DeleteJournalEntryResponse deleteJournalEntryResponse) { this.deleteJournalEntryResponse = deleteJournalEntryResponse; return this; } - /** - * Unexpected error - */ - public AccountingJournalEntriesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingJournalEntriesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingJournalEntriesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteJournalEntryResponse = Optional.empty(); + private DeleteJournalEntryResponse deleteJournalEntryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * JournalEntries - */ - public Builder deleteJournalEntryResponse(DeleteJournalEntryResponse deleteJournalEntryResponse) { - Utils.checkNotNull(deleteJournalEntryResponse, "deleteJournalEntryResponse"); - this.deleteJournalEntryResponse = Optional.ofNullable(deleteJournalEntryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * JournalEntries */ - public Builder deleteJournalEntryResponse(Optional deleteJournalEntryResponse) { - Utils.checkNotNull(deleteJournalEntryResponse, "deleteJournalEntryResponse"); + public Builder deleteJournalEntryResponse(@Nullable DeleteJournalEntryResponse deleteJournalEntryResponse) { this.deleteJournalEntryResponse = deleteJournalEntryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingJournalEntriesDeleteResponse build() { - return new AccountingJournalEntriesDeleteResponse( contentType, statusCode, rawResponse, deleteJournalEntryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneRequest.java index 02cca501..8c186eac 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingJournalEntriesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingJournalEntriesOneRequest { @JsonCreator public AccountingJournalEntriesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingJournalEntriesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingJournalEntriesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingJournalEntriesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingJournalEntriesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingJournalEntriesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingJournalEntriesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingJournalEntriesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingJournalEntriesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingJournalEntriesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingJournalEntriesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingJournalEntriesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingJournalEntriesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingJournalEntriesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingJournalEntriesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingJournalEntriesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingJournalEntriesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingJournalEntriesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingJournalEntriesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingJournalEntriesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingJournalEntriesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingJournalEntriesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneRequestBuilder.java index 069a8259..6fafd933 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingJournalEntriesOneRequestBuilder { - - private AccountingJournalEntriesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingJournalEntriesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingJournalEntriesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingJournalEntriesOneRequestBuilder request(AccountingJournalEntriesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingJournalEntriesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingJournalEntriesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingJournalEntriesOneRequestBuilder request(@Nonnull AccountingJournalEntriesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingJournalEntriesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingJournalEntriesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingJournalEntriesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneResponse.java index 0251940b..2fd86e0c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingJournalEntriesOneResponse implements Response { /** * JournalEntries */ - private Optional getJournalEntryResponse; + private GetJournalEntryResponse getJournalEntryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingJournalEntriesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getJournalEntryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getJournalEntryResponse, "getJournalEntryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetJournalEntryResponse getJournalEntryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getJournalEntryResponse = getJournalEntryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingJournalEntriesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * JournalEntries */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getJournalEntryResponse() { - return (Optional) getJournalEntryResponse; + return Optional.ofNullable(this.getJournalEntryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingJournalEntriesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingJournalEntriesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingJournalEntriesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingJournalEntriesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * JournalEntries + * Raw HTTP response; suitable for custom response parsing */ - public AccountingJournalEntriesOneResponse withGetJournalEntryResponse(GetJournalEntryResponse getJournalEntryResponse) { - Utils.checkNotNull(getJournalEntryResponse, "getJournalEntryResponse"); - this.getJournalEntryResponse = Optional.ofNullable(getJournalEntryResponse); + public AccountingJournalEntriesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingJournalEntriesOneResponse withGetJournalEntryResponse(GetJourna /** * JournalEntries */ - public AccountingJournalEntriesOneResponse withGetJournalEntryResponse(Optional getJournalEntryResponse) { - Utils.checkNotNull(getJournalEntryResponse, "getJournalEntryResponse"); + public AccountingJournalEntriesOneResponse withGetJournalEntryResponse(@Nullable GetJournalEntryResponse getJournalEntryResponse) { this.getJournalEntryResponse = getJournalEntryResponse; return this; } - /** - * Unexpected error - */ - public AccountingJournalEntriesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingJournalEntriesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingJournalEntriesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getJournalEntryResponse = Optional.empty(); + private GetJournalEntryResponse getJournalEntryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * JournalEntries - */ - public Builder getJournalEntryResponse(GetJournalEntryResponse getJournalEntryResponse) { - Utils.checkNotNull(getJournalEntryResponse, "getJournalEntryResponse"); - this.getJournalEntryResponse = Optional.ofNullable(getJournalEntryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * JournalEntries */ - public Builder getJournalEntryResponse(Optional getJournalEntryResponse) { - Utils.checkNotNull(getJournalEntryResponse, "getJournalEntryResponse"); + public Builder getJournalEntryResponse(@Nullable GetJournalEntryResponse getJournalEntryResponse) { this.getJournalEntryResponse = getJournalEntryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingJournalEntriesOneResponse build() { - return new AccountingJournalEntriesOneResponse( contentType, statusCode, rawResponse, getJournalEntryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateRequest.java index ee65df75..3f21c79f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingJournalEntriesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingJournalEntriesUpdateRequest { @JsonCreator public AccountingJournalEntriesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JournalEntryInput journalEntry) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(journalEntry, "journalEntry"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull JournalEntryInput journalEntry) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.journalEntry = journalEntry; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.journalEntry = Optional.ofNullable(journalEntry) + .orElseThrow(() -> new IllegalArgumentException("journalEntry cannot be null")); } public AccountingJournalEntriesUpdateRequest( - String id, - JournalEntryInput journalEntry) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), journalEntry); + @Nonnull String id, + @Nonnull JournalEntryInput journalEntry) { + this(id, null, null, + null, null, journalEntry); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public JournalEntryInput journalEntry() { - return journalEntry; + return this.journalEntry; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingJournalEntriesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingJournalEntriesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingJournalEntriesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingJournalEntriesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingJournalEntriesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingJournalEntriesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingJournalEntriesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingJournalEntriesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingJournalEntriesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingJournalEntriesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingJournalEntriesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingJournalEntriesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingJournalEntriesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingJournalEntriesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingJournalEntriesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingJournalEntriesUpdateRequest withJournalEntry(JournalEntryInput journalEntry) { - Utils.checkNotNull(journalEntry, "journalEntry"); - this.journalEntry = journalEntry; + + public AccountingJournalEntriesUpdateRequest withJournalEntry(@Nonnull JournalEntryInput journalEntry) { + this.journalEntry = Utils.checkNotNull(journalEntry, "journalEntry"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private JournalEntryInput journalEntry; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder journalEntry(JournalEntryInput journalEntry) { - Utils.checkNotNull(journalEntry, "journalEntry"); - this.journalEntry = journalEntry; + public Builder journalEntry(@Nonnull JournalEntryInput journalEntry) { + this.journalEntry = Utils.checkNotNull(journalEntry, "journalEntry"); return this; } public AccountingJournalEntriesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingJournalEntriesUpdateRequest( id, consumerId, appId, serviceId, raw, journalEntry); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateRequestBuilder.java index f969d3c2..f3151b58 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingJournalEntriesUpdateRequestBuilder { - - private AccountingJournalEntriesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingJournalEntriesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingJournalEntriesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingJournalEntriesUpdateRequestBuilder request(AccountingJournalEntriesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingJournalEntriesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingJournalEntriesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingJournalEntriesUpdateRequestBuilder request(@Nonnull AccountingJournalEntriesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingJournalEntriesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingJournalEntriesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingJournalEntriesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateResponse.java index 8f1ca2ac..09f30337 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingJournalEntriesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingJournalEntriesUpdateResponse implements Response { /** * JournalEntries */ - private Optional updateJournalEntryResponse; + private UpdateJournalEntryResponse updateJournalEntryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingJournalEntriesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateJournalEntryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateJournalEntryResponse, "updateJournalEntryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateJournalEntryResponse updateJournalEntryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateJournalEntryResponse = updateJournalEntryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingJournalEntriesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * JournalEntries */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateJournalEntryResponse() { - return (Optional) updateJournalEntryResponse; + return Optional.ofNullable(this.updateJournalEntryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingJournalEntriesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingJournalEntriesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingJournalEntriesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingJournalEntriesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * JournalEntries + * Raw HTTP response; suitable for custom response parsing */ - public AccountingJournalEntriesUpdateResponse withUpdateJournalEntryResponse(UpdateJournalEntryResponse updateJournalEntryResponse) { - Utils.checkNotNull(updateJournalEntryResponse, "updateJournalEntryResponse"); - this.updateJournalEntryResponse = Optional.ofNullable(updateJournalEntryResponse); + public AccountingJournalEntriesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingJournalEntriesUpdateResponse withUpdateJournalEntryResponse(Upd /** * JournalEntries */ - public AccountingJournalEntriesUpdateResponse withUpdateJournalEntryResponse(Optional updateJournalEntryResponse) { - Utils.checkNotNull(updateJournalEntryResponse, "updateJournalEntryResponse"); + public AccountingJournalEntriesUpdateResponse withUpdateJournalEntryResponse(@Nullable UpdateJournalEntryResponse updateJournalEntryResponse) { this.updateJournalEntryResponse = updateJournalEntryResponse; return this; } - /** - * Unexpected error - */ - public AccountingJournalEntriesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingJournalEntriesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingJournalEntriesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateJournalEntryResponse = Optional.empty(); + private UpdateJournalEntryResponse updateJournalEntryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * JournalEntries - */ - public Builder updateJournalEntryResponse(UpdateJournalEntryResponse updateJournalEntryResponse) { - Utils.checkNotNull(updateJournalEntryResponse, "updateJournalEntryResponse"); - this.updateJournalEntryResponse = Optional.ofNullable(updateJournalEntryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * JournalEntries */ - public Builder updateJournalEntryResponse(Optional updateJournalEntryResponse) { - Utils.checkNotNull(updateJournalEntryResponse, "updateJournalEntryResponse"); + public Builder updateJournalEntryResponse(@Nullable UpdateJournalEntryResponse updateJournalEntryResponse) { this.updateJournalEntryResponse = updateJournalEntryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingJournalEntriesUpdateResponse build() { - return new AccountingJournalEntriesUpdateResponse( contentType, statusCode, rawResponse, updateJournalEntryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddRequest.java index 97566282..3814665b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingLedgerAccountsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingLedgerAccountsAddRequest { @JsonCreator public AccountingLedgerAccountsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - LedgerAccountInput ledgerAccount) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull LedgerAccountInput ledgerAccount) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.ledgerAccount = ledgerAccount; + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElseThrow(() -> new IllegalArgumentException("ledgerAccount cannot be null")); } public AccountingLedgerAccountsAddRequest( - LedgerAccountInput ledgerAccount) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), ledgerAccount); + @Nonnull LedgerAccountInput ledgerAccount) { + this(null, null, null, + null, ledgerAccount); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public LedgerAccountInput ledgerAccount() { - return ledgerAccount; + return this.ledgerAccount; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingLedgerAccountsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingLedgerAccountsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingLedgerAccountsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingLedgerAccountsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingLedgerAccountsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingLedgerAccountsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingLedgerAccountsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingLedgerAccountsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingLedgerAccountsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingLedgerAccountsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingLedgerAccountsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingLedgerAccountsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingLedgerAccountsAddRequest withLedgerAccount(LedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; + + public AccountingLedgerAccountsAddRequest withLedgerAccount(@Nonnull LedgerAccountInput ledgerAccount) { + this.ledgerAccount = Utils.checkNotNull(ledgerAccount, "ledgerAccount"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private LedgerAccountInput ledgerAccount; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder ledgerAccount(LedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; + public Builder ledgerAccount(@Nonnull LedgerAccountInput ledgerAccount) { + this.ledgerAccount = Utils.checkNotNull(ledgerAccount, "ledgerAccount"); return this; } public AccountingLedgerAccountsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingLedgerAccountsAddRequest( raw, consumerId, appId, serviceId, ledgerAccount); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddRequestBuilder.java index 087fb57d..34a59846 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingLedgerAccountsAddRequestBuilder { - - private AccountingLedgerAccountsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingLedgerAccountsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingLedgerAccountsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingLedgerAccountsAddRequestBuilder request(AccountingLedgerAccountsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingLedgerAccountsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingLedgerAccountsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingLedgerAccountsAddRequestBuilder request(@Nonnull AccountingLedgerAccountsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingLedgerAccountsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingLedgerAccountsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingLedgerAccountsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddResponse.java index 5fdf7235..12efbb3a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingLedgerAccountsAddResponse implements Response { /** * LedgerAccount created */ - private Optional createLedgerAccountResponse; + private CreateLedgerAccountResponse createLedgerAccountResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingLedgerAccountsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createLedgerAccountResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createLedgerAccountResponse, "createLedgerAccountResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateLedgerAccountResponse createLedgerAccountResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createLedgerAccountResponse = createLedgerAccountResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingLedgerAccountsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * LedgerAccount created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createLedgerAccountResponse() { - return (Optional) createLedgerAccountResponse; + return Optional.ofNullable(this.createLedgerAccountResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingLedgerAccountsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingLedgerAccountsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingLedgerAccountsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingLedgerAccountsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * LedgerAccount created + * Raw HTTP response; suitable for custom response parsing */ - public AccountingLedgerAccountsAddResponse withCreateLedgerAccountResponse(CreateLedgerAccountResponse createLedgerAccountResponse) { - Utils.checkNotNull(createLedgerAccountResponse, "createLedgerAccountResponse"); - this.createLedgerAccountResponse = Optional.ofNullable(createLedgerAccountResponse); + public AccountingLedgerAccountsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingLedgerAccountsAddResponse withCreateLedgerAccountResponse(Creat /** * LedgerAccount created */ - public AccountingLedgerAccountsAddResponse withCreateLedgerAccountResponse(Optional createLedgerAccountResponse) { - Utils.checkNotNull(createLedgerAccountResponse, "createLedgerAccountResponse"); + public AccountingLedgerAccountsAddResponse withCreateLedgerAccountResponse(@Nullable CreateLedgerAccountResponse createLedgerAccountResponse) { this.createLedgerAccountResponse = createLedgerAccountResponse; return this; } - /** - * Unexpected error - */ - public AccountingLedgerAccountsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingLedgerAccountsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingLedgerAccountsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createLedgerAccountResponse = Optional.empty(); + private CreateLedgerAccountResponse createLedgerAccountResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * LedgerAccount created - */ - public Builder createLedgerAccountResponse(CreateLedgerAccountResponse createLedgerAccountResponse) { - Utils.checkNotNull(createLedgerAccountResponse, "createLedgerAccountResponse"); - this.createLedgerAccountResponse = Optional.ofNullable(createLedgerAccountResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * LedgerAccount created */ - public Builder createLedgerAccountResponse(Optional createLedgerAccountResponse) { - Utils.checkNotNull(createLedgerAccountResponse, "createLedgerAccountResponse"); + public Builder createLedgerAccountResponse(@Nullable CreateLedgerAccountResponse createLedgerAccountResponse) { this.createLedgerAccountResponse = createLedgerAccountResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingLedgerAccountsAddResponse build() { - return new AccountingLedgerAccountsAddResponse( contentType, statusCode, rawResponse, createLedgerAccountResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllRequest.java index 2c30fb73..a666537b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingLedgerAccountsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class AccountingLedgerAccountsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private LedgerAccountsFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private LedgerAccountsSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class AccountingLedgerAccountsAllRequest { @JsonCreator public AccountingLedgerAccountsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable LedgerAccountsFilter filter, + @Nullable LedgerAccountsSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingLedgerAccountsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingLedgerAccountsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingLedgerAccountsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingLedgerAccountsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingLedgerAccountsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingLedgerAccountsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingLedgerAccountsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingLedgerAccountsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingLedgerAccountsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingLedgerAccountsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingLedgerAccountsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingLedgerAccountsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingLedgerAccountsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingLedgerAccountsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingLedgerAccountsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingLedgerAccountsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingLedgerAccountsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public AccountingLedgerAccountsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingLedgerAccountsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingLedgerAccountsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingLedgerAccountsAllRequest withFilter(LedgerAccountsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingLedgerAccountsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingLedgerAccountsAllRequest withFilter(@Nullable LedgerAccountsFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingLedgerAccountsAllRequest withSort(LedgerAccountsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingLedgerAccountsAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingLedgerAccountsAllRequest withSort(@Nullable LedgerAccountsSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingLedgerAccountsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingLedgerAccountsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingLedgerAccountsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingLedgerAccountsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingLedgerAccountsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingLedgerAccountsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private LedgerAccountsFilter filter; - private Optional sort = Optional.empty(); + private LedgerAccountsSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(LedgerAccountsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable LedgerAccountsFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(LedgerAccountsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable LedgerAccountsSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingLedgerAccountsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingLedgerAccountsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public AccountingLedgerAccountsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllRequestBuilder.java index 9188969a..38906886 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingLedgerAccountsAllRequestBuilder { - - private AccountingLedgerAccountsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingLedgerAccountsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingLedgerAccountsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingLedgerAccountsAllRequestBuilder request(AccountingLedgerAccountsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingLedgerAccountsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingLedgerAccountsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingLedgerAccountsAllRequestBuilder request(@Nonnull AccountingLedgerAccountsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingLedgerAccountsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingLedgerAccountsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingLedgerAccountsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingLedgerAccountsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingLedgerAccountsAllOperation( - sdkConfiguration, - options); + AccountingLedgerAccountsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingLedgerAccountsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingLedgerAccountsAllRequest::withCursor, + AccountingLedgerAccountsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllResponse.java index c311062b..e67f9e6b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingLedgerAccountsAllResponse implements Response { /** * LedgerAccounts */ - private Optional getLedgerAccountsResponse; + private GetLedgerAccountsResponse getLedgerAccountsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingLedgerAccountsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getLedgerAccountsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getLedgerAccountsResponse, "getLedgerAccountsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetLedgerAccountsResponse getLedgerAccountsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getLedgerAccountsResponse = getLedgerAccountsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingLedgerAccountsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * LedgerAccounts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getLedgerAccountsResponse() { - return (Optional) getLedgerAccountsResponse; + return Optional.ofNullable(this.getLedgerAccountsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingLedgerAccountsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingLedgerAccountsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingLedgerAccountsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingLedgerAccountsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * LedgerAccounts + * Raw HTTP response; suitable for custom response parsing */ - public AccountingLedgerAccountsAllResponse withGetLedgerAccountsResponse(GetLedgerAccountsResponse getLedgerAccountsResponse) { - Utils.checkNotNull(getLedgerAccountsResponse, "getLedgerAccountsResponse"); - this.getLedgerAccountsResponse = Optional.ofNullable(getLedgerAccountsResponse); + public AccountingLedgerAccountsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingLedgerAccountsAllResponse withGetLedgerAccountsResponse(GetLedg /** * LedgerAccounts */ - public AccountingLedgerAccountsAllResponse withGetLedgerAccountsResponse(Optional getLedgerAccountsResponse) { - Utils.checkNotNull(getLedgerAccountsResponse, "getLedgerAccountsResponse"); + public AccountingLedgerAccountsAllResponse withGetLedgerAccountsResponse(@Nullable GetLedgerAccountsResponse getLedgerAccountsResponse) { this.getLedgerAccountsResponse = getLedgerAccountsResponse; return this; } - /** - * Unexpected error - */ - public AccountingLedgerAccountsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingLedgerAccountsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingLedgerAccountsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getLedgerAccountsResponse = Optional.empty(); + private GetLedgerAccountsResponse getLedgerAccountsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * LedgerAccounts - */ - public Builder getLedgerAccountsResponse(GetLedgerAccountsResponse getLedgerAccountsResponse) { - Utils.checkNotNull(getLedgerAccountsResponse, "getLedgerAccountsResponse"); - this.getLedgerAccountsResponse = Optional.ofNullable(getLedgerAccountsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * LedgerAccounts */ - public Builder getLedgerAccountsResponse(Optional getLedgerAccountsResponse) { - Utils.checkNotNull(getLedgerAccountsResponse, "getLedgerAccountsResponse"); + public Builder getLedgerAccountsResponse(@Nullable GetLedgerAccountsResponse getLedgerAccountsResponse) { this.getLedgerAccountsResponse = getLedgerAccountsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingLedgerAccountsAllResponse build() { - return new AccountingLedgerAccountsAllResponse( contentType, statusCode, rawResponse, getLedgerAccountsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteRequest.java index 9312d5a0..c7ffc2d9 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingLedgerAccountsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingLedgerAccountsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingLedgerAccountsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingLedgerAccountsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingLedgerAccountsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingLedgerAccountsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingLedgerAccountsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingLedgerAccountsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingLedgerAccountsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingLedgerAccountsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingLedgerAccountsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingLedgerAccountsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingLedgerAccountsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingLedgerAccountsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingLedgerAccountsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingLedgerAccountsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingLedgerAccountsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingLedgerAccountsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingLedgerAccountsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingLedgerAccountsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteRequestBuilder.java index b1ec9fa8..ea4951df 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingLedgerAccountsDeleteRequestBuilder { - - private AccountingLedgerAccountsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingLedgerAccountsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingLedgerAccountsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingLedgerAccountsDeleteRequestBuilder request(AccountingLedgerAccountsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingLedgerAccountsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingLedgerAccountsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingLedgerAccountsDeleteRequestBuilder request(@Nonnull AccountingLedgerAccountsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingLedgerAccountsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingLedgerAccountsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingLedgerAccountsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteResponse.java index 5f6cbd97..43a87d26 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingLedgerAccountsDeleteResponse implements Response { /** * LedgerAccount deleted */ - private Optional deleteLedgerAccountResponse; + private DeleteLedgerAccountResponse deleteLedgerAccountResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingLedgerAccountsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteLedgerAccountResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteLedgerAccountResponse, "deleteLedgerAccountResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteLedgerAccountResponse deleteLedgerAccountResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteLedgerAccountResponse = deleteLedgerAccountResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingLedgerAccountsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * LedgerAccount deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteLedgerAccountResponse() { - return (Optional) deleteLedgerAccountResponse; + return Optional.ofNullable(this.deleteLedgerAccountResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingLedgerAccountsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingLedgerAccountsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingLedgerAccountsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingLedgerAccountsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * LedgerAccount deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingLedgerAccountsDeleteResponse withDeleteLedgerAccountResponse(DeleteLedgerAccountResponse deleteLedgerAccountResponse) { - Utils.checkNotNull(deleteLedgerAccountResponse, "deleteLedgerAccountResponse"); - this.deleteLedgerAccountResponse = Optional.ofNullable(deleteLedgerAccountResponse); + public AccountingLedgerAccountsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingLedgerAccountsDeleteResponse withDeleteLedgerAccountResponse(De /** * LedgerAccount deleted */ - public AccountingLedgerAccountsDeleteResponse withDeleteLedgerAccountResponse(Optional deleteLedgerAccountResponse) { - Utils.checkNotNull(deleteLedgerAccountResponse, "deleteLedgerAccountResponse"); + public AccountingLedgerAccountsDeleteResponse withDeleteLedgerAccountResponse(@Nullable DeleteLedgerAccountResponse deleteLedgerAccountResponse) { this.deleteLedgerAccountResponse = deleteLedgerAccountResponse; return this; } - /** - * Unexpected error - */ - public AccountingLedgerAccountsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingLedgerAccountsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingLedgerAccountsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteLedgerAccountResponse = Optional.empty(); + private DeleteLedgerAccountResponse deleteLedgerAccountResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * LedgerAccount deleted - */ - public Builder deleteLedgerAccountResponse(DeleteLedgerAccountResponse deleteLedgerAccountResponse) { - Utils.checkNotNull(deleteLedgerAccountResponse, "deleteLedgerAccountResponse"); - this.deleteLedgerAccountResponse = Optional.ofNullable(deleteLedgerAccountResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * LedgerAccount deleted */ - public Builder deleteLedgerAccountResponse(Optional deleteLedgerAccountResponse) { - Utils.checkNotNull(deleteLedgerAccountResponse, "deleteLedgerAccountResponse"); + public Builder deleteLedgerAccountResponse(@Nullable DeleteLedgerAccountResponse deleteLedgerAccountResponse) { this.deleteLedgerAccountResponse = deleteLedgerAccountResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingLedgerAccountsDeleteResponse build() { - return new AccountingLedgerAccountsDeleteResponse( contentType, statusCode, rawResponse, deleteLedgerAccountResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneRequest.java index 82fdc804..52bb87d5 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingLedgerAccountsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingLedgerAccountsOneRequest { @JsonCreator public AccountingLedgerAccountsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingLedgerAccountsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingLedgerAccountsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingLedgerAccountsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingLedgerAccountsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingLedgerAccountsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingLedgerAccountsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingLedgerAccountsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingLedgerAccountsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingLedgerAccountsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingLedgerAccountsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingLedgerAccountsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingLedgerAccountsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingLedgerAccountsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingLedgerAccountsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingLedgerAccountsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingLedgerAccountsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingLedgerAccountsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingLedgerAccountsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingLedgerAccountsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingLedgerAccountsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingLedgerAccountsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneRequestBuilder.java index e2775393..218e5259 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingLedgerAccountsOneRequestBuilder { - - private AccountingLedgerAccountsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingLedgerAccountsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingLedgerAccountsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingLedgerAccountsOneRequestBuilder request(AccountingLedgerAccountsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingLedgerAccountsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingLedgerAccountsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingLedgerAccountsOneRequestBuilder request(@Nonnull AccountingLedgerAccountsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingLedgerAccountsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingLedgerAccountsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingLedgerAccountsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneResponse.java index ca598e4e..89932631 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingLedgerAccountsOneResponse implements Response { /** * LedgerAccount */ - private Optional getLedgerAccountResponse; + private GetLedgerAccountResponse getLedgerAccountResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingLedgerAccountsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getLedgerAccountResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getLedgerAccountResponse, "getLedgerAccountResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetLedgerAccountResponse getLedgerAccountResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getLedgerAccountResponse = getLedgerAccountResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingLedgerAccountsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * LedgerAccount */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getLedgerAccountResponse() { - return (Optional) getLedgerAccountResponse; + return Optional.ofNullable(this.getLedgerAccountResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingLedgerAccountsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingLedgerAccountsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingLedgerAccountsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingLedgerAccountsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * LedgerAccount + * Raw HTTP response; suitable for custom response parsing */ - public AccountingLedgerAccountsOneResponse withGetLedgerAccountResponse(GetLedgerAccountResponse getLedgerAccountResponse) { - Utils.checkNotNull(getLedgerAccountResponse, "getLedgerAccountResponse"); - this.getLedgerAccountResponse = Optional.ofNullable(getLedgerAccountResponse); + public AccountingLedgerAccountsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingLedgerAccountsOneResponse withGetLedgerAccountResponse(GetLedge /** * LedgerAccount */ - public AccountingLedgerAccountsOneResponse withGetLedgerAccountResponse(Optional getLedgerAccountResponse) { - Utils.checkNotNull(getLedgerAccountResponse, "getLedgerAccountResponse"); + public AccountingLedgerAccountsOneResponse withGetLedgerAccountResponse(@Nullable GetLedgerAccountResponse getLedgerAccountResponse) { this.getLedgerAccountResponse = getLedgerAccountResponse; return this; } - /** - * Unexpected error - */ - public AccountingLedgerAccountsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingLedgerAccountsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingLedgerAccountsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getLedgerAccountResponse = Optional.empty(); + private GetLedgerAccountResponse getLedgerAccountResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * LedgerAccount - */ - public Builder getLedgerAccountResponse(GetLedgerAccountResponse getLedgerAccountResponse) { - Utils.checkNotNull(getLedgerAccountResponse, "getLedgerAccountResponse"); - this.getLedgerAccountResponse = Optional.ofNullable(getLedgerAccountResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * LedgerAccount */ - public Builder getLedgerAccountResponse(Optional getLedgerAccountResponse) { - Utils.checkNotNull(getLedgerAccountResponse, "getLedgerAccountResponse"); + public Builder getLedgerAccountResponse(@Nullable GetLedgerAccountResponse getLedgerAccountResponse) { this.getLedgerAccountResponse = getLedgerAccountResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingLedgerAccountsOneResponse build() { - return new AccountingLedgerAccountsOneResponse( contentType, statusCode, rawResponse, getLedgerAccountResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateRequest.java index 039a3da9..002af28c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingLedgerAccountsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingLedgerAccountsUpdateRequest { @JsonCreator public AccountingLedgerAccountsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - LedgerAccountInput ledgerAccount) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull LedgerAccountInput ledgerAccount) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.ledgerAccount = ledgerAccount; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.ledgerAccount = Optional.ofNullable(ledgerAccount) + .orElseThrow(() -> new IllegalArgumentException("ledgerAccount cannot be null")); } public AccountingLedgerAccountsUpdateRequest( - String id, - LedgerAccountInput ledgerAccount) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), ledgerAccount); + @Nonnull String id, + @Nonnull LedgerAccountInput ledgerAccount) { + this(id, null, null, + null, null, ledgerAccount); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public LedgerAccountInput ledgerAccount() { - return ledgerAccount; + return this.ledgerAccount; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingLedgerAccountsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingLedgerAccountsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingLedgerAccountsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingLedgerAccountsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingLedgerAccountsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingLedgerAccountsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingLedgerAccountsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingLedgerAccountsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingLedgerAccountsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingLedgerAccountsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingLedgerAccountsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingLedgerAccountsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingLedgerAccountsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingLedgerAccountsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingLedgerAccountsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingLedgerAccountsUpdateRequest withLedgerAccount(LedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; + + public AccountingLedgerAccountsUpdateRequest withLedgerAccount(@Nonnull LedgerAccountInput ledgerAccount) { + this.ledgerAccount = Utils.checkNotNull(ledgerAccount, "ledgerAccount"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private LedgerAccountInput ledgerAccount; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder ledgerAccount(LedgerAccountInput ledgerAccount) { - Utils.checkNotNull(ledgerAccount, "ledgerAccount"); - this.ledgerAccount = ledgerAccount; + public Builder ledgerAccount(@Nonnull LedgerAccountInput ledgerAccount) { + this.ledgerAccount = Utils.checkNotNull(ledgerAccount, "ledgerAccount"); return this; } public AccountingLedgerAccountsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingLedgerAccountsUpdateRequest( id, consumerId, appId, serviceId, raw, ledgerAccount); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateRequestBuilder.java index 129d1fad..e4356e60 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingLedgerAccountsUpdateRequestBuilder { - - private AccountingLedgerAccountsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingLedgerAccountsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingLedgerAccountsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingLedgerAccountsUpdateRequestBuilder request(AccountingLedgerAccountsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingLedgerAccountsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingLedgerAccountsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingLedgerAccountsUpdateRequestBuilder request(@Nonnull AccountingLedgerAccountsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingLedgerAccountsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingLedgerAccountsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingLedgerAccountsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateResponse.java index 12b028b7..99e36646 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLedgerAccountsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingLedgerAccountsUpdateResponse implements Response { /** * LedgerAccount updated */ - private Optional updateLedgerAccountResponse; + private UpdateLedgerAccountResponse updateLedgerAccountResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingLedgerAccountsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateLedgerAccountResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateLedgerAccountResponse, "updateLedgerAccountResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateLedgerAccountResponse updateLedgerAccountResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateLedgerAccountResponse = updateLedgerAccountResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingLedgerAccountsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * LedgerAccount updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateLedgerAccountResponse() { - return (Optional) updateLedgerAccountResponse; + return Optional.ofNullable(this.updateLedgerAccountResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingLedgerAccountsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingLedgerAccountsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingLedgerAccountsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingLedgerAccountsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * LedgerAccount updated + * Raw HTTP response; suitable for custom response parsing */ - public AccountingLedgerAccountsUpdateResponse withUpdateLedgerAccountResponse(UpdateLedgerAccountResponse updateLedgerAccountResponse) { - Utils.checkNotNull(updateLedgerAccountResponse, "updateLedgerAccountResponse"); - this.updateLedgerAccountResponse = Optional.ofNullable(updateLedgerAccountResponse); + public AccountingLedgerAccountsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingLedgerAccountsUpdateResponse withUpdateLedgerAccountResponse(Up /** * LedgerAccount updated */ - public AccountingLedgerAccountsUpdateResponse withUpdateLedgerAccountResponse(Optional updateLedgerAccountResponse) { - Utils.checkNotNull(updateLedgerAccountResponse, "updateLedgerAccountResponse"); + public AccountingLedgerAccountsUpdateResponse withUpdateLedgerAccountResponse(@Nullable UpdateLedgerAccountResponse updateLedgerAccountResponse) { this.updateLedgerAccountResponse = updateLedgerAccountResponse; return this; } - /** - * Unexpected error - */ - public AccountingLedgerAccountsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingLedgerAccountsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingLedgerAccountsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateLedgerAccountResponse = Optional.empty(); + private UpdateLedgerAccountResponse updateLedgerAccountResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * LedgerAccount updated - */ - public Builder updateLedgerAccountResponse(UpdateLedgerAccountResponse updateLedgerAccountResponse) { - Utils.checkNotNull(updateLedgerAccountResponse, "updateLedgerAccountResponse"); - this.updateLedgerAccountResponse = Optional.ofNullable(updateLedgerAccountResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * LedgerAccount updated */ - public Builder updateLedgerAccountResponse(Optional updateLedgerAccountResponse) { - Utils.checkNotNull(updateLedgerAccountResponse, "updateLedgerAccountResponse"); + public Builder updateLedgerAccountResponse(@Nullable UpdateLedgerAccountResponse updateLedgerAccountResponse) { this.updateLedgerAccountResponse = updateLedgerAccountResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingLedgerAccountsUpdateResponse build() { - return new AccountingLedgerAccountsUpdateResponse( contentType, statusCode, rawResponse, updateLedgerAccountResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddRequest.java index fa99ad91..7499e4ca 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingLocationsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingLocationsAddRequest { @JsonCreator public AccountingLocationsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - AccountingLocationInput accountingLocation) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(accountingLocation, "accountingLocation"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull AccountingLocationInput accountingLocation) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.accountingLocation = accountingLocation; + this.accountingLocation = Optional.ofNullable(accountingLocation) + .orElseThrow(() -> new IllegalArgumentException("accountingLocation cannot be null")); } public AccountingLocationsAddRequest( - AccountingLocationInput accountingLocation) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), accountingLocation); + @Nonnull AccountingLocationInput accountingLocation) { + this(null, null, null, + null, accountingLocation); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public AccountingLocationInput accountingLocation() { - return accountingLocation; + return this.accountingLocation; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingLocationsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingLocationsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingLocationsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingLocationsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingLocationsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingLocationsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingLocationsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingLocationsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingLocationsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingLocationsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingLocationsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingLocationsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingLocationsAddRequest withAccountingLocation(AccountingLocationInput accountingLocation) { - Utils.checkNotNull(accountingLocation, "accountingLocation"); - this.accountingLocation = accountingLocation; + + public AccountingLocationsAddRequest withAccountingLocation(@Nonnull AccountingLocationInput accountingLocation) { + this.accountingLocation = Utils.checkNotNull(accountingLocation, "accountingLocation"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private AccountingLocationInput accountingLocation; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder accountingLocation(AccountingLocationInput accountingLocation) { - Utils.checkNotNull(accountingLocation, "accountingLocation"); - this.accountingLocation = accountingLocation; + public Builder accountingLocation(@Nonnull AccountingLocationInput accountingLocation) { + this.accountingLocation = Utils.checkNotNull(accountingLocation, "accountingLocation"); return this; } public AccountingLocationsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingLocationsAddRequest( raw, consumerId, appId, serviceId, accountingLocation); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddRequestBuilder.java index 1b5653e3..314aad6b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingLocationsAddRequestBuilder { - - private AccountingLocationsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingLocationsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingLocationsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingLocationsAddRequestBuilder request(AccountingLocationsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingLocationsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingLocationsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingLocationsAddRequestBuilder request(@Nonnull AccountingLocationsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingLocationsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingLocationsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingLocationsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddResponse.java index ddb074a9..da0a1de1 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingLocationsAddResponse implements Response { /** * Location */ - private Optional createAccountingLocationResponse; + private CreateAccountingLocationResponse createAccountingLocationResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingLocationsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createAccountingLocationResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createAccountingLocationResponse, "createAccountingLocationResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateAccountingLocationResponse createAccountingLocationResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createAccountingLocationResponse = createAccountingLocationResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingLocationsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Location */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createAccountingLocationResponse() { - return (Optional) createAccountingLocationResponse; + return Optional.ofNullable(this.createAccountingLocationResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingLocationsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingLocationsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingLocationsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingLocationsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Location + * Raw HTTP response; suitable for custom response parsing */ - public AccountingLocationsAddResponse withCreateAccountingLocationResponse(CreateAccountingLocationResponse createAccountingLocationResponse) { - Utils.checkNotNull(createAccountingLocationResponse, "createAccountingLocationResponse"); - this.createAccountingLocationResponse = Optional.ofNullable(createAccountingLocationResponse); + public AccountingLocationsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingLocationsAddResponse withCreateAccountingLocationResponse(Creat /** * Location */ - public AccountingLocationsAddResponse withCreateAccountingLocationResponse(Optional createAccountingLocationResponse) { - Utils.checkNotNull(createAccountingLocationResponse, "createAccountingLocationResponse"); + public AccountingLocationsAddResponse withCreateAccountingLocationResponse(@Nullable CreateAccountingLocationResponse createAccountingLocationResponse) { this.createAccountingLocationResponse = createAccountingLocationResponse; return this; } - /** - * Unexpected error - */ - public AccountingLocationsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingLocationsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingLocationsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createAccountingLocationResponse = Optional.empty(); + private CreateAccountingLocationResponse createAccountingLocationResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Location - */ - public Builder createAccountingLocationResponse(CreateAccountingLocationResponse createAccountingLocationResponse) { - Utils.checkNotNull(createAccountingLocationResponse, "createAccountingLocationResponse"); - this.createAccountingLocationResponse = Optional.ofNullable(createAccountingLocationResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Location */ - public Builder createAccountingLocationResponse(Optional createAccountingLocationResponse) { - Utils.checkNotNull(createAccountingLocationResponse, "createAccountingLocationResponse"); + public Builder createAccountingLocationResponse(@Nullable CreateAccountingLocationResponse createAccountingLocationResponse) { this.createAccountingLocationResponse = createAccountingLocationResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingLocationsAddResponse build() { - return new AccountingLocationsAddResponse( contentType, statusCode, rawResponse, createAccountingLocationResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllRequest.java index 4a51cac4..2e86e22c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllRequest.java @@ -8,13 +8,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,25 +23,25 @@ public class AccountingLocationsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -54,7 +53,7 @@ public class AccountingLocationsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -66,105 +65,92 @@ public class AccountingLocationsAllRequest { * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private AccountingLocationsFilter filter; @JsonCreator public AccountingLocationsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - JsonNullable fields, - Optional filter) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(filter, "filter"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable JsonNullable fields, + @Nullable AccountingLocationsFilter filter) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; - this.fields = fields; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); this.filter = filter; } public AccountingLocationsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } public static Builder builder() { @@ -175,103 +161,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingLocationsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingLocationsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingLocationsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingLocationsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingLocationsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingLocationsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingLocationsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingLocationsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingLocationsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingLocationsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingLocationsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingLocationsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingLocationsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingLocationsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingLocationsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingLocationsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -279,36 +206,17 @@ public AccountingLocationsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingLocationsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingLocationsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingLocationsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = JsonNullable.of(fields); - return this; - } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingLocationsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** - * Apply filters - */ - public AccountingLocationsAllRequest withFilter(AccountingLocationsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); + public AccountingLocationsAllRequest withFields(@Nullable String fields) { + this.fields = JsonNullable.of(fields); return this; } @@ -316,12 +224,12 @@ public AccountingLocationsAllRequest withFilter(AccountingLocationsFilter filter /** * Apply filters */ - public AccountingLocationsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingLocationsAllRequest withFilter(@Nullable AccountingLocationsFilter filter) { this.filter = filter; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -366,186 +274,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; - private Optional filter = Optional.empty(); + private AccountingLocationsFilter filter; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** * Apply filters */ - public Builder filter(AccountingLocationsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable AccountingLocationsFilter filter) { this.filter = filter; return this; } public AccountingLocationsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingLocationsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -553,16 +366,16 @@ public AccountingLocationsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllRequestBuilder.java index 37eda319..6f2e1631 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingLocationsAllRequestBuilder { - - private AccountingLocationsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingLocationsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingLocationsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingLocationsAllRequestBuilder request(AccountingLocationsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingLocationsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingLocationsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingLocationsAllRequestBuilder request(@Nonnull AccountingLocationsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingLocationsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingLocationsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingLocationsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingLocationsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingLocationsAllOperation( - sdkConfiguration, - options); + AccountingLocationsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingLocationsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingLocationsAllRequest::withCursor, + AccountingLocationsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllResponse.java index bb27779f..bfa022ff 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingLocationsAllResponse implements Response { /** * Locations */ - private Optional getAccountingLocationsResponse; + private GetAccountingLocationsResponse getAccountingLocationsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingLocationsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getAccountingLocationsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getAccountingLocationsResponse, "getAccountingLocationsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetAccountingLocationsResponse getAccountingLocationsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getAccountingLocationsResponse = getAccountingLocationsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingLocationsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Locations */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getAccountingLocationsResponse() { - return (Optional) getAccountingLocationsResponse; + return Optional.ofNullable(this.getAccountingLocationsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingLocationsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingLocationsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingLocationsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingLocationsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Locations + * Raw HTTP response; suitable for custom response parsing */ - public AccountingLocationsAllResponse withGetAccountingLocationsResponse(GetAccountingLocationsResponse getAccountingLocationsResponse) { - Utils.checkNotNull(getAccountingLocationsResponse, "getAccountingLocationsResponse"); - this.getAccountingLocationsResponse = Optional.ofNullable(getAccountingLocationsResponse); + public AccountingLocationsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingLocationsAllResponse withGetAccountingLocationsResponse(GetAcco /** * Locations */ - public AccountingLocationsAllResponse withGetAccountingLocationsResponse(Optional getAccountingLocationsResponse) { - Utils.checkNotNull(getAccountingLocationsResponse, "getAccountingLocationsResponse"); + public AccountingLocationsAllResponse withGetAccountingLocationsResponse(@Nullable GetAccountingLocationsResponse getAccountingLocationsResponse) { this.getAccountingLocationsResponse = getAccountingLocationsResponse; return this; } - /** - * Unexpected error - */ - public AccountingLocationsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingLocationsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingLocationsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getAccountingLocationsResponse = Optional.empty(); + private GetAccountingLocationsResponse getAccountingLocationsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Locations - */ - public Builder getAccountingLocationsResponse(GetAccountingLocationsResponse getAccountingLocationsResponse) { - Utils.checkNotNull(getAccountingLocationsResponse, "getAccountingLocationsResponse"); - this.getAccountingLocationsResponse = Optional.ofNullable(getAccountingLocationsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Locations */ - public Builder getAccountingLocationsResponse(Optional getAccountingLocationsResponse) { - Utils.checkNotNull(getAccountingLocationsResponse, "getAccountingLocationsResponse"); + public Builder getAccountingLocationsResponse(@Nullable GetAccountingLocationsResponse getAccountingLocationsResponse) { this.getAccountingLocationsResponse = getAccountingLocationsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingLocationsAllResponse build() { - return new AccountingLocationsAllResponse( contentType, statusCode, rawResponse, getAccountingLocationsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteRequest.java index 805ce064..8dd76425 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingLocationsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingLocationsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingLocationsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingLocationsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingLocationsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingLocationsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingLocationsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingLocationsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingLocationsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingLocationsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingLocationsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingLocationsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingLocationsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingLocationsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingLocationsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingLocationsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingLocationsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingLocationsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingLocationsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingLocationsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteRequestBuilder.java index 4e18b91a..430b848e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingLocationsDeleteRequestBuilder { - - private AccountingLocationsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingLocationsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingLocationsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingLocationsDeleteRequestBuilder request(AccountingLocationsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingLocationsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingLocationsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingLocationsDeleteRequestBuilder request(@Nonnull AccountingLocationsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingLocationsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingLocationsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingLocationsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteResponse.java index 11eb722c..0daa9b66 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingLocationsDeleteResponse implements Response { /** * Location deleted */ - private Optional deleteAccountingLocationResponse; + private DeleteAccountingLocationResponse deleteAccountingLocationResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingLocationsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteAccountingLocationResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteAccountingLocationResponse, "deleteAccountingLocationResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteAccountingLocationResponse deleteAccountingLocationResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteAccountingLocationResponse = deleteAccountingLocationResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingLocationsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Location deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteAccountingLocationResponse() { - return (Optional) deleteAccountingLocationResponse; + return Optional.ofNullable(this.deleteAccountingLocationResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingLocationsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingLocationsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingLocationsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingLocationsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Location deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingLocationsDeleteResponse withDeleteAccountingLocationResponse(DeleteAccountingLocationResponse deleteAccountingLocationResponse) { - Utils.checkNotNull(deleteAccountingLocationResponse, "deleteAccountingLocationResponse"); - this.deleteAccountingLocationResponse = Optional.ofNullable(deleteAccountingLocationResponse); + public AccountingLocationsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingLocationsDeleteResponse withDeleteAccountingLocationResponse(De /** * Location deleted */ - public AccountingLocationsDeleteResponse withDeleteAccountingLocationResponse(Optional deleteAccountingLocationResponse) { - Utils.checkNotNull(deleteAccountingLocationResponse, "deleteAccountingLocationResponse"); + public AccountingLocationsDeleteResponse withDeleteAccountingLocationResponse(@Nullable DeleteAccountingLocationResponse deleteAccountingLocationResponse) { this.deleteAccountingLocationResponse = deleteAccountingLocationResponse; return this; } - /** - * Unexpected error - */ - public AccountingLocationsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingLocationsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingLocationsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteAccountingLocationResponse = Optional.empty(); + private DeleteAccountingLocationResponse deleteAccountingLocationResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Location deleted - */ - public Builder deleteAccountingLocationResponse(DeleteAccountingLocationResponse deleteAccountingLocationResponse) { - Utils.checkNotNull(deleteAccountingLocationResponse, "deleteAccountingLocationResponse"); - this.deleteAccountingLocationResponse = Optional.ofNullable(deleteAccountingLocationResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Location deleted */ - public Builder deleteAccountingLocationResponse(Optional deleteAccountingLocationResponse) { - Utils.checkNotNull(deleteAccountingLocationResponse, "deleteAccountingLocationResponse"); + public Builder deleteAccountingLocationResponse(@Nullable DeleteAccountingLocationResponse deleteAccountingLocationResponse) { this.deleteAccountingLocationResponse = deleteAccountingLocationResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingLocationsDeleteResponse build() { - return new AccountingLocationsDeleteResponse( contentType, statusCode, rawResponse, deleteAccountingLocationResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneRequest.java index 08c7d278..bb9a9771 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingLocationsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingLocationsOneRequest { @JsonCreator public AccountingLocationsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingLocationsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingLocationsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingLocationsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingLocationsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingLocationsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingLocationsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingLocationsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingLocationsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingLocationsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingLocationsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingLocationsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingLocationsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingLocationsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingLocationsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingLocationsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingLocationsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingLocationsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingLocationsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingLocationsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingLocationsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingLocationsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneRequestBuilder.java index 04c593c9..c90a7f66 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingLocationsOneRequestBuilder { - - private AccountingLocationsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingLocationsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingLocationsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingLocationsOneRequestBuilder request(AccountingLocationsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingLocationsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingLocationsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingLocationsOneRequestBuilder request(@Nonnull AccountingLocationsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingLocationsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingLocationsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingLocationsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneResponse.java index 7ecd2214..9f7e956a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingLocationsOneResponse implements Response { /** * Location */ - private Optional getAccountingLocationResponse; + private GetAccountingLocationResponse getAccountingLocationResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingLocationsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getAccountingLocationResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getAccountingLocationResponse, "getAccountingLocationResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetAccountingLocationResponse getAccountingLocationResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getAccountingLocationResponse = getAccountingLocationResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingLocationsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Location */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getAccountingLocationResponse() { - return (Optional) getAccountingLocationResponse; + return Optional.ofNullable(this.getAccountingLocationResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingLocationsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingLocationsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingLocationsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingLocationsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Location + * Raw HTTP response; suitable for custom response parsing */ - public AccountingLocationsOneResponse withGetAccountingLocationResponse(GetAccountingLocationResponse getAccountingLocationResponse) { - Utils.checkNotNull(getAccountingLocationResponse, "getAccountingLocationResponse"); - this.getAccountingLocationResponse = Optional.ofNullable(getAccountingLocationResponse); + public AccountingLocationsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingLocationsOneResponse withGetAccountingLocationResponse(GetAccou /** * Location */ - public AccountingLocationsOneResponse withGetAccountingLocationResponse(Optional getAccountingLocationResponse) { - Utils.checkNotNull(getAccountingLocationResponse, "getAccountingLocationResponse"); + public AccountingLocationsOneResponse withGetAccountingLocationResponse(@Nullable GetAccountingLocationResponse getAccountingLocationResponse) { this.getAccountingLocationResponse = getAccountingLocationResponse; return this; } - /** - * Unexpected error - */ - public AccountingLocationsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingLocationsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingLocationsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getAccountingLocationResponse = Optional.empty(); + private GetAccountingLocationResponse getAccountingLocationResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Location - */ - public Builder getAccountingLocationResponse(GetAccountingLocationResponse getAccountingLocationResponse) { - Utils.checkNotNull(getAccountingLocationResponse, "getAccountingLocationResponse"); - this.getAccountingLocationResponse = Optional.ofNullable(getAccountingLocationResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Location */ - public Builder getAccountingLocationResponse(Optional getAccountingLocationResponse) { - Utils.checkNotNull(getAccountingLocationResponse, "getAccountingLocationResponse"); + public Builder getAccountingLocationResponse(@Nullable GetAccountingLocationResponse getAccountingLocationResponse) { this.getAccountingLocationResponse = getAccountingLocationResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingLocationsOneResponse build() { - return new AccountingLocationsOneResponse( contentType, statusCode, rawResponse, getAccountingLocationResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateRequest.java index 9d174131..e75f4390 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingLocationsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingLocationsUpdateRequest { @JsonCreator public AccountingLocationsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - AccountingLocationInput accountingLocation) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(accountingLocation, "accountingLocation"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull AccountingLocationInput accountingLocation) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.accountingLocation = accountingLocation; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.accountingLocation = Optional.ofNullable(accountingLocation) + .orElseThrow(() -> new IllegalArgumentException("accountingLocation cannot be null")); } public AccountingLocationsUpdateRequest( - String id, - AccountingLocationInput accountingLocation) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), accountingLocation); + @Nonnull String id, + @Nonnull AccountingLocationInput accountingLocation) { + this(id, null, null, + null, null, accountingLocation); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public AccountingLocationInput accountingLocation() { - return accountingLocation; + return this.accountingLocation; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingLocationsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingLocationsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingLocationsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingLocationsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingLocationsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingLocationsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingLocationsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingLocationsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingLocationsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingLocationsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingLocationsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingLocationsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingLocationsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingLocationsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingLocationsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingLocationsUpdateRequest withAccountingLocation(AccountingLocationInput accountingLocation) { - Utils.checkNotNull(accountingLocation, "accountingLocation"); - this.accountingLocation = accountingLocation; + + public AccountingLocationsUpdateRequest withAccountingLocation(@Nonnull AccountingLocationInput accountingLocation) { + this.accountingLocation = Utils.checkNotNull(accountingLocation, "accountingLocation"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private AccountingLocationInput accountingLocation; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder accountingLocation(AccountingLocationInput accountingLocation) { - Utils.checkNotNull(accountingLocation, "accountingLocation"); - this.accountingLocation = accountingLocation; + public Builder accountingLocation(@Nonnull AccountingLocationInput accountingLocation) { + this.accountingLocation = Utils.checkNotNull(accountingLocation, "accountingLocation"); return this; } public AccountingLocationsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingLocationsUpdateRequest( id, consumerId, appId, serviceId, raw, accountingLocation); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateRequestBuilder.java index cc0495dd..c7e39b8a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingLocationsUpdateRequestBuilder { - - private AccountingLocationsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingLocationsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingLocationsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingLocationsUpdateRequestBuilder request(AccountingLocationsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingLocationsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingLocationsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingLocationsUpdateRequestBuilder request(@Nonnull AccountingLocationsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingLocationsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingLocationsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingLocationsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateResponse.java index 87776d83..2e71d10e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingLocationsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingLocationsUpdateResponse implements Response { /** * Location */ - private Optional updateAccountingLocationResponse; + private UpdateAccountingLocationResponse updateAccountingLocationResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingLocationsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateAccountingLocationResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateAccountingLocationResponse, "updateAccountingLocationResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateAccountingLocationResponse updateAccountingLocationResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateAccountingLocationResponse = updateAccountingLocationResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingLocationsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Location */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateAccountingLocationResponse() { - return (Optional) updateAccountingLocationResponse; + return Optional.ofNullable(this.updateAccountingLocationResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingLocationsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingLocationsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingLocationsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingLocationsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Location + * Raw HTTP response; suitable for custom response parsing */ - public AccountingLocationsUpdateResponse withUpdateAccountingLocationResponse(UpdateAccountingLocationResponse updateAccountingLocationResponse) { - Utils.checkNotNull(updateAccountingLocationResponse, "updateAccountingLocationResponse"); - this.updateAccountingLocationResponse = Optional.ofNullable(updateAccountingLocationResponse); + public AccountingLocationsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingLocationsUpdateResponse withUpdateAccountingLocationResponse(Up /** * Location */ - public AccountingLocationsUpdateResponse withUpdateAccountingLocationResponse(Optional updateAccountingLocationResponse) { - Utils.checkNotNull(updateAccountingLocationResponse, "updateAccountingLocationResponse"); + public AccountingLocationsUpdateResponse withUpdateAccountingLocationResponse(@Nullable UpdateAccountingLocationResponse updateAccountingLocationResponse) { this.updateAccountingLocationResponse = updateAccountingLocationResponse; return this; } - /** - * Unexpected error - */ - public AccountingLocationsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingLocationsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingLocationsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateAccountingLocationResponse = Optional.empty(); + private UpdateAccountingLocationResponse updateAccountingLocationResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Location - */ - public Builder updateAccountingLocationResponse(UpdateAccountingLocationResponse updateAccountingLocationResponse) { - Utils.checkNotNull(updateAccountingLocationResponse, "updateAccountingLocationResponse"); - this.updateAccountingLocationResponse = Optional.ofNullable(updateAccountingLocationResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Location */ - public Builder updateAccountingLocationResponse(Optional updateAccountingLocationResponse) { - Utils.checkNotNull(updateAccountingLocationResponse, "updateAccountingLocationResponse"); + public Builder updateAccountingLocationResponse(@Nullable UpdateAccountingLocationResponse updateAccountingLocationResponse) { this.updateAccountingLocationResponse = updateAccountingLocationResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingLocationsUpdateResponse build() { - return new AccountingLocationsUpdateResponse( contentType, statusCode, rawResponse, updateAccountingLocationResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddRequest.java index c9529b46..c0da4a14 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingPaymentsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingPaymentsAddRequest { @JsonCreator public AccountingPaymentsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - PaymentInput payment) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(payment, "payment"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull PaymentInput payment) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.payment = payment; + this.payment = Optional.ofNullable(payment) + .orElseThrow(() -> new IllegalArgumentException("payment cannot be null")); } public AccountingPaymentsAddRequest( - PaymentInput payment) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), payment); + @Nonnull PaymentInput payment) { + this(null, null, null, + null, payment); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public PaymentInput payment() { - return payment; + return this.payment; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingPaymentsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingPaymentsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingPaymentsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingPaymentsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingPaymentsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingPaymentsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingPaymentsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingPaymentsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingPaymentsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingPaymentsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingPaymentsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingPaymentsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingPaymentsAddRequest withPayment(PaymentInput payment) { - Utils.checkNotNull(payment, "payment"); - this.payment = payment; + + public AccountingPaymentsAddRequest withPayment(@Nonnull PaymentInput payment) { + this.payment = Utils.checkNotNull(payment, "payment"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private PaymentInput payment; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder payment(PaymentInput payment) { - Utils.checkNotNull(payment, "payment"); - this.payment = payment; + public Builder payment(@Nonnull PaymentInput payment) { + this.payment = Utils.checkNotNull(payment, "payment"); return this; } public AccountingPaymentsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingPaymentsAddRequest( raw, consumerId, appId, serviceId, payment); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddRequestBuilder.java index a9da1ccf..42cc5175 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingPaymentsAddRequestBuilder { - - private AccountingPaymentsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingPaymentsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingPaymentsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingPaymentsAddRequestBuilder request(AccountingPaymentsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingPaymentsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingPaymentsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingPaymentsAddRequestBuilder request(@Nonnull AccountingPaymentsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingPaymentsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingPaymentsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingPaymentsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddResponse.java index b3d1e44e..386caeff 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingPaymentsAddResponse implements Response { /** * Payment created */ - private Optional createPaymentResponse; + private CreatePaymentResponse createPaymentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingPaymentsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createPaymentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createPaymentResponse, "createPaymentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreatePaymentResponse createPaymentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createPaymentResponse = createPaymentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingPaymentsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Payment created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createPaymentResponse() { - return (Optional) createPaymentResponse; + return Optional.ofNullable(this.createPaymentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingPaymentsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingPaymentsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingPaymentsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingPaymentsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Payment created + * Raw HTTP response; suitable for custom response parsing */ - public AccountingPaymentsAddResponse withCreatePaymentResponse(CreatePaymentResponse createPaymentResponse) { - Utils.checkNotNull(createPaymentResponse, "createPaymentResponse"); - this.createPaymentResponse = Optional.ofNullable(createPaymentResponse); + public AccountingPaymentsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingPaymentsAddResponse withCreatePaymentResponse(CreatePaymentResp /** * Payment created */ - public AccountingPaymentsAddResponse withCreatePaymentResponse(Optional createPaymentResponse) { - Utils.checkNotNull(createPaymentResponse, "createPaymentResponse"); + public AccountingPaymentsAddResponse withCreatePaymentResponse(@Nullable CreatePaymentResponse createPaymentResponse) { this.createPaymentResponse = createPaymentResponse; return this; } - /** - * Unexpected error - */ - public AccountingPaymentsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingPaymentsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingPaymentsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createPaymentResponse = Optional.empty(); + private CreatePaymentResponse createPaymentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Payment created - */ - public Builder createPaymentResponse(CreatePaymentResponse createPaymentResponse) { - Utils.checkNotNull(createPaymentResponse, "createPaymentResponse"); - this.createPaymentResponse = Optional.ofNullable(createPaymentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Payment created */ - public Builder createPaymentResponse(Optional createPaymentResponse) { - Utils.checkNotNull(createPaymentResponse, "createPaymentResponse"); + public Builder createPaymentResponse(@Nullable CreatePaymentResponse createPaymentResponse) { this.createPaymentResponse = createPaymentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingPaymentsAddResponse build() { - return new AccountingPaymentsAddResponse( contentType, statusCode, rawResponse, createPaymentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllRequest.java index 77ce4dd6..e3873942 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingPaymentsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class AccountingPaymentsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private PaymentsFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private PaymentsSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class AccountingPaymentsAllRequest { @JsonCreator public AccountingPaymentsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable PaymentsFilter filter, + @Nullable PaymentsSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingPaymentsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingPaymentsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingPaymentsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingPaymentsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingPaymentsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingPaymentsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingPaymentsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingPaymentsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingPaymentsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingPaymentsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingPaymentsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingPaymentsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingPaymentsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingPaymentsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingPaymentsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingPaymentsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingPaymentsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public AccountingPaymentsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingPaymentsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingPaymentsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingPaymentsAllRequest withFilter(PaymentsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingPaymentsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingPaymentsAllRequest withFilter(@Nullable PaymentsFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingPaymentsAllRequest withSort(PaymentsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingPaymentsAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingPaymentsAllRequest withSort(@Nullable PaymentsSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingPaymentsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingPaymentsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingPaymentsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingPaymentsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingPaymentsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingPaymentsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private PaymentsFilter filter; - private Optional sort = Optional.empty(); + private PaymentsSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(PaymentsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable PaymentsFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(PaymentsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable PaymentsSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingPaymentsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingPaymentsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public AccountingPaymentsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllRequestBuilder.java index 1a687374..15c046fb 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingPaymentsAllRequestBuilder { - - private AccountingPaymentsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingPaymentsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingPaymentsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingPaymentsAllRequestBuilder request(AccountingPaymentsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingPaymentsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingPaymentsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingPaymentsAllRequestBuilder request(@Nonnull AccountingPaymentsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingPaymentsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingPaymentsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingPaymentsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingPaymentsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingPaymentsAllOperation( - sdkConfiguration, - options); + AccountingPaymentsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingPaymentsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingPaymentsAllRequest::withCursor, + AccountingPaymentsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllResponse.java index 92c212e5..947cbdaa 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingPaymentsAllResponse implements Response { /** * Payments */ - private Optional getPaymentsResponse; + private GetPaymentsResponse getPaymentsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingPaymentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getPaymentsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getPaymentsResponse, "getPaymentsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetPaymentsResponse getPaymentsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getPaymentsResponse = getPaymentsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingPaymentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Payments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getPaymentsResponse() { - return (Optional) getPaymentsResponse; + return Optional.ofNullable(this.getPaymentsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingPaymentsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingPaymentsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingPaymentsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingPaymentsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Payments + * Raw HTTP response; suitable for custom response parsing */ - public AccountingPaymentsAllResponse withGetPaymentsResponse(GetPaymentsResponse getPaymentsResponse) { - Utils.checkNotNull(getPaymentsResponse, "getPaymentsResponse"); - this.getPaymentsResponse = Optional.ofNullable(getPaymentsResponse); + public AccountingPaymentsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingPaymentsAllResponse withGetPaymentsResponse(GetPaymentsResponse /** * Payments */ - public AccountingPaymentsAllResponse withGetPaymentsResponse(Optional getPaymentsResponse) { - Utils.checkNotNull(getPaymentsResponse, "getPaymentsResponse"); + public AccountingPaymentsAllResponse withGetPaymentsResponse(@Nullable GetPaymentsResponse getPaymentsResponse) { this.getPaymentsResponse = getPaymentsResponse; return this; } - /** - * Unexpected error - */ - public AccountingPaymentsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingPaymentsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingPaymentsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getPaymentsResponse = Optional.empty(); + private GetPaymentsResponse getPaymentsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Payments - */ - public Builder getPaymentsResponse(GetPaymentsResponse getPaymentsResponse) { - Utils.checkNotNull(getPaymentsResponse, "getPaymentsResponse"); - this.getPaymentsResponse = Optional.ofNullable(getPaymentsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Payments */ - public Builder getPaymentsResponse(Optional getPaymentsResponse) { - Utils.checkNotNull(getPaymentsResponse, "getPaymentsResponse"); + public Builder getPaymentsResponse(@Nullable GetPaymentsResponse getPaymentsResponse) { this.getPaymentsResponse = getPaymentsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingPaymentsAllResponse build() { - return new AccountingPaymentsAllResponse( contentType, statusCode, rawResponse, getPaymentsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteRequest.java index 98d0c0eb..5dac27a8 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingPaymentsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingPaymentsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingPaymentsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingPaymentsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingPaymentsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingPaymentsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingPaymentsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingPaymentsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingPaymentsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingPaymentsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingPaymentsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingPaymentsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingPaymentsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingPaymentsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingPaymentsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingPaymentsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingPaymentsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingPaymentsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingPaymentsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingPaymentsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteRequestBuilder.java index 92daa9b9..cceb5989 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingPaymentsDeleteRequestBuilder { - - private AccountingPaymentsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingPaymentsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingPaymentsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingPaymentsDeleteRequestBuilder request(AccountingPaymentsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingPaymentsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingPaymentsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingPaymentsDeleteRequestBuilder request(@Nonnull AccountingPaymentsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingPaymentsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingPaymentsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingPaymentsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteResponse.java index c13a3a38..5b8e3280 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingPaymentsDeleteResponse implements Response { /** * Payment deleted */ - private Optional deletePaymentResponse; + private DeletePaymentResponse deletePaymentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingPaymentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deletePaymentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deletePaymentResponse, "deletePaymentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeletePaymentResponse deletePaymentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deletePaymentResponse = deletePaymentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingPaymentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Payment deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deletePaymentResponse() { - return (Optional) deletePaymentResponse; + return Optional.ofNullable(this.deletePaymentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingPaymentsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingPaymentsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingPaymentsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingPaymentsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Payment deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingPaymentsDeleteResponse withDeletePaymentResponse(DeletePaymentResponse deletePaymentResponse) { - Utils.checkNotNull(deletePaymentResponse, "deletePaymentResponse"); - this.deletePaymentResponse = Optional.ofNullable(deletePaymentResponse); + public AccountingPaymentsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingPaymentsDeleteResponse withDeletePaymentResponse(DeletePaymentR /** * Payment deleted */ - public AccountingPaymentsDeleteResponse withDeletePaymentResponse(Optional deletePaymentResponse) { - Utils.checkNotNull(deletePaymentResponse, "deletePaymentResponse"); + public AccountingPaymentsDeleteResponse withDeletePaymentResponse(@Nullable DeletePaymentResponse deletePaymentResponse) { this.deletePaymentResponse = deletePaymentResponse; return this; } - /** - * Unexpected error - */ - public AccountingPaymentsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingPaymentsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingPaymentsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deletePaymentResponse = Optional.empty(); + private DeletePaymentResponse deletePaymentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Payment deleted - */ - public Builder deletePaymentResponse(DeletePaymentResponse deletePaymentResponse) { - Utils.checkNotNull(deletePaymentResponse, "deletePaymentResponse"); - this.deletePaymentResponse = Optional.ofNullable(deletePaymentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Payment deleted */ - public Builder deletePaymentResponse(Optional deletePaymentResponse) { - Utils.checkNotNull(deletePaymentResponse, "deletePaymentResponse"); + public Builder deletePaymentResponse(@Nullable DeletePaymentResponse deletePaymentResponse) { this.deletePaymentResponse = deletePaymentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingPaymentsDeleteResponse build() { - return new AccountingPaymentsDeleteResponse( contentType, statusCode, rawResponse, deletePaymentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneRequest.java index eb570bdc..90a01304 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingPaymentsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingPaymentsOneRequest { @JsonCreator public AccountingPaymentsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingPaymentsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingPaymentsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingPaymentsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingPaymentsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingPaymentsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingPaymentsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingPaymentsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingPaymentsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingPaymentsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingPaymentsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingPaymentsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingPaymentsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingPaymentsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingPaymentsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingPaymentsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingPaymentsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingPaymentsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingPaymentsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingPaymentsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingPaymentsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingPaymentsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneRequestBuilder.java index 8febf767..7179b42c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingPaymentsOneRequestBuilder { - - private AccountingPaymentsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingPaymentsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingPaymentsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingPaymentsOneRequestBuilder request(AccountingPaymentsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingPaymentsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingPaymentsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingPaymentsOneRequestBuilder request(@Nonnull AccountingPaymentsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingPaymentsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingPaymentsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingPaymentsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneResponse.java index f7c4ca69..6d8e35c2 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingPaymentsOneResponse implements Response { /** * Payment */ - private Optional getPaymentResponse; + private GetPaymentResponse getPaymentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingPaymentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getPaymentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getPaymentResponse, "getPaymentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetPaymentResponse getPaymentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getPaymentResponse = getPaymentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingPaymentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Payment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getPaymentResponse() { - return (Optional) getPaymentResponse; + return Optional.ofNullable(this.getPaymentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingPaymentsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingPaymentsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingPaymentsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingPaymentsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Payment + * Raw HTTP response; suitable for custom response parsing */ - public AccountingPaymentsOneResponse withGetPaymentResponse(GetPaymentResponse getPaymentResponse) { - Utils.checkNotNull(getPaymentResponse, "getPaymentResponse"); - this.getPaymentResponse = Optional.ofNullable(getPaymentResponse); + public AccountingPaymentsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingPaymentsOneResponse withGetPaymentResponse(GetPaymentResponse g /** * Payment */ - public AccountingPaymentsOneResponse withGetPaymentResponse(Optional getPaymentResponse) { - Utils.checkNotNull(getPaymentResponse, "getPaymentResponse"); + public AccountingPaymentsOneResponse withGetPaymentResponse(@Nullable GetPaymentResponse getPaymentResponse) { this.getPaymentResponse = getPaymentResponse; return this; } - /** - * Unexpected error - */ - public AccountingPaymentsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingPaymentsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingPaymentsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getPaymentResponse = Optional.empty(); + private GetPaymentResponse getPaymentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Payment - */ - public Builder getPaymentResponse(GetPaymentResponse getPaymentResponse) { - Utils.checkNotNull(getPaymentResponse, "getPaymentResponse"); - this.getPaymentResponse = Optional.ofNullable(getPaymentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Payment */ - public Builder getPaymentResponse(Optional getPaymentResponse) { - Utils.checkNotNull(getPaymentResponse, "getPaymentResponse"); + public Builder getPaymentResponse(@Nullable GetPaymentResponse getPaymentResponse) { this.getPaymentResponse = getPaymentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingPaymentsOneResponse build() { - return new AccountingPaymentsOneResponse( contentType, statusCode, rawResponse, getPaymentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateRequest.java index 6abc4ec8..197e7cd7 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingPaymentsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingPaymentsUpdateRequest { @JsonCreator public AccountingPaymentsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - PaymentInput payment) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(payment, "payment"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull PaymentInput payment) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.payment = payment; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.payment = Optional.ofNullable(payment) + .orElseThrow(() -> new IllegalArgumentException("payment cannot be null")); } public AccountingPaymentsUpdateRequest( - String id, - PaymentInput payment) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), payment); + @Nonnull String id, + @Nonnull PaymentInput payment) { + this(id, null, null, + null, null, payment); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public PaymentInput payment() { - return payment; + return this.payment; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingPaymentsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingPaymentsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingPaymentsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingPaymentsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingPaymentsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingPaymentsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingPaymentsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingPaymentsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingPaymentsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingPaymentsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingPaymentsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingPaymentsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingPaymentsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingPaymentsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingPaymentsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingPaymentsUpdateRequest withPayment(PaymentInput payment) { - Utils.checkNotNull(payment, "payment"); - this.payment = payment; + + public AccountingPaymentsUpdateRequest withPayment(@Nonnull PaymentInput payment) { + this.payment = Utils.checkNotNull(payment, "payment"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private PaymentInput payment; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder payment(PaymentInput payment) { - Utils.checkNotNull(payment, "payment"); - this.payment = payment; + public Builder payment(@Nonnull PaymentInput payment) { + this.payment = Utils.checkNotNull(payment, "payment"); return this; } public AccountingPaymentsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingPaymentsUpdateRequest( id, consumerId, appId, serviceId, raw, payment); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateRequestBuilder.java index 129e141e..08d36012 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingPaymentsUpdateRequestBuilder { - - private AccountingPaymentsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingPaymentsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingPaymentsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingPaymentsUpdateRequestBuilder request(AccountingPaymentsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingPaymentsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingPaymentsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingPaymentsUpdateRequestBuilder request(@Nonnull AccountingPaymentsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingPaymentsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingPaymentsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingPaymentsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateResponse.java index 0c6286ff..44df3dcb 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPaymentsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingPaymentsUpdateResponse implements Response { /** * Payment Updated */ - private Optional updatePaymentResponse; + private UpdatePaymentResponse updatePaymentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingPaymentsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updatePaymentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updatePaymentResponse, "updatePaymentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdatePaymentResponse updatePaymentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updatePaymentResponse = updatePaymentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingPaymentsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Payment Updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updatePaymentResponse() { - return (Optional) updatePaymentResponse; + return Optional.ofNullable(this.updatePaymentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingPaymentsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingPaymentsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingPaymentsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingPaymentsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Payment Updated + * Raw HTTP response; suitable for custom response parsing */ - public AccountingPaymentsUpdateResponse withUpdatePaymentResponse(UpdatePaymentResponse updatePaymentResponse) { - Utils.checkNotNull(updatePaymentResponse, "updatePaymentResponse"); - this.updatePaymentResponse = Optional.ofNullable(updatePaymentResponse); + public AccountingPaymentsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingPaymentsUpdateResponse withUpdatePaymentResponse(UpdatePaymentR /** * Payment Updated */ - public AccountingPaymentsUpdateResponse withUpdatePaymentResponse(Optional updatePaymentResponse) { - Utils.checkNotNull(updatePaymentResponse, "updatePaymentResponse"); + public AccountingPaymentsUpdateResponse withUpdatePaymentResponse(@Nullable UpdatePaymentResponse updatePaymentResponse) { this.updatePaymentResponse = updatePaymentResponse; return this; } - /** - * Unexpected error - */ - public AccountingPaymentsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingPaymentsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingPaymentsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updatePaymentResponse = Optional.empty(); + private UpdatePaymentResponse updatePaymentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Payment Updated - */ - public Builder updatePaymentResponse(UpdatePaymentResponse updatePaymentResponse) { - Utils.checkNotNull(updatePaymentResponse, "updatePaymentResponse"); - this.updatePaymentResponse = Optional.ofNullable(updatePaymentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Payment Updated */ - public Builder updatePaymentResponse(Optional updatePaymentResponse) { - Utils.checkNotNull(updatePaymentResponse, "updatePaymentResponse"); + public Builder updatePaymentResponse(@Nullable UpdatePaymentResponse updatePaymentResponse) { this.updatePaymentResponse = updatePaymentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingPaymentsUpdateResponse build() { - return new AccountingPaymentsUpdateResponse( contentType, statusCode, rawResponse, updatePaymentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneRequest.java index 05c8efbf..6d704551 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneRequest.java @@ -8,13 +8,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,37 +24,37 @@ public class AccountingProfitAndLossOneRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private ProfitAndLossFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -65,91 +64,77 @@ public class AccountingProfitAndLossOneRequest { @JsonCreator public AccountingProfitAndLossOneRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable ProfitAndLossFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingProfitAndLossOneRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -160,134 +145,65 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingProfitAndLossOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingProfitAndLossOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingProfitAndLossOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingProfitAndLossOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingProfitAndLossOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingProfitAndLossOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingProfitAndLossOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingProfitAndLossOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingProfitAndLossOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingProfitAndLossOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingProfitAndLossOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingProfitAndLossOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Apply filters - */ - public AccountingProfitAndLossOneRequest withFilter(ProfitAndLossFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingProfitAndLossOneRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingProfitAndLossOneRequest withFilter(@Nullable ProfitAndLossFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingProfitAndLossOneRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingProfitAndLossOneRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingProfitAndLossOneRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingProfitAndLossOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingProfitAndLossOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingProfitAndLossOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -331,162 +247,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional filter = Optional.empty(); + private ProfitAndLossFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Apply filters - */ - public Builder filter(ProfitAndLossFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable ProfitAndLossFilter filter) { this.filter = filter; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingProfitAndLossOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingProfitAndLossOneRequest( raw, consumerId, appId, serviceId, filter, passThrough, @@ -494,10 +329,10 @@ public AccountingProfitAndLossOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneRequestBuilder.java index c0f0c5fb..b53f9314 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingProfitAndLossOneRequestBuilder { - - private AccountingProfitAndLossOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingProfitAndLossOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingProfitAndLossOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingProfitAndLossOneRequestBuilder request(AccountingProfitAndLossOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingProfitAndLossOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingProfitAndLossOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingProfitAndLossOneRequestBuilder request(@Nonnull AccountingProfitAndLossOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingProfitAndLossOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingProfitAndLossOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingProfitAndLossOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneResponse.java index 06ae8499..637aa762 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingProfitAndLossOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingProfitAndLossOneResponse implements Response { /** * Profit & Loss Report */ - private Optional getProfitAndLossResponse; + private GetProfitAndLossResponse getProfitAndLossResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingProfitAndLossOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getProfitAndLossResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getProfitAndLossResponse, "getProfitAndLossResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetProfitAndLossResponse getProfitAndLossResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getProfitAndLossResponse = getProfitAndLossResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingProfitAndLossOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Profit & Loss Report */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getProfitAndLossResponse() { - return (Optional) getProfitAndLossResponse; + return Optional.ofNullable(this.getProfitAndLossResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingProfitAndLossOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingProfitAndLossOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingProfitAndLossOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingProfitAndLossOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Profit & Loss Report + * Raw HTTP response; suitable for custom response parsing */ - public AccountingProfitAndLossOneResponse withGetProfitAndLossResponse(GetProfitAndLossResponse getProfitAndLossResponse) { - Utils.checkNotNull(getProfitAndLossResponse, "getProfitAndLossResponse"); - this.getProfitAndLossResponse = Optional.ofNullable(getProfitAndLossResponse); + public AccountingProfitAndLossOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingProfitAndLossOneResponse withGetProfitAndLossResponse(GetProfit /** * Profit & Loss Report */ - public AccountingProfitAndLossOneResponse withGetProfitAndLossResponse(Optional getProfitAndLossResponse) { - Utils.checkNotNull(getProfitAndLossResponse, "getProfitAndLossResponse"); + public AccountingProfitAndLossOneResponse withGetProfitAndLossResponse(@Nullable GetProfitAndLossResponse getProfitAndLossResponse) { this.getProfitAndLossResponse = getProfitAndLossResponse; return this; } - /** - * Unexpected error - */ - public AccountingProfitAndLossOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingProfitAndLossOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingProfitAndLossOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getProfitAndLossResponse = Optional.empty(); + private GetProfitAndLossResponse getProfitAndLossResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Profit & Loss Report - */ - public Builder getProfitAndLossResponse(GetProfitAndLossResponse getProfitAndLossResponse) { - Utils.checkNotNull(getProfitAndLossResponse, "getProfitAndLossResponse"); - this.getProfitAndLossResponse = Optional.ofNullable(getProfitAndLossResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Profit & Loss Report */ - public Builder getProfitAndLossResponse(Optional getProfitAndLossResponse) { - Utils.checkNotNull(getProfitAndLossResponse, "getProfitAndLossResponse"); + public Builder getProfitAndLossResponse(@Nullable GetProfitAndLossResponse getProfitAndLossResponse) { this.getProfitAndLossResponse = getProfitAndLossResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingProfitAndLossOneResponse build() { - return new AccountingProfitAndLossOneResponse( contentType, statusCode, rawResponse, getProfitAndLossResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddRequest.java index b8b7b1a6..32a617b5 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingPurchaseOrdersAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingPurchaseOrdersAddRequest { @JsonCreator public AccountingPurchaseOrdersAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - PurchaseOrderInput purchaseOrder) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(purchaseOrder, "purchaseOrder"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull PurchaseOrderInput purchaseOrder) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.purchaseOrder = purchaseOrder; + this.purchaseOrder = Optional.ofNullable(purchaseOrder) + .orElseThrow(() -> new IllegalArgumentException("purchaseOrder cannot be null")); } public AccountingPurchaseOrdersAddRequest( - PurchaseOrderInput purchaseOrder) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), purchaseOrder); + @Nonnull PurchaseOrderInput purchaseOrder) { + this(null, null, null, + null, purchaseOrder); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public PurchaseOrderInput purchaseOrder() { - return purchaseOrder; + return this.purchaseOrder; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingPurchaseOrdersAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingPurchaseOrdersAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingPurchaseOrdersAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingPurchaseOrdersAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingPurchaseOrdersAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingPurchaseOrdersAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingPurchaseOrdersAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingPurchaseOrdersAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingPurchaseOrdersAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingPurchaseOrdersAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingPurchaseOrdersAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingPurchaseOrdersAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingPurchaseOrdersAddRequest withPurchaseOrder(PurchaseOrderInput purchaseOrder) { - Utils.checkNotNull(purchaseOrder, "purchaseOrder"); - this.purchaseOrder = purchaseOrder; + + public AccountingPurchaseOrdersAddRequest withPurchaseOrder(@Nonnull PurchaseOrderInput purchaseOrder) { + this.purchaseOrder = Utils.checkNotNull(purchaseOrder, "purchaseOrder"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private PurchaseOrderInput purchaseOrder; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder purchaseOrder(PurchaseOrderInput purchaseOrder) { - Utils.checkNotNull(purchaseOrder, "purchaseOrder"); - this.purchaseOrder = purchaseOrder; + public Builder purchaseOrder(@Nonnull PurchaseOrderInput purchaseOrder) { + this.purchaseOrder = Utils.checkNotNull(purchaseOrder, "purchaseOrder"); return this; } public AccountingPurchaseOrdersAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingPurchaseOrdersAddRequest( raw, consumerId, appId, serviceId, purchaseOrder); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddRequestBuilder.java index 159020f1..a8e3d3a2 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingPurchaseOrdersAddRequestBuilder { - - private AccountingPurchaseOrdersAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingPurchaseOrdersAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingPurchaseOrdersAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingPurchaseOrdersAddRequestBuilder request(AccountingPurchaseOrdersAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingPurchaseOrdersAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingPurchaseOrdersAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingPurchaseOrdersAddRequestBuilder request(@Nonnull AccountingPurchaseOrdersAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingPurchaseOrdersAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingPurchaseOrdersAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingPurchaseOrdersAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddResponse.java index 259ab99e..b203876f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingPurchaseOrdersAddResponse implements Response { /** * PurchaseOrders */ - private Optional createPurchaseOrderResponse; + private CreatePurchaseOrderResponse createPurchaseOrderResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingPurchaseOrdersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createPurchaseOrderResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createPurchaseOrderResponse, "createPurchaseOrderResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreatePurchaseOrderResponse createPurchaseOrderResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createPurchaseOrderResponse = createPurchaseOrderResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingPurchaseOrdersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * PurchaseOrders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createPurchaseOrderResponse() { - return (Optional) createPurchaseOrderResponse; + return Optional.ofNullable(this.createPurchaseOrderResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingPurchaseOrdersAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingPurchaseOrdersAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingPurchaseOrdersAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingPurchaseOrdersAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * PurchaseOrders + * Raw HTTP response; suitable for custom response parsing */ - public AccountingPurchaseOrdersAddResponse withCreatePurchaseOrderResponse(CreatePurchaseOrderResponse createPurchaseOrderResponse) { - Utils.checkNotNull(createPurchaseOrderResponse, "createPurchaseOrderResponse"); - this.createPurchaseOrderResponse = Optional.ofNullable(createPurchaseOrderResponse); + public AccountingPurchaseOrdersAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingPurchaseOrdersAddResponse withCreatePurchaseOrderResponse(Creat /** * PurchaseOrders */ - public AccountingPurchaseOrdersAddResponse withCreatePurchaseOrderResponse(Optional createPurchaseOrderResponse) { - Utils.checkNotNull(createPurchaseOrderResponse, "createPurchaseOrderResponse"); + public AccountingPurchaseOrdersAddResponse withCreatePurchaseOrderResponse(@Nullable CreatePurchaseOrderResponse createPurchaseOrderResponse) { this.createPurchaseOrderResponse = createPurchaseOrderResponse; return this; } - /** - * Unexpected error - */ - public AccountingPurchaseOrdersAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingPurchaseOrdersAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingPurchaseOrdersAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createPurchaseOrderResponse = Optional.empty(); + private CreatePurchaseOrderResponse createPurchaseOrderResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * PurchaseOrders - */ - public Builder createPurchaseOrderResponse(CreatePurchaseOrderResponse createPurchaseOrderResponse) { - Utils.checkNotNull(createPurchaseOrderResponse, "createPurchaseOrderResponse"); - this.createPurchaseOrderResponse = Optional.ofNullable(createPurchaseOrderResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * PurchaseOrders */ - public Builder createPurchaseOrderResponse(Optional createPurchaseOrderResponse) { - Utils.checkNotNull(createPurchaseOrderResponse, "createPurchaseOrderResponse"); + public Builder createPurchaseOrderResponse(@Nullable CreatePurchaseOrderResponse createPurchaseOrderResponse) { this.createPurchaseOrderResponse = createPurchaseOrderResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingPurchaseOrdersAddResponse build() { - return new AccountingPurchaseOrdersAddResponse( contentType, statusCode, rawResponse, createPurchaseOrderResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllRequest.java index ce9a6eca..08b58f40 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingPurchaseOrdersAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,136 +56,118 @@ public class AccountingPurchaseOrdersAllRequest { * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private PurchaseOrdersFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private PurchaseOrdersSort sort; @JsonCreator public AccountingPurchaseOrdersAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional> passThrough, - Optional limit, - Optional filter, - Optional sort) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Map passThrough, + @Nullable Long limit, + @Nullable PurchaseOrdersFilter filter, + @Nullable PurchaseOrdersSort sort) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; - this.limit = limit; + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; } public AccountingPurchaseOrdersAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null, + null, null, null, + null, null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } public static Builder builder() { @@ -197,103 +178,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingPurchaseOrdersAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingPurchaseOrdersAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingPurchaseOrdersAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingPurchaseOrdersAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingPurchaseOrdersAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingPurchaseOrdersAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingPurchaseOrdersAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingPurchaseOrdersAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingPurchaseOrdersAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingPurchaseOrdersAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingPurchaseOrdersAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingPurchaseOrdersAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingPurchaseOrdersAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingPurchaseOrdersAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingPurchaseOrdersAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public AccountingPurchaseOrdersAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -301,69 +223,39 @@ public AccountingPurchaseOrdersAllRequest withPassThrough(Map pa /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingPurchaseOrdersAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingPurchaseOrdersAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingPurchaseOrdersAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingPurchaseOrdersAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingPurchaseOrdersAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingPurchaseOrdersAllRequest withFilter(PurchaseOrdersFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingPurchaseOrdersAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingPurchaseOrdersAllRequest withFilter(@Nullable PurchaseOrdersFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingPurchaseOrdersAllRequest withSort(PurchaseOrdersSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingPurchaseOrdersAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingPurchaseOrdersAllRequest withSort(@Nullable PurchaseOrdersSort sort) { this.sort = sort; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -410,207 +302,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private PurchaseOrdersFilter filter; - private Optional sort = Optional.empty(); + private PurchaseOrdersSort sort; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - - /** - * Apply filters - */ - public Builder filter(PurchaseOrdersFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable PurchaseOrdersFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(PurchaseOrdersSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable PurchaseOrdersSort sort) { this.sort = sort; return this; } public AccountingPurchaseOrdersAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingPurchaseOrdersAllRequest( raw, consumerId, appId, serviceId, cursor, passThrough, @@ -618,16 +404,16 @@ public AccountingPurchaseOrdersAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllRequestBuilder.java index 089500d4..b1ccfeac 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingPurchaseOrdersAllRequestBuilder { - - private AccountingPurchaseOrdersAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingPurchaseOrdersAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingPurchaseOrdersAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingPurchaseOrdersAllRequestBuilder request(AccountingPurchaseOrdersAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingPurchaseOrdersAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingPurchaseOrdersAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingPurchaseOrdersAllRequestBuilder request(@Nonnull AccountingPurchaseOrdersAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingPurchaseOrdersAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingPurchaseOrdersAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingPurchaseOrdersAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingPurchaseOrdersAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingPurchaseOrdersAllOperation( - sdkConfiguration, - options); + AccountingPurchaseOrdersAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingPurchaseOrdersAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingPurchaseOrdersAllRequest::withCursor, + AccountingPurchaseOrdersAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllResponse.java index 84b6f7ae..473e7a94 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingPurchaseOrdersAllResponse implements Response { /** * PurchaseOrders */ - private Optional getPurchaseOrdersResponse; + private GetPurchaseOrdersResponse getPurchaseOrdersResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingPurchaseOrdersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getPurchaseOrdersResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getPurchaseOrdersResponse, "getPurchaseOrdersResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetPurchaseOrdersResponse getPurchaseOrdersResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getPurchaseOrdersResponse = getPurchaseOrdersResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingPurchaseOrdersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * PurchaseOrders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getPurchaseOrdersResponse() { - return (Optional) getPurchaseOrdersResponse; + return Optional.ofNullable(this.getPurchaseOrdersResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingPurchaseOrdersAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingPurchaseOrdersAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingPurchaseOrdersAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingPurchaseOrdersAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * PurchaseOrders + * Raw HTTP response; suitable for custom response parsing */ - public AccountingPurchaseOrdersAllResponse withGetPurchaseOrdersResponse(GetPurchaseOrdersResponse getPurchaseOrdersResponse) { - Utils.checkNotNull(getPurchaseOrdersResponse, "getPurchaseOrdersResponse"); - this.getPurchaseOrdersResponse = Optional.ofNullable(getPurchaseOrdersResponse); + public AccountingPurchaseOrdersAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingPurchaseOrdersAllResponse withGetPurchaseOrdersResponse(GetPurc /** * PurchaseOrders */ - public AccountingPurchaseOrdersAllResponse withGetPurchaseOrdersResponse(Optional getPurchaseOrdersResponse) { - Utils.checkNotNull(getPurchaseOrdersResponse, "getPurchaseOrdersResponse"); + public AccountingPurchaseOrdersAllResponse withGetPurchaseOrdersResponse(@Nullable GetPurchaseOrdersResponse getPurchaseOrdersResponse) { this.getPurchaseOrdersResponse = getPurchaseOrdersResponse; return this; } - /** - * Unexpected error - */ - public AccountingPurchaseOrdersAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingPurchaseOrdersAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingPurchaseOrdersAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getPurchaseOrdersResponse = Optional.empty(); + private GetPurchaseOrdersResponse getPurchaseOrdersResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * PurchaseOrders - */ - public Builder getPurchaseOrdersResponse(GetPurchaseOrdersResponse getPurchaseOrdersResponse) { - Utils.checkNotNull(getPurchaseOrdersResponse, "getPurchaseOrdersResponse"); - this.getPurchaseOrdersResponse = Optional.ofNullable(getPurchaseOrdersResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * PurchaseOrders */ - public Builder getPurchaseOrdersResponse(Optional getPurchaseOrdersResponse) { - Utils.checkNotNull(getPurchaseOrdersResponse, "getPurchaseOrdersResponse"); + public Builder getPurchaseOrdersResponse(@Nullable GetPurchaseOrdersResponse getPurchaseOrdersResponse) { this.getPurchaseOrdersResponse = getPurchaseOrdersResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingPurchaseOrdersAllResponse build() { - return new AccountingPurchaseOrdersAllResponse( contentType, statusCode, rawResponse, getPurchaseOrdersResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteRequest.java index 79024abe..53d5288c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingPurchaseOrdersDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingPurchaseOrdersDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingPurchaseOrdersDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingPurchaseOrdersDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingPurchaseOrdersDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingPurchaseOrdersDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingPurchaseOrdersDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingPurchaseOrdersDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingPurchaseOrdersDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingPurchaseOrdersDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingPurchaseOrdersDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingPurchaseOrdersDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingPurchaseOrdersDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingPurchaseOrdersDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingPurchaseOrdersDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingPurchaseOrdersDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingPurchaseOrdersDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingPurchaseOrdersDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingPurchaseOrdersDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingPurchaseOrdersDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteRequestBuilder.java index 2e9d8c5d..f34129e2 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingPurchaseOrdersDeleteRequestBuilder { - - private AccountingPurchaseOrdersDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingPurchaseOrdersDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingPurchaseOrdersDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingPurchaseOrdersDeleteRequestBuilder request(AccountingPurchaseOrdersDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingPurchaseOrdersDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingPurchaseOrdersDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingPurchaseOrdersDeleteRequestBuilder request(@Nonnull AccountingPurchaseOrdersDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingPurchaseOrdersDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingPurchaseOrdersDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingPurchaseOrdersDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteResponse.java index dca466e3..63478d49 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingPurchaseOrdersDeleteResponse implements Response { /** * PurchaseOrders */ - private Optional deletePurchaseOrderResponse; + private DeletePurchaseOrderResponse deletePurchaseOrderResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingPurchaseOrdersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deletePurchaseOrderResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deletePurchaseOrderResponse, "deletePurchaseOrderResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeletePurchaseOrderResponse deletePurchaseOrderResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deletePurchaseOrderResponse = deletePurchaseOrderResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingPurchaseOrdersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * PurchaseOrders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deletePurchaseOrderResponse() { - return (Optional) deletePurchaseOrderResponse; + return Optional.ofNullable(this.deletePurchaseOrderResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingPurchaseOrdersDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingPurchaseOrdersDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingPurchaseOrdersDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingPurchaseOrdersDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * PurchaseOrders + * Raw HTTP response; suitable for custom response parsing */ - public AccountingPurchaseOrdersDeleteResponse withDeletePurchaseOrderResponse(DeletePurchaseOrderResponse deletePurchaseOrderResponse) { - Utils.checkNotNull(deletePurchaseOrderResponse, "deletePurchaseOrderResponse"); - this.deletePurchaseOrderResponse = Optional.ofNullable(deletePurchaseOrderResponse); + public AccountingPurchaseOrdersDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingPurchaseOrdersDeleteResponse withDeletePurchaseOrderResponse(De /** * PurchaseOrders */ - public AccountingPurchaseOrdersDeleteResponse withDeletePurchaseOrderResponse(Optional deletePurchaseOrderResponse) { - Utils.checkNotNull(deletePurchaseOrderResponse, "deletePurchaseOrderResponse"); + public AccountingPurchaseOrdersDeleteResponse withDeletePurchaseOrderResponse(@Nullable DeletePurchaseOrderResponse deletePurchaseOrderResponse) { this.deletePurchaseOrderResponse = deletePurchaseOrderResponse; return this; } - /** - * Unexpected error - */ - public AccountingPurchaseOrdersDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingPurchaseOrdersDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingPurchaseOrdersDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deletePurchaseOrderResponse = Optional.empty(); + private DeletePurchaseOrderResponse deletePurchaseOrderResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * PurchaseOrders - */ - public Builder deletePurchaseOrderResponse(DeletePurchaseOrderResponse deletePurchaseOrderResponse) { - Utils.checkNotNull(deletePurchaseOrderResponse, "deletePurchaseOrderResponse"); - this.deletePurchaseOrderResponse = Optional.ofNullable(deletePurchaseOrderResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * PurchaseOrders */ - public Builder deletePurchaseOrderResponse(Optional deletePurchaseOrderResponse) { - Utils.checkNotNull(deletePurchaseOrderResponse, "deletePurchaseOrderResponse"); + public Builder deletePurchaseOrderResponse(@Nullable DeletePurchaseOrderResponse deletePurchaseOrderResponse) { this.deletePurchaseOrderResponse = deletePurchaseOrderResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingPurchaseOrdersDeleteResponse build() { - return new AccountingPurchaseOrdersDeleteResponse( contentType, statusCode, rawResponse, deletePurchaseOrderResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneRequest.java index 81784fc0..c7138ecc 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingPurchaseOrdersOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingPurchaseOrdersOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingPurchaseOrdersOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingPurchaseOrdersOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingPurchaseOrdersOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingPurchaseOrdersOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingPurchaseOrdersOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingPurchaseOrdersOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingPurchaseOrdersOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingPurchaseOrdersOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingPurchaseOrdersOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingPurchaseOrdersOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingPurchaseOrdersOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingPurchaseOrdersOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingPurchaseOrdersOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingPurchaseOrdersOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingPurchaseOrdersOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingPurchaseOrdersOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingPurchaseOrdersOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingPurchaseOrdersOneRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneRequestBuilder.java index 58947e1d..5dff0090 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingPurchaseOrdersOneRequestBuilder { - - private AccountingPurchaseOrdersOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingPurchaseOrdersOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingPurchaseOrdersOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingPurchaseOrdersOneRequestBuilder request(AccountingPurchaseOrdersOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingPurchaseOrdersOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingPurchaseOrdersOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingPurchaseOrdersOneRequestBuilder request(@Nonnull AccountingPurchaseOrdersOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingPurchaseOrdersOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingPurchaseOrdersOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingPurchaseOrdersOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneResponse.java index f54d61dc..68930afb 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingPurchaseOrdersOneResponse implements Response { /** * PurchaseOrders */ - private Optional getPurchaseOrderResponse; + private GetPurchaseOrderResponse getPurchaseOrderResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingPurchaseOrdersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getPurchaseOrderResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getPurchaseOrderResponse, "getPurchaseOrderResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetPurchaseOrderResponse getPurchaseOrderResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getPurchaseOrderResponse = getPurchaseOrderResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingPurchaseOrdersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * PurchaseOrders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getPurchaseOrderResponse() { - return (Optional) getPurchaseOrderResponse; + return Optional.ofNullable(this.getPurchaseOrderResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingPurchaseOrdersOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingPurchaseOrdersOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingPurchaseOrdersOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingPurchaseOrdersOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * PurchaseOrders + * Raw HTTP response; suitable for custom response parsing */ - public AccountingPurchaseOrdersOneResponse withGetPurchaseOrderResponse(GetPurchaseOrderResponse getPurchaseOrderResponse) { - Utils.checkNotNull(getPurchaseOrderResponse, "getPurchaseOrderResponse"); - this.getPurchaseOrderResponse = Optional.ofNullable(getPurchaseOrderResponse); + public AccountingPurchaseOrdersOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingPurchaseOrdersOneResponse withGetPurchaseOrderResponse(GetPurch /** * PurchaseOrders */ - public AccountingPurchaseOrdersOneResponse withGetPurchaseOrderResponse(Optional getPurchaseOrderResponse) { - Utils.checkNotNull(getPurchaseOrderResponse, "getPurchaseOrderResponse"); + public AccountingPurchaseOrdersOneResponse withGetPurchaseOrderResponse(@Nullable GetPurchaseOrderResponse getPurchaseOrderResponse) { this.getPurchaseOrderResponse = getPurchaseOrderResponse; return this; } - /** - * Unexpected error - */ - public AccountingPurchaseOrdersOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingPurchaseOrdersOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingPurchaseOrdersOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getPurchaseOrderResponse = Optional.empty(); + private GetPurchaseOrderResponse getPurchaseOrderResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * PurchaseOrders - */ - public Builder getPurchaseOrderResponse(GetPurchaseOrderResponse getPurchaseOrderResponse) { - Utils.checkNotNull(getPurchaseOrderResponse, "getPurchaseOrderResponse"); - this.getPurchaseOrderResponse = Optional.ofNullable(getPurchaseOrderResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * PurchaseOrders */ - public Builder getPurchaseOrderResponse(Optional getPurchaseOrderResponse) { - Utils.checkNotNull(getPurchaseOrderResponse, "getPurchaseOrderResponse"); + public Builder getPurchaseOrderResponse(@Nullable GetPurchaseOrderResponse getPurchaseOrderResponse) { this.getPurchaseOrderResponse = getPurchaseOrderResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingPurchaseOrdersOneResponse build() { - return new AccountingPurchaseOrdersOneResponse( contentType, statusCode, rawResponse, getPurchaseOrderResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateRequest.java index 71a54a26..1b3ff353 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingPurchaseOrdersUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingPurchaseOrdersUpdateRequest { @JsonCreator public AccountingPurchaseOrdersUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - PurchaseOrderInput purchaseOrder) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(purchaseOrder, "purchaseOrder"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull PurchaseOrderInput purchaseOrder) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.purchaseOrder = purchaseOrder; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.purchaseOrder = Optional.ofNullable(purchaseOrder) + .orElseThrow(() -> new IllegalArgumentException("purchaseOrder cannot be null")); } public AccountingPurchaseOrdersUpdateRequest( - String id, - PurchaseOrderInput purchaseOrder) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), purchaseOrder); + @Nonnull String id, + @Nonnull PurchaseOrderInput purchaseOrder) { + this(id, null, null, + null, null, purchaseOrder); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public PurchaseOrderInput purchaseOrder() { - return purchaseOrder; + return this.purchaseOrder; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingPurchaseOrdersUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingPurchaseOrdersUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingPurchaseOrdersUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingPurchaseOrdersUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingPurchaseOrdersUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingPurchaseOrdersUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingPurchaseOrdersUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingPurchaseOrdersUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingPurchaseOrdersUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingPurchaseOrdersUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingPurchaseOrdersUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingPurchaseOrdersUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingPurchaseOrdersUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingPurchaseOrdersUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingPurchaseOrdersUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingPurchaseOrdersUpdateRequest withPurchaseOrder(PurchaseOrderInput purchaseOrder) { - Utils.checkNotNull(purchaseOrder, "purchaseOrder"); - this.purchaseOrder = purchaseOrder; + + public AccountingPurchaseOrdersUpdateRequest withPurchaseOrder(@Nonnull PurchaseOrderInput purchaseOrder) { + this.purchaseOrder = Utils.checkNotNull(purchaseOrder, "purchaseOrder"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private PurchaseOrderInput purchaseOrder; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder purchaseOrder(PurchaseOrderInput purchaseOrder) { - Utils.checkNotNull(purchaseOrder, "purchaseOrder"); - this.purchaseOrder = purchaseOrder; + public Builder purchaseOrder(@Nonnull PurchaseOrderInput purchaseOrder) { + this.purchaseOrder = Utils.checkNotNull(purchaseOrder, "purchaseOrder"); return this; } public AccountingPurchaseOrdersUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingPurchaseOrdersUpdateRequest( id, consumerId, appId, serviceId, raw, purchaseOrder); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateRequestBuilder.java index 9cf1b236..2997f80a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingPurchaseOrdersUpdateRequestBuilder { - - private AccountingPurchaseOrdersUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingPurchaseOrdersUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingPurchaseOrdersUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingPurchaseOrdersUpdateRequestBuilder request(AccountingPurchaseOrdersUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingPurchaseOrdersUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingPurchaseOrdersUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingPurchaseOrdersUpdateRequestBuilder request(@Nonnull AccountingPurchaseOrdersUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingPurchaseOrdersUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingPurchaseOrdersUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingPurchaseOrdersUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateResponse.java index 95b0b5f5..e3bf3b93 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingPurchaseOrdersUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingPurchaseOrdersUpdateResponse implements Response { /** * PurchaseOrders */ - private Optional updatePurchaseOrderResponse; + private UpdatePurchaseOrderResponse updatePurchaseOrderResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingPurchaseOrdersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updatePurchaseOrderResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updatePurchaseOrderResponse, "updatePurchaseOrderResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdatePurchaseOrderResponse updatePurchaseOrderResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updatePurchaseOrderResponse = updatePurchaseOrderResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingPurchaseOrdersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * PurchaseOrders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updatePurchaseOrderResponse() { - return (Optional) updatePurchaseOrderResponse; + return Optional.ofNullable(this.updatePurchaseOrderResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingPurchaseOrdersUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingPurchaseOrdersUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingPurchaseOrdersUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingPurchaseOrdersUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * PurchaseOrders + * Raw HTTP response; suitable for custom response parsing */ - public AccountingPurchaseOrdersUpdateResponse withUpdatePurchaseOrderResponse(UpdatePurchaseOrderResponse updatePurchaseOrderResponse) { - Utils.checkNotNull(updatePurchaseOrderResponse, "updatePurchaseOrderResponse"); - this.updatePurchaseOrderResponse = Optional.ofNullable(updatePurchaseOrderResponse); + public AccountingPurchaseOrdersUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingPurchaseOrdersUpdateResponse withUpdatePurchaseOrderResponse(Up /** * PurchaseOrders */ - public AccountingPurchaseOrdersUpdateResponse withUpdatePurchaseOrderResponse(Optional updatePurchaseOrderResponse) { - Utils.checkNotNull(updatePurchaseOrderResponse, "updatePurchaseOrderResponse"); + public AccountingPurchaseOrdersUpdateResponse withUpdatePurchaseOrderResponse(@Nullable UpdatePurchaseOrderResponse updatePurchaseOrderResponse) { this.updatePurchaseOrderResponse = updatePurchaseOrderResponse; return this; } - /** - * Unexpected error - */ - public AccountingPurchaseOrdersUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingPurchaseOrdersUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingPurchaseOrdersUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updatePurchaseOrderResponse = Optional.empty(); + private UpdatePurchaseOrderResponse updatePurchaseOrderResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * PurchaseOrders - */ - public Builder updatePurchaseOrderResponse(UpdatePurchaseOrderResponse updatePurchaseOrderResponse) { - Utils.checkNotNull(updatePurchaseOrderResponse, "updatePurchaseOrderResponse"); - this.updatePurchaseOrderResponse = Optional.ofNullable(updatePurchaseOrderResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * PurchaseOrders */ - public Builder updatePurchaseOrderResponse(Optional updatePurchaseOrderResponse) { - Utils.checkNotNull(updatePurchaseOrderResponse, "updatePurchaseOrderResponse"); + public Builder updatePurchaseOrderResponse(@Nullable UpdatePurchaseOrderResponse updatePurchaseOrderResponse) { this.updatePurchaseOrderResponse = updatePurchaseOrderResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingPurchaseOrdersUpdateResponse build() { - return new AccountingPurchaseOrdersUpdateResponse( contentType, statusCode, rawResponse, updatePurchaseOrderResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddRequest.java index a900c744..adc32dab 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingSubsidiariesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingSubsidiariesAddRequest { @JsonCreator public AccountingSubsidiariesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - SubsidiaryInput subsidiary) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(subsidiary, "subsidiary"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull SubsidiaryInput subsidiary) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.subsidiary = subsidiary; + this.subsidiary = Optional.ofNullable(subsidiary) + .orElseThrow(() -> new IllegalArgumentException("subsidiary cannot be null")); } public AccountingSubsidiariesAddRequest( - SubsidiaryInput subsidiary) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), subsidiary); + @Nonnull SubsidiaryInput subsidiary) { + this(null, null, null, + null, subsidiary); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public SubsidiaryInput subsidiary() { - return subsidiary; + return this.subsidiary; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingSubsidiariesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingSubsidiariesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingSubsidiariesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingSubsidiariesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingSubsidiariesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingSubsidiariesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingSubsidiariesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingSubsidiariesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingSubsidiariesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingSubsidiariesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingSubsidiariesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingSubsidiariesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingSubsidiariesAddRequest withSubsidiary(SubsidiaryInput subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); - this.subsidiary = subsidiary; + + public AccountingSubsidiariesAddRequest withSubsidiary(@Nonnull SubsidiaryInput subsidiary) { + this.subsidiary = Utils.checkNotNull(subsidiary, "subsidiary"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private SubsidiaryInput subsidiary; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder subsidiary(SubsidiaryInput subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); - this.subsidiary = subsidiary; + public Builder subsidiary(@Nonnull SubsidiaryInput subsidiary) { + this.subsidiary = Utils.checkNotNull(subsidiary, "subsidiary"); return this; } public AccountingSubsidiariesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingSubsidiariesAddRequest( raw, consumerId, appId, serviceId, subsidiary); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddRequestBuilder.java index 187df71b..6892386f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingSubsidiariesAddRequestBuilder { - - private AccountingSubsidiariesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingSubsidiariesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingSubsidiariesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingSubsidiariesAddRequestBuilder request(AccountingSubsidiariesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingSubsidiariesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingSubsidiariesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingSubsidiariesAddRequestBuilder request(@Nonnull AccountingSubsidiariesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingSubsidiariesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingSubsidiariesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingSubsidiariesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddResponse.java index aea495c3..660d6dc4 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingSubsidiariesAddResponse implements Response { /** * Subsidiaries */ - private Optional createSubsidiaryResponse; + private CreateSubsidiaryResponse createSubsidiaryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingSubsidiariesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createSubsidiaryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createSubsidiaryResponse, "createSubsidiaryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateSubsidiaryResponse createSubsidiaryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createSubsidiaryResponse = createSubsidiaryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingSubsidiariesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Subsidiaries */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createSubsidiaryResponse() { - return (Optional) createSubsidiaryResponse; + return Optional.ofNullable(this.createSubsidiaryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingSubsidiariesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingSubsidiariesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingSubsidiariesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingSubsidiariesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Subsidiaries + * Raw HTTP response; suitable for custom response parsing */ - public AccountingSubsidiariesAddResponse withCreateSubsidiaryResponse(CreateSubsidiaryResponse createSubsidiaryResponse) { - Utils.checkNotNull(createSubsidiaryResponse, "createSubsidiaryResponse"); - this.createSubsidiaryResponse = Optional.ofNullable(createSubsidiaryResponse); + public AccountingSubsidiariesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingSubsidiariesAddResponse withCreateSubsidiaryResponse(CreateSubs /** * Subsidiaries */ - public AccountingSubsidiariesAddResponse withCreateSubsidiaryResponse(Optional createSubsidiaryResponse) { - Utils.checkNotNull(createSubsidiaryResponse, "createSubsidiaryResponse"); + public AccountingSubsidiariesAddResponse withCreateSubsidiaryResponse(@Nullable CreateSubsidiaryResponse createSubsidiaryResponse) { this.createSubsidiaryResponse = createSubsidiaryResponse; return this; } - /** - * Unexpected error - */ - public AccountingSubsidiariesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingSubsidiariesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingSubsidiariesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createSubsidiaryResponse = Optional.empty(); + private CreateSubsidiaryResponse createSubsidiaryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Subsidiaries - */ - public Builder createSubsidiaryResponse(CreateSubsidiaryResponse createSubsidiaryResponse) { - Utils.checkNotNull(createSubsidiaryResponse, "createSubsidiaryResponse"); - this.createSubsidiaryResponse = Optional.ofNullable(createSubsidiaryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Subsidiaries */ - public Builder createSubsidiaryResponse(Optional createSubsidiaryResponse) { - Utils.checkNotNull(createSubsidiaryResponse, "createSubsidiaryResponse"); + public Builder createSubsidiaryResponse(@Nullable CreateSubsidiaryResponse createSubsidiaryResponse) { this.createSubsidiaryResponse = createSubsidiaryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingSubsidiariesAddResponse build() { - return new AccountingSubsidiariesAddResponse( contentType, statusCode, rawResponse, createSubsidiaryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllRequest.java index 80a7e1a6..ef991f59 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllRequest.java @@ -7,8 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; @@ -22,25 +22,25 @@ public class AccountingSubsidiariesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -52,7 +52,7 @@ public class AccountingSubsidiariesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -62,89 +62,79 @@ public class AccountingSubsidiariesAllRequest { @JsonCreator public AccountingSubsidiariesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; - this.fields = fields; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingSubsidiariesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -155,103 +145,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingSubsidiariesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingSubsidiariesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingSubsidiariesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingSubsidiariesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingSubsidiariesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingSubsidiariesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingSubsidiariesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingSubsidiariesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingSubsidiariesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingSubsidiariesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingSubsidiariesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingSubsidiariesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingSubsidiariesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingSubsidiariesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingSubsidiariesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingSubsidiariesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -259,29 +190,20 @@ public AccountingSubsidiariesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingSubsidiariesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingSubsidiariesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingSubsidiariesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingSubsidiariesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingSubsidiariesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -325,165 +247,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingSubsidiariesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingSubsidiariesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -491,16 +329,16 @@ public AccountingSubsidiariesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllRequestBuilder.java index f24bbca2..35a853f0 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingSubsidiariesAllRequestBuilder { - - private AccountingSubsidiariesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingSubsidiariesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingSubsidiariesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingSubsidiariesAllRequestBuilder request(AccountingSubsidiariesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingSubsidiariesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingSubsidiariesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingSubsidiariesAllRequestBuilder request(@Nonnull AccountingSubsidiariesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingSubsidiariesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingSubsidiariesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingSubsidiariesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingSubsidiariesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingSubsidiariesAllOperation( - sdkConfiguration, - options); + AccountingSubsidiariesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingSubsidiariesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingSubsidiariesAllRequest::withCursor, + AccountingSubsidiariesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllResponse.java index eed0c423..2b96b15a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingSubsidiariesAllResponse implements Response { /** * Subsidiaries */ - private Optional getSubsidiariesResponse; + private GetSubsidiariesResponse getSubsidiariesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingSubsidiariesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getSubsidiariesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getSubsidiariesResponse, "getSubsidiariesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetSubsidiariesResponse getSubsidiariesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getSubsidiariesResponse = getSubsidiariesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingSubsidiariesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Subsidiaries */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getSubsidiariesResponse() { - return (Optional) getSubsidiariesResponse; + return Optional.ofNullable(this.getSubsidiariesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingSubsidiariesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingSubsidiariesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingSubsidiariesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingSubsidiariesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Subsidiaries + * Raw HTTP response; suitable for custom response parsing */ - public AccountingSubsidiariesAllResponse withGetSubsidiariesResponse(GetSubsidiariesResponse getSubsidiariesResponse) { - Utils.checkNotNull(getSubsidiariesResponse, "getSubsidiariesResponse"); - this.getSubsidiariesResponse = Optional.ofNullable(getSubsidiariesResponse); + public AccountingSubsidiariesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingSubsidiariesAllResponse withGetSubsidiariesResponse(GetSubsidia /** * Subsidiaries */ - public AccountingSubsidiariesAllResponse withGetSubsidiariesResponse(Optional getSubsidiariesResponse) { - Utils.checkNotNull(getSubsidiariesResponse, "getSubsidiariesResponse"); + public AccountingSubsidiariesAllResponse withGetSubsidiariesResponse(@Nullable GetSubsidiariesResponse getSubsidiariesResponse) { this.getSubsidiariesResponse = getSubsidiariesResponse; return this; } - /** - * Unexpected error - */ - public AccountingSubsidiariesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingSubsidiariesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingSubsidiariesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getSubsidiariesResponse = Optional.empty(); + private GetSubsidiariesResponse getSubsidiariesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Subsidiaries - */ - public Builder getSubsidiariesResponse(GetSubsidiariesResponse getSubsidiariesResponse) { - Utils.checkNotNull(getSubsidiariesResponse, "getSubsidiariesResponse"); - this.getSubsidiariesResponse = Optional.ofNullable(getSubsidiariesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Subsidiaries */ - public Builder getSubsidiariesResponse(Optional getSubsidiariesResponse) { - Utils.checkNotNull(getSubsidiariesResponse, "getSubsidiariesResponse"); + public Builder getSubsidiariesResponse(@Nullable GetSubsidiariesResponse getSubsidiariesResponse) { this.getSubsidiariesResponse = getSubsidiariesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingSubsidiariesAllResponse build() { - return new AccountingSubsidiariesAllResponse( contentType, statusCode, rawResponse, getSubsidiariesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteRequest.java index 1c995960..f0132b50 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingSubsidiariesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingSubsidiariesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingSubsidiariesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingSubsidiariesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingSubsidiariesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingSubsidiariesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingSubsidiariesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingSubsidiariesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingSubsidiariesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingSubsidiariesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingSubsidiariesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingSubsidiariesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingSubsidiariesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingSubsidiariesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingSubsidiariesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingSubsidiariesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingSubsidiariesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingSubsidiariesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingSubsidiariesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingSubsidiariesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteRequestBuilder.java index d7bb3a6d..1bb66e79 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingSubsidiariesDeleteRequestBuilder { - - private AccountingSubsidiariesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingSubsidiariesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingSubsidiariesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingSubsidiariesDeleteRequestBuilder request(AccountingSubsidiariesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingSubsidiariesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingSubsidiariesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingSubsidiariesDeleteRequestBuilder request(@Nonnull AccountingSubsidiariesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingSubsidiariesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingSubsidiariesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingSubsidiariesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteResponse.java index 335d7f2b..e0a0da04 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingSubsidiariesDeleteResponse implements Response { /** * Subsidiarys */ - private Optional deleteSubsidiaryResponse; + private DeleteSubsidiaryResponse deleteSubsidiaryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingSubsidiariesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteSubsidiaryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteSubsidiaryResponse, "deleteSubsidiaryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteSubsidiaryResponse deleteSubsidiaryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteSubsidiaryResponse = deleteSubsidiaryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingSubsidiariesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Subsidiarys */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteSubsidiaryResponse() { - return (Optional) deleteSubsidiaryResponse; + return Optional.ofNullable(this.deleteSubsidiaryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingSubsidiariesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingSubsidiariesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingSubsidiariesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingSubsidiariesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Subsidiarys + * Raw HTTP response; suitable for custom response parsing */ - public AccountingSubsidiariesDeleteResponse withDeleteSubsidiaryResponse(DeleteSubsidiaryResponse deleteSubsidiaryResponse) { - Utils.checkNotNull(deleteSubsidiaryResponse, "deleteSubsidiaryResponse"); - this.deleteSubsidiaryResponse = Optional.ofNullable(deleteSubsidiaryResponse); + public AccountingSubsidiariesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingSubsidiariesDeleteResponse withDeleteSubsidiaryResponse(DeleteS /** * Subsidiarys */ - public AccountingSubsidiariesDeleteResponse withDeleteSubsidiaryResponse(Optional deleteSubsidiaryResponse) { - Utils.checkNotNull(deleteSubsidiaryResponse, "deleteSubsidiaryResponse"); + public AccountingSubsidiariesDeleteResponse withDeleteSubsidiaryResponse(@Nullable DeleteSubsidiaryResponse deleteSubsidiaryResponse) { this.deleteSubsidiaryResponse = deleteSubsidiaryResponse; return this; } - /** - * Unexpected error - */ - public AccountingSubsidiariesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingSubsidiariesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingSubsidiariesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteSubsidiaryResponse = Optional.empty(); + private DeleteSubsidiaryResponse deleteSubsidiaryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Subsidiarys - */ - public Builder deleteSubsidiaryResponse(DeleteSubsidiaryResponse deleteSubsidiaryResponse) { - Utils.checkNotNull(deleteSubsidiaryResponse, "deleteSubsidiaryResponse"); - this.deleteSubsidiaryResponse = Optional.ofNullable(deleteSubsidiaryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Subsidiarys */ - public Builder deleteSubsidiaryResponse(Optional deleteSubsidiaryResponse) { - Utils.checkNotNull(deleteSubsidiaryResponse, "deleteSubsidiaryResponse"); + public Builder deleteSubsidiaryResponse(@Nullable DeleteSubsidiaryResponse deleteSubsidiaryResponse) { this.deleteSubsidiaryResponse = deleteSubsidiaryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingSubsidiariesDeleteResponse build() { - return new AccountingSubsidiariesDeleteResponse( contentType, statusCode, rawResponse, deleteSubsidiaryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneRequest.java index d994a870..1a3a1253 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingSubsidiariesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingSubsidiariesOneRequest { @JsonCreator public AccountingSubsidiariesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingSubsidiariesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingSubsidiariesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingSubsidiariesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingSubsidiariesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingSubsidiariesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingSubsidiariesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingSubsidiariesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingSubsidiariesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingSubsidiariesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingSubsidiariesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingSubsidiariesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingSubsidiariesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingSubsidiariesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingSubsidiariesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingSubsidiariesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingSubsidiariesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingSubsidiariesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingSubsidiariesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingSubsidiariesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingSubsidiariesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingSubsidiariesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneRequestBuilder.java index d7d53884..a9e8eee2 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingSubsidiariesOneRequestBuilder { - - private AccountingSubsidiariesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingSubsidiariesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingSubsidiariesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingSubsidiariesOneRequestBuilder request(AccountingSubsidiariesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingSubsidiariesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingSubsidiariesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingSubsidiariesOneRequestBuilder request(@Nonnull AccountingSubsidiariesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingSubsidiariesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingSubsidiariesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingSubsidiariesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneResponse.java index 66662cbd..95f376d4 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingSubsidiariesOneResponse implements Response { /** * Subsidiary */ - private Optional getSubsidiaryResponse; + private GetSubsidiaryResponse getSubsidiaryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingSubsidiariesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getSubsidiaryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getSubsidiaryResponse, "getSubsidiaryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetSubsidiaryResponse getSubsidiaryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getSubsidiaryResponse = getSubsidiaryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingSubsidiariesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Subsidiary */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getSubsidiaryResponse() { - return (Optional) getSubsidiaryResponse; + return Optional.ofNullable(this.getSubsidiaryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingSubsidiariesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingSubsidiariesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingSubsidiariesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingSubsidiariesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Subsidiary + * Raw HTTP response; suitable for custom response parsing */ - public AccountingSubsidiariesOneResponse withGetSubsidiaryResponse(GetSubsidiaryResponse getSubsidiaryResponse) { - Utils.checkNotNull(getSubsidiaryResponse, "getSubsidiaryResponse"); - this.getSubsidiaryResponse = Optional.ofNullable(getSubsidiaryResponse); + public AccountingSubsidiariesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingSubsidiariesOneResponse withGetSubsidiaryResponse(GetSubsidiary /** * Subsidiary */ - public AccountingSubsidiariesOneResponse withGetSubsidiaryResponse(Optional getSubsidiaryResponse) { - Utils.checkNotNull(getSubsidiaryResponse, "getSubsidiaryResponse"); + public AccountingSubsidiariesOneResponse withGetSubsidiaryResponse(@Nullable GetSubsidiaryResponse getSubsidiaryResponse) { this.getSubsidiaryResponse = getSubsidiaryResponse; return this; } - /** - * Unexpected error - */ - public AccountingSubsidiariesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingSubsidiariesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingSubsidiariesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getSubsidiaryResponse = Optional.empty(); + private GetSubsidiaryResponse getSubsidiaryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Subsidiary - */ - public Builder getSubsidiaryResponse(GetSubsidiaryResponse getSubsidiaryResponse) { - Utils.checkNotNull(getSubsidiaryResponse, "getSubsidiaryResponse"); - this.getSubsidiaryResponse = Optional.ofNullable(getSubsidiaryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Subsidiary */ - public Builder getSubsidiaryResponse(Optional getSubsidiaryResponse) { - Utils.checkNotNull(getSubsidiaryResponse, "getSubsidiaryResponse"); + public Builder getSubsidiaryResponse(@Nullable GetSubsidiaryResponse getSubsidiaryResponse) { this.getSubsidiaryResponse = getSubsidiaryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingSubsidiariesOneResponse build() { - return new AccountingSubsidiariesOneResponse( contentType, statusCode, rawResponse, getSubsidiaryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateRequest.java index a8703470..245b1163 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingSubsidiariesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingSubsidiariesUpdateRequest { @JsonCreator public AccountingSubsidiariesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - SubsidiaryInput subsidiary) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(subsidiary, "subsidiary"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull SubsidiaryInput subsidiary) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.subsidiary = subsidiary; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.subsidiary = Optional.ofNullable(subsidiary) + .orElseThrow(() -> new IllegalArgumentException("subsidiary cannot be null")); } public AccountingSubsidiariesUpdateRequest( - String id, - SubsidiaryInput subsidiary) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), subsidiary); + @Nonnull String id, + @Nonnull SubsidiaryInput subsidiary) { + this(id, null, null, + null, null, subsidiary); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public SubsidiaryInput subsidiary() { - return subsidiary; + return this.subsidiary; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingSubsidiariesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingSubsidiariesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingSubsidiariesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingSubsidiariesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingSubsidiariesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingSubsidiariesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingSubsidiariesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingSubsidiariesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingSubsidiariesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingSubsidiariesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingSubsidiariesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingSubsidiariesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingSubsidiariesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingSubsidiariesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingSubsidiariesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingSubsidiariesUpdateRequest withSubsidiary(SubsidiaryInput subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); - this.subsidiary = subsidiary; + + public AccountingSubsidiariesUpdateRequest withSubsidiary(@Nonnull SubsidiaryInput subsidiary) { + this.subsidiary = Utils.checkNotNull(subsidiary, "subsidiary"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private SubsidiaryInput subsidiary; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder subsidiary(SubsidiaryInput subsidiary) { - Utils.checkNotNull(subsidiary, "subsidiary"); - this.subsidiary = subsidiary; + public Builder subsidiary(@Nonnull SubsidiaryInput subsidiary) { + this.subsidiary = Utils.checkNotNull(subsidiary, "subsidiary"); return this; } public AccountingSubsidiariesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingSubsidiariesUpdateRequest( id, consumerId, appId, serviceId, raw, subsidiary); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateRequestBuilder.java index 39cda781..3b8ad93e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingSubsidiariesUpdateRequestBuilder { - - private AccountingSubsidiariesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingSubsidiariesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingSubsidiariesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingSubsidiariesUpdateRequestBuilder request(AccountingSubsidiariesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingSubsidiariesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingSubsidiariesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingSubsidiariesUpdateRequestBuilder request(@Nonnull AccountingSubsidiariesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingSubsidiariesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingSubsidiariesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingSubsidiariesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateResponse.java index 049eb561..cc70aeb1 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSubsidiariesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingSubsidiariesUpdateResponse implements Response { /** * Subsidiaries */ - private Optional updateSubsidiaryResponse; + private UpdateSubsidiaryResponse updateSubsidiaryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingSubsidiariesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateSubsidiaryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateSubsidiaryResponse, "updateSubsidiaryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateSubsidiaryResponse updateSubsidiaryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateSubsidiaryResponse = updateSubsidiaryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingSubsidiariesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Subsidiaries */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateSubsidiaryResponse() { - return (Optional) updateSubsidiaryResponse; + return Optional.ofNullable(this.updateSubsidiaryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingSubsidiariesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingSubsidiariesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingSubsidiariesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingSubsidiariesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Subsidiaries + * Raw HTTP response; suitable for custom response parsing */ - public AccountingSubsidiariesUpdateResponse withUpdateSubsidiaryResponse(UpdateSubsidiaryResponse updateSubsidiaryResponse) { - Utils.checkNotNull(updateSubsidiaryResponse, "updateSubsidiaryResponse"); - this.updateSubsidiaryResponse = Optional.ofNullable(updateSubsidiaryResponse); + public AccountingSubsidiariesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingSubsidiariesUpdateResponse withUpdateSubsidiaryResponse(UpdateS /** * Subsidiaries */ - public AccountingSubsidiariesUpdateResponse withUpdateSubsidiaryResponse(Optional updateSubsidiaryResponse) { - Utils.checkNotNull(updateSubsidiaryResponse, "updateSubsidiaryResponse"); + public AccountingSubsidiariesUpdateResponse withUpdateSubsidiaryResponse(@Nullable UpdateSubsidiaryResponse updateSubsidiaryResponse) { this.updateSubsidiaryResponse = updateSubsidiaryResponse; return this; } - /** - * Unexpected error - */ - public AccountingSubsidiariesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingSubsidiariesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingSubsidiariesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateSubsidiaryResponse = Optional.empty(); + private UpdateSubsidiaryResponse updateSubsidiaryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Subsidiaries - */ - public Builder updateSubsidiaryResponse(UpdateSubsidiaryResponse updateSubsidiaryResponse) { - Utils.checkNotNull(updateSubsidiaryResponse, "updateSubsidiaryResponse"); - this.updateSubsidiaryResponse = Optional.ofNullable(updateSubsidiaryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Subsidiaries */ - public Builder updateSubsidiaryResponse(Optional updateSubsidiaryResponse) { - Utils.checkNotNull(updateSubsidiaryResponse, "updateSubsidiaryResponse"); + public Builder updateSubsidiaryResponse(@Nullable UpdateSubsidiaryResponse updateSubsidiaryResponse) { this.updateSubsidiaryResponse = updateSubsidiaryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingSubsidiariesUpdateResponse build() { - return new AccountingSubsidiariesUpdateResponse( contentType, statusCode, rawResponse, updateSubsidiaryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddRequest.java index a8fb053b..b9eb6650 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingSuppliersAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingSuppliersAddRequest { @JsonCreator public AccountingSuppliersAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - SupplierInput supplier) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(supplier, "supplier"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull SupplierInput supplier) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.supplier = supplier; + this.supplier = Optional.ofNullable(supplier) + .orElseThrow(() -> new IllegalArgumentException("supplier cannot be null")); } public AccountingSuppliersAddRequest( - SupplierInput supplier) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), supplier); + @Nonnull SupplierInput supplier) { + this(null, null, null, + null, supplier); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public SupplierInput supplier() { - return supplier; + return this.supplier; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingSuppliersAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingSuppliersAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingSuppliersAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingSuppliersAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingSuppliersAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingSuppliersAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingSuppliersAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingSuppliersAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingSuppliersAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingSuppliersAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingSuppliersAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingSuppliersAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingSuppliersAddRequest withSupplier(SupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; + + public AccountingSuppliersAddRequest withSupplier(@Nonnull SupplierInput supplier) { + this.supplier = Utils.checkNotNull(supplier, "supplier"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private SupplierInput supplier; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder supplier(SupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; + public Builder supplier(@Nonnull SupplierInput supplier) { + this.supplier = Utils.checkNotNull(supplier, "supplier"); return this; } public AccountingSuppliersAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingSuppliersAddRequest( raw, consumerId, appId, serviceId, supplier); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddRequestBuilder.java index 58e66f5c..bf3ce079 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingSuppliersAddRequestBuilder { - - private AccountingSuppliersAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingSuppliersAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingSuppliersAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingSuppliersAddRequestBuilder request(AccountingSuppliersAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingSuppliersAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingSuppliersAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingSuppliersAddRequestBuilder request(@Nonnull AccountingSuppliersAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingSuppliersAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingSuppliersAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingSuppliersAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddResponse.java index e8166621..5678dff2 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingSuppliersAddResponse implements Response { /** * Supplier created */ - private Optional createSupplierResponse; + private CreateSupplierResponse createSupplierResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingSuppliersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createSupplierResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createSupplierResponse, "createSupplierResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateSupplierResponse createSupplierResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createSupplierResponse = createSupplierResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingSuppliersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Supplier created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createSupplierResponse() { - return (Optional) createSupplierResponse; + return Optional.ofNullable(this.createSupplierResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingSuppliersAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingSuppliersAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingSuppliersAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingSuppliersAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Supplier created + * Raw HTTP response; suitable for custom response parsing */ - public AccountingSuppliersAddResponse withCreateSupplierResponse(CreateSupplierResponse createSupplierResponse) { - Utils.checkNotNull(createSupplierResponse, "createSupplierResponse"); - this.createSupplierResponse = Optional.ofNullable(createSupplierResponse); + public AccountingSuppliersAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingSuppliersAddResponse withCreateSupplierResponse(CreateSupplierR /** * Supplier created */ - public AccountingSuppliersAddResponse withCreateSupplierResponse(Optional createSupplierResponse) { - Utils.checkNotNull(createSupplierResponse, "createSupplierResponse"); + public AccountingSuppliersAddResponse withCreateSupplierResponse(@Nullable CreateSupplierResponse createSupplierResponse) { this.createSupplierResponse = createSupplierResponse; return this; } - /** - * Unexpected error - */ - public AccountingSuppliersAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingSuppliersAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingSuppliersAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createSupplierResponse = Optional.empty(); + private CreateSupplierResponse createSupplierResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Supplier created - */ - public Builder createSupplierResponse(CreateSupplierResponse createSupplierResponse) { - Utils.checkNotNull(createSupplierResponse, "createSupplierResponse"); - this.createSupplierResponse = Optional.ofNullable(createSupplierResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Supplier created */ - public Builder createSupplierResponse(Optional createSupplierResponse) { - Utils.checkNotNull(createSupplierResponse, "createSupplierResponse"); + public Builder createSupplierResponse(@Nullable CreateSupplierResponse createSupplierResponse) { this.createSupplierResponse = createSupplierResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingSuppliersAddResponse build() { - return new AccountingSuppliersAddResponse( contentType, statusCode, rawResponse, createSupplierResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllRequest.java index 390d89ae..74819f7b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class AccountingSuppliersAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class AccountingSuppliersAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private SuppliersFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private SuppliersSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class AccountingSuppliersAllRequest { @JsonCreator public AccountingSuppliersAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable SuppliersFilter filter, + @Nullable SuppliersSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingSuppliersAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingSuppliersAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingSuppliersAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingSuppliersAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingSuppliersAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingSuppliersAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingSuppliersAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingSuppliersAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingSuppliersAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingSuppliersAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingSuppliersAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingSuppliersAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingSuppliersAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingSuppliersAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingSuppliersAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingSuppliersAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingSuppliersAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public AccountingSuppliersAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingSuppliersAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingSuppliersAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingSuppliersAllRequest withFilter(SuppliersFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingSuppliersAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingSuppliersAllRequest withFilter(@Nullable SuppliersFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public AccountingSuppliersAllRequest withSort(SuppliersSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public AccountingSuppliersAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public AccountingSuppliersAllRequest withSort(@Nullable SuppliersSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingSuppliersAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingSuppliersAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingSuppliersAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingSuppliersAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingSuppliersAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingSuppliersAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private SuppliersFilter filter; - private Optional sort = Optional.empty(); + private SuppliersSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(SuppliersFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable SuppliersFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(SuppliersSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable SuppliersSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingSuppliersAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingSuppliersAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public AccountingSuppliersAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllRequestBuilder.java index ec5fe741..832d4c14 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingSuppliersAllRequestBuilder { - - private AccountingSuppliersAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingSuppliersAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingSuppliersAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingSuppliersAllRequestBuilder request(AccountingSuppliersAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingSuppliersAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingSuppliersAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingSuppliersAllRequestBuilder request(@Nonnull AccountingSuppliersAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingSuppliersAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingSuppliersAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingSuppliersAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingSuppliersAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingSuppliersAllOperation( - sdkConfiguration, - options); + AccountingSuppliersAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingSuppliersAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingSuppliersAllRequest::withCursor, + AccountingSuppliersAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllResponse.java index 4ea11a5e..562f448f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingSuppliersAllResponse implements Response { /** * Suppliers */ - private Optional getSuppliersResponse; + private GetSuppliersResponse getSuppliersResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingSuppliersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getSuppliersResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getSuppliersResponse, "getSuppliersResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetSuppliersResponse getSuppliersResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getSuppliersResponse = getSuppliersResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingSuppliersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Suppliers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getSuppliersResponse() { - return (Optional) getSuppliersResponse; + return Optional.ofNullable(this.getSuppliersResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingSuppliersAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingSuppliersAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingSuppliersAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingSuppliersAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Suppliers + * Raw HTTP response; suitable for custom response parsing */ - public AccountingSuppliersAllResponse withGetSuppliersResponse(GetSuppliersResponse getSuppliersResponse) { - Utils.checkNotNull(getSuppliersResponse, "getSuppliersResponse"); - this.getSuppliersResponse = Optional.ofNullable(getSuppliersResponse); + public AccountingSuppliersAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingSuppliersAllResponse withGetSuppliersResponse(GetSuppliersRespo /** * Suppliers */ - public AccountingSuppliersAllResponse withGetSuppliersResponse(Optional getSuppliersResponse) { - Utils.checkNotNull(getSuppliersResponse, "getSuppliersResponse"); + public AccountingSuppliersAllResponse withGetSuppliersResponse(@Nullable GetSuppliersResponse getSuppliersResponse) { this.getSuppliersResponse = getSuppliersResponse; return this; } - /** - * Unexpected error - */ - public AccountingSuppliersAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingSuppliersAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingSuppliersAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getSuppliersResponse = Optional.empty(); + private GetSuppliersResponse getSuppliersResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Suppliers - */ - public Builder getSuppliersResponse(GetSuppliersResponse getSuppliersResponse) { - Utils.checkNotNull(getSuppliersResponse, "getSuppliersResponse"); - this.getSuppliersResponse = Optional.ofNullable(getSuppliersResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Suppliers */ - public Builder getSuppliersResponse(Optional getSuppliersResponse) { - Utils.checkNotNull(getSuppliersResponse, "getSuppliersResponse"); + public Builder getSuppliersResponse(@Nullable GetSuppliersResponse getSuppliersResponse) { this.getSuppliersResponse = getSuppliersResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingSuppliersAllResponse build() { - return new AccountingSuppliersAllResponse( contentType, statusCode, rawResponse, getSuppliersResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteRequest.java index 125c0733..ecd08585 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingSuppliersDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingSuppliersDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingSuppliersDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingSuppliersDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingSuppliersDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingSuppliersDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingSuppliersDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingSuppliersDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingSuppliersDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingSuppliersDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingSuppliersDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingSuppliersDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingSuppliersDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingSuppliersDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingSuppliersDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingSuppliersDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingSuppliersDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingSuppliersDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingSuppliersDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingSuppliersDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteRequestBuilder.java index 5658a9bd..f7905f29 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingSuppliersDeleteRequestBuilder { - - private AccountingSuppliersDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingSuppliersDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingSuppliersDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingSuppliersDeleteRequestBuilder request(AccountingSuppliersDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingSuppliersDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingSuppliersDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingSuppliersDeleteRequestBuilder request(@Nonnull AccountingSuppliersDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingSuppliersDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingSuppliersDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingSuppliersDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteResponse.java index 1a3a69c5..4c0ceab0 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingSuppliersDeleteResponse implements Response { /** * Supplier deleted */ - private Optional deleteSupplierResponse; + private DeleteSupplierResponse deleteSupplierResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingSuppliersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteSupplierResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteSupplierResponse, "deleteSupplierResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteSupplierResponse deleteSupplierResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteSupplierResponse = deleteSupplierResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingSuppliersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Supplier deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteSupplierResponse() { - return (Optional) deleteSupplierResponse; + return Optional.ofNullable(this.deleteSupplierResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingSuppliersDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingSuppliersDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingSuppliersDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingSuppliersDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Supplier deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingSuppliersDeleteResponse withDeleteSupplierResponse(DeleteSupplierResponse deleteSupplierResponse) { - Utils.checkNotNull(deleteSupplierResponse, "deleteSupplierResponse"); - this.deleteSupplierResponse = Optional.ofNullable(deleteSupplierResponse); + public AccountingSuppliersDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingSuppliersDeleteResponse withDeleteSupplierResponse(DeleteSuppli /** * Supplier deleted */ - public AccountingSuppliersDeleteResponse withDeleteSupplierResponse(Optional deleteSupplierResponse) { - Utils.checkNotNull(deleteSupplierResponse, "deleteSupplierResponse"); + public AccountingSuppliersDeleteResponse withDeleteSupplierResponse(@Nullable DeleteSupplierResponse deleteSupplierResponse) { this.deleteSupplierResponse = deleteSupplierResponse; return this; } - /** - * Unexpected error - */ - public AccountingSuppliersDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingSuppliersDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingSuppliersDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteSupplierResponse = Optional.empty(); + private DeleteSupplierResponse deleteSupplierResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Supplier deleted - */ - public Builder deleteSupplierResponse(DeleteSupplierResponse deleteSupplierResponse) { - Utils.checkNotNull(deleteSupplierResponse, "deleteSupplierResponse"); - this.deleteSupplierResponse = Optional.ofNullable(deleteSupplierResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Supplier deleted */ - public Builder deleteSupplierResponse(Optional deleteSupplierResponse) { - Utils.checkNotNull(deleteSupplierResponse, "deleteSupplierResponse"); + public Builder deleteSupplierResponse(@Nullable DeleteSupplierResponse deleteSupplierResponse) { this.deleteSupplierResponse = deleteSupplierResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingSuppliersDeleteResponse build() { - return new AccountingSuppliersDeleteResponse( contentType, statusCode, rawResponse, deleteSupplierResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneRequest.java index 81bb21e3..3ca0c49b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingSuppliersOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingSuppliersOneRequest { @JsonCreator public AccountingSuppliersOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingSuppliersOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingSuppliersOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingSuppliersOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingSuppliersOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingSuppliersOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingSuppliersOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingSuppliersOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingSuppliersOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingSuppliersOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingSuppliersOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingSuppliersOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingSuppliersOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingSuppliersOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingSuppliersOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingSuppliersOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingSuppliersOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingSuppliersOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingSuppliersOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingSuppliersOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingSuppliersOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingSuppliersOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneRequestBuilder.java index a9716aa0..a2678f1c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingSuppliersOneRequestBuilder { - - private AccountingSuppliersOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingSuppliersOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingSuppliersOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingSuppliersOneRequestBuilder request(AccountingSuppliersOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingSuppliersOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingSuppliersOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingSuppliersOneRequestBuilder request(@Nonnull AccountingSuppliersOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingSuppliersOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingSuppliersOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingSuppliersOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneResponse.java index e0236c25..b40e7afb 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingSuppliersOneResponse implements Response { /** * Supplier */ - private Optional getSupplierResponse; + private GetSupplierResponse getSupplierResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingSuppliersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getSupplierResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getSupplierResponse, "getSupplierResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetSupplierResponse getSupplierResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getSupplierResponse = getSupplierResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingSuppliersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Supplier */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getSupplierResponse() { - return (Optional) getSupplierResponse; + return Optional.ofNullable(this.getSupplierResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingSuppliersOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingSuppliersOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingSuppliersOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingSuppliersOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Supplier + * Raw HTTP response; suitable for custom response parsing */ - public AccountingSuppliersOneResponse withGetSupplierResponse(GetSupplierResponse getSupplierResponse) { - Utils.checkNotNull(getSupplierResponse, "getSupplierResponse"); - this.getSupplierResponse = Optional.ofNullable(getSupplierResponse); + public AccountingSuppliersOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingSuppliersOneResponse withGetSupplierResponse(GetSupplierRespons /** * Supplier */ - public AccountingSuppliersOneResponse withGetSupplierResponse(Optional getSupplierResponse) { - Utils.checkNotNull(getSupplierResponse, "getSupplierResponse"); + public AccountingSuppliersOneResponse withGetSupplierResponse(@Nullable GetSupplierResponse getSupplierResponse) { this.getSupplierResponse = getSupplierResponse; return this; } - /** - * Unexpected error - */ - public AccountingSuppliersOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingSuppliersOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingSuppliersOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getSupplierResponse = Optional.empty(); + private GetSupplierResponse getSupplierResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Supplier - */ - public Builder getSupplierResponse(GetSupplierResponse getSupplierResponse) { - Utils.checkNotNull(getSupplierResponse, "getSupplierResponse"); - this.getSupplierResponse = Optional.ofNullable(getSupplierResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Supplier */ - public Builder getSupplierResponse(Optional getSupplierResponse) { - Utils.checkNotNull(getSupplierResponse, "getSupplierResponse"); + public Builder getSupplierResponse(@Nullable GetSupplierResponse getSupplierResponse) { this.getSupplierResponse = getSupplierResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingSuppliersOneResponse build() { - return new AccountingSuppliersOneResponse( contentType, statusCode, rawResponse, getSupplierResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateRequest.java index d32c2845..7bb05799 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingSuppliersUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingSuppliersUpdateRequest { @JsonCreator public AccountingSuppliersUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - SupplierInput supplier) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(supplier, "supplier"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull SupplierInput supplier) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.supplier = supplier; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.supplier = Optional.ofNullable(supplier) + .orElseThrow(() -> new IllegalArgumentException("supplier cannot be null")); } public AccountingSuppliersUpdateRequest( - String id, - SupplierInput supplier) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), supplier); + @Nonnull String id, + @Nonnull SupplierInput supplier) { + this(id, null, null, + null, null, supplier); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public SupplierInput supplier() { - return supplier; + return this.supplier; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingSuppliersUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingSuppliersUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingSuppliersUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingSuppliersUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingSuppliersUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingSuppliersUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingSuppliersUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingSuppliersUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingSuppliersUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingSuppliersUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingSuppliersUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingSuppliersUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingSuppliersUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingSuppliersUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingSuppliersUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingSuppliersUpdateRequest withSupplier(SupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; + + public AccountingSuppliersUpdateRequest withSupplier(@Nonnull SupplierInput supplier) { + this.supplier = Utils.checkNotNull(supplier, "supplier"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private SupplierInput supplier; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder supplier(SupplierInput supplier) { - Utils.checkNotNull(supplier, "supplier"); - this.supplier = supplier; + public Builder supplier(@Nonnull SupplierInput supplier) { + this.supplier = Utils.checkNotNull(supplier, "supplier"); return this; } public AccountingSuppliersUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingSuppliersUpdateRequest( id, consumerId, appId, serviceId, raw, supplier); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateRequestBuilder.java index efb85c8e..e7b9d5e3 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingSuppliersUpdateRequestBuilder { - - private AccountingSuppliersUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingSuppliersUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingSuppliersUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingSuppliersUpdateRequestBuilder request(AccountingSuppliersUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingSuppliersUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingSuppliersUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingSuppliersUpdateRequestBuilder request(@Nonnull AccountingSuppliersUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingSuppliersUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingSuppliersUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingSuppliersUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateResponse.java index 8d1930d5..7ae9222e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingSuppliersUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingSuppliersUpdateResponse implements Response { /** * Supplier updated */ - private Optional updateSupplierResponse; + private UpdateSupplierResponse updateSupplierResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingSuppliersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateSupplierResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateSupplierResponse, "updateSupplierResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateSupplierResponse updateSupplierResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateSupplierResponse = updateSupplierResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingSuppliersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Supplier updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateSupplierResponse() { - return (Optional) updateSupplierResponse; + return Optional.ofNullable(this.updateSupplierResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingSuppliersUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingSuppliersUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingSuppliersUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingSuppliersUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Supplier updated + * Raw HTTP response; suitable for custom response parsing */ - public AccountingSuppliersUpdateResponse withUpdateSupplierResponse(UpdateSupplierResponse updateSupplierResponse) { - Utils.checkNotNull(updateSupplierResponse, "updateSupplierResponse"); - this.updateSupplierResponse = Optional.ofNullable(updateSupplierResponse); + public AccountingSuppliersUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingSuppliersUpdateResponse withUpdateSupplierResponse(UpdateSuppli /** * Supplier updated */ - public AccountingSuppliersUpdateResponse withUpdateSupplierResponse(Optional updateSupplierResponse) { - Utils.checkNotNull(updateSupplierResponse, "updateSupplierResponse"); + public AccountingSuppliersUpdateResponse withUpdateSupplierResponse(@Nullable UpdateSupplierResponse updateSupplierResponse) { this.updateSupplierResponse = updateSupplierResponse; return this; } - /** - * Unexpected error - */ - public AccountingSuppliersUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingSuppliersUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingSuppliersUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateSupplierResponse = Optional.empty(); + private UpdateSupplierResponse updateSupplierResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Supplier updated - */ - public Builder updateSupplierResponse(UpdateSupplierResponse updateSupplierResponse) { - Utils.checkNotNull(updateSupplierResponse, "updateSupplierResponse"); - this.updateSupplierResponse = Optional.ofNullable(updateSupplierResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Supplier updated */ - public Builder updateSupplierResponse(Optional updateSupplierResponse) { - Utils.checkNotNull(updateSupplierResponse, "updateSupplierResponse"); + public Builder updateSupplierResponse(@Nullable UpdateSupplierResponse updateSupplierResponse) { this.updateSupplierResponse = updateSupplierResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingSuppliersUpdateResponse build() { - return new AccountingSuppliersUpdateResponse( contentType, statusCode, rawResponse, updateSupplierResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddRequest.java index 4b5d806b..cfc86a36 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingTaxRatesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingTaxRatesAddRequest { @JsonCreator public AccountingTaxRatesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - TaxRateInput taxRate) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(taxRate, "taxRate"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull TaxRateInput taxRate) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.taxRate = taxRate; + this.taxRate = Optional.ofNullable(taxRate) + .orElseThrow(() -> new IllegalArgumentException("taxRate cannot be null")); } public AccountingTaxRatesAddRequest( - TaxRateInput taxRate) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), taxRate); + @Nonnull TaxRateInput taxRate) { + this(null, null, null, + null, taxRate); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public TaxRateInput taxRate() { - return taxRate; + return this.taxRate; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingTaxRatesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingTaxRatesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingTaxRatesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingTaxRatesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingTaxRatesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingTaxRatesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingTaxRatesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingTaxRatesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingTaxRatesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingTaxRatesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingTaxRatesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingTaxRatesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingTaxRatesAddRequest withTaxRate(TaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = taxRate; + + public AccountingTaxRatesAddRequest withTaxRate(@Nonnull TaxRateInput taxRate) { + this.taxRate = Utils.checkNotNull(taxRate, "taxRate"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private TaxRateInput taxRate; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder taxRate(TaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = taxRate; + public Builder taxRate(@Nonnull TaxRateInput taxRate) { + this.taxRate = Utils.checkNotNull(taxRate, "taxRate"); return this; } public AccountingTaxRatesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingTaxRatesAddRequest( raw, consumerId, appId, serviceId, taxRate); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddRequestBuilder.java index 400e313f..d527ca74 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingTaxRatesAddRequestBuilder { - - private AccountingTaxRatesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingTaxRatesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingTaxRatesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingTaxRatesAddRequestBuilder request(AccountingTaxRatesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingTaxRatesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingTaxRatesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingTaxRatesAddRequestBuilder request(@Nonnull AccountingTaxRatesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingTaxRatesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingTaxRatesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingTaxRatesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddResponse.java index 84f4c836..9fa7c2a6 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingTaxRatesAddResponse implements Response { /** * TaxRate created */ - private Optional createTaxRateResponse; + private CreateTaxRateResponse createTaxRateResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingTaxRatesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createTaxRateResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createTaxRateResponse, "createTaxRateResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateTaxRateResponse createTaxRateResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createTaxRateResponse = createTaxRateResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingTaxRatesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * TaxRate created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createTaxRateResponse() { - return (Optional) createTaxRateResponse; + return Optional.ofNullable(this.createTaxRateResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingTaxRatesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingTaxRatesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingTaxRatesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingTaxRatesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * TaxRate created + * Raw HTTP response; suitable for custom response parsing */ - public AccountingTaxRatesAddResponse withCreateTaxRateResponse(CreateTaxRateResponse createTaxRateResponse) { - Utils.checkNotNull(createTaxRateResponse, "createTaxRateResponse"); - this.createTaxRateResponse = Optional.ofNullable(createTaxRateResponse); + public AccountingTaxRatesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingTaxRatesAddResponse withCreateTaxRateResponse(CreateTaxRateResp /** * TaxRate created */ - public AccountingTaxRatesAddResponse withCreateTaxRateResponse(Optional createTaxRateResponse) { - Utils.checkNotNull(createTaxRateResponse, "createTaxRateResponse"); + public AccountingTaxRatesAddResponse withCreateTaxRateResponse(@Nullable CreateTaxRateResponse createTaxRateResponse) { this.createTaxRateResponse = createTaxRateResponse; return this; } - /** - * Unexpected error - */ - public AccountingTaxRatesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingTaxRatesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingTaxRatesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createTaxRateResponse = Optional.empty(); + private CreateTaxRateResponse createTaxRateResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * TaxRate created - */ - public Builder createTaxRateResponse(CreateTaxRateResponse createTaxRateResponse) { - Utils.checkNotNull(createTaxRateResponse, "createTaxRateResponse"); - this.createTaxRateResponse = Optional.ofNullable(createTaxRateResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * TaxRate created */ - public Builder createTaxRateResponse(Optional createTaxRateResponse) { - Utils.checkNotNull(createTaxRateResponse, "createTaxRateResponse"); + public Builder createTaxRateResponse(@Nullable CreateTaxRateResponse createTaxRateResponse) { this.createTaxRateResponse = createTaxRateResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingTaxRatesAddResponse build() { - return new AccountingTaxRatesAddResponse( contentType, statusCode, rawResponse, createTaxRateResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllRequest.java index 8dd6f08a..7f4b27a0 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllRequest.java @@ -8,14 +8,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,25 +25,25 @@ public class AccountingTaxRatesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -56,19 +55,19 @@ public class AccountingTaxRatesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private TaxRatesFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -78,113 +77,97 @@ public class AccountingTaxRatesAllRequest { @JsonCreator public AccountingTaxRatesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable TaxRatesFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingTaxRatesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -195,103 +178,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingTaxRatesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingTaxRatesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingTaxRatesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingTaxRatesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingTaxRatesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingTaxRatesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingTaxRatesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingTaxRatesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingTaxRatesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingTaxRatesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingTaxRatesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingTaxRatesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingTaxRatesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingTaxRatesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingTaxRatesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingTaxRatesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -299,67 +223,38 @@ public AccountingTaxRatesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingTaxRatesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingTaxRatesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AccountingTaxRatesAllRequest withFilter(TaxRatesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AccountingTaxRatesAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AccountingTaxRatesAllRequest withFilter(@Nullable TaxRatesFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingTaxRatesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingTaxRatesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingTaxRatesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingTaxRatesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingTaxRatesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingTaxRatesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -407,207 +302,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private TaxRatesFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - - /** - * Apply filters - */ - public Builder filter(TaxRatesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable TaxRatesFilter filter) { this.filter = filter; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingTaxRatesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingTaxRatesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -615,16 +404,16 @@ public AccountingTaxRatesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllRequestBuilder.java index 522dd6fc..ad1b4407 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingTaxRatesAllRequestBuilder { - - private AccountingTaxRatesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingTaxRatesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingTaxRatesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingTaxRatesAllRequestBuilder request(AccountingTaxRatesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingTaxRatesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingTaxRatesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingTaxRatesAllRequestBuilder request(@Nonnull AccountingTaxRatesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingTaxRatesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingTaxRatesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingTaxRatesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingTaxRatesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingTaxRatesAllOperation( - sdkConfiguration, - options); + AccountingTaxRatesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingTaxRatesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingTaxRatesAllRequest::withCursor, + AccountingTaxRatesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllResponse.java index 6cbd9b54..cc676e96 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingTaxRatesAllResponse implements Response { /** * TaxRates */ - private Optional getTaxRatesResponse; + private GetTaxRatesResponse getTaxRatesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingTaxRatesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getTaxRatesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getTaxRatesResponse, "getTaxRatesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetTaxRatesResponse getTaxRatesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getTaxRatesResponse = getTaxRatesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingTaxRatesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * TaxRates */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getTaxRatesResponse() { - return (Optional) getTaxRatesResponse; + return Optional.ofNullable(this.getTaxRatesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingTaxRatesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingTaxRatesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingTaxRatesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingTaxRatesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * TaxRates + * Raw HTTP response; suitable for custom response parsing */ - public AccountingTaxRatesAllResponse withGetTaxRatesResponse(GetTaxRatesResponse getTaxRatesResponse) { - Utils.checkNotNull(getTaxRatesResponse, "getTaxRatesResponse"); - this.getTaxRatesResponse = Optional.ofNullable(getTaxRatesResponse); + public AccountingTaxRatesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingTaxRatesAllResponse withGetTaxRatesResponse(GetTaxRatesResponse /** * TaxRates */ - public AccountingTaxRatesAllResponse withGetTaxRatesResponse(Optional getTaxRatesResponse) { - Utils.checkNotNull(getTaxRatesResponse, "getTaxRatesResponse"); + public AccountingTaxRatesAllResponse withGetTaxRatesResponse(@Nullable GetTaxRatesResponse getTaxRatesResponse) { this.getTaxRatesResponse = getTaxRatesResponse; return this; } - /** - * Unexpected error - */ - public AccountingTaxRatesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingTaxRatesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingTaxRatesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getTaxRatesResponse = Optional.empty(); + private GetTaxRatesResponse getTaxRatesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * TaxRates - */ - public Builder getTaxRatesResponse(GetTaxRatesResponse getTaxRatesResponse) { - Utils.checkNotNull(getTaxRatesResponse, "getTaxRatesResponse"); - this.getTaxRatesResponse = Optional.ofNullable(getTaxRatesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * TaxRates */ - public Builder getTaxRatesResponse(Optional getTaxRatesResponse) { - Utils.checkNotNull(getTaxRatesResponse, "getTaxRatesResponse"); + public Builder getTaxRatesResponse(@Nullable GetTaxRatesResponse getTaxRatesResponse) { this.getTaxRatesResponse = getTaxRatesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingTaxRatesAllResponse build() { - return new AccountingTaxRatesAllResponse( contentType, statusCode, rawResponse, getTaxRatesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteRequest.java index da57c640..a2829827 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingTaxRatesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingTaxRatesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingTaxRatesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingTaxRatesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingTaxRatesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingTaxRatesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingTaxRatesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingTaxRatesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingTaxRatesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingTaxRatesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingTaxRatesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingTaxRatesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingTaxRatesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingTaxRatesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingTaxRatesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingTaxRatesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingTaxRatesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingTaxRatesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingTaxRatesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingTaxRatesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteRequestBuilder.java index 9b833a83..40d77b58 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingTaxRatesDeleteRequestBuilder { - - private AccountingTaxRatesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingTaxRatesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingTaxRatesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingTaxRatesDeleteRequestBuilder request(AccountingTaxRatesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingTaxRatesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingTaxRatesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingTaxRatesDeleteRequestBuilder request(@Nonnull AccountingTaxRatesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingTaxRatesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingTaxRatesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingTaxRatesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteResponse.java index d62493dd..44848c9e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingTaxRatesDeleteResponse implements Response { /** * TaxRates deleted */ - private Optional deleteTaxRateResponse; + private DeleteTaxRateResponse deleteTaxRateResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingTaxRatesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteTaxRateResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteTaxRateResponse, "deleteTaxRateResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteTaxRateResponse deleteTaxRateResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteTaxRateResponse = deleteTaxRateResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingTaxRatesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * TaxRates deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteTaxRateResponse() { - return (Optional) deleteTaxRateResponse; + return Optional.ofNullable(this.deleteTaxRateResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingTaxRatesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingTaxRatesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingTaxRatesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingTaxRatesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * TaxRates deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingTaxRatesDeleteResponse withDeleteTaxRateResponse(DeleteTaxRateResponse deleteTaxRateResponse) { - Utils.checkNotNull(deleteTaxRateResponse, "deleteTaxRateResponse"); - this.deleteTaxRateResponse = Optional.ofNullable(deleteTaxRateResponse); + public AccountingTaxRatesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingTaxRatesDeleteResponse withDeleteTaxRateResponse(DeleteTaxRateR /** * TaxRates deleted */ - public AccountingTaxRatesDeleteResponse withDeleteTaxRateResponse(Optional deleteTaxRateResponse) { - Utils.checkNotNull(deleteTaxRateResponse, "deleteTaxRateResponse"); + public AccountingTaxRatesDeleteResponse withDeleteTaxRateResponse(@Nullable DeleteTaxRateResponse deleteTaxRateResponse) { this.deleteTaxRateResponse = deleteTaxRateResponse; return this; } - /** - * Unexpected error - */ - public AccountingTaxRatesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingTaxRatesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingTaxRatesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteTaxRateResponse = Optional.empty(); + private DeleteTaxRateResponse deleteTaxRateResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * TaxRates deleted - */ - public Builder deleteTaxRateResponse(DeleteTaxRateResponse deleteTaxRateResponse) { - Utils.checkNotNull(deleteTaxRateResponse, "deleteTaxRateResponse"); - this.deleteTaxRateResponse = Optional.ofNullable(deleteTaxRateResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * TaxRates deleted */ - public Builder deleteTaxRateResponse(Optional deleteTaxRateResponse) { - Utils.checkNotNull(deleteTaxRateResponse, "deleteTaxRateResponse"); + public Builder deleteTaxRateResponse(@Nullable DeleteTaxRateResponse deleteTaxRateResponse) { this.deleteTaxRateResponse = deleteTaxRateResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingTaxRatesDeleteResponse build() { - return new AccountingTaxRatesDeleteResponse( contentType, statusCode, rawResponse, deleteTaxRateResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneRequest.java index 384bac75..b9cb4854 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingTaxRatesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingTaxRatesOneRequest { @JsonCreator public AccountingTaxRatesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingTaxRatesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingTaxRatesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingTaxRatesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingTaxRatesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingTaxRatesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingTaxRatesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingTaxRatesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingTaxRatesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingTaxRatesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingTaxRatesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingTaxRatesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingTaxRatesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingTaxRatesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingTaxRatesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingTaxRatesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingTaxRatesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingTaxRatesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingTaxRatesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingTaxRatesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingTaxRatesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingTaxRatesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneRequestBuilder.java index 91c6b9be..3521f886 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingTaxRatesOneRequestBuilder { - - private AccountingTaxRatesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingTaxRatesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingTaxRatesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingTaxRatesOneRequestBuilder request(AccountingTaxRatesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingTaxRatesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingTaxRatesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingTaxRatesOneRequestBuilder request(@Nonnull AccountingTaxRatesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingTaxRatesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingTaxRatesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingTaxRatesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneResponse.java index 9a8943d1..3b25389d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingTaxRatesOneResponse implements Response { /** * TaxRate */ - private Optional getTaxRateResponse; + private GetTaxRateResponse getTaxRateResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingTaxRatesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getTaxRateResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getTaxRateResponse, "getTaxRateResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetTaxRateResponse getTaxRateResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getTaxRateResponse = getTaxRateResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingTaxRatesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * TaxRate */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getTaxRateResponse() { - return (Optional) getTaxRateResponse; + return Optional.ofNullable(this.getTaxRateResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingTaxRatesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingTaxRatesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingTaxRatesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingTaxRatesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * TaxRate + * Raw HTTP response; suitable for custom response parsing */ - public AccountingTaxRatesOneResponse withGetTaxRateResponse(GetTaxRateResponse getTaxRateResponse) { - Utils.checkNotNull(getTaxRateResponse, "getTaxRateResponse"); - this.getTaxRateResponse = Optional.ofNullable(getTaxRateResponse); + public AccountingTaxRatesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingTaxRatesOneResponse withGetTaxRateResponse(GetTaxRateResponse g /** * TaxRate */ - public AccountingTaxRatesOneResponse withGetTaxRateResponse(Optional getTaxRateResponse) { - Utils.checkNotNull(getTaxRateResponse, "getTaxRateResponse"); + public AccountingTaxRatesOneResponse withGetTaxRateResponse(@Nullable GetTaxRateResponse getTaxRateResponse) { this.getTaxRateResponse = getTaxRateResponse; return this; } - /** - * Unexpected error - */ - public AccountingTaxRatesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingTaxRatesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingTaxRatesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getTaxRateResponse = Optional.empty(); + private GetTaxRateResponse getTaxRateResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * TaxRate - */ - public Builder getTaxRateResponse(GetTaxRateResponse getTaxRateResponse) { - Utils.checkNotNull(getTaxRateResponse, "getTaxRateResponse"); - this.getTaxRateResponse = Optional.ofNullable(getTaxRateResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * TaxRate */ - public Builder getTaxRateResponse(Optional getTaxRateResponse) { - Utils.checkNotNull(getTaxRateResponse, "getTaxRateResponse"); + public Builder getTaxRateResponse(@Nullable GetTaxRateResponse getTaxRateResponse) { this.getTaxRateResponse = getTaxRateResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingTaxRatesOneResponse build() { - return new AccountingTaxRatesOneResponse( contentType, statusCode, rawResponse, getTaxRateResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateRequest.java index b7559537..523e25f6 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingTaxRatesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingTaxRatesUpdateRequest { @JsonCreator public AccountingTaxRatesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - TaxRateInput taxRate) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(taxRate, "taxRate"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull TaxRateInput taxRate) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.taxRate = taxRate; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.taxRate = Optional.ofNullable(taxRate) + .orElseThrow(() -> new IllegalArgumentException("taxRate cannot be null")); } public AccountingTaxRatesUpdateRequest( - String id, - TaxRateInput taxRate) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), taxRate); + @Nonnull String id, + @Nonnull TaxRateInput taxRate) { + this(id, null, null, + null, null, taxRate); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public TaxRateInput taxRate() { - return taxRate; + return this.taxRate; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingTaxRatesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingTaxRatesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingTaxRatesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingTaxRatesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AccountingTaxRatesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingTaxRatesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingTaxRatesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingTaxRatesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingTaxRatesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingTaxRatesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingTaxRatesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingTaxRatesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingTaxRatesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingTaxRatesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingTaxRatesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingTaxRatesUpdateRequest withTaxRate(TaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = taxRate; + + public AccountingTaxRatesUpdateRequest withTaxRate(@Nonnull TaxRateInput taxRate) { + this.taxRate = Utils.checkNotNull(taxRate, "taxRate"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private TaxRateInput taxRate; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder taxRate(TaxRateInput taxRate) { - Utils.checkNotNull(taxRate, "taxRate"); - this.taxRate = taxRate; + public Builder taxRate(@Nonnull TaxRateInput taxRate) { + this.taxRate = Utils.checkNotNull(taxRate, "taxRate"); return this; } public AccountingTaxRatesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingTaxRatesUpdateRequest( id, consumerId, appId, serviceId, raw, taxRate); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateRequestBuilder.java index 273c6cdd..2cf37e99 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingTaxRatesUpdateRequestBuilder { - - private AccountingTaxRatesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingTaxRatesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingTaxRatesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingTaxRatesUpdateRequestBuilder request(AccountingTaxRatesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingTaxRatesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingTaxRatesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingTaxRatesUpdateRequestBuilder request(@Nonnull AccountingTaxRatesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingTaxRatesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingTaxRatesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingTaxRatesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateResponse.java index bcb43c88..5bfaa12b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTaxRatesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingTaxRatesUpdateResponse implements Response { /** * TaxRate updated */ - private Optional updateTaxRateResponse; + private UpdateTaxRateResponse updateTaxRateResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingTaxRatesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateTaxRateResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateTaxRateResponse, "updateTaxRateResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateTaxRateResponse updateTaxRateResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateTaxRateResponse = updateTaxRateResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingTaxRatesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * TaxRate updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateTaxRateResponse() { - return (Optional) updateTaxRateResponse; + return Optional.ofNullable(this.updateTaxRateResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingTaxRatesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingTaxRatesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingTaxRatesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingTaxRatesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * TaxRate updated + * Raw HTTP response; suitable for custom response parsing */ - public AccountingTaxRatesUpdateResponse withUpdateTaxRateResponse(UpdateTaxRateResponse updateTaxRateResponse) { - Utils.checkNotNull(updateTaxRateResponse, "updateTaxRateResponse"); - this.updateTaxRateResponse = Optional.ofNullable(updateTaxRateResponse); + public AccountingTaxRatesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingTaxRatesUpdateResponse withUpdateTaxRateResponse(UpdateTaxRateR /** * TaxRate updated */ - public AccountingTaxRatesUpdateResponse withUpdateTaxRateResponse(Optional updateTaxRateResponse) { - Utils.checkNotNull(updateTaxRateResponse, "updateTaxRateResponse"); + public AccountingTaxRatesUpdateResponse withUpdateTaxRateResponse(@Nullable UpdateTaxRateResponse updateTaxRateResponse) { this.updateTaxRateResponse = updateTaxRateResponse; return this; } - /** - * Unexpected error - */ - public AccountingTaxRatesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingTaxRatesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingTaxRatesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateTaxRateResponse = Optional.empty(); + private UpdateTaxRateResponse updateTaxRateResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * TaxRate updated - */ - public Builder updateTaxRateResponse(UpdateTaxRateResponse updateTaxRateResponse) { - Utils.checkNotNull(updateTaxRateResponse, "updateTaxRateResponse"); - this.updateTaxRateResponse = Optional.ofNullable(updateTaxRateResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * TaxRate updated */ - public Builder updateTaxRateResponse(Optional updateTaxRateResponse) { - Utils.checkNotNull(updateTaxRateResponse, "updateTaxRateResponse"); + public Builder updateTaxRateResponse(@Nullable UpdateTaxRateResponse updateTaxRateResponse) { this.updateTaxRateResponse = updateTaxRateResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingTaxRatesUpdateResponse build() { - return new AccountingTaxRatesUpdateResponse( contentType, statusCode, rawResponse, updateTaxRateResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddRequest.java index c91b7eac..14e4904f 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AccountingTrackingCategoriesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AccountingTrackingCategoriesAddRequest { @JsonCreator public AccountingTrackingCategoriesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - TrackingCategoryInput trackingCategory) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull TrackingCategoryInput trackingCategory) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.trackingCategory = trackingCategory; + this.trackingCategory = Optional.ofNullable(trackingCategory) + .orElseThrow(() -> new IllegalArgumentException("trackingCategory cannot be null")); } public AccountingTrackingCategoriesAddRequest( - TrackingCategoryInput trackingCategory) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), trackingCategory); + @Nonnull TrackingCategoryInput trackingCategory) { + this(null, null, null, + null, trackingCategory); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public TrackingCategoryInput trackingCategory() { - return trackingCategory; + return this.trackingCategory; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingTrackingCategoriesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingTrackingCategoriesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingTrackingCategoriesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingTrackingCategoriesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingTrackingCategoriesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingTrackingCategoriesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingTrackingCategoriesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingTrackingCategoriesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingTrackingCategoriesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingTrackingCategoriesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingTrackingCategoriesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingTrackingCategoriesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AccountingTrackingCategoriesAddRequest withTrackingCategory(TrackingCategoryInput trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; + + public AccountingTrackingCategoriesAddRequest withTrackingCategory(@Nonnull TrackingCategoryInput trackingCategory) { + this.trackingCategory = Utils.checkNotNull(trackingCategory, "trackingCategory"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private TrackingCategoryInput trackingCategory; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder trackingCategory(TrackingCategoryInput trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; + public Builder trackingCategory(@Nonnull TrackingCategoryInput trackingCategory) { + this.trackingCategory = Utils.checkNotNull(trackingCategory, "trackingCategory"); return this; } public AccountingTrackingCategoriesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingTrackingCategoriesAddRequest( raw, consumerId, appId, serviceId, trackingCategory); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddRequestBuilder.java index 435d3455..8b6b108e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingTrackingCategoriesAddRequestBuilder { - - private AccountingTrackingCategoriesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingTrackingCategoriesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingTrackingCategoriesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingTrackingCategoriesAddRequestBuilder request(AccountingTrackingCategoriesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingTrackingCategoriesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingTrackingCategoriesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingTrackingCategoriesAddRequestBuilder request(@Nonnull AccountingTrackingCategoriesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingTrackingCategoriesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingTrackingCategoriesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingTrackingCategoriesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddResponse.java index d76c41de..56ba9966 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingTrackingCategoriesAddResponse implements Response { /** * Tracking category created */ - private Optional createTrackingCategoryResponse; + private CreateTrackingCategoryResponse createTrackingCategoryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingTrackingCategoriesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createTrackingCategoryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createTrackingCategoryResponse, "createTrackingCategoryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateTrackingCategoryResponse createTrackingCategoryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createTrackingCategoryResponse = createTrackingCategoryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingTrackingCategoriesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Tracking category created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createTrackingCategoryResponse() { - return (Optional) createTrackingCategoryResponse; + return Optional.ofNullable(this.createTrackingCategoryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingTrackingCategoriesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingTrackingCategoriesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingTrackingCategoriesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingTrackingCategoriesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Tracking category created + * Raw HTTP response; suitable for custom response parsing */ - public AccountingTrackingCategoriesAddResponse withCreateTrackingCategoryResponse(CreateTrackingCategoryResponse createTrackingCategoryResponse) { - Utils.checkNotNull(createTrackingCategoryResponse, "createTrackingCategoryResponse"); - this.createTrackingCategoryResponse = Optional.ofNullable(createTrackingCategoryResponse); + public AccountingTrackingCategoriesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingTrackingCategoriesAddResponse withCreateTrackingCategoryRespons /** * Tracking category created */ - public AccountingTrackingCategoriesAddResponse withCreateTrackingCategoryResponse(Optional createTrackingCategoryResponse) { - Utils.checkNotNull(createTrackingCategoryResponse, "createTrackingCategoryResponse"); + public AccountingTrackingCategoriesAddResponse withCreateTrackingCategoryResponse(@Nullable CreateTrackingCategoryResponse createTrackingCategoryResponse) { this.createTrackingCategoryResponse = createTrackingCategoryResponse; return this; } - /** - * Unexpected error - */ - public AccountingTrackingCategoriesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingTrackingCategoriesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingTrackingCategoriesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createTrackingCategoryResponse = Optional.empty(); + private CreateTrackingCategoryResponse createTrackingCategoryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Tracking category created - */ - public Builder createTrackingCategoryResponse(CreateTrackingCategoryResponse createTrackingCategoryResponse) { - Utils.checkNotNull(createTrackingCategoryResponse, "createTrackingCategoryResponse"); - this.createTrackingCategoryResponse = Optional.ofNullable(createTrackingCategoryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Tracking category created */ - public Builder createTrackingCategoryResponse(Optional createTrackingCategoryResponse) { - Utils.checkNotNull(createTrackingCategoryResponse, "createTrackingCategoryResponse"); + public Builder createTrackingCategoryResponse(@Nullable CreateTrackingCategoryResponse createTrackingCategoryResponse) { this.createTrackingCategoryResponse = createTrackingCategoryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingTrackingCategoriesAddResponse build() { - return new AccountingTrackingCategoriesAddResponse( contentType, statusCode, rawResponse, createTrackingCategoryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllRequest.java index 5d71d327..442b0b06 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class AccountingTrackingCategoriesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class AccountingTrackingCategoriesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class AccountingTrackingCategoriesAllRequest { @JsonCreator public AccountingTrackingCategoriesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingTrackingCategoriesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AccountingTrackingCategoriesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingTrackingCategoriesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingTrackingCategoriesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingTrackingCategoriesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AccountingTrackingCategoriesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingTrackingCategoriesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingTrackingCategoriesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingTrackingCategoriesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingTrackingCategoriesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingTrackingCategoriesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingTrackingCategoriesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingTrackingCategoriesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AccountingTrackingCategoriesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AccountingTrackingCategoriesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AccountingTrackingCategoriesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AccountingTrackingCategoriesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public AccountingTrackingCategoriesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AccountingTrackingCategoriesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AccountingTrackingCategoriesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AccountingTrackingCategoriesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AccountingTrackingCategoriesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AccountingTrackingCategoriesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingTrackingCategoriesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingTrackingCategoriesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingTrackingCategoriesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingTrackingCategoriesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AccountingTrackingCategoriesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public AccountingTrackingCategoriesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllRequestBuilder.java index eb1d5168..d32a91c7 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AccountingTrackingCategoriesAllRequestBuilder { - - private AccountingTrackingCategoriesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingTrackingCategoriesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingTrackingCategoriesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingTrackingCategoriesAllRequestBuilder request(AccountingTrackingCategoriesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingTrackingCategoriesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingTrackingCategoriesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingTrackingCategoriesAllRequestBuilder request(@Nonnull AccountingTrackingCategoriesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingTrackingCategoriesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingTrackingCategoriesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingTrackingCategoriesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AccountingTrackingCategoriesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AccountingTrackingCategoriesAllOperation( - sdkConfiguration, - options); + AccountingTrackingCategoriesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AccountingTrackingCategoriesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AccountingTrackingCategoriesAllRequest::withCursor, + AccountingTrackingCategoriesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllResponse.java index 662436af..b2fe6801 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingTrackingCategoriesAllResponse implements Response { /** * Tracking categories */ - private Optional getTrackingCategoriesResponse; + private GetTrackingCategoriesResponse getTrackingCategoriesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingTrackingCategoriesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getTrackingCategoriesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getTrackingCategoriesResponse, "getTrackingCategoriesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetTrackingCategoriesResponse getTrackingCategoriesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getTrackingCategoriesResponse = getTrackingCategoriesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingTrackingCategoriesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Tracking categories */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getTrackingCategoriesResponse() { - return (Optional) getTrackingCategoriesResponse; + return Optional.ofNullable(this.getTrackingCategoriesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingTrackingCategoriesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingTrackingCategoriesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingTrackingCategoriesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingTrackingCategoriesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Tracking categories + * Raw HTTP response; suitable for custom response parsing */ - public AccountingTrackingCategoriesAllResponse withGetTrackingCategoriesResponse(GetTrackingCategoriesResponse getTrackingCategoriesResponse) { - Utils.checkNotNull(getTrackingCategoriesResponse, "getTrackingCategoriesResponse"); - this.getTrackingCategoriesResponse = Optional.ofNullable(getTrackingCategoriesResponse); + public AccountingTrackingCategoriesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingTrackingCategoriesAllResponse withGetTrackingCategoriesResponse /** * Tracking categories */ - public AccountingTrackingCategoriesAllResponse withGetTrackingCategoriesResponse(Optional getTrackingCategoriesResponse) { - Utils.checkNotNull(getTrackingCategoriesResponse, "getTrackingCategoriesResponse"); + public AccountingTrackingCategoriesAllResponse withGetTrackingCategoriesResponse(@Nullable GetTrackingCategoriesResponse getTrackingCategoriesResponse) { this.getTrackingCategoriesResponse = getTrackingCategoriesResponse; return this; } - /** - * Unexpected error - */ - public AccountingTrackingCategoriesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingTrackingCategoriesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingTrackingCategoriesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getTrackingCategoriesResponse = Optional.empty(); + private GetTrackingCategoriesResponse getTrackingCategoriesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Tracking categories - */ - public Builder getTrackingCategoriesResponse(GetTrackingCategoriesResponse getTrackingCategoriesResponse) { - Utils.checkNotNull(getTrackingCategoriesResponse, "getTrackingCategoriesResponse"); - this.getTrackingCategoriesResponse = Optional.ofNullable(getTrackingCategoriesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Tracking categories */ - public Builder getTrackingCategoriesResponse(Optional getTrackingCategoriesResponse) { - Utils.checkNotNull(getTrackingCategoriesResponse, "getTrackingCategoriesResponse"); + public Builder getTrackingCategoriesResponse(@Nullable GetTrackingCategoriesResponse getTrackingCategoriesResponse) { this.getTrackingCategoriesResponse = getTrackingCategoriesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingTrackingCategoriesAllResponse build() { - return new AccountingTrackingCategoriesAllResponse( contentType, statusCode, rawResponse, getTrackingCategoriesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteRequest.java index b6deebcd..bfee4f29 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AccountingTrackingCategoriesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AccountingTrackingCategoriesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AccountingTrackingCategoriesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingTrackingCategoriesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingTrackingCategoriesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingTrackingCategoriesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AccountingTrackingCategoriesDeleteRequest withConsumerId(String consumerI /** * ID of the consumer which you want to get or push data from */ - public AccountingTrackingCategoriesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingTrackingCategoriesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingTrackingCategoriesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingTrackingCategoriesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingTrackingCategoriesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingTrackingCategoriesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingTrackingCategoriesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingTrackingCategoriesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingTrackingCategoriesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingTrackingCategoriesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingTrackingCategoriesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AccountingTrackingCategoriesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingTrackingCategoriesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteRequestBuilder.java index 52185ca2..4a9ebf55 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingTrackingCategoriesDeleteRequestBuilder { - - private AccountingTrackingCategoriesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingTrackingCategoriesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingTrackingCategoriesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingTrackingCategoriesDeleteRequestBuilder request(AccountingTrackingCategoriesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingTrackingCategoriesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingTrackingCategoriesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingTrackingCategoriesDeleteRequestBuilder request(@Nonnull AccountingTrackingCategoriesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingTrackingCategoriesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingTrackingCategoriesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingTrackingCategoriesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteResponse.java index d97e9113..b61edc93 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingTrackingCategoriesDeleteResponse implements Response { /** * Tracking category deleted */ - private Optional deleteTrackingCategoryResponse; + private DeleteTrackingCategoryResponse deleteTrackingCategoryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingTrackingCategoriesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteTrackingCategoryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteTrackingCategoryResponse, "deleteTrackingCategoryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteTrackingCategoryResponse deleteTrackingCategoryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteTrackingCategoryResponse = deleteTrackingCategoryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingTrackingCategoriesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Tracking category deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteTrackingCategoryResponse() { - return (Optional) deleteTrackingCategoryResponse; + return Optional.ofNullable(this.deleteTrackingCategoryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingTrackingCategoriesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingTrackingCategoriesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingTrackingCategoriesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingTrackingCategoriesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Tracking category deleted + * Raw HTTP response; suitable for custom response parsing */ - public AccountingTrackingCategoriesDeleteResponse withDeleteTrackingCategoryResponse(DeleteTrackingCategoryResponse deleteTrackingCategoryResponse) { - Utils.checkNotNull(deleteTrackingCategoryResponse, "deleteTrackingCategoryResponse"); - this.deleteTrackingCategoryResponse = Optional.ofNullable(deleteTrackingCategoryResponse); + public AccountingTrackingCategoriesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingTrackingCategoriesDeleteResponse withDeleteTrackingCategoryResp /** * Tracking category deleted */ - public AccountingTrackingCategoriesDeleteResponse withDeleteTrackingCategoryResponse(Optional deleteTrackingCategoryResponse) { - Utils.checkNotNull(deleteTrackingCategoryResponse, "deleteTrackingCategoryResponse"); + public AccountingTrackingCategoriesDeleteResponse withDeleteTrackingCategoryResponse(@Nullable DeleteTrackingCategoryResponse deleteTrackingCategoryResponse) { this.deleteTrackingCategoryResponse = deleteTrackingCategoryResponse; return this; } - /** - * Unexpected error - */ - public AccountingTrackingCategoriesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingTrackingCategoriesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingTrackingCategoriesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteTrackingCategoryResponse = Optional.empty(); + private DeleteTrackingCategoryResponse deleteTrackingCategoryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Tracking category deleted - */ - public Builder deleteTrackingCategoryResponse(DeleteTrackingCategoryResponse deleteTrackingCategoryResponse) { - Utils.checkNotNull(deleteTrackingCategoryResponse, "deleteTrackingCategoryResponse"); - this.deleteTrackingCategoryResponse = Optional.ofNullable(deleteTrackingCategoryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Tracking category deleted */ - public Builder deleteTrackingCategoryResponse(Optional deleteTrackingCategoryResponse) { - Utils.checkNotNull(deleteTrackingCategoryResponse, "deleteTrackingCategoryResponse"); + public Builder deleteTrackingCategoryResponse(@Nullable DeleteTrackingCategoryResponse deleteTrackingCategoryResponse) { this.deleteTrackingCategoryResponse = deleteTrackingCategoryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingTrackingCategoriesDeleteResponse build() { - return new AccountingTrackingCategoriesDeleteResponse( contentType, statusCode, rawResponse, deleteTrackingCategoryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneRequest.java index e0d538ab..7deada06 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingTrackingCategoriesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AccountingTrackingCategoriesOneRequest { @JsonCreator public AccountingTrackingCategoriesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AccountingTrackingCategoriesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingTrackingCategoriesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingTrackingCategoriesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingTrackingCategoriesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AccountingTrackingCategoriesOneRequest withConsumerId(String consumerId) /** * ID of the consumer which you want to get or push data from */ - public AccountingTrackingCategoriesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingTrackingCategoriesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingTrackingCategoriesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingTrackingCategoriesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingTrackingCategoriesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingTrackingCategoriesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingTrackingCategoriesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingTrackingCategoriesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingTrackingCategoriesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingTrackingCategoriesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingTrackingCategoriesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AccountingTrackingCategoriesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AccountingTrackingCategoriesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AccountingTrackingCategoriesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AccountingTrackingCategoriesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingTrackingCategoriesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneRequestBuilder.java index 33e7a7fe..3614cac0 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingTrackingCategoriesOneRequestBuilder { - - private AccountingTrackingCategoriesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingTrackingCategoriesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingTrackingCategoriesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingTrackingCategoriesOneRequestBuilder request(AccountingTrackingCategoriesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingTrackingCategoriesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingTrackingCategoriesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingTrackingCategoriesOneRequestBuilder request(@Nonnull AccountingTrackingCategoriesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingTrackingCategoriesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingTrackingCategoriesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingTrackingCategoriesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneResponse.java index b984360f..3556fff1 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingTrackingCategoriesOneResponse implements Response { /** * Tracking category */ - private Optional getTrackingCategoryResponse; + private GetTrackingCategoryResponse getTrackingCategoryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingTrackingCategoriesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getTrackingCategoryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getTrackingCategoryResponse, "getTrackingCategoryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetTrackingCategoryResponse getTrackingCategoryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getTrackingCategoryResponse = getTrackingCategoryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingTrackingCategoriesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Tracking category */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getTrackingCategoryResponse() { - return (Optional) getTrackingCategoryResponse; + return Optional.ofNullable(this.getTrackingCategoryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingTrackingCategoriesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingTrackingCategoriesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingTrackingCategoriesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingTrackingCategoriesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Tracking category + * Raw HTTP response; suitable for custom response parsing */ - public AccountingTrackingCategoriesOneResponse withGetTrackingCategoryResponse(GetTrackingCategoryResponse getTrackingCategoryResponse) { - Utils.checkNotNull(getTrackingCategoryResponse, "getTrackingCategoryResponse"); - this.getTrackingCategoryResponse = Optional.ofNullable(getTrackingCategoryResponse); + public AccountingTrackingCategoriesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingTrackingCategoriesOneResponse withGetTrackingCategoryResponse(G /** * Tracking category */ - public AccountingTrackingCategoriesOneResponse withGetTrackingCategoryResponse(Optional getTrackingCategoryResponse) { - Utils.checkNotNull(getTrackingCategoryResponse, "getTrackingCategoryResponse"); + public AccountingTrackingCategoriesOneResponse withGetTrackingCategoryResponse(@Nullable GetTrackingCategoryResponse getTrackingCategoryResponse) { this.getTrackingCategoryResponse = getTrackingCategoryResponse; return this; } - /** - * Unexpected error - */ - public AccountingTrackingCategoriesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingTrackingCategoriesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingTrackingCategoriesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getTrackingCategoryResponse = Optional.empty(); + private GetTrackingCategoryResponse getTrackingCategoryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Tracking category - */ - public Builder getTrackingCategoryResponse(GetTrackingCategoryResponse getTrackingCategoryResponse) { - Utils.checkNotNull(getTrackingCategoryResponse, "getTrackingCategoryResponse"); - this.getTrackingCategoryResponse = Optional.ofNullable(getTrackingCategoryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Tracking category */ - public Builder getTrackingCategoryResponse(Optional getTrackingCategoryResponse) { - Utils.checkNotNull(getTrackingCategoryResponse, "getTrackingCategoryResponse"); + public Builder getTrackingCategoryResponse(@Nullable GetTrackingCategoryResponse getTrackingCategoryResponse) { this.getTrackingCategoryResponse = getTrackingCategoryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingTrackingCategoriesOneResponse build() { - return new AccountingTrackingCategoriesOneResponse( contentType, statusCode, rawResponse, getTrackingCategoryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateRequest.java index adea33b2..1408c097 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AccountingTrackingCategoriesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AccountingTrackingCategoriesUpdateRequest { @JsonCreator public AccountingTrackingCategoriesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - TrackingCategoryInput trackingCategory) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull TrackingCategoryInput trackingCategory) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.trackingCategory = trackingCategory; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.trackingCategory = Optional.ofNullable(trackingCategory) + .orElseThrow(() -> new IllegalArgumentException("trackingCategory cannot be null")); } public AccountingTrackingCategoriesUpdateRequest( - String id, - TrackingCategoryInput trackingCategory) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), trackingCategory); + @Nonnull String id, + @Nonnull TrackingCategoryInput trackingCategory) { + this(id, null, null, + null, null, trackingCategory); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public TrackingCategoryInput trackingCategory() { - return trackingCategory; + return this.trackingCategory; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AccountingTrackingCategoriesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AccountingTrackingCategoriesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AccountingTrackingCategoriesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AccountingTrackingCategoriesUpdateRequest withConsumerId(String consumerI /** * ID of the consumer which you want to get or push data from */ - public AccountingTrackingCategoriesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AccountingTrackingCategoriesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AccountingTrackingCategoriesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AccountingTrackingCategoriesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AccountingTrackingCategoriesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AccountingTrackingCategoriesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AccountingTrackingCategoriesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AccountingTrackingCategoriesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AccountingTrackingCategoriesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AccountingTrackingCategoriesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AccountingTrackingCategoriesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AccountingTrackingCategoriesUpdateRequest withTrackingCategory(TrackingCategoryInput trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; + + public AccountingTrackingCategoriesUpdateRequest withTrackingCategory(@Nonnull TrackingCategoryInput trackingCategory) { + this.trackingCategory = Utils.checkNotNull(trackingCategory, "trackingCategory"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private TrackingCategoryInput trackingCategory; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder trackingCategory(TrackingCategoryInput trackingCategory) { - Utils.checkNotNull(trackingCategory, "trackingCategory"); - this.trackingCategory = trackingCategory; + public Builder trackingCategory(@Nonnull TrackingCategoryInput trackingCategory) { + this.trackingCategory = Utils.checkNotNull(trackingCategory, "trackingCategory"); return this; } public AccountingTrackingCategoriesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AccountingTrackingCategoriesUpdateRequest( id, consumerId, appId, serviceId, raw, trackingCategory); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateRequestBuilder.java index 28e42093..e8f69ffc 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AccountingTrackingCategoriesUpdateRequestBuilder { - - private AccountingTrackingCategoriesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AccountingTrackingCategoriesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AccountingTrackingCategoriesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AccountingTrackingCategoriesUpdateRequestBuilder request(AccountingTrackingCategoriesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AccountingTrackingCategoriesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AccountingTrackingCategoriesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AccountingTrackingCategoriesUpdateRequestBuilder request(@Nonnull AccountingTrackingCategoriesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AccountingTrackingCategoriesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AccountingTrackingCategoriesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AccountingTrackingCategoriesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateResponse.java index 0b154eb1..29e7e43a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AccountingTrackingCategoriesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AccountingTrackingCategoriesUpdateResponse implements Response { /** * Tracking category updated */ - private Optional updateTrackingCategoryResponse; + private UpdateTrackingCategoryResponse updateTrackingCategoryResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AccountingTrackingCategoriesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateTrackingCategoryResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateTrackingCategoryResponse, "updateTrackingCategoryResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateTrackingCategoryResponse updateTrackingCategoryResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateTrackingCategoryResponse = updateTrackingCategoryResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AccountingTrackingCategoriesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Tracking category updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateTrackingCategoryResponse() { - return (Optional) updateTrackingCategoryResponse; + return Optional.ofNullable(this.updateTrackingCategoryResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AccountingTrackingCategoriesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AccountingTrackingCategoriesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AccountingTrackingCategoriesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AccountingTrackingCategoriesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Tracking category updated + * Raw HTTP response; suitable for custom response parsing */ - public AccountingTrackingCategoriesUpdateResponse withUpdateTrackingCategoryResponse(UpdateTrackingCategoryResponse updateTrackingCategoryResponse) { - Utils.checkNotNull(updateTrackingCategoryResponse, "updateTrackingCategoryResponse"); - this.updateTrackingCategoryResponse = Optional.ofNullable(updateTrackingCategoryResponse); + public AccountingTrackingCategoriesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AccountingTrackingCategoriesUpdateResponse withUpdateTrackingCategoryResp /** * Tracking category updated */ - public AccountingTrackingCategoriesUpdateResponse withUpdateTrackingCategoryResponse(Optional updateTrackingCategoryResponse) { - Utils.checkNotNull(updateTrackingCategoryResponse, "updateTrackingCategoryResponse"); + public AccountingTrackingCategoriesUpdateResponse withUpdateTrackingCategoryResponse(@Nullable UpdateTrackingCategoryResponse updateTrackingCategoryResponse) { this.updateTrackingCategoryResponse = updateTrackingCategoryResponse; return this; } - /** - * Unexpected error - */ - public AccountingTrackingCategoriesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AccountingTrackingCategoriesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AccountingTrackingCategoriesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateTrackingCategoryResponse = Optional.empty(); + private UpdateTrackingCategoryResponse updateTrackingCategoryResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Tracking category updated - */ - public Builder updateTrackingCategoryResponse(UpdateTrackingCategoryResponse updateTrackingCategoryResponse) { - Utils.checkNotNull(updateTrackingCategoryResponse, "updateTrackingCategoryResponse"); - this.updateTrackingCategoryResponse = Optional.ofNullable(updateTrackingCategoryResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Tracking category updated */ - public Builder updateTrackingCategoryResponse(Optional updateTrackingCategoryResponse) { - Utils.checkNotNull(updateTrackingCategoryResponse, "updateTrackingCategoryResponse"); + public Builder updateTrackingCategoryResponse(@Nullable UpdateTrackingCategoryResponse updateTrackingCategoryResponse) { this.updateTrackingCategoryResponse = updateTrackingCategoryResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AccountingTrackingCategoriesUpdateResponse build() { - return new AccountingTrackingCategoriesUpdateResponse( contentType, statusCode, rawResponse, updateTrackingCategoryResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddRequest.java index 83649a38..b1374c23 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AtsApplicantsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AtsApplicantsAddRequest { @JsonCreator public AtsApplicantsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - ApplicantInput applicant) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(applicant, "applicant"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull ApplicantInput applicant) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.applicant = applicant; + this.applicant = Optional.ofNullable(applicant) + .orElseThrow(() -> new IllegalArgumentException("applicant cannot be null")); } public AtsApplicantsAddRequest( - ApplicantInput applicant) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), applicant); + @Nonnull ApplicantInput applicant) { + this(null, null, null, + null, applicant); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public ApplicantInput applicant() { - return applicant; + return this.applicant; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AtsApplicantsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsApplicantsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsApplicantsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AtsApplicantsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AtsApplicantsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsApplicantsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsApplicantsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsApplicantsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsApplicantsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsApplicantsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsApplicantsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsApplicantsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AtsApplicantsAddRequest withApplicant(ApplicantInput applicant) { - Utils.checkNotNull(applicant, "applicant"); - this.applicant = applicant; + + public AtsApplicantsAddRequest withApplicant(@Nonnull ApplicantInput applicant) { + this.applicant = Utils.checkNotNull(applicant, "applicant"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private ApplicantInput applicant; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder applicant(ApplicantInput applicant) { - Utils.checkNotNull(applicant, "applicant"); - this.applicant = applicant; + public Builder applicant(@Nonnull ApplicantInput applicant) { + this.applicant = Utils.checkNotNull(applicant, "applicant"); return this; } public AtsApplicantsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AtsApplicantsAddRequest( raw, consumerId, appId, serviceId, applicant); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddRequestBuilder.java index 79657a64..cc160fbe 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AtsApplicantsAddRequestBuilder { - - private AtsApplicantsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsApplicantsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsApplicantsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsApplicantsAddRequestBuilder request(AtsApplicantsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsApplicantsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsApplicantsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsApplicantsAddRequestBuilder request(@Nonnull AtsApplicantsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsApplicantsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsApplicantsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsApplicantsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddResponse.java index 0a05cb79..33248d8d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsApplicantsAddResponse implements Response { /** * Applicants */ - private Optional createApplicantResponse; + private CreateApplicantResponse createApplicantResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsApplicantsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createApplicantResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createApplicantResponse, "createApplicantResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateApplicantResponse createApplicantResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createApplicantResponse = createApplicantResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsApplicantsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Applicants */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createApplicantResponse() { - return (Optional) createApplicantResponse; + return Optional.ofNullable(this.createApplicantResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsApplicantsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsApplicantsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsApplicantsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsApplicantsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Applicants + * Raw HTTP response; suitable for custom response parsing */ - public AtsApplicantsAddResponse withCreateApplicantResponse(CreateApplicantResponse createApplicantResponse) { - Utils.checkNotNull(createApplicantResponse, "createApplicantResponse"); - this.createApplicantResponse = Optional.ofNullable(createApplicantResponse); + public AtsApplicantsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsApplicantsAddResponse withCreateApplicantResponse(CreateApplicantRespo /** * Applicants */ - public AtsApplicantsAddResponse withCreateApplicantResponse(Optional createApplicantResponse) { - Utils.checkNotNull(createApplicantResponse, "createApplicantResponse"); + public AtsApplicantsAddResponse withCreateApplicantResponse(@Nullable CreateApplicantResponse createApplicantResponse) { this.createApplicantResponse = createApplicantResponse; return this; } - /** - * Unexpected error - */ - public AtsApplicantsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsApplicantsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsApplicantsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createApplicantResponse = Optional.empty(); + private CreateApplicantResponse createApplicantResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Applicants - */ - public Builder createApplicantResponse(CreateApplicantResponse createApplicantResponse) { - Utils.checkNotNull(createApplicantResponse, "createApplicantResponse"); - this.createApplicantResponse = Optional.ofNullable(createApplicantResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Applicants */ - public Builder createApplicantResponse(Optional createApplicantResponse) { - Utils.checkNotNull(createApplicantResponse, "createApplicantResponse"); + public Builder createApplicantResponse(@Nullable CreateApplicantResponse createApplicantResponse) { this.createApplicantResponse = createApplicantResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsApplicantsAddResponse build() { - return new AtsApplicantsAddResponse( contentType, statusCode, rawResponse, createApplicantResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllRequest.java index 34055007..e2cf4144 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllRequest.java @@ -8,14 +8,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,25 +25,25 @@ public class AtsApplicantsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -56,19 +55,19 @@ public class AtsApplicantsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private ApplicantsFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -78,113 +77,97 @@ public class AtsApplicantsAllRequest { @JsonCreator public AtsApplicantsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable ApplicantsFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AtsApplicantsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -195,103 +178,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AtsApplicantsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsApplicantsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsApplicantsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AtsApplicantsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AtsApplicantsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsApplicantsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsApplicantsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsApplicantsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsApplicantsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsApplicantsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsApplicantsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsApplicantsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AtsApplicantsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AtsApplicantsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AtsApplicantsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AtsApplicantsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -299,67 +223,38 @@ public AtsApplicantsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AtsApplicantsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AtsApplicantsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public AtsApplicantsAllRequest withFilter(ApplicantsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public AtsApplicantsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public AtsApplicantsAllRequest withFilter(@Nullable ApplicantsFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AtsApplicantsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AtsApplicantsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AtsApplicantsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AtsApplicantsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AtsApplicantsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AtsApplicantsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -407,207 +302,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private ApplicantsFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - - /** - * Apply filters - */ - public Builder filter(ApplicantsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable ApplicantsFilter filter) { this.filter = filter; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AtsApplicantsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AtsApplicantsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -615,16 +404,16 @@ public AtsApplicantsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllRequestBuilder.java index 2548a446..64ec9253 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AtsApplicantsAllRequestBuilder { - - private AtsApplicantsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsApplicantsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsApplicantsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsApplicantsAllRequestBuilder request(AtsApplicantsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsApplicantsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsApplicantsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsApplicantsAllRequestBuilder request(@Nonnull AtsApplicantsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsApplicantsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsApplicantsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsApplicantsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AtsApplicantsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AtsApplicantsAllOperation( - sdkConfiguration, - options); + AtsApplicantsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AtsApplicantsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AtsApplicantsAllRequest::withCursor, + AtsApplicantsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllResponse.java index e4af6c70..7eaa7355 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsApplicantsAllResponse implements Response { /** * Applicants */ - private Optional getApplicantsResponse; + private GetApplicantsResponse getApplicantsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsApplicantsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getApplicantsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getApplicantsResponse, "getApplicantsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetApplicantsResponse getApplicantsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getApplicantsResponse = getApplicantsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsApplicantsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Applicants */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getApplicantsResponse() { - return (Optional) getApplicantsResponse; + return Optional.ofNullable(this.getApplicantsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsApplicantsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsApplicantsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsApplicantsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsApplicantsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Applicants + * Raw HTTP response; suitable for custom response parsing */ - public AtsApplicantsAllResponse withGetApplicantsResponse(GetApplicantsResponse getApplicantsResponse) { - Utils.checkNotNull(getApplicantsResponse, "getApplicantsResponse"); - this.getApplicantsResponse = Optional.ofNullable(getApplicantsResponse); + public AtsApplicantsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsApplicantsAllResponse withGetApplicantsResponse(GetApplicantsResponse /** * Applicants */ - public AtsApplicantsAllResponse withGetApplicantsResponse(Optional getApplicantsResponse) { - Utils.checkNotNull(getApplicantsResponse, "getApplicantsResponse"); + public AtsApplicantsAllResponse withGetApplicantsResponse(@Nullable GetApplicantsResponse getApplicantsResponse) { this.getApplicantsResponse = getApplicantsResponse; return this; } - /** - * Unexpected error - */ - public AtsApplicantsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsApplicantsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsApplicantsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getApplicantsResponse = Optional.empty(); + private GetApplicantsResponse getApplicantsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Applicants - */ - public Builder getApplicantsResponse(GetApplicantsResponse getApplicantsResponse) { - Utils.checkNotNull(getApplicantsResponse, "getApplicantsResponse"); - this.getApplicantsResponse = Optional.ofNullable(getApplicantsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Applicants */ - public Builder getApplicantsResponse(Optional getApplicantsResponse) { - Utils.checkNotNull(getApplicantsResponse, "getApplicantsResponse"); + public Builder getApplicantsResponse(@Nullable GetApplicantsResponse getApplicantsResponse) { this.getApplicantsResponse = getApplicantsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsApplicantsAllResponse build() { - return new AtsApplicantsAllResponse( contentType, statusCode, rawResponse, getApplicantsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteRequest.java index 99c77401..b189347d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AtsApplicantsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AtsApplicantsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AtsApplicantsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AtsApplicantsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AtsApplicantsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AtsApplicantsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AtsApplicantsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AtsApplicantsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsApplicantsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsApplicantsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsApplicantsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsApplicantsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsApplicantsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsApplicantsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsApplicantsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsApplicantsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AtsApplicantsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsApplicantsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AtsApplicantsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AtsApplicantsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteRequestBuilder.java index 224bb1f6..7c2b8e9b 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AtsApplicantsDeleteRequestBuilder { - - private AtsApplicantsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsApplicantsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsApplicantsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsApplicantsDeleteRequestBuilder request(AtsApplicantsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsApplicantsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsApplicantsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsApplicantsDeleteRequestBuilder request(@Nonnull AtsApplicantsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsApplicantsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsApplicantsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsApplicantsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteResponse.java index fb896afa..adae734e 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsApplicantsDeleteResponse implements Response { /** * Applicants */ - private Optional deleteApplicantResponse; + private DeleteApplicantResponse deleteApplicantResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsApplicantsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteApplicantResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteApplicantResponse, "deleteApplicantResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteApplicantResponse deleteApplicantResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteApplicantResponse = deleteApplicantResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsApplicantsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Applicants */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteApplicantResponse() { - return (Optional) deleteApplicantResponse; + return Optional.ofNullable(this.deleteApplicantResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsApplicantsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsApplicantsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsApplicantsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsApplicantsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Applicants + * Raw HTTP response; suitable for custom response parsing */ - public AtsApplicantsDeleteResponse withDeleteApplicantResponse(DeleteApplicantResponse deleteApplicantResponse) { - Utils.checkNotNull(deleteApplicantResponse, "deleteApplicantResponse"); - this.deleteApplicantResponse = Optional.ofNullable(deleteApplicantResponse); + public AtsApplicantsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsApplicantsDeleteResponse withDeleteApplicantResponse(DeleteApplicantRe /** * Applicants */ - public AtsApplicantsDeleteResponse withDeleteApplicantResponse(Optional deleteApplicantResponse) { - Utils.checkNotNull(deleteApplicantResponse, "deleteApplicantResponse"); + public AtsApplicantsDeleteResponse withDeleteApplicantResponse(@Nullable DeleteApplicantResponse deleteApplicantResponse) { this.deleteApplicantResponse = deleteApplicantResponse; return this; } - /** - * Unexpected error - */ - public AtsApplicantsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsApplicantsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsApplicantsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteApplicantResponse = Optional.empty(); + private DeleteApplicantResponse deleteApplicantResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Applicants - */ - public Builder deleteApplicantResponse(DeleteApplicantResponse deleteApplicantResponse) { - Utils.checkNotNull(deleteApplicantResponse, "deleteApplicantResponse"); - this.deleteApplicantResponse = Optional.ofNullable(deleteApplicantResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Applicants */ - public Builder deleteApplicantResponse(Optional deleteApplicantResponse) { - Utils.checkNotNull(deleteApplicantResponse, "deleteApplicantResponse"); + public Builder deleteApplicantResponse(@Nullable DeleteApplicantResponse deleteApplicantResponse) { this.deleteApplicantResponse = deleteApplicantResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsApplicantsDeleteResponse build() { - return new AtsApplicantsDeleteResponse( contentType, statusCode, rawResponse, deleteApplicantResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneRequest.java index 61bf2b7d..98ca0cf2 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AtsApplicantsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AtsApplicantsOneRequest { @JsonCreator public AtsApplicantsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AtsApplicantsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AtsApplicantsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AtsApplicantsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AtsApplicantsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AtsApplicantsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AtsApplicantsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsApplicantsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsApplicantsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsApplicantsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsApplicantsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsApplicantsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsApplicantsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsApplicantsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsApplicantsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AtsApplicantsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsApplicantsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AtsApplicantsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AtsApplicantsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AtsApplicantsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AtsApplicantsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AtsApplicantsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneRequestBuilder.java index 95ae1a45..edbdac77 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AtsApplicantsOneRequestBuilder { - - private AtsApplicantsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsApplicantsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsApplicantsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsApplicantsOneRequestBuilder request(AtsApplicantsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsApplicantsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsApplicantsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsApplicantsOneRequestBuilder request(@Nonnull AtsApplicantsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsApplicantsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsApplicantsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsApplicantsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneResponse.java index 8a5317f2..a9906857 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsApplicantsOneResponse implements Response { /** * Applicants */ - private Optional getApplicantResponse; + private GetApplicantResponse getApplicantResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsApplicantsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getApplicantResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getApplicantResponse, "getApplicantResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetApplicantResponse getApplicantResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getApplicantResponse = getApplicantResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsApplicantsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Applicants */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getApplicantResponse() { - return (Optional) getApplicantResponse; + return Optional.ofNullable(this.getApplicantResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsApplicantsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsApplicantsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsApplicantsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsApplicantsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Applicants + * Raw HTTP response; suitable for custom response parsing */ - public AtsApplicantsOneResponse withGetApplicantResponse(GetApplicantResponse getApplicantResponse) { - Utils.checkNotNull(getApplicantResponse, "getApplicantResponse"); - this.getApplicantResponse = Optional.ofNullable(getApplicantResponse); + public AtsApplicantsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsApplicantsOneResponse withGetApplicantResponse(GetApplicantResponse ge /** * Applicants */ - public AtsApplicantsOneResponse withGetApplicantResponse(Optional getApplicantResponse) { - Utils.checkNotNull(getApplicantResponse, "getApplicantResponse"); + public AtsApplicantsOneResponse withGetApplicantResponse(@Nullable GetApplicantResponse getApplicantResponse) { this.getApplicantResponse = getApplicantResponse; return this; } - /** - * Unexpected error - */ - public AtsApplicantsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsApplicantsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsApplicantsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getApplicantResponse = Optional.empty(); + private GetApplicantResponse getApplicantResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Applicants - */ - public Builder getApplicantResponse(GetApplicantResponse getApplicantResponse) { - Utils.checkNotNull(getApplicantResponse, "getApplicantResponse"); - this.getApplicantResponse = Optional.ofNullable(getApplicantResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Applicants */ - public Builder getApplicantResponse(Optional getApplicantResponse) { - Utils.checkNotNull(getApplicantResponse, "getApplicantResponse"); + public Builder getApplicantResponse(@Nullable GetApplicantResponse getApplicantResponse) { this.getApplicantResponse = getApplicantResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsApplicantsOneResponse build() { - return new AtsApplicantsOneResponse( contentType, statusCode, rawResponse, getApplicantResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateRequest.java index 266d0cab..5a696f46 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AtsApplicantsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AtsApplicantsUpdateRequest { @JsonCreator public AtsApplicantsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - ApplicantInput applicant) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(applicant, "applicant"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull ApplicantInput applicant) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.applicant = applicant; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.applicant = Optional.ofNullable(applicant) + .orElseThrow(() -> new IllegalArgumentException("applicant cannot be null")); } public AtsApplicantsUpdateRequest( - String id, - ApplicantInput applicant) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), applicant); + @Nonnull String id, + @Nonnull ApplicantInput applicant) { + this(id, null, null, + null, null, applicant); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public ApplicantInput applicant() { - return applicant; + return this.applicant; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AtsApplicantsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AtsApplicantsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AtsApplicantsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AtsApplicantsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AtsApplicantsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsApplicantsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsApplicantsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsApplicantsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsApplicantsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsApplicantsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsApplicantsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsApplicantsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsApplicantsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AtsApplicantsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsApplicantsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AtsApplicantsUpdateRequest withApplicant(ApplicantInput applicant) { - Utils.checkNotNull(applicant, "applicant"); - this.applicant = applicant; + + public AtsApplicantsUpdateRequest withApplicant(@Nonnull ApplicantInput applicant) { + this.applicant = Utils.checkNotNull(applicant, "applicant"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private ApplicantInput applicant; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder applicant(ApplicantInput applicant) { - Utils.checkNotNull(applicant, "applicant"); - this.applicant = applicant; + public Builder applicant(@Nonnull ApplicantInput applicant) { + this.applicant = Utils.checkNotNull(applicant, "applicant"); return this; } public AtsApplicantsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AtsApplicantsUpdateRequest( id, consumerId, appId, serviceId, raw, applicant); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateRequestBuilder.java index b8b1ac92..5c0a3970 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AtsApplicantsUpdateRequestBuilder { - - private AtsApplicantsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsApplicantsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsApplicantsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsApplicantsUpdateRequestBuilder request(AtsApplicantsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsApplicantsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsApplicantsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsApplicantsUpdateRequestBuilder request(@Nonnull AtsApplicantsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsApplicantsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsApplicantsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsApplicantsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateResponse.java index efce417b..f73ddfea 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicantsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsApplicantsUpdateResponse implements Response { /** * Applicants */ - private Optional updateApplicantResponse; + private UpdateApplicantResponse updateApplicantResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsApplicantsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateApplicantResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateApplicantResponse, "updateApplicantResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateApplicantResponse updateApplicantResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateApplicantResponse = updateApplicantResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsApplicantsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Applicants */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateApplicantResponse() { - return (Optional) updateApplicantResponse; + return Optional.ofNullable(this.updateApplicantResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsApplicantsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsApplicantsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsApplicantsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsApplicantsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Applicants + * Raw HTTP response; suitable for custom response parsing */ - public AtsApplicantsUpdateResponse withUpdateApplicantResponse(UpdateApplicantResponse updateApplicantResponse) { - Utils.checkNotNull(updateApplicantResponse, "updateApplicantResponse"); - this.updateApplicantResponse = Optional.ofNullable(updateApplicantResponse); + public AtsApplicantsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsApplicantsUpdateResponse withUpdateApplicantResponse(UpdateApplicantRe /** * Applicants */ - public AtsApplicantsUpdateResponse withUpdateApplicantResponse(Optional updateApplicantResponse) { - Utils.checkNotNull(updateApplicantResponse, "updateApplicantResponse"); + public AtsApplicantsUpdateResponse withUpdateApplicantResponse(@Nullable UpdateApplicantResponse updateApplicantResponse) { this.updateApplicantResponse = updateApplicantResponse; return this; } - /** - * Unexpected error - */ - public AtsApplicantsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsApplicantsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsApplicantsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateApplicantResponse = Optional.empty(); + private UpdateApplicantResponse updateApplicantResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Applicants - */ - public Builder updateApplicantResponse(UpdateApplicantResponse updateApplicantResponse) { - Utils.checkNotNull(updateApplicantResponse, "updateApplicantResponse"); - this.updateApplicantResponse = Optional.ofNullable(updateApplicantResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Applicants */ - public Builder updateApplicantResponse(Optional updateApplicantResponse) { - Utils.checkNotNull(updateApplicantResponse, "updateApplicantResponse"); + public Builder updateApplicantResponse(@Nullable UpdateApplicantResponse updateApplicantResponse) { this.updateApplicantResponse = updateApplicantResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsApplicantsUpdateResponse build() { - return new AtsApplicantsUpdateResponse( contentType, statusCode, rawResponse, updateApplicantResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddRequest.java index bf90b1f5..c92f1b3a 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class AtsApplicationsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class AtsApplicationsAddRequest { @JsonCreator public AtsApplicationsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - ApplicationInput application) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(application, "application"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull ApplicationInput application) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.application = application; + this.application = Optional.ofNullable(application) + .orElseThrow(() -> new IllegalArgumentException("application cannot be null")); } public AtsApplicationsAddRequest( - ApplicationInput application) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), application); + @Nonnull ApplicationInput application) { + this(null, null, null, + null, application); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public ApplicationInput application() { - return application; + return this.application; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AtsApplicationsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsApplicationsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsApplicationsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AtsApplicationsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AtsApplicationsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsApplicationsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsApplicationsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsApplicationsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsApplicationsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsApplicationsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsApplicationsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsApplicationsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public AtsApplicationsAddRequest withApplication(ApplicationInput application) { - Utils.checkNotNull(application, "application"); - this.application = application; + + public AtsApplicationsAddRequest withApplication(@Nonnull ApplicationInput application) { + this.application = Utils.checkNotNull(application, "application"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private ApplicationInput application; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder application(ApplicationInput application) { - Utils.checkNotNull(application, "application"); - this.application = application; + public Builder application(@Nonnull ApplicationInput application) { + this.application = Utils.checkNotNull(application, "application"); return this; } public AtsApplicationsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AtsApplicationsAddRequest( raw, consumerId, appId, serviceId, application); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddRequestBuilder.java index c65d866f..3f29dffd 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AtsApplicationsAddRequestBuilder { - - private AtsApplicationsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsApplicationsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsApplicationsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsApplicationsAddRequestBuilder request(AtsApplicationsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsApplicationsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsApplicationsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsApplicationsAddRequestBuilder request(@Nonnull AtsApplicationsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsApplicationsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsApplicationsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsApplicationsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddResponse.java index 14ee9111..5bd6dc72 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsApplicationsAddResponse implements Response { /** * Applications */ - private Optional createApplicationResponse; + private CreateApplicationResponse createApplicationResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsApplicationsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createApplicationResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createApplicationResponse, "createApplicationResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateApplicationResponse createApplicationResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createApplicationResponse = createApplicationResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsApplicationsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Applications */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createApplicationResponse() { - return (Optional) createApplicationResponse; + return Optional.ofNullable(this.createApplicationResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsApplicationsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsApplicationsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsApplicationsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsApplicationsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Applications + * Raw HTTP response; suitable for custom response parsing */ - public AtsApplicationsAddResponse withCreateApplicationResponse(CreateApplicationResponse createApplicationResponse) { - Utils.checkNotNull(createApplicationResponse, "createApplicationResponse"); - this.createApplicationResponse = Optional.ofNullable(createApplicationResponse); + public AtsApplicationsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsApplicationsAddResponse withCreateApplicationResponse(CreateApplicatio /** * Applications */ - public AtsApplicationsAddResponse withCreateApplicationResponse(Optional createApplicationResponse) { - Utils.checkNotNull(createApplicationResponse, "createApplicationResponse"); + public AtsApplicationsAddResponse withCreateApplicationResponse(@Nullable CreateApplicationResponse createApplicationResponse) { this.createApplicationResponse = createApplicationResponse; return this; } - /** - * Unexpected error - */ - public AtsApplicationsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsApplicationsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsApplicationsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createApplicationResponse = Optional.empty(); + private CreateApplicationResponse createApplicationResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Applications - */ - public Builder createApplicationResponse(CreateApplicationResponse createApplicationResponse) { - Utils.checkNotNull(createApplicationResponse, "createApplicationResponse"); - this.createApplicationResponse = Optional.ofNullable(createApplicationResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Applications */ - public Builder createApplicationResponse(Optional createApplicationResponse) { - Utils.checkNotNull(createApplicationResponse, "createApplicationResponse"); + public Builder createApplicationResponse(@Nullable CreateApplicationResponse createApplicationResponse) { this.createApplicationResponse = createApplicationResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsApplicationsAddResponse build() { - return new AtsApplicationsAddResponse( contentType, statusCode, rawResponse, createApplicationResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllRequest.java index 72c3fc39..e7c26603 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class AtsApplicationsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,100 +54,88 @@ public class AtsApplicationsAllRequest { * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; @JsonCreator public AtsApplicationsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional> passThrough, - Optional limit) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(limit, "limit"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Map passThrough, + @Nullable Long limit) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); this.passThrough = passThrough; - this.limit = limit; + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); } public AtsApplicationsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } public static Builder builder() { @@ -159,103 +146,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AtsApplicationsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsApplicationsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsApplicationsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AtsApplicationsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AtsApplicationsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsApplicationsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsApplicationsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsApplicationsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsApplicationsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsApplicationsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsApplicationsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsApplicationsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AtsApplicationsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AtsApplicationsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AtsApplicationsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); + public AtsApplicationsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -263,31 +191,21 @@ public AtsApplicationsAllRequest withPassThrough(Map passThrough /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AtsApplicationsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AtsApplicationsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AtsApplicationsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AtsApplicationsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AtsApplicationsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -330,165 +248,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private Optional limit; + private Long limit; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } public AtsApplicationsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AtsApplicationsAllRequest( raw, consumerId, appId, serviceId, cursor, passThrough, @@ -496,16 +330,16 @@ public AtsApplicationsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllRequestBuilder.java index a3690ee7..d2f2a7c2 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AtsApplicationsAllRequestBuilder { - - private AtsApplicationsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsApplicationsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsApplicationsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsApplicationsAllRequestBuilder request(AtsApplicationsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsApplicationsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsApplicationsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsApplicationsAllRequestBuilder request(@Nonnull AtsApplicationsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsApplicationsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsApplicationsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsApplicationsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AtsApplicationsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AtsApplicationsAllOperation( - sdkConfiguration, - options); + AtsApplicationsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AtsApplicationsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AtsApplicationsAllRequest::withCursor, + AtsApplicationsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllResponse.java index aa5c2c48..f7b4809c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsApplicationsAllResponse implements Response { /** * Applications */ - private Optional getApplicationsResponse; + private GetApplicationsResponse getApplicationsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsApplicationsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getApplicationsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getApplicationsResponse, "getApplicationsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetApplicationsResponse getApplicationsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getApplicationsResponse = getApplicationsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsApplicationsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Applications */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getApplicationsResponse() { - return (Optional) getApplicationsResponse; + return Optional.ofNullable(this.getApplicationsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsApplicationsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsApplicationsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsApplicationsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsApplicationsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Applications + * Raw HTTP response; suitable for custom response parsing */ - public AtsApplicationsAllResponse withGetApplicationsResponse(GetApplicationsResponse getApplicationsResponse) { - Utils.checkNotNull(getApplicationsResponse, "getApplicationsResponse"); - this.getApplicationsResponse = Optional.ofNullable(getApplicationsResponse); + public AtsApplicationsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsApplicationsAllResponse withGetApplicationsResponse(GetApplicationsRes /** * Applications */ - public AtsApplicationsAllResponse withGetApplicationsResponse(Optional getApplicationsResponse) { - Utils.checkNotNull(getApplicationsResponse, "getApplicationsResponse"); + public AtsApplicationsAllResponse withGetApplicationsResponse(@Nullable GetApplicationsResponse getApplicationsResponse) { this.getApplicationsResponse = getApplicationsResponse; return this; } - /** - * Unexpected error - */ - public AtsApplicationsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsApplicationsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsApplicationsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getApplicationsResponse = Optional.empty(); + private GetApplicationsResponse getApplicationsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Applications - */ - public Builder getApplicationsResponse(GetApplicationsResponse getApplicationsResponse) { - Utils.checkNotNull(getApplicationsResponse, "getApplicationsResponse"); - this.getApplicationsResponse = Optional.ofNullable(getApplicationsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Applications */ - public Builder getApplicationsResponse(Optional getApplicationsResponse) { - Utils.checkNotNull(getApplicationsResponse, "getApplicationsResponse"); + public Builder getApplicationsResponse(@Nullable GetApplicationsResponse getApplicationsResponse) { this.getApplicationsResponse = getApplicationsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsApplicationsAllResponse build() { - return new AtsApplicationsAllResponse( contentType, statusCode, rawResponse, getApplicationsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteRequest.java index 6cfc3a1b..52da5e61 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AtsApplicationsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AtsApplicationsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AtsApplicationsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AtsApplicationsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AtsApplicationsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AtsApplicationsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AtsApplicationsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AtsApplicationsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsApplicationsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsApplicationsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsApplicationsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsApplicationsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsApplicationsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsApplicationsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsApplicationsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsApplicationsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AtsApplicationsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsApplicationsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AtsApplicationsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AtsApplicationsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteRequestBuilder.java index 3ed3afc8..5c197a98 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AtsApplicationsDeleteRequestBuilder { - - private AtsApplicationsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsApplicationsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsApplicationsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsApplicationsDeleteRequestBuilder request(AtsApplicationsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsApplicationsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsApplicationsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsApplicationsDeleteRequestBuilder request(@Nonnull AtsApplicationsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsApplicationsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsApplicationsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsApplicationsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteResponse.java index ddf6665d..8b22447c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsApplicationsDeleteResponse implements Response { /** * Applications */ - private Optional deleteApplicationResponse; + private DeleteApplicationResponse deleteApplicationResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsApplicationsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteApplicationResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteApplicationResponse, "deleteApplicationResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteApplicationResponse deleteApplicationResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteApplicationResponse = deleteApplicationResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsApplicationsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Applications */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteApplicationResponse() { - return (Optional) deleteApplicationResponse; + return Optional.ofNullable(this.deleteApplicationResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsApplicationsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsApplicationsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsApplicationsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsApplicationsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Applications + * Raw HTTP response; suitable for custom response parsing */ - public AtsApplicationsDeleteResponse withDeleteApplicationResponse(DeleteApplicationResponse deleteApplicationResponse) { - Utils.checkNotNull(deleteApplicationResponse, "deleteApplicationResponse"); - this.deleteApplicationResponse = Optional.ofNullable(deleteApplicationResponse); + public AtsApplicationsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsApplicationsDeleteResponse withDeleteApplicationResponse(DeleteApplica /** * Applications */ - public AtsApplicationsDeleteResponse withDeleteApplicationResponse(Optional deleteApplicationResponse) { - Utils.checkNotNull(deleteApplicationResponse, "deleteApplicationResponse"); + public AtsApplicationsDeleteResponse withDeleteApplicationResponse(@Nullable DeleteApplicationResponse deleteApplicationResponse) { this.deleteApplicationResponse = deleteApplicationResponse; return this; } - /** - * Unexpected error - */ - public AtsApplicationsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsApplicationsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsApplicationsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteApplicationResponse = Optional.empty(); + private DeleteApplicationResponse deleteApplicationResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Applications - */ - public Builder deleteApplicationResponse(DeleteApplicationResponse deleteApplicationResponse) { - Utils.checkNotNull(deleteApplicationResponse, "deleteApplicationResponse"); - this.deleteApplicationResponse = Optional.ofNullable(deleteApplicationResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Applications */ - public Builder deleteApplicationResponse(Optional deleteApplicationResponse) { - Utils.checkNotNull(deleteApplicationResponse, "deleteApplicationResponse"); + public Builder deleteApplicationResponse(@Nullable DeleteApplicationResponse deleteApplicationResponse) { this.deleteApplicationResponse = deleteApplicationResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsApplicationsDeleteResponse build() { - return new AtsApplicationsDeleteResponse( contentType, statusCode, rawResponse, deleteApplicationResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneRequest.java index 6b78dd05..be70da8c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class AtsApplicationsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public AtsApplicationsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public AtsApplicationsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AtsApplicationsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AtsApplicationsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AtsApplicationsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public AtsApplicationsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AtsApplicationsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsApplicationsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsApplicationsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsApplicationsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsApplicationsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsApplicationsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsApplicationsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsApplicationsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsApplicationsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AtsApplicationsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsApplicationsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public AtsApplicationsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AtsApplicationsOneRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneRequestBuilder.java index f767757e..6d0209e3 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AtsApplicationsOneRequestBuilder { - - private AtsApplicationsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsApplicationsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsApplicationsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsApplicationsOneRequestBuilder request(AtsApplicationsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsApplicationsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsApplicationsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsApplicationsOneRequestBuilder request(@Nonnull AtsApplicationsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsApplicationsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsApplicationsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsApplicationsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneResponse.java index 84b9b607..94af02e1 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsApplicationsOneResponse implements Response { /** * Applications */ - private Optional getApplicationResponse; + private GetApplicationResponse getApplicationResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsApplicationsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getApplicationResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getApplicationResponse, "getApplicationResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetApplicationResponse getApplicationResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getApplicationResponse = getApplicationResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsApplicationsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Applications */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getApplicationResponse() { - return (Optional) getApplicationResponse; + return Optional.ofNullable(this.getApplicationResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsApplicationsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsApplicationsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsApplicationsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsApplicationsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Applications + * Raw HTTP response; suitable for custom response parsing */ - public AtsApplicationsOneResponse withGetApplicationResponse(GetApplicationResponse getApplicationResponse) { - Utils.checkNotNull(getApplicationResponse, "getApplicationResponse"); - this.getApplicationResponse = Optional.ofNullable(getApplicationResponse); + public AtsApplicationsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsApplicationsOneResponse withGetApplicationResponse(GetApplicationRespo /** * Applications */ - public AtsApplicationsOneResponse withGetApplicationResponse(Optional getApplicationResponse) { - Utils.checkNotNull(getApplicationResponse, "getApplicationResponse"); + public AtsApplicationsOneResponse withGetApplicationResponse(@Nullable GetApplicationResponse getApplicationResponse) { this.getApplicationResponse = getApplicationResponse; return this; } - /** - * Unexpected error - */ - public AtsApplicationsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsApplicationsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsApplicationsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getApplicationResponse = Optional.empty(); + private GetApplicationResponse getApplicationResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Applications - */ - public Builder getApplicationResponse(GetApplicationResponse getApplicationResponse) { - Utils.checkNotNull(getApplicationResponse, "getApplicationResponse"); - this.getApplicationResponse = Optional.ofNullable(getApplicationResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Applications */ - public Builder getApplicationResponse(Optional getApplicationResponse) { - Utils.checkNotNull(getApplicationResponse, "getApplicationResponse"); + public Builder getApplicationResponse(@Nullable GetApplicationResponse getApplicationResponse) { this.getApplicationResponse = getApplicationResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsApplicationsOneResponse build() { - return new AtsApplicationsOneResponse( contentType, statusCode, rawResponse, getApplicationResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateRequest.java index 334565ce..27f2fa60 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AtsApplicationsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class AtsApplicationsUpdateRequest { @JsonCreator public AtsApplicationsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - ApplicationInput application) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(application, "application"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull ApplicationInput application) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.application = application; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.application = Optional.ofNullable(application) + .orElseThrow(() -> new IllegalArgumentException("application cannot be null")); } public AtsApplicationsUpdateRequest( - String id, - ApplicationInput application) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), application); + @Nonnull String id, + @Nonnull ApplicationInput application) { + this(id, null, null, + null, null, application); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public ApplicationInput application() { - return application; + return this.application; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AtsApplicationsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AtsApplicationsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AtsApplicationsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public AtsApplicationsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AtsApplicationsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsApplicationsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsApplicationsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsApplicationsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsApplicationsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsApplicationsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsApplicationsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsApplicationsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsApplicationsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AtsApplicationsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsApplicationsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public AtsApplicationsUpdateRequest withApplication(ApplicationInput application) { - Utils.checkNotNull(application, "application"); - this.application = application; + + public AtsApplicationsUpdateRequest withApplication(@Nonnull ApplicationInput application) { + this.application = Utils.checkNotNull(application, "application"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private ApplicationInput application; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder application(ApplicationInput application) { - Utils.checkNotNull(application, "application"); - this.application = application; + public Builder application(@Nonnull ApplicationInput application) { + this.application = Utils.checkNotNull(application, "application"); return this; } public AtsApplicationsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AtsApplicationsUpdateRequest( id, consumerId, appId, serviceId, raw, application); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateRequestBuilder.java index e731f303..dbed6a92 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AtsApplicationsUpdateRequestBuilder { - - private AtsApplicationsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsApplicationsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsApplicationsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsApplicationsUpdateRequestBuilder request(AtsApplicationsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsApplicationsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsApplicationsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsApplicationsUpdateRequestBuilder request(@Nonnull AtsApplicationsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsApplicationsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsApplicationsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsApplicationsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateResponse.java index 5294eae2..860fb670 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsApplicationsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsApplicationsUpdateResponse implements Response { /** * Applications */ - private Optional updateApplicationResponse; + private UpdateApplicationResponse updateApplicationResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsApplicationsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateApplicationResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateApplicationResponse, "updateApplicationResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateApplicationResponse updateApplicationResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateApplicationResponse = updateApplicationResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsApplicationsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Applications */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateApplicationResponse() { - return (Optional) updateApplicationResponse; + return Optional.ofNullable(this.updateApplicationResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsApplicationsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsApplicationsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsApplicationsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsApplicationsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Applications + * Raw HTTP response; suitable for custom response parsing */ - public AtsApplicationsUpdateResponse withUpdateApplicationResponse(UpdateApplicationResponse updateApplicationResponse) { - Utils.checkNotNull(updateApplicationResponse, "updateApplicationResponse"); - this.updateApplicationResponse = Optional.ofNullable(updateApplicationResponse); + public AtsApplicationsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsApplicationsUpdateResponse withUpdateApplicationResponse(UpdateApplica /** * Applications */ - public AtsApplicationsUpdateResponse withUpdateApplicationResponse(Optional updateApplicationResponse) { - Utils.checkNotNull(updateApplicationResponse, "updateApplicationResponse"); + public AtsApplicationsUpdateResponse withUpdateApplicationResponse(@Nullable UpdateApplicationResponse updateApplicationResponse) { this.updateApplicationResponse = updateApplicationResponse; return this; } - /** - * Unexpected error - */ - public AtsApplicationsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsApplicationsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsApplicationsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateApplicationResponse = Optional.empty(); + private UpdateApplicationResponse updateApplicationResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Applications - */ - public Builder updateApplicationResponse(UpdateApplicationResponse updateApplicationResponse) { - Utils.checkNotNull(updateApplicationResponse, "updateApplicationResponse"); - this.updateApplicationResponse = Optional.ofNullable(updateApplicationResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Applications */ - public Builder updateApplicationResponse(Optional updateApplicationResponse) { - Utils.checkNotNull(updateApplicationResponse, "updateApplicationResponse"); + public Builder updateApplicationResponse(@Nullable UpdateApplicationResponse updateApplicationResponse) { this.updateApplicationResponse = updateApplicationResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsApplicationsUpdateResponse build() { - return new AtsApplicationsUpdateResponse( contentType, statusCode, rawResponse, updateApplicationResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsJobsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsJobsAllRequest.java index bdfdf404..8a935b2d 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsJobsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsJobsAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class AtsJobsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class AtsJobsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class AtsJobsAllRequest { @JsonCreator public AtsJobsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AtsJobsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public AtsJobsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsJobsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsJobsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public AtsJobsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public AtsJobsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsJobsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsJobsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsJobsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsJobsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsJobsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsJobsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsJobsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public AtsJobsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public AtsJobsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public AtsJobsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public AtsJobsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public AtsJobsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public AtsJobsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public AtsJobsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public AtsJobsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public AtsJobsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public AtsJobsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AtsJobsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AtsJobsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AtsJobsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AtsJobsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new AtsJobsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public AtsJobsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsJobsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsJobsAllRequestBuilder.java index bd33134e..8c045d2c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsJobsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsJobsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class AtsJobsAllRequestBuilder { - - private AtsJobsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsJobsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsJobsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsJobsAllRequestBuilder request(AtsJobsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsJobsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsJobsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsJobsAllRequestBuilder request(@Nonnull AtsJobsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsJobsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsJobsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsJobsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public AtsJobsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new AtsJobsAllOperation( - sdkConfiguration, - options); + AtsJobsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new AtsJobsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - AtsJobsAllRequest::withCursor, + AtsJobsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsJobsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsJobsAllResponse.java index 188a56e1..05277bba 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsJobsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsJobsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsJobsAllResponse implements Response { /** * Jobs */ - private Optional getJobsResponse; + private GetJobsResponse getJobsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsJobsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getJobsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getJobsResponse, "getJobsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetJobsResponse getJobsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getJobsResponse = getJobsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsJobsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Jobs */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getJobsResponse() { - return (Optional) getJobsResponse; + return Optional.ofNullable(this.getJobsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsJobsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsJobsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsJobsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsJobsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Jobs + * Raw HTTP response; suitable for custom response parsing */ - public AtsJobsAllResponse withGetJobsResponse(GetJobsResponse getJobsResponse) { - Utils.checkNotNull(getJobsResponse, "getJobsResponse"); - this.getJobsResponse = Optional.ofNullable(getJobsResponse); + public AtsJobsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsJobsAllResponse withGetJobsResponse(GetJobsResponse getJobsResponse) { /** * Jobs */ - public AtsJobsAllResponse withGetJobsResponse(Optional getJobsResponse) { - Utils.checkNotNull(getJobsResponse, "getJobsResponse"); + public AtsJobsAllResponse withGetJobsResponse(@Nullable GetJobsResponse getJobsResponse) { this.getJobsResponse = getJobsResponse; return this; } - /** - * Unexpected error - */ - public AtsJobsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsJobsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsJobsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getJobsResponse = Optional.empty(); + private GetJobsResponse getJobsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Jobs - */ - public Builder getJobsResponse(GetJobsResponse getJobsResponse) { - Utils.checkNotNull(getJobsResponse, "getJobsResponse"); - this.getJobsResponse = Optional.ofNullable(getJobsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Jobs */ - public Builder getJobsResponse(Optional getJobsResponse) { - Utils.checkNotNull(getJobsResponse, "getJobsResponse"); + public Builder getJobsResponse(@Nullable GetJobsResponse getJobsResponse) { this.getJobsResponse = getJobsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsJobsAllResponse build() { - return new AtsJobsAllResponse( contentType, statusCode, rawResponse, getJobsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/AtsJobsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/AtsJobsOneRequest.java index b94c1fdc..8dda2cd7 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsJobsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsJobsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class AtsJobsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class AtsJobsOneRequest { @JsonCreator public AtsJobsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public AtsJobsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public AtsJobsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public AtsJobsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public AtsJobsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public AtsJobsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public AtsJobsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public AtsJobsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public AtsJobsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public AtsJobsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public AtsJobsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public AtsJobsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public AtsJobsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public AtsJobsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public AtsJobsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public AtsJobsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public AtsJobsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public AtsJobsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public AtsJobsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public AtsJobsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public AtsJobsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new AtsJobsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsJobsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/AtsJobsOneRequestBuilder.java index 147029d6..566c543c 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsJobsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsJobsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class AtsJobsOneRequestBuilder { - - private AtsJobsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private AtsJobsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public AtsJobsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public AtsJobsOneRequestBuilder request(AtsJobsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public AtsJobsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public AtsJobsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public AtsJobsOneRequestBuilder request(@Nonnull AtsJobsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private AtsJobsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public AtsJobsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new AtsJobsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/AtsJobsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/AtsJobsOneResponse.java index 77d959d3..b0064514 100644 --- a/src/main/java/com/apideck/unify/models/operations/AtsJobsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/AtsJobsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class AtsJobsOneResponse implements Response { /** * Jobs */ - private Optional getJobResponse; + private GetJobResponse getJobResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public AtsJobsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getJobResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getJobResponse, "getJobResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetJobResponse getJobResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getJobResponse = getJobResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public AtsJobsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Jobs */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getJobResponse() { - return (Optional) getJobResponse; + return Optional.ofNullable(this.getJobResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public AtsJobsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public AtsJobsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public AtsJobsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public AtsJobsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Jobs + * Raw HTTP response; suitable for custom response parsing */ - public AtsJobsOneResponse withGetJobResponse(GetJobResponse getJobResponse) { - Utils.checkNotNull(getJobResponse, "getJobResponse"); - this.getJobResponse = Optional.ofNullable(getJobResponse); + public AtsJobsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public AtsJobsOneResponse withGetJobResponse(GetJobResponse getJobResponse) { /** * Jobs */ - public AtsJobsOneResponse withGetJobResponse(Optional getJobResponse) { - Utils.checkNotNull(getJobResponse, "getJobResponse"); + public AtsJobsOneResponse withGetJobResponse(@Nullable GetJobResponse getJobResponse) { this.getJobResponse = getJobResponse; return this; } - /** - * Unexpected error - */ - public AtsJobsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public AtsJobsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public AtsJobsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getJobResponse = Optional.empty(); + private GetJobResponse getJobResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Jobs - */ - public Builder getJobResponse(GetJobResponse getJobResponse) { - Utils.checkNotNull(getJobResponse, "getJobResponse"); - this.getJobResponse = Optional.ofNullable(getJobResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Jobs */ - public Builder getJobResponse(Optional getJobResponse) { - Utils.checkNotNull(getJobResponse, "getJobResponse"); + public Builder getJobResponse(@Nullable GetJobResponse getJobResponse) { this.getJobResponse = getJobResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public AtsJobsOneResponse build() { - return new AtsJobsOneResponse( contentType, statusCode, rawResponse, getJobResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneRequest.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneRequest.java index 9af5a01c..ec381562 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,7 +18,7 @@ public class ConnectorApiResourceCoverageOneRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the record you are acting upon. @@ -33,45 +34,41 @@ public class ConnectorApiResourceCoverageOneRequest { @JsonCreator public ConnectorApiResourceCoverageOneRequest( - Optional appId, - String id, - String resourceId) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(resourceId, "resourceId"); + @Nullable String appId, + @Nonnull String id, + @Nonnull String resourceId) { this.appId = appId; - this.id = id; - this.resourceId = resourceId; + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.resourceId = Optional.ofNullable(resourceId) + .orElseThrow(() -> new IllegalArgumentException("resourceId cannot be null")); } public ConnectorApiResourceCoverageOneRequest( - String id, - String resourceId) { - this(Optional.empty(), id, resourceId); + @Nonnull String id, + @Nonnull String resourceId) { + this(null, id, resourceId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the resource you are acting upon. */ - @JsonIgnore public String resourceId() { - return resourceId; + return this.resourceId; } public static Builder builder() { @@ -82,40 +79,30 @@ public static Builder builder() { /** * The ID of your Unify application */ - public ConnectorApiResourceCoverageOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public ConnectorApiResourceCoverageOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public ConnectorApiResourceCoverageOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * ID of the record you are acting upon. */ - public ConnectorApiResourceCoverageOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public ConnectorApiResourceCoverageOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * ID of the resource you are acting upon. */ - public ConnectorApiResourceCoverageOneRequest withResourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = resourceId; + public ConnectorApiResourceCoverageOneRequest withResourceId(@Nonnull String resourceId) { + this.resourceId = Utils.checkNotNull(resourceId, "resourceId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -148,7 +135,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private String id; @@ -158,47 +145,31 @@ private Builder() { // force use of static builder() method } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * ID of the resource you are acting upon. */ - public Builder resourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = resourceId; + public Builder resourceId(@Nonnull String resourceId) { + this.resourceId = Utils.checkNotNull(resourceId, "resourceId"); return this; } public ConnectorApiResourceCoverageOneRequest build() { - return new ConnectorApiResourceCoverageOneRequest( appId, id, resourceId); } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneRequestBuilder.java index a8d50ef3..2e938e02 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneRequestBuilder.java @@ -10,79 +10,65 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class ConnectorApiResourceCoverageOneRequestBuilder { - - private Optional appId = Optional.empty(); - private String id; - private String resourceId; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final ConnectorApiResourceCoverageOneRequest.Builder pojoBuilder; + private ConnectorApiResourceCoverageOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public ConnectorApiResourceCoverageOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public ConnectorApiResourceCoverageOneRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = ConnectorApiResourceCoverageOneRequest.builder(); + this.optionsBuilder = Options.builder(); } - public ConnectorApiResourceCoverageOneRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public ConnectorApiResourceCoverageOneRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public ConnectorApiResourceCoverageOneRequestBuilder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public ConnectorApiResourceCoverageOneRequestBuilder id(@Nonnull String id) { + this.pojoBuilder.id(id); + this._setterCalled = true; return this; } - public ConnectorApiResourceCoverageOneRequestBuilder resourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = resourceId; - return this; - } - - public ConnectorApiResourceCoverageOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public ConnectorApiResourceCoverageOneRequestBuilder resourceId(@Nonnull String resourceId) { + this.pojoBuilder.resourceId(resourceId); + this._setterCalled = true; return this; } - public ConnectorApiResourceCoverageOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public ConnectorApiResourceCoverageOneRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private ConnectorApiResourceCoverageOneRequest buildRequest() { - - ConnectorApiResourceCoverageOneRequest request = new ConnectorApiResourceCoverageOneRequest(appId, - id, - resourceId); - - return request; + private ConnectorApiResourceCoverageOneRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public ConnectorApiResourceCoverageOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new ConnectorApiResourceCoverageOneOperation( sdkConfiguration, options); - ConnectorApiResourceCoverageOneRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneResponse.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneResponse.java index 6bee2361..def06682 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourceCoverageOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class ConnectorApiResourceCoverageOneResponse implements Response { /** * ApiResources */ - private Optional getApiResourceCoverageResponse; + private GetApiResourceCoverageResponse getApiResourceCoverageResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public ConnectorApiResourceCoverageOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getApiResourceCoverageResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getApiResourceCoverageResponse, "getApiResourceCoverageResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetApiResourceCoverageResponse getApiResourceCoverageResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getApiResourceCoverageResponse = getApiResourceCoverageResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public ConnectorApiResourceCoverageOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * ApiResources */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getApiResourceCoverageResponse() { - return (Optional) getApiResourceCoverageResponse; + return Optional.ofNullable(this.getApiResourceCoverageResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public ConnectorApiResourceCoverageOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public ConnectorApiResourceCoverageOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public ConnectorApiResourceCoverageOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public ConnectorApiResourceCoverageOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * ApiResources + * Raw HTTP response; suitable for custom response parsing */ - public ConnectorApiResourceCoverageOneResponse withGetApiResourceCoverageResponse(GetApiResourceCoverageResponse getApiResourceCoverageResponse) { - Utils.checkNotNull(getApiResourceCoverageResponse, "getApiResourceCoverageResponse"); - this.getApiResourceCoverageResponse = Optional.ofNullable(getApiResourceCoverageResponse); + public ConnectorApiResourceCoverageOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public ConnectorApiResourceCoverageOneResponse withGetApiResourceCoverageRespons /** * ApiResources */ - public ConnectorApiResourceCoverageOneResponse withGetApiResourceCoverageResponse(Optional getApiResourceCoverageResponse) { - Utils.checkNotNull(getApiResourceCoverageResponse, "getApiResourceCoverageResponse"); + public ConnectorApiResourceCoverageOneResponse withGetApiResourceCoverageResponse(@Nullable GetApiResourceCoverageResponse getApiResourceCoverageResponse) { this.getApiResourceCoverageResponse = getApiResourceCoverageResponse; return this; } - /** - * Unexpected error - */ - public ConnectorApiResourceCoverageOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public ConnectorApiResourceCoverageOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public ConnectorApiResourceCoverageOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getApiResourceCoverageResponse = Optional.empty(); + private GetApiResourceCoverageResponse getApiResourceCoverageResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * ApiResources - */ - public Builder getApiResourceCoverageResponse(GetApiResourceCoverageResponse getApiResourceCoverageResponse) { - Utils.checkNotNull(getApiResourceCoverageResponse, "getApiResourceCoverageResponse"); - this.getApiResourceCoverageResponse = Optional.ofNullable(getApiResourceCoverageResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * ApiResources */ - public Builder getApiResourceCoverageResponse(Optional getApiResourceCoverageResponse) { - Utils.checkNotNull(getApiResourceCoverageResponse, "getApiResourceCoverageResponse"); + public Builder getApiResourceCoverageResponse(@Nullable GetApiResourceCoverageResponse getApiResourceCoverageResponse) { this.getApiResourceCoverageResponse = getApiResourceCoverageResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public ConnectorApiResourceCoverageOneResponse build() { - return new ConnectorApiResourceCoverageOneResponse( contentType, statusCode, rawResponse, getApiResourceCoverageResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneRequest.java index aebef992..7ccafd39 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,7 +18,7 @@ public class ConnectorApiResourcesOneRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the record you are acting upon. @@ -33,45 +34,41 @@ public class ConnectorApiResourcesOneRequest { @JsonCreator public ConnectorApiResourcesOneRequest( - Optional appId, - String id, - String resourceId) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(resourceId, "resourceId"); + @Nullable String appId, + @Nonnull String id, + @Nonnull String resourceId) { this.appId = appId; - this.id = id; - this.resourceId = resourceId; + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.resourceId = Optional.ofNullable(resourceId) + .orElseThrow(() -> new IllegalArgumentException("resourceId cannot be null")); } public ConnectorApiResourcesOneRequest( - String id, - String resourceId) { - this(Optional.empty(), id, resourceId); + @Nonnull String id, + @Nonnull String resourceId) { + this(null, id, resourceId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the resource you are acting upon. */ - @JsonIgnore public String resourceId() { - return resourceId; + return this.resourceId; } public static Builder builder() { @@ -82,40 +79,30 @@ public static Builder builder() { /** * The ID of your Unify application */ - public ConnectorApiResourcesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public ConnectorApiResourcesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public ConnectorApiResourcesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * ID of the record you are acting upon. */ - public ConnectorApiResourcesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public ConnectorApiResourcesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * ID of the resource you are acting upon. */ - public ConnectorApiResourcesOneRequest withResourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = resourceId; + public ConnectorApiResourcesOneRequest withResourceId(@Nonnull String resourceId) { + this.resourceId = Utils.checkNotNull(resourceId, "resourceId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -148,7 +135,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private String id; @@ -158,47 +145,31 @@ private Builder() { // force use of static builder() method } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * ID of the resource you are acting upon. */ - public Builder resourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = resourceId; + public Builder resourceId(@Nonnull String resourceId) { + this.resourceId = Utils.checkNotNull(resourceId, "resourceId"); return this; } public ConnectorApiResourcesOneRequest build() { - return new ConnectorApiResourcesOneRequest( appId, id, resourceId); } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneRequestBuilder.java index 77d3a980..c4b5fe1a 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneRequestBuilder.java @@ -10,79 +10,65 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class ConnectorApiResourcesOneRequestBuilder { - - private Optional appId = Optional.empty(); - private String id; - private String resourceId; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final ConnectorApiResourcesOneRequest.Builder pojoBuilder; + private ConnectorApiResourcesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public ConnectorApiResourcesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public ConnectorApiResourcesOneRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = ConnectorApiResourcesOneRequest.builder(); + this.optionsBuilder = Options.builder(); } - public ConnectorApiResourcesOneRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public ConnectorApiResourcesOneRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public ConnectorApiResourcesOneRequestBuilder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public ConnectorApiResourcesOneRequestBuilder id(@Nonnull String id) { + this.pojoBuilder.id(id); + this._setterCalled = true; return this; } - public ConnectorApiResourcesOneRequestBuilder resourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = resourceId; - return this; - } - - public ConnectorApiResourcesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public ConnectorApiResourcesOneRequestBuilder resourceId(@Nonnull String resourceId) { + this.pojoBuilder.resourceId(resourceId); + this._setterCalled = true; return this; } - public ConnectorApiResourcesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public ConnectorApiResourcesOneRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private ConnectorApiResourcesOneRequest buildRequest() { - - ConnectorApiResourcesOneRequest request = new ConnectorApiResourcesOneRequest(appId, - id, - resourceId); - - return request; + private ConnectorApiResourcesOneRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public ConnectorApiResourcesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new ConnectorApiResourcesOneOperation( sdkConfiguration, options); - ConnectorApiResourcesOneRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneResponse.java index 6a439d3c..00ece8ff 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApiResourcesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class ConnectorApiResourcesOneResponse implements Response { /** * ApiResources */ - private Optional getApiResourceResponse; + private GetApiResourceResponse getApiResourceResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public ConnectorApiResourcesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getApiResourceResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getApiResourceResponse, "getApiResourceResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetApiResourceResponse getApiResourceResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getApiResourceResponse = getApiResourceResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public ConnectorApiResourcesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * ApiResources */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getApiResourceResponse() { - return (Optional) getApiResourceResponse; + return Optional.ofNullable(this.getApiResourceResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public ConnectorApiResourcesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public ConnectorApiResourcesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public ConnectorApiResourcesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public ConnectorApiResourcesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * ApiResources + * Raw HTTP response; suitable for custom response parsing */ - public ConnectorApiResourcesOneResponse withGetApiResourceResponse(GetApiResourceResponse getApiResourceResponse) { - Utils.checkNotNull(getApiResourceResponse, "getApiResourceResponse"); - this.getApiResourceResponse = Optional.ofNullable(getApiResourceResponse); + public ConnectorApiResourcesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public ConnectorApiResourcesOneResponse withGetApiResourceResponse(GetApiResourc /** * ApiResources */ - public ConnectorApiResourcesOneResponse withGetApiResourceResponse(Optional getApiResourceResponse) { - Utils.checkNotNull(getApiResourceResponse, "getApiResourceResponse"); + public ConnectorApiResourcesOneResponse withGetApiResourceResponse(@Nullable GetApiResourceResponse getApiResourceResponse) { this.getApiResourceResponse = getApiResourceResponse; return this; } - /** - * Unexpected error - */ - public ConnectorApiResourcesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public ConnectorApiResourcesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public ConnectorApiResourcesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getApiResourceResponse = Optional.empty(); + private GetApiResourceResponse getApiResourceResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * ApiResources - */ - public Builder getApiResourceResponse(GetApiResourceResponse getApiResourceResponse) { - Utils.checkNotNull(getApiResourceResponse, "getApiResourceResponse"); - this.getApiResourceResponse = Optional.ofNullable(getApiResourceResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * ApiResources */ - public Builder getApiResourceResponse(Optional getApiResourceResponse) { - Utils.checkNotNull(getApiResourceResponse, "getApiResourceResponse"); + public Builder getApiResourceResponse(@Nullable GetApiResourceResponse getApiResourceResponse) { this.getApiResourceResponse = getApiResourceResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public ConnectorApiResourcesOneResponse build() { - return new ConnectorApiResourcesOneResponse( contentType, statusCode, rawResponse, getApiResourceResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllRequest.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllRequest.java index 79460d5f..d0550f4c 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllRequest.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,7 +22,7 @@ public class ConnectorApisAllRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -35,66 +34,59 @@ public class ConnectorApisAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private ApisFilter filter; @JsonCreator public ConnectorApisAllRequest( - Optional appId, - JsonNullable cursor, - Optional limit, - Optional filter) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); + @Nullable String appId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable ApisFilter filter) { this.appId = appId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; } public ConnectorApisAllRequest() { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } public static Builder builder() { @@ -105,46 +97,17 @@ public static Builder builder() { /** * The ID of your Unify application */ - public ConnectorApisAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public ConnectorApisAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public ConnectorApisAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public ConnectorApisAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public ConnectorApisAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public ConnectorApisAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public ConnectorApisAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -152,31 +115,21 @@ public ConnectorApisAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public ConnectorApisAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public ConnectorApisAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public ConnectorApisAllRequest withFilter(ApisFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public ConnectorApisAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public ConnectorApisAllRequest withFilter(@Nullable ApisFilter filter) { this.filter = filter; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -212,109 +165,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private ApisFilter filter; private Builder() { // force use of static builder() method } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - - /** - * Apply filters - */ - public Builder filter(ApisFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable ApisFilter filter) { this.filter = filter; return this; } public ConnectorApisAllRequest build() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new ConnectorApisAllRequest( appId, cursor, limit, filter); } - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllRequestBuilder.java index 90741faf..61e9e329 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllRequestBuilder.java @@ -11,13 +11,11 @@ import com.apideck.unify.SDKConfiguration; import com.apideck.unify.models.components.ApisFilter; import com.apideck.unify.operations.ConnectorApisAllOperation; -import com.apideck.unify.utils.LazySingletonValue; import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; -import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; -import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; @@ -25,114 +23,72 @@ import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; import org.openapitools.jackson.nullable.JsonNullable; public class ConnectorApisAllRequestBuilder { - - private Optional appId = Optional.empty(); - private JsonNullable cursor = JsonNullable.undefined(); - private Optional limit = Utils.readDefaultOrConstValue( - "limit", - "20", - new TypeReference>() {}); - private Optional filter = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final ConnectorApisAllRequest.Builder pojoBuilder; + private ConnectorApisAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public ConnectorApisAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public ConnectorApisAllRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = ConnectorApisAllRequest.builder(); + this.optionsBuilder = Options.builder(); } - public ConnectorApisAllRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public ConnectorApisAllRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public ConnectorApisAllRequestBuilder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); + public ConnectorApisAllRequestBuilder cursor(@Nullable String cursor) { + this.pojoBuilder.cursor(cursor); + this._setterCalled = true; return this; } - public ConnectorApisAllRequestBuilder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - public ConnectorApisAllRequestBuilder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.of(limit); + public ConnectorApisAllRequestBuilder limit(@Nullable Long limit) { + this.pojoBuilder.limit(limit); + this._setterCalled = true; return this; } - public ConnectorApisAllRequestBuilder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = limit; - return this; - } - - public ConnectorApisAllRequestBuilder filter(ApisFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.of(filter); + public ConnectorApisAllRequestBuilder filter(@Nullable ApisFilter filter) { + this.pojoBuilder.filter(filter); + this._setterCalled = true; return this; } - public ConnectorApisAllRequestBuilder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = filter; - return this; - } - public ConnectorApisAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); - return this; - } - - public ConnectorApisAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private ConnectorApisAllRequest buildRequest() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); + private ConnectorApisAllRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); } - - ConnectorApisAllRequest request = new ConnectorApisAllRequest(appId, - cursor, - limit, - filter); - - return request; + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public ConnectorApisAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new ConnectorApisAllOperation( sdkConfiguration, options); - ConnectorApisAllRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -147,36 +103,27 @@ public ConnectorApisAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new ConnectorApisAllOperation( - sdkConfiguration, - options); - ConnectorApisAllRequest request = buildRequest(); + ConnectorApisAllRequest request = pojoBuilder.build(); + Options options = optionsBuilder.build(); + RequestOperation operation = + new ConnectorApisAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - ConnectorApisAllRequest::withCursor, + ConnectorApisAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - - - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = - new LazySingletonValue<>( - "limit", - "20", - new TypeReference>() {}); } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllResponse.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllResponse.java index b015bef2..88b319ba 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApisAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class ConnectorApisAllResponse implements Response { /** * Apis */ - private Optional getApisResponse; + private GetApisResponse getApisResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public ConnectorApisAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getApisResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getApisResponse, "getApisResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetApisResponse getApisResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getApisResponse = getApisResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public ConnectorApisAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Apis */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getApisResponse() { - return (Optional) getApisResponse; + return Optional.ofNullable(this.getApisResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public ConnectorApisAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public ConnectorApisAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public ConnectorApisAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public ConnectorApisAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Apis + * Raw HTTP response; suitable for custom response parsing */ - public ConnectorApisAllResponse withGetApisResponse(GetApisResponse getApisResponse) { - Utils.checkNotNull(getApisResponse, "getApisResponse"); - this.getApisResponse = Optional.ofNullable(getApisResponse); + public ConnectorApisAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public ConnectorApisAllResponse withGetApisResponse(GetApisResponse getApisRespo /** * Apis */ - public ConnectorApisAllResponse withGetApisResponse(Optional getApisResponse) { - Utils.checkNotNull(getApisResponse, "getApisResponse"); + public ConnectorApisAllResponse withGetApisResponse(@Nullable GetApisResponse getApisResponse) { this.getApisResponse = getApisResponse; return this; } - /** - * Unexpected error - */ - public ConnectorApisAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public ConnectorApisAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public ConnectorApisAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getApisResponse = Optional.empty(); + private GetApisResponse getApisResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Apis - */ - public Builder getApisResponse(GetApisResponse getApisResponse) { - Utils.checkNotNull(getApisResponse, "getApisResponse"); - this.getApisResponse = Optional.ofNullable(getApisResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Apis */ - public Builder getApisResponse(Optional getApisResponse) { - Utils.checkNotNull(getApisResponse, "getApisResponse"); + public Builder getApisResponse(@Nullable GetApisResponse getApisResponse) { this.getApisResponse = getApisResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public ConnectorApisAllResponse build() { - return new ConnectorApisAllResponse( contentType, statusCode, rawResponse, getApisResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneRequest.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneRequest.java index 145c6545..71d048d6 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,7 +18,7 @@ public class ConnectorApisOneRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the record you are acting upon. @@ -27,33 +28,30 @@ public class ConnectorApisOneRequest { @JsonCreator public ConnectorApisOneRequest( - Optional appId, - String id) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(id, "id"); + @Nullable String appId, + @Nonnull String id) { this.appId = appId; - this.id = id; + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); } public ConnectorApisOneRequest( - String id) { - this(Optional.empty(), id); + @Nonnull String id) { + this(null, id); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } public static Builder builder() { @@ -64,31 +62,21 @@ public static Builder builder() { /** * The ID of your Unify application */ - public ConnectorApisOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public ConnectorApisOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public ConnectorApisOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * ID of the record you are acting upon. */ - public ConnectorApisOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public ConnectorApisOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -119,7 +107,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private String id; @@ -127,37 +115,23 @@ private Builder() { // force use of static builder() method } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } public ConnectorApisOneRequest build() { - return new ConnectorApisOneRequest( appId, id); } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneRequestBuilder.java index 5143b3e8..f15f3bb1 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneRequestBuilder.java @@ -10,71 +10,59 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class ConnectorApisOneRequestBuilder { - - private Optional appId = Optional.empty(); - private String id; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final ConnectorApisOneRequest.Builder pojoBuilder; + private ConnectorApisOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public ConnectorApisOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public ConnectorApisOneRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = ConnectorApisOneRequest.builder(); + this.optionsBuilder = Options.builder(); } - public ConnectorApisOneRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public ConnectorApisOneRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public ConnectorApisOneRequestBuilder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - public ConnectorApisOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public ConnectorApisOneRequestBuilder id(@Nonnull String id) { + this.pojoBuilder.id(id); + this._setterCalled = true; return this; } - public ConnectorApisOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public ConnectorApisOneRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private ConnectorApisOneRequest buildRequest() { - - ConnectorApisOneRequest request = new ConnectorApisOneRequest(appId, - id); - - return request; + private ConnectorApisOneRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public ConnectorApisOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new ConnectorApisOneOperation( sdkConfiguration, options); - ConnectorApisOneRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneResponse.java b/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneResponse.java index 422b6449..ddb6fe6d 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorApisOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class ConnectorApisOneResponse implements Response { /** * Apis */ - private Optional getApiResponse; + private GetApiResponse getApiResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public ConnectorApisOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getApiResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getApiResponse, "getApiResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetApiResponse getApiResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getApiResponse = getApiResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public ConnectorApisOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Apis */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getApiResponse() { - return (Optional) getApiResponse; + return Optional.ofNullable(this.getApiResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public ConnectorApisOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public ConnectorApisOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public ConnectorApisOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public ConnectorApisOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Apis + * Raw HTTP response; suitable for custom response parsing */ - public ConnectorApisOneResponse withGetApiResponse(GetApiResponse getApiResponse) { - Utils.checkNotNull(getApiResponse, "getApiResponse"); - this.getApiResponse = Optional.ofNullable(getApiResponse); + public ConnectorApisOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public ConnectorApisOneResponse withGetApiResponse(GetApiResponse getApiResponse /** * Apis */ - public ConnectorApisOneResponse withGetApiResponse(Optional getApiResponse) { - Utils.checkNotNull(getApiResponse, "getApiResponse"); + public ConnectorApisOneResponse withGetApiResponse(@Nullable GetApiResponse getApiResponse) { this.getApiResponse = getApiResponse; return this; } - /** - * Unexpected error - */ - public ConnectorApisOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public ConnectorApisOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public ConnectorApisOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getApiResponse = Optional.empty(); + private GetApiResponse getApiResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Apis - */ - public Builder getApiResponse(GetApiResponse getApiResponse) { - Utils.checkNotNull(getApiResponse, "getApiResponse"); - this.getApiResponse = Optional.ofNullable(getApiResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Apis */ - public Builder getApiResponse(Optional getApiResponse) { - Utils.checkNotNull(getApiResponse, "getApiResponse"); + public Builder getApiResponse(@Nullable GetApiResponse getApiResponse) { this.getApiResponse = getApiResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public ConnectorApisOneResponse build() { - return new ConnectorApisOneResponse( contentType, statusCode, rawResponse, getApiResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneRequest.java index 4981c196..88fdc4b7 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,7 +18,7 @@ public class ConnectorConnectorDocsOneRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the record you are acting upon. @@ -33,45 +34,41 @@ public class ConnectorConnectorDocsOneRequest { @JsonCreator public ConnectorConnectorDocsOneRequest( - Optional appId, - String id, - String docId) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(docId, "docId"); + @Nullable String appId, + @Nonnull String id, + @Nonnull String docId) { this.appId = appId; - this.id = id; - this.docId = docId; + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.docId = Optional.ofNullable(docId) + .orElseThrow(() -> new IllegalArgumentException("docId cannot be null")); } public ConnectorConnectorDocsOneRequest( - String id, - String docId) { - this(Optional.empty(), id, docId); + @Nonnull String id, + @Nonnull String docId) { + this(null, id, docId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the Doc */ - @JsonIgnore public String docId() { - return docId; + return this.docId; } public static Builder builder() { @@ -82,40 +79,30 @@ public static Builder builder() { /** * The ID of your Unify application */ - public ConnectorConnectorDocsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public ConnectorConnectorDocsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public ConnectorConnectorDocsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * ID of the record you are acting upon. */ - public ConnectorConnectorDocsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public ConnectorConnectorDocsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + /** * ID of the Doc */ - public ConnectorConnectorDocsOneRequest withDocId(String docId) { - Utils.checkNotNull(docId, "docId"); - this.docId = docId; + public ConnectorConnectorDocsOneRequest withDocId(@Nonnull String docId) { + this.docId = Utils.checkNotNull(docId, "docId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -148,7 +135,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private String id; @@ -158,47 +145,31 @@ private Builder() { // force use of static builder() method } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * ID of the Doc */ - public Builder docId(String docId) { - Utils.checkNotNull(docId, "docId"); - this.docId = docId; + public Builder docId(@Nonnull String docId) { + this.docId = Utils.checkNotNull(docId, "docId"); return this; } public ConnectorConnectorDocsOneRequest build() { - return new ConnectorConnectorDocsOneRequest( appId, id, docId); } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneRequestBuilder.java index 1f47a0b3..5c29807c 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneRequestBuilder.java @@ -10,79 +10,65 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class ConnectorConnectorDocsOneRequestBuilder { - - private Optional appId = Optional.empty(); - private String id; - private String docId; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final ConnectorConnectorDocsOneRequest.Builder pojoBuilder; + private ConnectorConnectorDocsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public ConnectorConnectorDocsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public ConnectorConnectorDocsOneRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = ConnectorConnectorDocsOneRequest.builder(); + this.optionsBuilder = Options.builder(); } - public ConnectorConnectorDocsOneRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public ConnectorConnectorDocsOneRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public ConnectorConnectorDocsOneRequestBuilder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public ConnectorConnectorDocsOneRequestBuilder id(@Nonnull String id) { + this.pojoBuilder.id(id); + this._setterCalled = true; return this; } - public ConnectorConnectorDocsOneRequestBuilder docId(String docId) { - Utils.checkNotNull(docId, "docId"); - this.docId = docId; - return this; - } - - public ConnectorConnectorDocsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public ConnectorConnectorDocsOneRequestBuilder docId(@Nonnull String docId) { + this.pojoBuilder.docId(docId); + this._setterCalled = true; return this; } - public ConnectorConnectorDocsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public ConnectorConnectorDocsOneRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private ConnectorConnectorDocsOneRequest buildRequest() { - - ConnectorConnectorDocsOneRequest request = new ConnectorConnectorDocsOneRequest(appId, - id, - docId); - - return request; + private ConnectorConnectorDocsOneRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public ConnectorConnectorDocsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new ConnectorConnectorDocsOneOperation( sdkConfiguration, options); - ConnectorConnectorDocsOneRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneResponse.java index 6e229554..1bff2906 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorDocsOneResponse.java @@ -7,12 +7,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -36,79 +35,70 @@ public class ConnectorConnectorDocsOneResponse implements Response { /** * Connectors */ - private Optional getConnectorDocResponse; + private String getConnectorDocResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public ConnectorConnectorDocsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getConnectorDocResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getConnectorDocResponse, "getConnectorDocResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable String getConnectorDocResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getConnectorDocResponse = getConnectorDocResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public ConnectorConnectorDocsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connectors */ - @JsonIgnore public Optional getConnectorDocResponse() { - return getConnectorDocResponse; + return Optional.ofNullable(this.getConnectorDocResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -119,36 +109,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public ConnectorConnectorDocsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public ConnectorConnectorDocsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public ConnectorConnectorDocsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public ConnectorConnectorDocsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connectors + * Raw HTTP response; suitable for custom response parsing */ - public ConnectorConnectorDocsOneResponse withGetConnectorDocResponse(String getConnectorDocResponse) { - Utils.checkNotNull(getConnectorDocResponse, "getConnectorDocResponse"); - this.getConnectorDocResponse = Optional.ofNullable(getConnectorDocResponse); + public ConnectorConnectorDocsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -156,31 +136,21 @@ public ConnectorConnectorDocsOneResponse withGetConnectorDocResponse(String getC /** * Connectors */ - public ConnectorConnectorDocsOneResponse withGetConnectorDocResponse(Optional getConnectorDocResponse) { - Utils.checkNotNull(getConnectorDocResponse, "getConnectorDocResponse"); + public ConnectorConnectorDocsOneResponse withGetConnectorDocResponse(@Nullable String getConnectorDocResponse) { this.getConnectorDocResponse = getConnectorDocResponse; return this; } - /** - * Unexpected error - */ - public ConnectorConnectorDocsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public ConnectorConnectorDocsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public ConnectorConnectorDocsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,88 +190,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getConnectorDocResponse = Optional.empty(); + private String getConnectorDocResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connectors - */ - public Builder getConnectorDocResponse(String getConnectorDocResponse) { - Utils.checkNotNull(getConnectorDocResponse, "getConnectorDocResponse"); - this.getConnectorDocResponse = Optional.ofNullable(getConnectorDocResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connectors */ - public Builder getConnectorDocResponse(Optional getConnectorDocResponse) { - Utils.checkNotNull(getConnectorDocResponse, "getConnectorDocResponse"); + public Builder getConnectorDocResponse(@Nullable String getConnectorDocResponse) { this.getConnectorDocResponse = getConnectorDocResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public ConnectorConnectorDocsOneResponse build() { - return new ConnectorConnectorDocsOneResponse( contentType, statusCode, rawResponse, getConnectorDocResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneRequest.java index 7a2cf5f1..2a05e3ca 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneRequest.java @@ -7,10 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -19,7 +19,7 @@ public class ConnectorConnectorResourcesOneRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the record you are acting upon. @@ -37,62 +37,55 @@ public class ConnectorConnectorResourcesOneRequest { * Specify unified API for the connector resource. This is useful when a resource appears in multiple APIs */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=unified_api") - private Optional unifiedApi; + private UnifiedApiId unifiedApi; @JsonCreator public ConnectorConnectorResourcesOneRequest( - Optional appId, - String id, - String resourceId, - Optional unifiedApi) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(resourceId, "resourceId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); + @Nullable String appId, + @Nonnull String id, + @Nonnull String resourceId, + @Nullable UnifiedApiId unifiedApi) { this.appId = appId; - this.id = id; - this.resourceId = resourceId; + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.resourceId = Optional.ofNullable(resourceId) + .orElseThrow(() -> new IllegalArgumentException("resourceId cannot be null")); this.unifiedApi = unifiedApi; } public ConnectorConnectorResourcesOneRequest( - String id, - String resourceId) { - this(Optional.empty(), id, resourceId, - Optional.empty()); + @Nonnull String id, + @Nonnull String resourceId) { + this(null, id, resourceId, + null); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the resource you are acting upon. */ - @JsonIgnore public String resourceId() { - return resourceId; + return this.resourceId; } /** * Specify unified API for the connector resource. This is useful when a resource appears in multiple APIs */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unifiedApi() { - return (Optional) unifiedApi; + return Optional.ofNullable(this.unifiedApi); } public static Builder builder() { @@ -103,46 +96,26 @@ public static Builder builder() { /** * The ID of your Unify application */ - public ConnectorConnectorResourcesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public ConnectorConnectorResourcesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public ConnectorConnectorResourcesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * ID of the record you are acting upon. */ - public ConnectorConnectorResourcesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public ConnectorConnectorResourcesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** - * ID of the resource you are acting upon. - */ - public ConnectorConnectorResourcesOneRequest withResourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = resourceId; - return this; - } /** - * Specify unified API for the connector resource. This is useful when a resource appears in multiple APIs + * ID of the resource you are acting upon. */ - public ConnectorConnectorResourcesOneRequest withUnifiedApi(UnifiedApiId unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = Optional.ofNullable(unifiedApi); + public ConnectorConnectorResourcesOneRequest withResourceId(@Nonnull String resourceId) { + this.resourceId = Utils.checkNotNull(resourceId, "resourceId"); return this; } @@ -150,12 +123,12 @@ public ConnectorConnectorResourcesOneRequest withUnifiedApi(UnifiedApiId unified /** * Specify unified API for the connector resource. This is useful when a resource appears in multiple APIs */ - public ConnectorConnectorResourcesOneRequest withUnifiedApi(Optional unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); + public ConnectorConnectorResourcesOneRequest withUnifiedApi(@Nullable UnifiedApiId unifiedApi) { this.unifiedApi = unifiedApi; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -191,78 +164,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private String id; private String resourceId; - private Optional unifiedApi = Optional.empty(); + private UnifiedApiId unifiedApi; private Builder() { // force use of static builder() method } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * ID of the resource you are acting upon. */ - public Builder resourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = resourceId; - return this; - } - - - /** - * Specify unified API for the connector resource. This is useful when a resource appears in multiple APIs - */ - public Builder unifiedApi(UnifiedApiId unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = Optional.ofNullable(unifiedApi); + public Builder resourceId(@Nonnull String resourceId) { + this.resourceId = Utils.checkNotNull(resourceId, "resourceId"); return this; } /** * Specify unified API for the connector resource. This is useful when a resource appears in multiple APIs */ - public Builder unifiedApi(Optional unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); + public Builder unifiedApi(@Nullable UnifiedApiId unifiedApi) { this.unifiedApi = unifiedApi; return this; } public ConnectorConnectorResourcesOneRequest build() { - return new ConnectorConnectorResourcesOneRequest( appId, id, resourceId, unifiedApi); diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneRequestBuilder.java index 386c2963..6cd481aa 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneRequestBuilder.java @@ -11,93 +11,71 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class ConnectorConnectorResourcesOneRequestBuilder { - - private Optional appId = Optional.empty(); - private String id; - private String resourceId; - private Optional unifiedApi = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final ConnectorConnectorResourcesOneRequest.Builder pojoBuilder; + private ConnectorConnectorResourcesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public ConnectorConnectorResourcesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public ConnectorConnectorResourcesOneRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = ConnectorConnectorResourcesOneRequest.builder(); + this.optionsBuilder = Options.builder(); } - public ConnectorConnectorResourcesOneRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public ConnectorConnectorResourcesOneRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public ConnectorConnectorResourcesOneRequestBuilder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public ConnectorConnectorResourcesOneRequestBuilder id(@Nonnull String id) { + this.pojoBuilder.id(id); + this._setterCalled = true; return this; } - public ConnectorConnectorResourcesOneRequestBuilder resourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = resourceId; - return this; - } - - public ConnectorConnectorResourcesOneRequestBuilder unifiedApi(UnifiedApiId unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = Optional.of(unifiedApi); + public ConnectorConnectorResourcesOneRequestBuilder resourceId(@Nonnull String resourceId) { + this.pojoBuilder.resourceId(resourceId); + this._setterCalled = true; return this; } - public ConnectorConnectorResourcesOneRequestBuilder unifiedApi(Optional unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; - return this; - } - - public ConnectorConnectorResourcesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public ConnectorConnectorResourcesOneRequestBuilder unifiedApi(@Nullable UnifiedApiId unifiedApi) { + this.pojoBuilder.unifiedApi(unifiedApi); + this._setterCalled = true; return this; } - public ConnectorConnectorResourcesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public ConnectorConnectorResourcesOneRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private ConnectorConnectorResourcesOneRequest buildRequest() { - - ConnectorConnectorResourcesOneRequest request = new ConnectorConnectorResourcesOneRequest(appId, - id, - resourceId, - unifiedApi); - - return request; + private ConnectorConnectorResourcesOneRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public ConnectorConnectorResourcesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new ConnectorConnectorResourcesOneOperation( sdkConfiguration, options); - ConnectorConnectorResourcesOneRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneResponse.java index a79d76e0..e93d3579 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorResourcesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class ConnectorConnectorResourcesOneResponse implements Response { /** * ConnectorResources */ - private Optional getConnectorResourceResponse; + private GetConnectorResourceResponse getConnectorResourceResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public ConnectorConnectorResourcesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getConnectorResourceResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getConnectorResourceResponse, "getConnectorResourceResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetConnectorResourceResponse getConnectorResourceResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getConnectorResourceResponse = getConnectorResourceResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public ConnectorConnectorResourcesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * ConnectorResources */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getConnectorResourceResponse() { - return (Optional) getConnectorResourceResponse; + return Optional.ofNullable(this.getConnectorResourceResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public ConnectorConnectorResourcesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public ConnectorConnectorResourcesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public ConnectorConnectorResourcesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public ConnectorConnectorResourcesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * ConnectorResources + * Raw HTTP response; suitable for custom response parsing */ - public ConnectorConnectorResourcesOneResponse withGetConnectorResourceResponse(GetConnectorResourceResponse getConnectorResourceResponse) { - Utils.checkNotNull(getConnectorResourceResponse, "getConnectorResourceResponse"); - this.getConnectorResourceResponse = Optional.ofNullable(getConnectorResourceResponse); + public ConnectorConnectorResourcesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public ConnectorConnectorResourcesOneResponse withGetConnectorResourceResponse(G /** * ConnectorResources */ - public ConnectorConnectorResourcesOneResponse withGetConnectorResourceResponse(Optional getConnectorResourceResponse) { - Utils.checkNotNull(getConnectorResourceResponse, "getConnectorResourceResponse"); + public ConnectorConnectorResourcesOneResponse withGetConnectorResourceResponse(@Nullable GetConnectorResourceResponse getConnectorResourceResponse) { this.getConnectorResourceResponse = getConnectorResourceResponse; return this; } - /** - * Unexpected error - */ - public ConnectorConnectorResourcesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public ConnectorConnectorResourcesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public ConnectorConnectorResourcesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getConnectorResourceResponse = Optional.empty(); + private GetConnectorResourceResponse getConnectorResourceResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * ConnectorResources - */ - public Builder getConnectorResourceResponse(GetConnectorResourceResponse getConnectorResourceResponse) { - Utils.checkNotNull(getConnectorResourceResponse, "getConnectorResourceResponse"); - this.getConnectorResourceResponse = Optional.ofNullable(getConnectorResourceResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * ConnectorResources */ - public Builder getConnectorResourceResponse(Optional getConnectorResourceResponse) { - Utils.checkNotNull(getConnectorResourceResponse, "getConnectorResourceResponse"); + public Builder getConnectorResourceResponse(@Nullable GetConnectorResourceResponse getConnectorResourceResponse) { this.getConnectorResourceResponse = getConnectorResourceResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public ConnectorConnectorResourcesOneResponse build() { - return new ConnectorConnectorResourcesOneResponse( contentType, statusCode, rawResponse, getConnectorResourceResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllRequest.java index 13ef1791..c1224314 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllRequest.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,7 +22,7 @@ public class ConnectorConnectorsAllRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -35,66 +34,59 @@ public class ConnectorConnectorsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private ConnectorsFilter filter; @JsonCreator public ConnectorConnectorsAllRequest( - Optional appId, - JsonNullable cursor, - Optional limit, - Optional filter) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); + @Nullable String appId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable ConnectorsFilter filter) { this.appId = appId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; } public ConnectorConnectorsAllRequest() { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } public static Builder builder() { @@ -105,46 +97,17 @@ public static Builder builder() { /** * The ID of your Unify application */ - public ConnectorConnectorsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public ConnectorConnectorsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public ConnectorConnectorsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public ConnectorConnectorsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public ConnectorConnectorsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public ConnectorConnectorsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public ConnectorConnectorsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -152,31 +115,21 @@ public ConnectorConnectorsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public ConnectorConnectorsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public ConnectorConnectorsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public ConnectorConnectorsAllRequest withFilter(ConnectorsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public ConnectorConnectorsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public ConnectorConnectorsAllRequest withFilter(@Nullable ConnectorsFilter filter) { this.filter = filter; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -212,109 +165,61 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private ConnectorsFilter filter; private Builder() { // force use of static builder() method } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - - /** - * Apply filters - */ - public Builder filter(ConnectorsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable ConnectorsFilter filter) { this.filter = filter; return this; } public ConnectorConnectorsAllRequest build() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new ConnectorConnectorsAllRequest( appId, cursor, limit, filter); } - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllRequestBuilder.java index 0a66c437..d0039ec2 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllRequestBuilder.java @@ -11,13 +11,11 @@ import com.apideck.unify.SDKConfiguration; import com.apideck.unify.models.components.ConnectorsFilter; import com.apideck.unify.operations.ConnectorConnectorsAllOperation; -import com.apideck.unify.utils.LazySingletonValue; import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; -import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; -import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; @@ -25,114 +23,72 @@ import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; import org.openapitools.jackson.nullable.JsonNullable; public class ConnectorConnectorsAllRequestBuilder { - - private Optional appId = Optional.empty(); - private JsonNullable cursor = JsonNullable.undefined(); - private Optional limit = Utils.readDefaultOrConstValue( - "limit", - "20", - new TypeReference>() {}); - private Optional filter = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final ConnectorConnectorsAllRequest.Builder pojoBuilder; + private ConnectorConnectorsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public ConnectorConnectorsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public ConnectorConnectorsAllRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = ConnectorConnectorsAllRequest.builder(); + this.optionsBuilder = Options.builder(); } - public ConnectorConnectorsAllRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public ConnectorConnectorsAllRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public ConnectorConnectorsAllRequestBuilder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); + public ConnectorConnectorsAllRequestBuilder cursor(@Nullable String cursor) { + this.pojoBuilder.cursor(cursor); + this._setterCalled = true; return this; } - public ConnectorConnectorsAllRequestBuilder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - public ConnectorConnectorsAllRequestBuilder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.of(limit); + public ConnectorConnectorsAllRequestBuilder limit(@Nullable Long limit) { + this.pojoBuilder.limit(limit); + this._setterCalled = true; return this; } - public ConnectorConnectorsAllRequestBuilder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = limit; - return this; - } - - public ConnectorConnectorsAllRequestBuilder filter(ConnectorsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.of(filter); + public ConnectorConnectorsAllRequestBuilder filter(@Nullable ConnectorsFilter filter) { + this.pojoBuilder.filter(filter); + this._setterCalled = true; return this; } - public ConnectorConnectorsAllRequestBuilder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = filter; - return this; - } - public ConnectorConnectorsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); - return this; - } - - public ConnectorConnectorsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private ConnectorConnectorsAllRequest buildRequest() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); + private ConnectorConnectorsAllRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); } - - ConnectorConnectorsAllRequest request = new ConnectorConnectorsAllRequest(appId, - cursor, - limit, - filter); - - return request; + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public ConnectorConnectorsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new ConnectorConnectorsAllOperation( sdkConfiguration, options); - ConnectorConnectorsAllRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -147,36 +103,27 @@ public ConnectorConnectorsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new ConnectorConnectorsAllOperation( - sdkConfiguration, - options); - ConnectorConnectorsAllRequest request = buildRequest(); + ConnectorConnectorsAllRequest request = pojoBuilder.build(); + Options options = optionsBuilder.build(); + RequestOperation operation = + new ConnectorConnectorsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - ConnectorConnectorsAllRequest::withCursor, + ConnectorConnectorsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - - - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = - new LazySingletonValue<>( - "limit", - "20", - new TypeReference>() {}); } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllResponse.java index f629944b..3995131f 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class ConnectorConnectorsAllResponse implements Response { /** * Connectors */ - private Optional getConnectorsResponse; + private GetConnectorsResponse getConnectorsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public ConnectorConnectorsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getConnectorsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getConnectorsResponse, "getConnectorsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetConnectorsResponse getConnectorsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getConnectorsResponse = getConnectorsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public ConnectorConnectorsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connectors */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getConnectorsResponse() { - return (Optional) getConnectorsResponse; + return Optional.ofNullable(this.getConnectorsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public ConnectorConnectorsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public ConnectorConnectorsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public ConnectorConnectorsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public ConnectorConnectorsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connectors + * Raw HTTP response; suitable for custom response parsing */ - public ConnectorConnectorsAllResponse withGetConnectorsResponse(GetConnectorsResponse getConnectorsResponse) { - Utils.checkNotNull(getConnectorsResponse, "getConnectorsResponse"); - this.getConnectorsResponse = Optional.ofNullable(getConnectorsResponse); + public ConnectorConnectorsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public ConnectorConnectorsAllResponse withGetConnectorsResponse(GetConnectorsRes /** * Connectors */ - public ConnectorConnectorsAllResponse withGetConnectorsResponse(Optional getConnectorsResponse) { - Utils.checkNotNull(getConnectorsResponse, "getConnectorsResponse"); + public ConnectorConnectorsAllResponse withGetConnectorsResponse(@Nullable GetConnectorsResponse getConnectorsResponse) { this.getConnectorsResponse = getConnectorsResponse; return this; } - /** - * Unexpected error - */ - public ConnectorConnectorsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public ConnectorConnectorsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public ConnectorConnectorsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getConnectorsResponse = Optional.empty(); + private GetConnectorsResponse getConnectorsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connectors - */ - public Builder getConnectorsResponse(GetConnectorsResponse getConnectorsResponse) { - Utils.checkNotNull(getConnectorsResponse, "getConnectorsResponse"); - this.getConnectorsResponse = Optional.ofNullable(getConnectorsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connectors */ - public Builder getConnectorsResponse(Optional getConnectorsResponse) { - Utils.checkNotNull(getConnectorsResponse, "getConnectorsResponse"); + public Builder getConnectorsResponse(@Nullable GetConnectorsResponse getConnectorsResponse) { this.getConnectorsResponse = getConnectorsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public ConnectorConnectorsAllResponse build() { - return new ConnectorConnectorsAllResponse( contentType, statusCode, rawResponse, getConnectorsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneRequest.java index 4dfcfa00..f5d38e49 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,7 +18,7 @@ public class ConnectorConnectorsOneRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the record you are acting upon. @@ -27,33 +28,30 @@ public class ConnectorConnectorsOneRequest { @JsonCreator public ConnectorConnectorsOneRequest( - Optional appId, - String id) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(id, "id"); + @Nullable String appId, + @Nonnull String id) { this.appId = appId; - this.id = id; + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); } public ConnectorConnectorsOneRequest( - String id) { - this(Optional.empty(), id); + @Nonnull String id) { + this(null, id); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } public static Builder builder() { @@ -64,31 +62,21 @@ public static Builder builder() { /** * The ID of your Unify application */ - public ConnectorConnectorsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public ConnectorConnectorsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public ConnectorConnectorsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * ID of the record you are acting upon. */ - public ConnectorConnectorsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public ConnectorConnectorsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -119,7 +107,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private String id; @@ -127,37 +115,23 @@ private Builder() { // force use of static builder() method } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } public ConnectorConnectorsOneRequest build() { - return new ConnectorConnectorsOneRequest( appId, id); } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneRequestBuilder.java index d3192fde..36a5cbd4 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneRequestBuilder.java @@ -10,71 +10,59 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class ConnectorConnectorsOneRequestBuilder { - - private Optional appId = Optional.empty(); - private String id; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final ConnectorConnectorsOneRequest.Builder pojoBuilder; + private ConnectorConnectorsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public ConnectorConnectorsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public ConnectorConnectorsOneRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = ConnectorConnectorsOneRequest.builder(); + this.optionsBuilder = Options.builder(); } - public ConnectorConnectorsOneRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public ConnectorConnectorsOneRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public ConnectorConnectorsOneRequestBuilder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - public ConnectorConnectorsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public ConnectorConnectorsOneRequestBuilder id(@Nonnull String id) { + this.pojoBuilder.id(id); + this._setterCalled = true; return this; } - public ConnectorConnectorsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public ConnectorConnectorsOneRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private ConnectorConnectorsOneRequest buildRequest() { - - ConnectorConnectorsOneRequest request = new ConnectorConnectorsOneRequest(appId, - id); - - return request; + private ConnectorConnectorsOneRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public ConnectorConnectorsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new ConnectorConnectorsOneOperation( sdkConfiguration, options); - ConnectorConnectorsOneRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneResponse.java index 0b8f253f..7cf63325 100644 --- a/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/ConnectorConnectorsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class ConnectorConnectorsOneResponse implements Response { /** * Connectors */ - private Optional getConnectorResponse; + private GetConnectorResponse getConnectorResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public ConnectorConnectorsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getConnectorResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getConnectorResponse, "getConnectorResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetConnectorResponse getConnectorResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getConnectorResponse = getConnectorResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public ConnectorConnectorsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connectors */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getConnectorResponse() { - return (Optional) getConnectorResponse; + return Optional.ofNullable(this.getConnectorResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public ConnectorConnectorsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public ConnectorConnectorsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public ConnectorConnectorsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public ConnectorConnectorsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connectors + * Raw HTTP response; suitable for custom response parsing */ - public ConnectorConnectorsOneResponse withGetConnectorResponse(GetConnectorResponse getConnectorResponse) { - Utils.checkNotNull(getConnectorResponse, "getConnectorResponse"); - this.getConnectorResponse = Optional.ofNullable(getConnectorResponse); + public ConnectorConnectorsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public ConnectorConnectorsOneResponse withGetConnectorResponse(GetConnectorRespo /** * Connectors */ - public ConnectorConnectorsOneResponse withGetConnectorResponse(Optional getConnectorResponse) { - Utils.checkNotNull(getConnectorResponse, "getConnectorResponse"); + public ConnectorConnectorsOneResponse withGetConnectorResponse(@Nullable GetConnectorResponse getConnectorResponse) { this.getConnectorResponse = getConnectorResponse; return this; } - /** - * Unexpected error - */ - public ConnectorConnectorsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public ConnectorConnectorsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public ConnectorConnectorsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getConnectorResponse = Optional.empty(); + private GetConnectorResponse getConnectorResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connectors - */ - public Builder getConnectorResponse(GetConnectorResponse getConnectorResponse) { - Utils.checkNotNull(getConnectorResponse, "getConnectorResponse"); - this.getConnectorResponse = Optional.ofNullable(getConnectorResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connectors */ - public Builder getConnectorResponse(Optional getConnectorResponse) { - Utils.checkNotNull(getConnectorResponse, "getConnectorResponse"); + public Builder getConnectorResponse(@Nullable GetConnectorResponse getConnectorResponse) { this.getConnectorResponse = getConnectorResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public ConnectorConnectorsOneResponse build() { - return new ConnectorConnectorsOneResponse( contentType, statusCode, rawResponse, getConnectorResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddRequest.java index d021c2c8..bf8d3fad 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class CrmActivitiesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class CrmActivitiesAddRequest { @JsonCreator public CrmActivitiesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - ActivityInput activity) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(activity, "activity"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull ActivityInput activity) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.activity = activity; + this.activity = Optional.ofNullable(activity) + .orElseThrow(() -> new IllegalArgumentException("activity cannot be null")); } public CrmActivitiesAddRequest( - ActivityInput activity) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), activity); + @Nonnull ActivityInput activity) { + this(null, null, null, + null, activity); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public ActivityInput activity() { - return activity; + return this.activity; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmActivitiesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmActivitiesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmActivitiesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmActivitiesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmActivitiesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmActivitiesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmActivitiesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmActivitiesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmActivitiesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmActivitiesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmActivitiesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmActivitiesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public CrmActivitiesAddRequest withActivity(ActivityInput activity) { - Utils.checkNotNull(activity, "activity"); - this.activity = activity; + + public CrmActivitiesAddRequest withActivity(@Nonnull ActivityInput activity) { + this.activity = Utils.checkNotNull(activity, "activity"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private ActivityInput activity; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder activity(ActivityInput activity) { - Utils.checkNotNull(activity, "activity"); - this.activity = activity; + public Builder activity(@Nonnull ActivityInput activity) { + this.activity = Utils.checkNotNull(activity, "activity"); return this; } public CrmActivitiesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmActivitiesAddRequest( raw, consumerId, appId, serviceId, activity); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddRequestBuilder.java index 566aed7b..083f5a9d 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmActivitiesAddRequestBuilder { - - private CrmActivitiesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmActivitiesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmActivitiesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmActivitiesAddRequestBuilder request(CrmActivitiesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmActivitiesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmActivitiesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmActivitiesAddRequestBuilder request(@Nonnull CrmActivitiesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmActivitiesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmActivitiesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmActivitiesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddResponse.java index 5840f6da..fb498a1c 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmActivitiesAddResponse implements Response { /** * Activity created */ - private Optional createActivityResponse; + private CreateActivityResponse createActivityResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmActivitiesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createActivityResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createActivityResponse, "createActivityResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateActivityResponse createActivityResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createActivityResponse = createActivityResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmActivitiesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Activity created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createActivityResponse() { - return (Optional) createActivityResponse; + return Optional.ofNullable(this.createActivityResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmActivitiesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmActivitiesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmActivitiesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmActivitiesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Activity created + * Raw HTTP response; suitable for custom response parsing */ - public CrmActivitiesAddResponse withCreateActivityResponse(CreateActivityResponse createActivityResponse) { - Utils.checkNotNull(createActivityResponse, "createActivityResponse"); - this.createActivityResponse = Optional.ofNullable(createActivityResponse); + public CrmActivitiesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmActivitiesAddResponse withCreateActivityResponse(CreateActivityRespons /** * Activity created */ - public CrmActivitiesAddResponse withCreateActivityResponse(Optional createActivityResponse) { - Utils.checkNotNull(createActivityResponse, "createActivityResponse"); + public CrmActivitiesAddResponse withCreateActivityResponse(@Nullable CreateActivityResponse createActivityResponse) { this.createActivityResponse = createActivityResponse; return this; } - /** - * Unexpected error - */ - public CrmActivitiesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmActivitiesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmActivitiesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createActivityResponse = Optional.empty(); + private CreateActivityResponse createActivityResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Activity created - */ - public Builder createActivityResponse(CreateActivityResponse createActivityResponse) { - Utils.checkNotNull(createActivityResponse, "createActivityResponse"); - this.createActivityResponse = Optional.ofNullable(createActivityResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Activity created */ - public Builder createActivityResponse(Optional createActivityResponse) { - Utils.checkNotNull(createActivityResponse, "createActivityResponse"); + public Builder createActivityResponse(@Nullable CreateActivityResponse createActivityResponse) { this.createActivityResponse = createActivityResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmActivitiesAddResponse build() { - return new CrmActivitiesAddResponse( contentType, statusCode, rawResponse, createActivityResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllRequest.java index 3c35464b..3aa41f74 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class CrmActivitiesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class CrmActivitiesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private ActivitiesFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private ActivitiesSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class CrmActivitiesAllRequest { @JsonCreator public CrmActivitiesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable ActivitiesFilter filter, + @Nullable ActivitiesSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmActivitiesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmActivitiesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmActivitiesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmActivitiesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmActivitiesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmActivitiesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmActivitiesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmActivitiesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmActivitiesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmActivitiesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmActivitiesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmActivitiesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmActivitiesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public CrmActivitiesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public CrmActivitiesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public CrmActivitiesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public CrmActivitiesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public CrmActivitiesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public CrmActivitiesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public CrmActivitiesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public CrmActivitiesAllRequest withFilter(ActivitiesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public CrmActivitiesAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public CrmActivitiesAllRequest withFilter(@Nullable ActivitiesFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public CrmActivitiesAllRequest withSort(ActivitiesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public CrmActivitiesAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public CrmActivitiesAllRequest withSort(@Nullable ActivitiesSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public CrmActivitiesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public CrmActivitiesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CrmActivitiesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmActivitiesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmActivitiesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmActivitiesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private ActivitiesFilter filter; - private Optional sort = Optional.empty(); + private ActivitiesSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(ActivitiesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable ActivitiesFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(ActivitiesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable ActivitiesSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmActivitiesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new CrmActivitiesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public CrmActivitiesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllRequestBuilder.java index 375d46c4..73f9a680 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class CrmActivitiesAllRequestBuilder { - - private CrmActivitiesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmActivitiesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmActivitiesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmActivitiesAllRequestBuilder request(CrmActivitiesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmActivitiesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmActivitiesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmActivitiesAllRequestBuilder request(@Nonnull CrmActivitiesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmActivitiesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmActivitiesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmActivitiesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public CrmActivitiesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new CrmActivitiesAllOperation( - sdkConfiguration, - options); + CrmActivitiesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new CrmActivitiesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - CrmActivitiesAllRequest::withCursor, + CrmActivitiesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllResponse.java index a4310440..0d4ac923 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmActivitiesAllResponse implements Response { /** * Activities */ - private Optional getActivitiesResponse; + private GetActivitiesResponse getActivitiesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmActivitiesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getActivitiesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getActivitiesResponse, "getActivitiesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetActivitiesResponse getActivitiesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getActivitiesResponse = getActivitiesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmActivitiesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Activities */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getActivitiesResponse() { - return (Optional) getActivitiesResponse; + return Optional.ofNullable(this.getActivitiesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmActivitiesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmActivitiesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmActivitiesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmActivitiesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Activities + * Raw HTTP response; suitable for custom response parsing */ - public CrmActivitiesAllResponse withGetActivitiesResponse(GetActivitiesResponse getActivitiesResponse) { - Utils.checkNotNull(getActivitiesResponse, "getActivitiesResponse"); - this.getActivitiesResponse = Optional.ofNullable(getActivitiesResponse); + public CrmActivitiesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmActivitiesAllResponse withGetActivitiesResponse(GetActivitiesResponse /** * Activities */ - public CrmActivitiesAllResponse withGetActivitiesResponse(Optional getActivitiesResponse) { - Utils.checkNotNull(getActivitiesResponse, "getActivitiesResponse"); + public CrmActivitiesAllResponse withGetActivitiesResponse(@Nullable GetActivitiesResponse getActivitiesResponse) { this.getActivitiesResponse = getActivitiesResponse; return this; } - /** - * Unexpected error - */ - public CrmActivitiesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmActivitiesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmActivitiesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getActivitiesResponse = Optional.empty(); + private GetActivitiesResponse getActivitiesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Activities - */ - public Builder getActivitiesResponse(GetActivitiesResponse getActivitiesResponse) { - Utils.checkNotNull(getActivitiesResponse, "getActivitiesResponse"); - this.getActivitiesResponse = Optional.ofNullable(getActivitiesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Activities */ - public Builder getActivitiesResponse(Optional getActivitiesResponse) { - Utils.checkNotNull(getActivitiesResponse, "getActivitiesResponse"); + public Builder getActivitiesResponse(@Nullable GetActivitiesResponse getActivitiesResponse) { this.getActivitiesResponse = getActivitiesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmActivitiesAllResponse build() { - return new CrmActivitiesAllResponse( contentType, statusCode, rawResponse, getActivitiesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteRequest.java index 917d48a2..f699417d 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class CrmActivitiesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public CrmActivitiesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public CrmActivitiesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmActivitiesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmActivitiesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmActivitiesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public CrmActivitiesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmActivitiesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmActivitiesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmActivitiesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmActivitiesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmActivitiesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmActivitiesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmActivitiesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmActivitiesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmActivitiesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmActivitiesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmActivitiesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public CrmActivitiesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmActivitiesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteRequestBuilder.java index 3bc6edb9..8bac1ca9 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmActivitiesDeleteRequestBuilder { - - private CrmActivitiesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmActivitiesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmActivitiesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmActivitiesDeleteRequestBuilder request(CrmActivitiesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmActivitiesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmActivitiesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmActivitiesDeleteRequestBuilder request(@Nonnull CrmActivitiesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmActivitiesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmActivitiesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmActivitiesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteResponse.java index cde1ab81..af568113 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmActivitiesDeleteResponse implements Response { /** * Activity deleted */ - private Optional deleteActivityResponse; + private DeleteActivityResponse deleteActivityResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmActivitiesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteActivityResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteActivityResponse, "deleteActivityResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteActivityResponse deleteActivityResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteActivityResponse = deleteActivityResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmActivitiesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Activity deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteActivityResponse() { - return (Optional) deleteActivityResponse; + return Optional.ofNullable(this.deleteActivityResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmActivitiesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmActivitiesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmActivitiesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmActivitiesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Activity deleted + * Raw HTTP response; suitable for custom response parsing */ - public CrmActivitiesDeleteResponse withDeleteActivityResponse(DeleteActivityResponse deleteActivityResponse) { - Utils.checkNotNull(deleteActivityResponse, "deleteActivityResponse"); - this.deleteActivityResponse = Optional.ofNullable(deleteActivityResponse); + public CrmActivitiesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmActivitiesDeleteResponse withDeleteActivityResponse(DeleteActivityResp /** * Activity deleted */ - public CrmActivitiesDeleteResponse withDeleteActivityResponse(Optional deleteActivityResponse) { - Utils.checkNotNull(deleteActivityResponse, "deleteActivityResponse"); + public CrmActivitiesDeleteResponse withDeleteActivityResponse(@Nullable DeleteActivityResponse deleteActivityResponse) { this.deleteActivityResponse = deleteActivityResponse; return this; } - /** - * Unexpected error - */ - public CrmActivitiesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmActivitiesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmActivitiesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteActivityResponse = Optional.empty(); + private DeleteActivityResponse deleteActivityResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Activity deleted - */ - public Builder deleteActivityResponse(DeleteActivityResponse deleteActivityResponse) { - Utils.checkNotNull(deleteActivityResponse, "deleteActivityResponse"); - this.deleteActivityResponse = Optional.ofNullable(deleteActivityResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Activity deleted */ - public Builder deleteActivityResponse(Optional deleteActivityResponse) { - Utils.checkNotNull(deleteActivityResponse, "deleteActivityResponse"); + public Builder deleteActivityResponse(@Nullable DeleteActivityResponse deleteActivityResponse) { this.deleteActivityResponse = deleteActivityResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmActivitiesDeleteResponse build() { - return new CrmActivitiesDeleteResponse( contentType, statusCode, rawResponse, deleteActivityResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneRequest.java index 6ffe3214..272d0841 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmActivitiesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class CrmActivitiesOneRequest { @JsonCreator public CrmActivitiesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmActivitiesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmActivitiesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmActivitiesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmActivitiesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public CrmActivitiesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmActivitiesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmActivitiesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmActivitiesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmActivitiesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmActivitiesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmActivitiesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmActivitiesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmActivitiesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmActivitiesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmActivitiesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmActivitiesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmActivitiesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmActivitiesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmActivitiesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmActivitiesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmActivitiesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneRequestBuilder.java index a92fac18..9c9a4caf 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmActivitiesOneRequestBuilder { - - private CrmActivitiesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmActivitiesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmActivitiesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmActivitiesOneRequestBuilder request(CrmActivitiesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmActivitiesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmActivitiesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmActivitiesOneRequestBuilder request(@Nonnull CrmActivitiesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmActivitiesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmActivitiesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmActivitiesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneResponse.java index f5f258f5..3cd12128 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmActivitiesOneResponse implements Response { /** * Activity */ - private Optional getActivityResponse; + private GetActivityResponse getActivityResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmActivitiesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getActivityResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getActivityResponse, "getActivityResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetActivityResponse getActivityResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getActivityResponse = getActivityResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmActivitiesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Activity */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getActivityResponse() { - return (Optional) getActivityResponse; + return Optional.ofNullable(this.getActivityResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmActivitiesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmActivitiesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmActivitiesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmActivitiesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Activity + * Raw HTTP response; suitable for custom response parsing */ - public CrmActivitiesOneResponse withGetActivityResponse(GetActivityResponse getActivityResponse) { - Utils.checkNotNull(getActivityResponse, "getActivityResponse"); - this.getActivityResponse = Optional.ofNullable(getActivityResponse); + public CrmActivitiesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmActivitiesOneResponse withGetActivityResponse(GetActivityResponse getA /** * Activity */ - public CrmActivitiesOneResponse withGetActivityResponse(Optional getActivityResponse) { - Utils.checkNotNull(getActivityResponse, "getActivityResponse"); + public CrmActivitiesOneResponse withGetActivityResponse(@Nullable GetActivityResponse getActivityResponse) { this.getActivityResponse = getActivityResponse; return this; } - /** - * Unexpected error - */ - public CrmActivitiesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmActivitiesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmActivitiesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getActivityResponse = Optional.empty(); + private GetActivityResponse getActivityResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Activity - */ - public Builder getActivityResponse(GetActivityResponse getActivityResponse) { - Utils.checkNotNull(getActivityResponse, "getActivityResponse"); - this.getActivityResponse = Optional.ofNullable(getActivityResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Activity */ - public Builder getActivityResponse(Optional getActivityResponse) { - Utils.checkNotNull(getActivityResponse, "getActivityResponse"); + public Builder getActivityResponse(@Nullable GetActivityResponse getActivityResponse) { this.getActivityResponse = getActivityResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmActivitiesOneResponse build() { - return new CrmActivitiesOneResponse( contentType, statusCode, rawResponse, getActivityResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateRequest.java index 8a033bd4..674614b2 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmActivitiesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class CrmActivitiesUpdateRequest { @JsonCreator public CrmActivitiesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - ActivityInput activity) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(activity, "activity"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull ActivityInput activity) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.activity = activity; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.activity = Optional.ofNullable(activity) + .orElseThrow(() -> new IllegalArgumentException("activity cannot be null")); } public CrmActivitiesUpdateRequest( - String id, - ActivityInput activity) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), activity); + @Nonnull String id, + @Nonnull ActivityInput activity) { + this(id, null, null, + null, null, activity); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public ActivityInput activity() { - return activity; + return this.activity; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmActivitiesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmActivitiesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmActivitiesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public CrmActivitiesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmActivitiesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmActivitiesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmActivitiesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmActivitiesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmActivitiesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmActivitiesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmActivitiesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmActivitiesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmActivitiesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmActivitiesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmActivitiesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public CrmActivitiesUpdateRequest withActivity(ActivityInput activity) { - Utils.checkNotNull(activity, "activity"); - this.activity = activity; + + public CrmActivitiesUpdateRequest withActivity(@Nonnull ActivityInput activity) { + this.activity = Utils.checkNotNull(activity, "activity"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private ActivityInput activity; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder activity(ActivityInput activity) { - Utils.checkNotNull(activity, "activity"); - this.activity = activity; + public Builder activity(@Nonnull ActivityInput activity) { + this.activity = Utils.checkNotNull(activity, "activity"); return this; } public CrmActivitiesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmActivitiesUpdateRequest( id, consumerId, appId, serviceId, raw, activity); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateRequestBuilder.java index 25113e7f..9c0e475e 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmActivitiesUpdateRequestBuilder { - - private CrmActivitiesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmActivitiesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmActivitiesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmActivitiesUpdateRequestBuilder request(CrmActivitiesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmActivitiesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmActivitiesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmActivitiesUpdateRequestBuilder request(@Nonnull CrmActivitiesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmActivitiesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmActivitiesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmActivitiesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateResponse.java index 7aeb83fd..a07cb252 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmActivitiesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmActivitiesUpdateResponse implements Response { /** * Activity updated */ - private Optional updateActivityResponse; + private UpdateActivityResponse updateActivityResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmActivitiesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateActivityResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateActivityResponse, "updateActivityResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateActivityResponse updateActivityResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateActivityResponse = updateActivityResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmActivitiesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Activity updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateActivityResponse() { - return (Optional) updateActivityResponse; + return Optional.ofNullable(this.updateActivityResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmActivitiesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmActivitiesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmActivitiesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmActivitiesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Activity updated + * Raw HTTP response; suitable for custom response parsing */ - public CrmActivitiesUpdateResponse withUpdateActivityResponse(UpdateActivityResponse updateActivityResponse) { - Utils.checkNotNull(updateActivityResponse, "updateActivityResponse"); - this.updateActivityResponse = Optional.ofNullable(updateActivityResponse); + public CrmActivitiesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmActivitiesUpdateResponse withUpdateActivityResponse(UpdateActivityResp /** * Activity updated */ - public CrmActivitiesUpdateResponse withUpdateActivityResponse(Optional updateActivityResponse) { - Utils.checkNotNull(updateActivityResponse, "updateActivityResponse"); + public CrmActivitiesUpdateResponse withUpdateActivityResponse(@Nullable UpdateActivityResponse updateActivityResponse) { this.updateActivityResponse = updateActivityResponse; return this; } - /** - * Unexpected error - */ - public CrmActivitiesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmActivitiesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmActivitiesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateActivityResponse = Optional.empty(); + private UpdateActivityResponse updateActivityResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Activity updated - */ - public Builder updateActivityResponse(UpdateActivityResponse updateActivityResponse) { - Utils.checkNotNull(updateActivityResponse, "updateActivityResponse"); - this.updateActivityResponse = Optional.ofNullable(updateActivityResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Activity updated */ - public Builder updateActivityResponse(Optional updateActivityResponse) { - Utils.checkNotNull(updateActivityResponse, "updateActivityResponse"); + public Builder updateActivityResponse(@Nullable UpdateActivityResponse updateActivityResponse) { this.updateActivityResponse = updateActivityResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmActivitiesUpdateResponse build() { - return new CrmActivitiesUpdateResponse( contentType, statusCode, rawResponse, updateActivityResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddRequest.java index 56dc9274..60ae022d 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class CrmCompaniesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class CrmCompaniesAddRequest { @JsonCreator public CrmCompaniesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - Company1Input company1) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(company1, "company1"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull Company1Input company1) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.company1 = company1; + this.company1 = Optional.ofNullable(company1) + .orElseThrow(() -> new IllegalArgumentException("company1 cannot be null")); } public CrmCompaniesAddRequest( - Company1Input company1) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), company1); + @Nonnull Company1Input company1) { + this(null, null, null, + null, company1); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public Company1Input company1() { - return company1; + return this.company1; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmCompaniesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCompaniesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCompaniesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCompaniesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmCompaniesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCompaniesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCompaniesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCompaniesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCompaniesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCompaniesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCompaniesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCompaniesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public CrmCompaniesAddRequest withCompany1(Company1Input company1) { - Utils.checkNotNull(company1, "company1"); - this.company1 = company1; + + public CrmCompaniesAddRequest withCompany1(@Nonnull Company1Input company1) { + this.company1 = Utils.checkNotNull(company1, "company1"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private Company1Input company1; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder company1(Company1Input company1) { - Utils.checkNotNull(company1, "company1"); - this.company1 = company1; + public Builder company1(@Nonnull Company1Input company1) { + this.company1 = Utils.checkNotNull(company1, "company1"); return this; } public CrmCompaniesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCompaniesAddRequest( raw, consumerId, appId, serviceId, company1); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddRequestBuilder.java index 4fd80bfb..6ca9d3a7 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCompaniesAddRequestBuilder { - - private CrmCompaniesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCompaniesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCompaniesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCompaniesAddRequestBuilder request(CrmCompaniesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCompaniesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCompaniesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCompaniesAddRequestBuilder request(@Nonnull CrmCompaniesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCompaniesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCompaniesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCompaniesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddResponse.java index 89a1962d..f1055a20 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCompaniesAddResponse implements Response { /** * Company created */ - private Optional createCompanyResponse; + private CreateCompanyResponse createCompanyResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCompaniesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createCompanyResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createCompanyResponse, "createCompanyResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateCompanyResponse createCompanyResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createCompanyResponse = createCompanyResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCompaniesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Company created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createCompanyResponse() { - return (Optional) createCompanyResponse; + return Optional.ofNullable(this.createCompanyResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCompaniesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCompaniesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCompaniesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCompaniesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Company created + * Raw HTTP response; suitable for custom response parsing */ - public CrmCompaniesAddResponse withCreateCompanyResponse(CreateCompanyResponse createCompanyResponse) { - Utils.checkNotNull(createCompanyResponse, "createCompanyResponse"); - this.createCompanyResponse = Optional.ofNullable(createCompanyResponse); + public CrmCompaniesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCompaniesAddResponse withCreateCompanyResponse(CreateCompanyResponse c /** * Company created */ - public CrmCompaniesAddResponse withCreateCompanyResponse(Optional createCompanyResponse) { - Utils.checkNotNull(createCompanyResponse, "createCompanyResponse"); + public CrmCompaniesAddResponse withCreateCompanyResponse(@Nullable CreateCompanyResponse createCompanyResponse) { this.createCompanyResponse = createCompanyResponse; return this; } - /** - * Unexpected error - */ - public CrmCompaniesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCompaniesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCompaniesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createCompanyResponse = Optional.empty(); + private CreateCompanyResponse createCompanyResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Company created - */ - public Builder createCompanyResponse(CreateCompanyResponse createCompanyResponse) { - Utils.checkNotNull(createCompanyResponse, "createCompanyResponse"); - this.createCompanyResponse = Optional.ofNullable(createCompanyResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Company created */ - public Builder createCompanyResponse(Optional createCompanyResponse) { - Utils.checkNotNull(createCompanyResponse, "createCompanyResponse"); + public Builder createCompanyResponse(@Nullable CreateCompanyResponse createCompanyResponse) { this.createCompanyResponse = createCompanyResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCompaniesAddResponse build() { - return new CrmCompaniesAddResponse( contentType, statusCode, rawResponse, createCompanyResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllRequest.java index e6702e50..7dd96f4a 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class CrmCompaniesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class CrmCompaniesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private CompaniesFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private CompaniesSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class CrmCompaniesAllRequest { @JsonCreator public CrmCompaniesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable CompaniesFilter filter, + @Nullable CompaniesSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmCompaniesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmCompaniesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCompaniesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCompaniesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCompaniesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmCompaniesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCompaniesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCompaniesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCompaniesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCompaniesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCompaniesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCompaniesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCompaniesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public CrmCompaniesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public CrmCompaniesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public CrmCompaniesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public CrmCompaniesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public CrmCompaniesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public CrmCompaniesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public CrmCompaniesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public CrmCompaniesAllRequest withFilter(CompaniesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public CrmCompaniesAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public CrmCompaniesAllRequest withFilter(@Nullable CompaniesFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public CrmCompaniesAllRequest withSort(CompaniesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public CrmCompaniesAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public CrmCompaniesAllRequest withSort(@Nullable CompaniesSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public CrmCompaniesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public CrmCompaniesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CrmCompaniesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmCompaniesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmCompaniesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmCompaniesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private CompaniesFilter filter; - private Optional sort = Optional.empty(); + private CompaniesSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(CompaniesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable CompaniesFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(CompaniesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable CompaniesSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmCompaniesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new CrmCompaniesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public CrmCompaniesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllRequestBuilder.java index 06a1c94a..915d3bc6 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class CrmCompaniesAllRequestBuilder { - - private CrmCompaniesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCompaniesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCompaniesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCompaniesAllRequestBuilder request(CrmCompaniesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCompaniesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCompaniesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCompaniesAllRequestBuilder request(@Nonnull CrmCompaniesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCompaniesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCompaniesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCompaniesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public CrmCompaniesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new CrmCompaniesAllOperation( - sdkConfiguration, - options); + CrmCompaniesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new CrmCompaniesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - CrmCompaniesAllRequest::withCursor, + CrmCompaniesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllResponse.java index 896d2691..c9857c3c 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCompaniesAllResponse implements Response { /** * Companies */ - private Optional getCompaniesResponse; + private GetCompaniesResponse getCompaniesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCompaniesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCompaniesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCompaniesResponse, "getCompaniesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCompaniesResponse getCompaniesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCompaniesResponse = getCompaniesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCompaniesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Companies */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCompaniesResponse() { - return (Optional) getCompaniesResponse; + return Optional.ofNullable(this.getCompaniesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCompaniesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCompaniesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCompaniesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCompaniesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Companies + * Raw HTTP response; suitable for custom response parsing */ - public CrmCompaniesAllResponse withGetCompaniesResponse(GetCompaniesResponse getCompaniesResponse) { - Utils.checkNotNull(getCompaniesResponse, "getCompaniesResponse"); - this.getCompaniesResponse = Optional.ofNullable(getCompaniesResponse); + public CrmCompaniesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCompaniesAllResponse withGetCompaniesResponse(GetCompaniesResponse get /** * Companies */ - public CrmCompaniesAllResponse withGetCompaniesResponse(Optional getCompaniesResponse) { - Utils.checkNotNull(getCompaniesResponse, "getCompaniesResponse"); + public CrmCompaniesAllResponse withGetCompaniesResponse(@Nullable GetCompaniesResponse getCompaniesResponse) { this.getCompaniesResponse = getCompaniesResponse; return this; } - /** - * Unexpected error - */ - public CrmCompaniesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCompaniesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCompaniesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCompaniesResponse = Optional.empty(); + private GetCompaniesResponse getCompaniesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Companies - */ - public Builder getCompaniesResponse(GetCompaniesResponse getCompaniesResponse) { - Utils.checkNotNull(getCompaniesResponse, "getCompaniesResponse"); - this.getCompaniesResponse = Optional.ofNullable(getCompaniesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Companies */ - public Builder getCompaniesResponse(Optional getCompaniesResponse) { - Utils.checkNotNull(getCompaniesResponse, "getCompaniesResponse"); + public Builder getCompaniesResponse(@Nullable GetCompaniesResponse getCompaniesResponse) { this.getCompaniesResponse = getCompaniesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCompaniesAllResponse build() { - return new CrmCompaniesAllResponse( contentType, statusCode, rawResponse, getCompaniesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteRequest.java index 7efe80ce..2122abc4 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class CrmCompaniesDeleteRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @JsonCreator public CrmCompaniesDeleteRequest( - String id, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - this.id = id; - this.raw = raw; + @Nonnull String id, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; } public CrmCompaniesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmCompaniesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCompaniesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public CrmCompaniesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public CrmCompaniesDeleteRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public CrmCompaniesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCompaniesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCompaniesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmCompaniesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCompaniesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCompaniesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCompaniesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCompaniesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCompaniesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCompaniesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCompaniesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } public CrmCompaniesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCompaniesDeleteRequest( id, raw, consumerId, appId, serviceId); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteRequestBuilder.java index 9b6792ce..38e1bd2f 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCompaniesDeleteRequestBuilder { - - private CrmCompaniesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCompaniesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCompaniesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCompaniesDeleteRequestBuilder request(CrmCompaniesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCompaniesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCompaniesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCompaniesDeleteRequestBuilder request(@Nonnull CrmCompaniesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCompaniesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCompaniesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCompaniesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteResponse.java index bc7edef5..fb4e0b6d 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCompaniesDeleteResponse implements Response { /** * Company deleted */ - private Optional deleteCompanyResponse; + private DeleteCompanyResponse deleteCompanyResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCompaniesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteCompanyResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteCompanyResponse, "deleteCompanyResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteCompanyResponse deleteCompanyResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteCompanyResponse = deleteCompanyResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCompaniesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Company deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteCompanyResponse() { - return (Optional) deleteCompanyResponse; + return Optional.ofNullable(this.deleteCompanyResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCompaniesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCompaniesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCompaniesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCompaniesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Company deleted + * Raw HTTP response; suitable for custom response parsing */ - public CrmCompaniesDeleteResponse withDeleteCompanyResponse(DeleteCompanyResponse deleteCompanyResponse) { - Utils.checkNotNull(deleteCompanyResponse, "deleteCompanyResponse"); - this.deleteCompanyResponse = Optional.ofNullable(deleteCompanyResponse); + public CrmCompaniesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCompaniesDeleteResponse withDeleteCompanyResponse(DeleteCompanyRespons /** * Company deleted */ - public CrmCompaniesDeleteResponse withDeleteCompanyResponse(Optional deleteCompanyResponse) { - Utils.checkNotNull(deleteCompanyResponse, "deleteCompanyResponse"); + public CrmCompaniesDeleteResponse withDeleteCompanyResponse(@Nullable DeleteCompanyResponse deleteCompanyResponse) { this.deleteCompanyResponse = deleteCompanyResponse; return this; } - /** - * Unexpected error - */ - public CrmCompaniesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCompaniesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCompaniesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteCompanyResponse = Optional.empty(); + private DeleteCompanyResponse deleteCompanyResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Company deleted - */ - public Builder deleteCompanyResponse(DeleteCompanyResponse deleteCompanyResponse) { - Utils.checkNotNull(deleteCompanyResponse, "deleteCompanyResponse"); - this.deleteCompanyResponse = Optional.ofNullable(deleteCompanyResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Company deleted */ - public Builder deleteCompanyResponse(Optional deleteCompanyResponse) { - Utils.checkNotNull(deleteCompanyResponse, "deleteCompanyResponse"); + public Builder deleteCompanyResponse(@Nullable DeleteCompanyResponse deleteCompanyResponse) { this.deleteCompanyResponse = deleteCompanyResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCompaniesDeleteResponse build() { - return new CrmCompaniesDeleteResponse( contentType, statusCode, rawResponse, deleteCompanyResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneRequest.java index 3348aa9c..9e27fb6d 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmCompaniesOneRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class CrmCompaniesOneRequest { @JsonCreator public CrmCompaniesOneRequest( - String id, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(fields, "fields"); - this.id = id; - this.raw = raw; + @Nonnull String id, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmCompaniesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmCompaniesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCompaniesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public CrmCompaniesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public CrmCompaniesOneRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public CrmCompaniesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCompaniesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCompaniesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmCompaniesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCompaniesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCompaniesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCompaniesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCompaniesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCompaniesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCompaniesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCompaniesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmCompaniesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmCompaniesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmCompaniesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmCompaniesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCompaniesOneRequest( id, raw, consumerId, appId, serviceId, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneRequestBuilder.java index 755d43eb..02093869 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCompaniesOneRequestBuilder { - - private CrmCompaniesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCompaniesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCompaniesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCompaniesOneRequestBuilder request(CrmCompaniesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCompaniesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCompaniesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCompaniesOneRequestBuilder request(@Nonnull CrmCompaniesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCompaniesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCompaniesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCompaniesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneResponse.java index d17af747..2b8c0bf6 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCompaniesOneResponse implements Response { /** * Company */ - private Optional getCompanyResponse; + private GetCompanyResponse getCompanyResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCompaniesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCompanyResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCompanyResponse, "getCompanyResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCompanyResponse getCompanyResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCompanyResponse = getCompanyResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCompaniesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Company */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCompanyResponse() { - return (Optional) getCompanyResponse; + return Optional.ofNullable(this.getCompanyResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCompaniesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCompaniesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCompaniesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCompaniesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Company + * Raw HTTP response; suitable for custom response parsing */ - public CrmCompaniesOneResponse withGetCompanyResponse(GetCompanyResponse getCompanyResponse) { - Utils.checkNotNull(getCompanyResponse, "getCompanyResponse"); - this.getCompanyResponse = Optional.ofNullable(getCompanyResponse); + public CrmCompaniesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCompaniesOneResponse withGetCompanyResponse(GetCompanyResponse getComp /** * Company */ - public CrmCompaniesOneResponse withGetCompanyResponse(Optional getCompanyResponse) { - Utils.checkNotNull(getCompanyResponse, "getCompanyResponse"); + public CrmCompaniesOneResponse withGetCompanyResponse(@Nullable GetCompanyResponse getCompanyResponse) { this.getCompanyResponse = getCompanyResponse; return this; } - /** - * Unexpected error - */ - public CrmCompaniesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCompaniesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCompaniesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCompanyResponse = Optional.empty(); + private GetCompanyResponse getCompanyResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Company - */ - public Builder getCompanyResponse(GetCompanyResponse getCompanyResponse) { - Utils.checkNotNull(getCompanyResponse, "getCompanyResponse"); - this.getCompanyResponse = Optional.ofNullable(getCompanyResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Company */ - public Builder getCompanyResponse(Optional getCompanyResponse) { - Utils.checkNotNull(getCompanyResponse, "getCompanyResponse"); + public Builder getCompanyResponse(@Nullable GetCompanyResponse getCompanyResponse) { this.getCompanyResponse = getCompanyResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCompaniesOneResponse build() { - return new CrmCompaniesOneResponse( contentType, statusCode, rawResponse, getCompanyResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateRequest.java index c21d8c72..0f881420 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmCompaniesUpdateRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class CrmCompaniesUpdateRequest { @JsonCreator public CrmCompaniesUpdateRequest( - String id, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - Company1Input company1) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(company1, "company1"); - this.id = id; - this.raw = raw; + @Nonnull String id, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull Company1Input company1) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.company1 = company1; + this.company1 = Optional.ofNullable(company1) + .orElseThrow(() -> new IllegalArgumentException("company1 cannot be null")); } public CrmCompaniesUpdateRequest( - String id, - Company1Input company1) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), company1); + @Nonnull String id, + @Nonnull Company1Input company1) { + this(id, null, null, + null, null, company1); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public Company1Input company1() { - return company1; + return this.company1; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmCompaniesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCompaniesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public CrmCompaniesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public CrmCompaniesUpdateRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public CrmCompaniesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCompaniesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCompaniesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmCompaniesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCompaniesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCompaniesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCompaniesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCompaniesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCompaniesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCompaniesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCompaniesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public CrmCompaniesUpdateRequest withCompany1(Company1Input company1) { - Utils.checkNotNull(company1, "company1"); - this.company1 = company1; + + public CrmCompaniesUpdateRequest withCompany1(@Nonnull Company1Input company1) { + this.company1 = Utils.checkNotNull(company1, "company1"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private Company1Input company1; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder company1(Company1Input company1) { - Utils.checkNotNull(company1, "company1"); - this.company1 = company1; + public Builder company1(@Nonnull Company1Input company1) { + this.company1 = Utils.checkNotNull(company1, "company1"); return this; } public CrmCompaniesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCompaniesUpdateRequest( id, raw, consumerId, appId, serviceId, company1); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateRequestBuilder.java index bd24b379..baa2b714 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCompaniesUpdateRequestBuilder { - - private CrmCompaniesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCompaniesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCompaniesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCompaniesUpdateRequestBuilder request(CrmCompaniesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCompaniesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCompaniesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCompaniesUpdateRequestBuilder request(@Nonnull CrmCompaniesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCompaniesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCompaniesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCompaniesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateResponse.java index 21966f0c..9644a79f 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCompaniesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCompaniesUpdateResponse implements Response { /** * Company updated */ - private Optional updateCompanyResponse; + private UpdateCompanyResponse updateCompanyResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCompaniesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateCompanyResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateCompanyResponse, "updateCompanyResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateCompanyResponse updateCompanyResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateCompanyResponse = updateCompanyResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCompaniesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Company updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateCompanyResponse() { - return (Optional) updateCompanyResponse; + return Optional.ofNullable(this.updateCompanyResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCompaniesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCompaniesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCompaniesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCompaniesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Company updated + * Raw HTTP response; suitable for custom response parsing */ - public CrmCompaniesUpdateResponse withUpdateCompanyResponse(UpdateCompanyResponse updateCompanyResponse) { - Utils.checkNotNull(updateCompanyResponse, "updateCompanyResponse"); - this.updateCompanyResponse = Optional.ofNullable(updateCompanyResponse); + public CrmCompaniesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCompaniesUpdateResponse withUpdateCompanyResponse(UpdateCompanyRespons /** * Company updated */ - public CrmCompaniesUpdateResponse withUpdateCompanyResponse(Optional updateCompanyResponse) { - Utils.checkNotNull(updateCompanyResponse, "updateCompanyResponse"); + public CrmCompaniesUpdateResponse withUpdateCompanyResponse(@Nullable UpdateCompanyResponse updateCompanyResponse) { this.updateCompanyResponse = updateCompanyResponse; return this; } - /** - * Unexpected error - */ - public CrmCompaniesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCompaniesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCompaniesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateCompanyResponse = Optional.empty(); + private UpdateCompanyResponse updateCompanyResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Company updated - */ - public Builder updateCompanyResponse(UpdateCompanyResponse updateCompanyResponse) { - Utils.checkNotNull(updateCompanyResponse, "updateCompanyResponse"); - this.updateCompanyResponse = Optional.ofNullable(updateCompanyResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Company updated */ - public Builder updateCompanyResponse(Optional updateCompanyResponse) { - Utils.checkNotNull(updateCompanyResponse, "updateCompanyResponse"); + public Builder updateCompanyResponse(@Nullable UpdateCompanyResponse updateCompanyResponse) { this.updateCompanyResponse = updateCompanyResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCompaniesUpdateResponse build() { - return new CrmCompaniesUpdateResponse( contentType, statusCode, rawResponse, updateCompanyResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsAddRequest.java index 6a5db8a5..a9dff817 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class CrmContactsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class CrmContactsAddRequest { @JsonCreator public CrmContactsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - ContactInput contact) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(contact, "contact"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull ContactInput contact) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.contact = contact; + this.contact = Optional.ofNullable(contact) + .orElseThrow(() -> new IllegalArgumentException("contact cannot be null")); } public CrmContactsAddRequest( - ContactInput contact) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), contact); + @Nonnull ContactInput contact) { + this(null, null, null, + null, contact); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public ContactInput contact() { - return contact; + return this.contact; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmContactsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmContactsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmContactsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmContactsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmContactsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmContactsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmContactsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmContactsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmContactsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmContactsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmContactsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmContactsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public CrmContactsAddRequest withContact(ContactInput contact) { - Utils.checkNotNull(contact, "contact"); - this.contact = contact; + + public CrmContactsAddRequest withContact(@Nonnull ContactInput contact) { + this.contact = Utils.checkNotNull(contact, "contact"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private ContactInput contact; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder contact(ContactInput contact) { - Utils.checkNotNull(contact, "contact"); - this.contact = contact; + public Builder contact(@Nonnull ContactInput contact) { + this.contact = Utils.checkNotNull(contact, "contact"); return this; } public CrmContactsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmContactsAddRequest( raw, consumerId, appId, serviceId, contact); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsAddRequestBuilder.java index b74b41d0..b00ca055 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmContactsAddRequestBuilder { - - private CrmContactsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmContactsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmContactsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmContactsAddRequestBuilder request(CrmContactsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmContactsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmContactsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmContactsAddRequestBuilder request(@Nonnull CrmContactsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmContactsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmContactsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmContactsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsAddResponse.java index db5036e2..85381bef 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmContactsAddResponse implements Response { /** * Contact created */ - private Optional createContactResponse; + private CreateContactResponse createContactResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmContactsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createContactResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createContactResponse, "createContactResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateContactResponse createContactResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createContactResponse = createContactResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmContactsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Contact created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createContactResponse() { - return (Optional) createContactResponse; + return Optional.ofNullable(this.createContactResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmContactsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmContactsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmContactsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmContactsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Contact created + * Raw HTTP response; suitable for custom response parsing */ - public CrmContactsAddResponse withCreateContactResponse(CreateContactResponse createContactResponse) { - Utils.checkNotNull(createContactResponse, "createContactResponse"); - this.createContactResponse = Optional.ofNullable(createContactResponse); + public CrmContactsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmContactsAddResponse withCreateContactResponse(CreateContactResponse cr /** * Contact created */ - public CrmContactsAddResponse withCreateContactResponse(Optional createContactResponse) { - Utils.checkNotNull(createContactResponse, "createContactResponse"); + public CrmContactsAddResponse withCreateContactResponse(@Nullable CreateContactResponse createContactResponse) { this.createContactResponse = createContactResponse; return this; } - /** - * Unexpected error - */ - public CrmContactsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmContactsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmContactsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createContactResponse = Optional.empty(); + private CreateContactResponse createContactResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Contact created - */ - public Builder createContactResponse(CreateContactResponse createContactResponse) { - Utils.checkNotNull(createContactResponse, "createContactResponse"); - this.createContactResponse = Optional.ofNullable(createContactResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Contact created */ - public Builder createContactResponse(Optional createContactResponse) { - Utils.checkNotNull(createContactResponse, "createContactResponse"); + public Builder createContactResponse(@Nullable CreateContactResponse createContactResponse) { this.createContactResponse = createContactResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmContactsAddResponse build() { - return new CrmContactsAddResponse( contentType, statusCode, rawResponse, createContactResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsAllRequest.java index 44753cfa..786a9a98 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class CrmContactsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class CrmContactsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private ContactsFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private ContactsSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class CrmContactsAllRequest { @JsonCreator public CrmContactsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable ContactsFilter filter, + @Nullable ContactsSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmContactsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmContactsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmContactsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmContactsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmContactsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmContactsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmContactsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmContactsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmContactsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmContactsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmContactsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmContactsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmContactsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public CrmContactsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public CrmContactsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public CrmContactsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public CrmContactsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public CrmContactsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public CrmContactsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public CrmContactsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public CrmContactsAllRequest withFilter(ContactsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public CrmContactsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public CrmContactsAllRequest withFilter(@Nullable ContactsFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public CrmContactsAllRequest withSort(ContactsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public CrmContactsAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public CrmContactsAllRequest withSort(@Nullable ContactsSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public CrmContactsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public CrmContactsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CrmContactsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmContactsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmContactsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmContactsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private ContactsFilter filter; - private Optional sort = Optional.empty(); + private ContactsSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(ContactsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable ContactsFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(ContactsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable ContactsSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmContactsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new CrmContactsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public CrmContactsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsAllRequestBuilder.java index b69c0c91..ac07349e 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class CrmContactsAllRequestBuilder { - - private CrmContactsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmContactsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmContactsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmContactsAllRequestBuilder request(CrmContactsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmContactsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmContactsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmContactsAllRequestBuilder request(@Nonnull CrmContactsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmContactsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmContactsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmContactsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public CrmContactsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new CrmContactsAllOperation( - sdkConfiguration, - options); + CrmContactsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new CrmContactsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - CrmContactsAllRequest::withCursor, + CrmContactsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsAllResponse.java index fce7a876..7acaa11c 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmContactsAllResponse implements Response { /** * Contacts */ - private Optional getContactsResponse; + private GetContactsResponse getContactsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmContactsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getContactsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getContactsResponse, "getContactsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetContactsResponse getContactsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getContactsResponse = getContactsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmContactsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Contacts */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getContactsResponse() { - return (Optional) getContactsResponse; + return Optional.ofNullable(this.getContactsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmContactsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmContactsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmContactsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmContactsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Contacts + * Raw HTTP response; suitable for custom response parsing */ - public CrmContactsAllResponse withGetContactsResponse(GetContactsResponse getContactsResponse) { - Utils.checkNotNull(getContactsResponse, "getContactsResponse"); - this.getContactsResponse = Optional.ofNullable(getContactsResponse); + public CrmContactsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmContactsAllResponse withGetContactsResponse(GetContactsResponse getCon /** * Contacts */ - public CrmContactsAllResponse withGetContactsResponse(Optional getContactsResponse) { - Utils.checkNotNull(getContactsResponse, "getContactsResponse"); + public CrmContactsAllResponse withGetContactsResponse(@Nullable GetContactsResponse getContactsResponse) { this.getContactsResponse = getContactsResponse; return this; } - /** - * Unexpected error - */ - public CrmContactsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmContactsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmContactsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getContactsResponse = Optional.empty(); + private GetContactsResponse getContactsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Contacts - */ - public Builder getContactsResponse(GetContactsResponse getContactsResponse) { - Utils.checkNotNull(getContactsResponse, "getContactsResponse"); - this.getContactsResponse = Optional.ofNullable(getContactsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Contacts */ - public Builder getContactsResponse(Optional getContactsResponse) { - Utils.checkNotNull(getContactsResponse, "getContactsResponse"); + public Builder getContactsResponse(@Nullable GetContactsResponse getContactsResponse) { this.getContactsResponse = getContactsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmContactsAllResponse build() { - return new CrmContactsAllResponse( contentType, statusCode, rawResponse, getContactsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteRequest.java index b7e04530..0ff39945 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class CrmContactsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public CrmContactsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public CrmContactsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmContactsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmContactsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmContactsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public CrmContactsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmContactsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmContactsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmContactsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmContactsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmContactsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmContactsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmContactsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmContactsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmContactsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmContactsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmContactsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public CrmContactsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmContactsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteRequestBuilder.java index de2a035d..960d0555 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmContactsDeleteRequestBuilder { - - private CrmContactsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmContactsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmContactsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmContactsDeleteRequestBuilder request(CrmContactsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmContactsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmContactsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmContactsDeleteRequestBuilder request(@Nonnull CrmContactsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmContactsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmContactsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmContactsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteResponse.java index bfecb13b..cc7e7530 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmContactsDeleteResponse implements Response { /** * Contact deleted */ - private Optional deleteContactResponse; + private DeleteContactResponse deleteContactResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmContactsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteContactResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteContactResponse, "deleteContactResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteContactResponse deleteContactResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteContactResponse = deleteContactResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmContactsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Contact deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteContactResponse() { - return (Optional) deleteContactResponse; + return Optional.ofNullable(this.deleteContactResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmContactsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmContactsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmContactsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmContactsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Contact deleted + * Raw HTTP response; suitable for custom response parsing */ - public CrmContactsDeleteResponse withDeleteContactResponse(DeleteContactResponse deleteContactResponse) { - Utils.checkNotNull(deleteContactResponse, "deleteContactResponse"); - this.deleteContactResponse = Optional.ofNullable(deleteContactResponse); + public CrmContactsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmContactsDeleteResponse withDeleteContactResponse(DeleteContactResponse /** * Contact deleted */ - public CrmContactsDeleteResponse withDeleteContactResponse(Optional deleteContactResponse) { - Utils.checkNotNull(deleteContactResponse, "deleteContactResponse"); + public CrmContactsDeleteResponse withDeleteContactResponse(@Nullable DeleteContactResponse deleteContactResponse) { this.deleteContactResponse = deleteContactResponse; return this; } - /** - * Unexpected error - */ - public CrmContactsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmContactsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmContactsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteContactResponse = Optional.empty(); + private DeleteContactResponse deleteContactResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Contact deleted - */ - public Builder deleteContactResponse(DeleteContactResponse deleteContactResponse) { - Utils.checkNotNull(deleteContactResponse, "deleteContactResponse"); - this.deleteContactResponse = Optional.ofNullable(deleteContactResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Contact deleted */ - public Builder deleteContactResponse(Optional deleteContactResponse) { - Utils.checkNotNull(deleteContactResponse, "deleteContactResponse"); + public Builder deleteContactResponse(@Nullable DeleteContactResponse deleteContactResponse) { this.deleteContactResponse = deleteContactResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmContactsDeleteResponse build() { - return new CrmContactsDeleteResponse( contentType, statusCode, rawResponse, deleteContactResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsOneRequest.java index c0378b18..725c26a2 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsOneRequest.java @@ -8,12 +8,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -29,25 +29,25 @@ public class CrmContactsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -59,95 +59,83 @@ public class CrmContactsOneRequest { * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private ContactsFilter filter; @JsonCreator public CrmContactsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields, - Optional filter) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(filter, "filter"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields, + @Nullable ContactsFilter filter) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); this.filter = filter; } public CrmContactsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } public static Builder builder() { @@ -158,18 +146,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmContactsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmContactsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmContactsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -177,93 +155,44 @@ public CrmContactsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmContactsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmContactsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmContactsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmContactsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmContactsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmContactsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmContactsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmContactsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmContactsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmContactsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmContactsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmContactsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = JsonNullable.of(fields); - return this; - } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmContactsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** - * Apply filters - */ - public CrmContactsOneRequest withFilter(ContactsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); + public CrmContactsOneRequest withFields(@Nullable String fields) { + this.fields = JsonNullable.of(fields); return this; } @@ -271,12 +200,12 @@ public CrmContactsOneRequest withFilter(ContactsFilter filter) { /** * Apply filters */ - public CrmContactsOneRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public CrmContactsOneRequest withFilter(@Nullable ContactsFilter filter) { this.filter = filter; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -321,151 +250,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; - private Optional filter = Optional.empty(); + private ContactsFilter filter; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - - /** - * Apply filters - */ - public Builder filter(ContactsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable ContactsFilter filter) { this.filter = filter; return this; } public CrmContactsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmContactsOneRequest( id, consumerId, appId, serviceId, raw, fields, @@ -473,10 +330,10 @@ public CrmContactsOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsOneRequestBuilder.java index 1d2b95b8..4043f80b 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmContactsOneRequestBuilder { - - private CrmContactsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmContactsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmContactsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmContactsOneRequestBuilder request(CrmContactsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmContactsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmContactsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmContactsOneRequestBuilder request(@Nonnull CrmContactsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmContactsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmContactsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmContactsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsOneResponse.java index 4754b6f9..4f328a25 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmContactsOneResponse implements Response { /** * Contact */ - private Optional getContactResponse; + private GetContactResponse getContactResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmContactsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getContactResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getContactResponse, "getContactResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetContactResponse getContactResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getContactResponse = getContactResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmContactsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Contact */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getContactResponse() { - return (Optional) getContactResponse; + return Optional.ofNullable(this.getContactResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmContactsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmContactsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmContactsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmContactsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Contact + * Raw HTTP response; suitable for custom response parsing */ - public CrmContactsOneResponse withGetContactResponse(GetContactResponse getContactResponse) { - Utils.checkNotNull(getContactResponse, "getContactResponse"); - this.getContactResponse = Optional.ofNullable(getContactResponse); + public CrmContactsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmContactsOneResponse withGetContactResponse(GetContactResponse getConta /** * Contact */ - public CrmContactsOneResponse withGetContactResponse(Optional getContactResponse) { - Utils.checkNotNull(getContactResponse, "getContactResponse"); + public CrmContactsOneResponse withGetContactResponse(@Nullable GetContactResponse getContactResponse) { this.getContactResponse = getContactResponse; return this; } - /** - * Unexpected error - */ - public CrmContactsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmContactsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmContactsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getContactResponse = Optional.empty(); + private GetContactResponse getContactResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Contact - */ - public Builder getContactResponse(GetContactResponse getContactResponse) { - Utils.checkNotNull(getContactResponse, "getContactResponse"); - this.getContactResponse = Optional.ofNullable(getContactResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Contact */ - public Builder getContactResponse(Optional getContactResponse) { - Utils.checkNotNull(getContactResponse, "getContactResponse"); + public Builder getContactResponse(@Nullable GetContactResponse getContactResponse) { this.getContactResponse = getContactResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmContactsOneResponse build() { - return new CrmContactsOneResponse( contentType, statusCode, rawResponse, getContactResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateRequest.java index 536f2420..b8cef20c 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmContactsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class CrmContactsUpdateRequest { @JsonCreator public CrmContactsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - ContactInput contact) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(contact, "contact"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull ContactInput contact) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.contact = contact; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.contact = Optional.ofNullable(contact) + .orElseThrow(() -> new IllegalArgumentException("contact cannot be null")); } public CrmContactsUpdateRequest( - String id, - ContactInput contact) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), contact); + @Nonnull String id, + @Nonnull ContactInput contact) { + this(id, null, null, + null, null, contact); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public ContactInput contact() { - return contact; + return this.contact; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmContactsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmContactsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmContactsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public CrmContactsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmContactsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmContactsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmContactsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmContactsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmContactsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmContactsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmContactsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmContactsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmContactsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmContactsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmContactsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public CrmContactsUpdateRequest withContact(ContactInput contact) { - Utils.checkNotNull(contact, "contact"); - this.contact = contact; + + public CrmContactsUpdateRequest withContact(@Nonnull ContactInput contact) { + this.contact = Utils.checkNotNull(contact, "contact"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private ContactInput contact; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder contact(ContactInput contact) { - Utils.checkNotNull(contact, "contact"); - this.contact = contact; + public Builder contact(@Nonnull ContactInput contact) { + this.contact = Utils.checkNotNull(contact, "contact"); return this; } public CrmContactsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmContactsUpdateRequest( id, consumerId, appId, serviceId, raw, contact); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateRequestBuilder.java index 1166f3f2..c090d4eb 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmContactsUpdateRequestBuilder { - - private CrmContactsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmContactsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmContactsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmContactsUpdateRequestBuilder request(CrmContactsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmContactsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmContactsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmContactsUpdateRequestBuilder request(@Nonnull CrmContactsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmContactsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmContactsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmContactsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateResponse.java index bf85106f..77468d39 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmContactsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmContactsUpdateResponse implements Response { /** * Contact updated */ - private Optional updateContactResponse; + private UpdateContactResponse updateContactResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmContactsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateContactResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateContactResponse, "updateContactResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateContactResponse updateContactResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateContactResponse = updateContactResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmContactsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Contact updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateContactResponse() { - return (Optional) updateContactResponse; + return Optional.ofNullable(this.updateContactResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmContactsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmContactsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmContactsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmContactsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Contact updated + * Raw HTTP response; suitable for custom response parsing */ - public CrmContactsUpdateResponse withUpdateContactResponse(UpdateContactResponse updateContactResponse) { - Utils.checkNotNull(updateContactResponse, "updateContactResponse"); - this.updateContactResponse = Optional.ofNullable(updateContactResponse); + public CrmContactsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmContactsUpdateResponse withUpdateContactResponse(UpdateContactResponse /** * Contact updated */ - public CrmContactsUpdateResponse withUpdateContactResponse(Optional updateContactResponse) { - Utils.checkNotNull(updateContactResponse, "updateContactResponse"); + public CrmContactsUpdateResponse withUpdateContactResponse(@Nullable UpdateContactResponse updateContactResponse) { this.updateContactResponse = updateContactResponse; return this; } - /** - * Unexpected error - */ - public CrmContactsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmContactsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmContactsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateContactResponse = Optional.empty(); + private UpdateContactResponse updateContactResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Contact updated - */ - public Builder updateContactResponse(UpdateContactResponse updateContactResponse) { - Utils.checkNotNull(updateContactResponse, "updateContactResponse"); - this.updateContactResponse = Optional.ofNullable(updateContactResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Contact updated */ - public Builder updateContactResponse(Optional updateContactResponse) { - Utils.checkNotNull(updateContactResponse, "updateContactResponse"); + public Builder updateContactResponse(@Nullable UpdateContactResponse updateContactResponse) { this.updateContactResponse = updateContactResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmContactsUpdateResponse build() { - return new CrmContactsUpdateResponse( contentType, statusCode, rawResponse, updateContactResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddRequest.java index 51c3f5f2..9c0e9948 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class CrmCustomObjectSchemasAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class CrmCustomObjectSchemasAddRequest { @JsonCreator public CrmCustomObjectSchemasAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - CustomObjectSchemaInput customObjectSchema) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(customObjectSchema, "customObjectSchema"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull CustomObjectSchemaInput customObjectSchema) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.customObjectSchema = customObjectSchema; + this.customObjectSchema = Optional.ofNullable(customObjectSchema) + .orElseThrow(() -> new IllegalArgumentException("customObjectSchema cannot be null")); } public CrmCustomObjectSchemasAddRequest( - CustomObjectSchemaInput customObjectSchema) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), customObjectSchema); + @Nonnull CustomObjectSchemaInput customObjectSchema) { + this(null, null, null, + null, customObjectSchema); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public CustomObjectSchemaInput customObjectSchema() { - return customObjectSchema; + return this.customObjectSchema; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmCustomObjectSchemasAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCustomObjectSchemasAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCustomObjectSchemasAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCustomObjectSchemasAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmCustomObjectSchemasAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCustomObjectSchemasAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCustomObjectSchemasAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCustomObjectSchemasAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCustomObjectSchemasAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCustomObjectSchemasAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCustomObjectSchemasAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCustomObjectSchemasAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public CrmCustomObjectSchemasAddRequest withCustomObjectSchema(CustomObjectSchemaInput customObjectSchema) { - Utils.checkNotNull(customObjectSchema, "customObjectSchema"); - this.customObjectSchema = customObjectSchema; + + public CrmCustomObjectSchemasAddRequest withCustomObjectSchema(@Nonnull CustomObjectSchemaInput customObjectSchema) { + this.customObjectSchema = Utils.checkNotNull(customObjectSchema, "customObjectSchema"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private CustomObjectSchemaInput customObjectSchema; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder customObjectSchema(CustomObjectSchemaInput customObjectSchema) { - Utils.checkNotNull(customObjectSchema, "customObjectSchema"); - this.customObjectSchema = customObjectSchema; + public Builder customObjectSchema(@Nonnull CustomObjectSchemaInput customObjectSchema) { + this.customObjectSchema = Utils.checkNotNull(customObjectSchema, "customObjectSchema"); return this; } public CrmCustomObjectSchemasAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCustomObjectSchemasAddRequest( raw, consumerId, appId, serviceId, customObjectSchema); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddRequestBuilder.java index 3d6ff9c9..5cd02a5e 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCustomObjectSchemasAddRequestBuilder { - - private CrmCustomObjectSchemasAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCustomObjectSchemasAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCustomObjectSchemasAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCustomObjectSchemasAddRequestBuilder request(CrmCustomObjectSchemasAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCustomObjectSchemasAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCustomObjectSchemasAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCustomObjectSchemasAddRequestBuilder request(@Nonnull CrmCustomObjectSchemasAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCustomObjectSchemasAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCustomObjectSchemasAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCustomObjectSchemasAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddResponse.java index 3bf6f13e..bc2f6629 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCustomObjectSchemasAddResponse implements Response { /** * Custom object schema created */ - private Optional createCustomObjectSchemaResponse; + private CreateCustomObjectSchemaResponse createCustomObjectSchemaResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCustomObjectSchemasAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createCustomObjectSchemaResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createCustomObjectSchemaResponse, "createCustomObjectSchemaResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateCustomObjectSchemaResponse createCustomObjectSchemaResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createCustomObjectSchemaResponse = createCustomObjectSchemaResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCustomObjectSchemasAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom object schema created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createCustomObjectSchemaResponse() { - return (Optional) createCustomObjectSchemaResponse; + return Optional.ofNullable(this.createCustomObjectSchemaResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCustomObjectSchemasAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCustomObjectSchemasAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCustomObjectSchemasAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCustomObjectSchemasAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom object schema created + * Raw HTTP response; suitable for custom response parsing */ - public CrmCustomObjectSchemasAddResponse withCreateCustomObjectSchemaResponse(CreateCustomObjectSchemaResponse createCustomObjectSchemaResponse) { - Utils.checkNotNull(createCustomObjectSchemaResponse, "createCustomObjectSchemaResponse"); - this.createCustomObjectSchemaResponse = Optional.ofNullable(createCustomObjectSchemaResponse); + public CrmCustomObjectSchemasAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCustomObjectSchemasAddResponse withCreateCustomObjectSchemaResponse(Cr /** * Custom object schema created */ - public CrmCustomObjectSchemasAddResponse withCreateCustomObjectSchemaResponse(Optional createCustomObjectSchemaResponse) { - Utils.checkNotNull(createCustomObjectSchemaResponse, "createCustomObjectSchemaResponse"); + public CrmCustomObjectSchemasAddResponse withCreateCustomObjectSchemaResponse(@Nullable CreateCustomObjectSchemaResponse createCustomObjectSchemaResponse) { this.createCustomObjectSchemaResponse = createCustomObjectSchemaResponse; return this; } - /** - * Unexpected error - */ - public CrmCustomObjectSchemasAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCustomObjectSchemasAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCustomObjectSchemasAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createCustomObjectSchemaResponse = Optional.empty(); + private CreateCustomObjectSchemaResponse createCustomObjectSchemaResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom object schema created - */ - public Builder createCustomObjectSchemaResponse(CreateCustomObjectSchemaResponse createCustomObjectSchemaResponse) { - Utils.checkNotNull(createCustomObjectSchemaResponse, "createCustomObjectSchemaResponse"); - this.createCustomObjectSchemaResponse = Optional.ofNullable(createCustomObjectSchemaResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom object schema created */ - public Builder createCustomObjectSchemaResponse(Optional createCustomObjectSchemaResponse) { - Utils.checkNotNull(createCustomObjectSchemaResponse, "createCustomObjectSchemaResponse"); + public Builder createCustomObjectSchemaResponse(@Nullable CreateCustomObjectSchemaResponse createCustomObjectSchemaResponse) { this.createCustomObjectSchemaResponse = createCustomObjectSchemaResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCustomObjectSchemasAddResponse build() { - return new CrmCustomObjectSchemasAddResponse( contentType, statusCode, rawResponse, createCustomObjectSchemaResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllRequest.java index 7f64eb04..5372ac39 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class CrmCustomObjectSchemasAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,100 +54,88 @@ public class CrmCustomObjectSchemasAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; @JsonCreator public CrmCustomObjectSchemasAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; } public CrmCustomObjectSchemasAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -159,103 +146,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmCustomObjectSchemasAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCustomObjectSchemasAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCustomObjectSchemasAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCustomObjectSchemasAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmCustomObjectSchemasAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCustomObjectSchemasAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCustomObjectSchemasAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCustomObjectSchemasAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCustomObjectSchemasAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCustomObjectSchemasAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCustomObjectSchemasAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCustomObjectSchemasAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public CrmCustomObjectSchemasAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public CrmCustomObjectSchemasAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public CrmCustomObjectSchemasAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public CrmCustomObjectSchemasAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -263,31 +191,21 @@ public CrmCustomObjectSchemasAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public CrmCustomObjectSchemasAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public CrmCustomObjectSchemasAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public CrmCustomObjectSchemasAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public CrmCustomObjectSchemasAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CrmCustomObjectSchemasAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -330,165 +248,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } public CrmCustomObjectSchemasAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new CrmCustomObjectSchemasAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -496,16 +330,16 @@ public CrmCustomObjectSchemasAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllRequestBuilder.java index 63ee4dc3..fd87bfc5 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class CrmCustomObjectSchemasAllRequestBuilder { - - private CrmCustomObjectSchemasAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCustomObjectSchemasAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCustomObjectSchemasAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCustomObjectSchemasAllRequestBuilder request(CrmCustomObjectSchemasAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCustomObjectSchemasAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCustomObjectSchemasAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCustomObjectSchemasAllRequestBuilder request(@Nonnull CrmCustomObjectSchemasAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCustomObjectSchemasAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCustomObjectSchemasAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCustomObjectSchemasAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public CrmCustomObjectSchemasAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new CrmCustomObjectSchemasAllOperation( - sdkConfiguration, - options); + CrmCustomObjectSchemasAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new CrmCustomObjectSchemasAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - CrmCustomObjectSchemasAllRequest::withCursor, + CrmCustomObjectSchemasAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllResponse.java index 8f8d78d6..b9ac7d65 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCustomObjectSchemasAllResponse implements Response { /** * Custom object schemas */ - private Optional getCustomObjectSchemasResponse; + private GetCustomObjectSchemasResponse getCustomObjectSchemasResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCustomObjectSchemasAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCustomObjectSchemasResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCustomObjectSchemasResponse, "getCustomObjectSchemasResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCustomObjectSchemasResponse getCustomObjectSchemasResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCustomObjectSchemasResponse = getCustomObjectSchemasResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCustomObjectSchemasAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom object schemas */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCustomObjectSchemasResponse() { - return (Optional) getCustomObjectSchemasResponse; + return Optional.ofNullable(this.getCustomObjectSchemasResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCustomObjectSchemasAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCustomObjectSchemasAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCustomObjectSchemasAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCustomObjectSchemasAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom object schemas + * Raw HTTP response; suitable for custom response parsing */ - public CrmCustomObjectSchemasAllResponse withGetCustomObjectSchemasResponse(GetCustomObjectSchemasResponse getCustomObjectSchemasResponse) { - Utils.checkNotNull(getCustomObjectSchemasResponse, "getCustomObjectSchemasResponse"); - this.getCustomObjectSchemasResponse = Optional.ofNullable(getCustomObjectSchemasResponse); + public CrmCustomObjectSchemasAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCustomObjectSchemasAllResponse withGetCustomObjectSchemasResponse(GetC /** * Custom object schemas */ - public CrmCustomObjectSchemasAllResponse withGetCustomObjectSchemasResponse(Optional getCustomObjectSchemasResponse) { - Utils.checkNotNull(getCustomObjectSchemasResponse, "getCustomObjectSchemasResponse"); + public CrmCustomObjectSchemasAllResponse withGetCustomObjectSchemasResponse(@Nullable GetCustomObjectSchemasResponse getCustomObjectSchemasResponse) { this.getCustomObjectSchemasResponse = getCustomObjectSchemasResponse; return this; } - /** - * Unexpected error - */ - public CrmCustomObjectSchemasAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCustomObjectSchemasAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCustomObjectSchemasAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCustomObjectSchemasResponse = Optional.empty(); + private GetCustomObjectSchemasResponse getCustomObjectSchemasResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom object schemas - */ - public Builder getCustomObjectSchemasResponse(GetCustomObjectSchemasResponse getCustomObjectSchemasResponse) { - Utils.checkNotNull(getCustomObjectSchemasResponse, "getCustomObjectSchemasResponse"); - this.getCustomObjectSchemasResponse = Optional.ofNullable(getCustomObjectSchemasResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom object schemas */ - public Builder getCustomObjectSchemasResponse(Optional getCustomObjectSchemasResponse) { - Utils.checkNotNull(getCustomObjectSchemasResponse, "getCustomObjectSchemasResponse"); + public Builder getCustomObjectSchemasResponse(@Nullable GetCustomObjectSchemasResponse getCustomObjectSchemasResponse) { this.getCustomObjectSchemasResponse = getCustomObjectSchemasResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCustomObjectSchemasAllResponse build() { - return new CrmCustomObjectSchemasAllResponse( contentType, statusCode, rawResponse, getCustomObjectSchemasResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteRequest.java index 95c54a5e..3a43bbbb 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class CrmCustomObjectSchemasDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public CrmCustomObjectSchemasDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public CrmCustomObjectSchemasDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmCustomObjectSchemasDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCustomObjectSchemasDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmCustomObjectSchemasDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public CrmCustomObjectSchemasDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmCustomObjectSchemasDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCustomObjectSchemasDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCustomObjectSchemasDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCustomObjectSchemasDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCustomObjectSchemasDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCustomObjectSchemasDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCustomObjectSchemasDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCustomObjectSchemasDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCustomObjectSchemasDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmCustomObjectSchemasDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCustomObjectSchemasDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public CrmCustomObjectSchemasDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCustomObjectSchemasDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteRequestBuilder.java index 156d94a1..7bbf0b0c 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCustomObjectSchemasDeleteRequestBuilder { - - private CrmCustomObjectSchemasDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCustomObjectSchemasDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCustomObjectSchemasDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCustomObjectSchemasDeleteRequestBuilder request(CrmCustomObjectSchemasDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCustomObjectSchemasDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCustomObjectSchemasDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCustomObjectSchemasDeleteRequestBuilder request(@Nonnull CrmCustomObjectSchemasDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCustomObjectSchemasDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCustomObjectSchemasDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCustomObjectSchemasDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteResponse.java index b7331561..506f7d67 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCustomObjectSchemasDeleteResponse implements Response { /** * Custom object schema deleted */ - private Optional deleteCustomObjectSchemaResponse; + private DeleteCustomObjectSchemaResponse deleteCustomObjectSchemaResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCustomObjectSchemasDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteCustomObjectSchemaResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteCustomObjectSchemaResponse, "deleteCustomObjectSchemaResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteCustomObjectSchemaResponse deleteCustomObjectSchemaResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteCustomObjectSchemaResponse = deleteCustomObjectSchemaResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCustomObjectSchemasDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom object schema deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteCustomObjectSchemaResponse() { - return (Optional) deleteCustomObjectSchemaResponse; + return Optional.ofNullable(this.deleteCustomObjectSchemaResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCustomObjectSchemasDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCustomObjectSchemasDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCustomObjectSchemasDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCustomObjectSchemasDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom object schema deleted + * Raw HTTP response; suitable for custom response parsing */ - public CrmCustomObjectSchemasDeleteResponse withDeleteCustomObjectSchemaResponse(DeleteCustomObjectSchemaResponse deleteCustomObjectSchemaResponse) { - Utils.checkNotNull(deleteCustomObjectSchemaResponse, "deleteCustomObjectSchemaResponse"); - this.deleteCustomObjectSchemaResponse = Optional.ofNullable(deleteCustomObjectSchemaResponse); + public CrmCustomObjectSchemasDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCustomObjectSchemasDeleteResponse withDeleteCustomObjectSchemaResponse /** * Custom object schema deleted */ - public CrmCustomObjectSchemasDeleteResponse withDeleteCustomObjectSchemaResponse(Optional deleteCustomObjectSchemaResponse) { - Utils.checkNotNull(deleteCustomObjectSchemaResponse, "deleteCustomObjectSchemaResponse"); + public CrmCustomObjectSchemasDeleteResponse withDeleteCustomObjectSchemaResponse(@Nullable DeleteCustomObjectSchemaResponse deleteCustomObjectSchemaResponse) { this.deleteCustomObjectSchemaResponse = deleteCustomObjectSchemaResponse; return this; } - /** - * Unexpected error - */ - public CrmCustomObjectSchemasDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCustomObjectSchemasDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCustomObjectSchemasDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteCustomObjectSchemaResponse = Optional.empty(); + private DeleteCustomObjectSchemaResponse deleteCustomObjectSchemaResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom object schema deleted - */ - public Builder deleteCustomObjectSchemaResponse(DeleteCustomObjectSchemaResponse deleteCustomObjectSchemaResponse) { - Utils.checkNotNull(deleteCustomObjectSchemaResponse, "deleteCustomObjectSchemaResponse"); - this.deleteCustomObjectSchemaResponse = Optional.ofNullable(deleteCustomObjectSchemaResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom object schema deleted */ - public Builder deleteCustomObjectSchemaResponse(Optional deleteCustomObjectSchemaResponse) { - Utils.checkNotNull(deleteCustomObjectSchemaResponse, "deleteCustomObjectSchemaResponse"); + public Builder deleteCustomObjectSchemaResponse(@Nullable DeleteCustomObjectSchemaResponse deleteCustomObjectSchemaResponse) { this.deleteCustomObjectSchemaResponse = deleteCustomObjectSchemaResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCustomObjectSchemasDeleteResponse build() { - return new CrmCustomObjectSchemasDeleteResponse( contentType, statusCode, rawResponse, deleteCustomObjectSchemaResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneRequest.java index 734b3300..0cd4a897 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class CrmCustomObjectSchemasOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public CrmCustomObjectSchemasOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public CrmCustomObjectSchemasOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmCustomObjectSchemasOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCustomObjectSchemasOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmCustomObjectSchemasOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public CrmCustomObjectSchemasOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmCustomObjectSchemasOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCustomObjectSchemasOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCustomObjectSchemasOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCustomObjectSchemasOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCustomObjectSchemasOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCustomObjectSchemasOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCustomObjectSchemasOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCustomObjectSchemasOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCustomObjectSchemasOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmCustomObjectSchemasOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCustomObjectSchemasOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public CrmCustomObjectSchemasOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCustomObjectSchemasOneRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneRequestBuilder.java index 312760f5..ab313583 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCustomObjectSchemasOneRequestBuilder { - - private CrmCustomObjectSchemasOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCustomObjectSchemasOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCustomObjectSchemasOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCustomObjectSchemasOneRequestBuilder request(CrmCustomObjectSchemasOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCustomObjectSchemasOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCustomObjectSchemasOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCustomObjectSchemasOneRequestBuilder request(@Nonnull CrmCustomObjectSchemasOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCustomObjectSchemasOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCustomObjectSchemasOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCustomObjectSchemasOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneResponse.java index 897ce294..5af08010 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCustomObjectSchemasOneResponse implements Response { /** * Custom object schema */ - private Optional getCustomObjectSchemaResponse; + private GetCustomObjectSchemaResponse getCustomObjectSchemaResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCustomObjectSchemasOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCustomObjectSchemaResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCustomObjectSchemaResponse, "getCustomObjectSchemaResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCustomObjectSchemaResponse getCustomObjectSchemaResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCustomObjectSchemaResponse = getCustomObjectSchemaResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCustomObjectSchemasOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom object schema */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCustomObjectSchemaResponse() { - return (Optional) getCustomObjectSchemaResponse; + return Optional.ofNullable(this.getCustomObjectSchemaResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCustomObjectSchemasOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCustomObjectSchemasOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCustomObjectSchemasOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCustomObjectSchemasOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom object schema + * Raw HTTP response; suitable for custom response parsing */ - public CrmCustomObjectSchemasOneResponse withGetCustomObjectSchemaResponse(GetCustomObjectSchemaResponse getCustomObjectSchemaResponse) { - Utils.checkNotNull(getCustomObjectSchemaResponse, "getCustomObjectSchemaResponse"); - this.getCustomObjectSchemaResponse = Optional.ofNullable(getCustomObjectSchemaResponse); + public CrmCustomObjectSchemasOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCustomObjectSchemasOneResponse withGetCustomObjectSchemaResponse(GetCu /** * Custom object schema */ - public CrmCustomObjectSchemasOneResponse withGetCustomObjectSchemaResponse(Optional getCustomObjectSchemaResponse) { - Utils.checkNotNull(getCustomObjectSchemaResponse, "getCustomObjectSchemaResponse"); + public CrmCustomObjectSchemasOneResponse withGetCustomObjectSchemaResponse(@Nullable GetCustomObjectSchemaResponse getCustomObjectSchemaResponse) { this.getCustomObjectSchemaResponse = getCustomObjectSchemaResponse; return this; } - /** - * Unexpected error - */ - public CrmCustomObjectSchemasOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCustomObjectSchemasOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCustomObjectSchemasOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCustomObjectSchemaResponse = Optional.empty(); + private GetCustomObjectSchemaResponse getCustomObjectSchemaResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom object schema - */ - public Builder getCustomObjectSchemaResponse(GetCustomObjectSchemaResponse getCustomObjectSchemaResponse) { - Utils.checkNotNull(getCustomObjectSchemaResponse, "getCustomObjectSchemaResponse"); - this.getCustomObjectSchemaResponse = Optional.ofNullable(getCustomObjectSchemaResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom object schema */ - public Builder getCustomObjectSchemaResponse(Optional getCustomObjectSchemaResponse) { - Utils.checkNotNull(getCustomObjectSchemaResponse, "getCustomObjectSchemaResponse"); + public Builder getCustomObjectSchemaResponse(@Nullable GetCustomObjectSchemaResponse getCustomObjectSchemaResponse) { this.getCustomObjectSchemaResponse = getCustomObjectSchemaResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCustomObjectSchemasOneResponse build() { - return new CrmCustomObjectSchemasOneResponse( contentType, statusCode, rawResponse, getCustomObjectSchemaResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateRequest.java index 1162353c..212e75c6 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmCustomObjectSchemasUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class CrmCustomObjectSchemasUpdateRequest { @JsonCreator public CrmCustomObjectSchemasUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - CustomObjectSchemaInput customObjectSchema) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(customObjectSchema, "customObjectSchema"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull CustomObjectSchemaInput customObjectSchema) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.customObjectSchema = customObjectSchema; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.customObjectSchema = Optional.ofNullable(customObjectSchema) + .orElseThrow(() -> new IllegalArgumentException("customObjectSchema cannot be null")); } public CrmCustomObjectSchemasUpdateRequest( - String id, - CustomObjectSchemaInput customObjectSchema) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), customObjectSchema); + @Nonnull String id, + @Nonnull CustomObjectSchemaInput customObjectSchema) { + this(id, null, null, + null, null, customObjectSchema); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public CustomObjectSchemaInput customObjectSchema() { - return customObjectSchema; + return this.customObjectSchema; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmCustomObjectSchemasUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCustomObjectSchemasUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmCustomObjectSchemasUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public CrmCustomObjectSchemasUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmCustomObjectSchemasUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCustomObjectSchemasUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCustomObjectSchemasUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCustomObjectSchemasUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCustomObjectSchemasUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCustomObjectSchemasUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCustomObjectSchemasUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCustomObjectSchemasUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCustomObjectSchemasUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmCustomObjectSchemasUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCustomObjectSchemasUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public CrmCustomObjectSchemasUpdateRequest withCustomObjectSchema(CustomObjectSchemaInput customObjectSchema) { - Utils.checkNotNull(customObjectSchema, "customObjectSchema"); - this.customObjectSchema = customObjectSchema; + + public CrmCustomObjectSchemasUpdateRequest withCustomObjectSchema(@Nonnull CustomObjectSchemaInput customObjectSchema) { + this.customObjectSchema = Utils.checkNotNull(customObjectSchema, "customObjectSchema"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private CustomObjectSchemaInput customObjectSchema; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder customObjectSchema(CustomObjectSchemaInput customObjectSchema) { - Utils.checkNotNull(customObjectSchema, "customObjectSchema"); - this.customObjectSchema = customObjectSchema; + public Builder customObjectSchema(@Nonnull CustomObjectSchemaInput customObjectSchema) { + this.customObjectSchema = Utils.checkNotNull(customObjectSchema, "customObjectSchema"); return this; } public CrmCustomObjectSchemasUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCustomObjectSchemasUpdateRequest( id, consumerId, appId, serviceId, raw, customObjectSchema); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateRequestBuilder.java index be1ddc81..9b2ebce7 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCustomObjectSchemasUpdateRequestBuilder { - - private CrmCustomObjectSchemasUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCustomObjectSchemasUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCustomObjectSchemasUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCustomObjectSchemasUpdateRequestBuilder request(CrmCustomObjectSchemasUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCustomObjectSchemasUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCustomObjectSchemasUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCustomObjectSchemasUpdateRequestBuilder request(@Nonnull CrmCustomObjectSchemasUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCustomObjectSchemasUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCustomObjectSchemasUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCustomObjectSchemasUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateResponse.java index dfb022fe..3a32650b 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectSchemasUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCustomObjectSchemasUpdateResponse implements Response { /** * Custom object schema updated */ - private Optional updateCustomObjectSchemaResponse; + private UpdateCustomObjectSchemaResponse updateCustomObjectSchemaResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCustomObjectSchemasUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateCustomObjectSchemaResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateCustomObjectSchemaResponse, "updateCustomObjectSchemaResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateCustomObjectSchemaResponse updateCustomObjectSchemaResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateCustomObjectSchemaResponse = updateCustomObjectSchemaResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCustomObjectSchemasUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom object schema updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateCustomObjectSchemaResponse() { - return (Optional) updateCustomObjectSchemaResponse; + return Optional.ofNullable(this.updateCustomObjectSchemaResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCustomObjectSchemasUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCustomObjectSchemasUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCustomObjectSchemasUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCustomObjectSchemasUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom object schema updated + * Raw HTTP response; suitable for custom response parsing */ - public CrmCustomObjectSchemasUpdateResponse withUpdateCustomObjectSchemaResponse(UpdateCustomObjectSchemaResponse updateCustomObjectSchemaResponse) { - Utils.checkNotNull(updateCustomObjectSchemaResponse, "updateCustomObjectSchemaResponse"); - this.updateCustomObjectSchemaResponse = Optional.ofNullable(updateCustomObjectSchemaResponse); + public CrmCustomObjectSchemasUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCustomObjectSchemasUpdateResponse withUpdateCustomObjectSchemaResponse /** * Custom object schema updated */ - public CrmCustomObjectSchemasUpdateResponse withUpdateCustomObjectSchemaResponse(Optional updateCustomObjectSchemaResponse) { - Utils.checkNotNull(updateCustomObjectSchemaResponse, "updateCustomObjectSchemaResponse"); + public CrmCustomObjectSchemasUpdateResponse withUpdateCustomObjectSchemaResponse(@Nullable UpdateCustomObjectSchemaResponse updateCustomObjectSchemaResponse) { this.updateCustomObjectSchemaResponse = updateCustomObjectSchemaResponse; return this; } - /** - * Unexpected error - */ - public CrmCustomObjectSchemasUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCustomObjectSchemasUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCustomObjectSchemasUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateCustomObjectSchemaResponse = Optional.empty(); + private UpdateCustomObjectSchemaResponse updateCustomObjectSchemaResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom object schema updated - */ - public Builder updateCustomObjectSchemaResponse(UpdateCustomObjectSchemaResponse updateCustomObjectSchemaResponse) { - Utils.checkNotNull(updateCustomObjectSchemaResponse, "updateCustomObjectSchemaResponse"); - this.updateCustomObjectSchemaResponse = Optional.ofNullable(updateCustomObjectSchemaResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom object schema updated */ - public Builder updateCustomObjectSchemaResponse(Optional updateCustomObjectSchemaResponse) { - Utils.checkNotNull(updateCustomObjectSchemaResponse, "updateCustomObjectSchemaResponse"); + public Builder updateCustomObjectSchemaResponse(@Nullable UpdateCustomObjectSchemaResponse updateCustomObjectSchemaResponse) { this.updateCustomObjectSchemaResponse = updateCustomObjectSchemaResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCustomObjectSchemasUpdateResponse build() { - return new CrmCustomObjectSchemasUpdateResponse( contentType, statusCode, rawResponse, updateCustomObjectSchemaResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddRequest.java index a71eeb38..0ca00f8b 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class CrmCustomObjectsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The id of the custom object to query @@ -53,76 +54,67 @@ public class CrmCustomObjectsAddRequest { @JsonCreator public CrmCustomObjectsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - String objectId, - CustomObjectInput customObject) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(objectId, "objectId"); - Utils.checkNotNull(customObject, "customObject"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull String objectId, + @Nonnull CustomObjectInput customObject) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.objectId = objectId; - this.customObject = customObject; + this.objectId = Optional.ofNullable(objectId) + .orElseThrow(() -> new IllegalArgumentException("objectId cannot be null")); + this.customObject = Optional.ofNullable(customObject) + .orElseThrow(() -> new IllegalArgumentException("customObject cannot be null")); } public CrmCustomObjectsAddRequest( - String objectId, - CustomObjectInput customObject) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), objectId, customObject); + @Nonnull String objectId, + @Nonnull CustomObjectInput customObject) { + this(null, null, null, + null, objectId, customObject); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The id of the custom object to query */ - @JsonIgnore public String objectId() { - return objectId; + return this.objectId; } - @JsonIgnore public CustomObjectInput customObject() { - return customObject; + return this.customObject; } public static Builder builder() { @@ -133,94 +125,54 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmCustomObjectsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCustomObjectsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCustomObjectsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCustomObjectsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmCustomObjectsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCustomObjectsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCustomObjectsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCustomObjectsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCustomObjectsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCustomObjectsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCustomObjectsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCustomObjectsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The id of the custom object to query */ - public CrmCustomObjectsAddRequest withObjectId(String objectId) { - Utils.checkNotNull(objectId, "objectId"); - this.objectId = objectId; + public CrmCustomObjectsAddRequest withObjectId(@Nonnull String objectId) { + this.objectId = Utils.checkNotNull(objectId, "objectId"); return this; } - public CrmCustomObjectsAddRequest withCustomObject(CustomObjectInput customObject) { - Utils.checkNotNull(customObject, "customObject"); - this.customObject = customObject; + + public CrmCustomObjectsAddRequest withCustomObject(@Nonnull CustomObjectInput customObject) { + this.customObject = Utils.checkNotNull(customObject, "customObject"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -260,13 +212,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private String objectId; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The id of the custom object to query */ - public Builder objectId(String objectId) { - Utils.checkNotNull(objectId, "objectId"); - this.objectId = objectId; + public Builder objectId(@Nonnull String objectId) { + this.objectId = Utils.checkNotNull(objectId, "objectId"); return this; } - - public Builder customObject(CustomObjectInput customObject) { - Utils.checkNotNull(customObject, "customObject"); - this.customObject = customObject; + public Builder customObject(@Nonnull CustomObjectInput customObject) { + this.customObject = Utils.checkNotNull(customObject, "customObject"); return this; } public CrmCustomObjectsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCustomObjectsAddRequest( raw, consumerId, appId, serviceId, objectId, customObject); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddRequestBuilder.java index d6aacdaa..fdf03fd1 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCustomObjectsAddRequestBuilder { - - private CrmCustomObjectsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCustomObjectsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCustomObjectsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCustomObjectsAddRequestBuilder request(CrmCustomObjectsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCustomObjectsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCustomObjectsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCustomObjectsAddRequestBuilder request(@Nonnull CrmCustomObjectsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCustomObjectsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCustomObjectsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCustomObjectsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddResponse.java index 6a2f27a5..727c6601 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCustomObjectsAddResponse implements Response { /** * Custom object created */ - private Optional createCustomObjectResponse; + private CreateCustomObjectResponse createCustomObjectResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCustomObjectsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createCustomObjectResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createCustomObjectResponse, "createCustomObjectResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateCustomObjectResponse createCustomObjectResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createCustomObjectResponse = createCustomObjectResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCustomObjectsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom object created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createCustomObjectResponse() { - return (Optional) createCustomObjectResponse; + return Optional.ofNullable(this.createCustomObjectResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCustomObjectsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCustomObjectsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCustomObjectsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCustomObjectsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom object created + * Raw HTTP response; suitable for custom response parsing */ - public CrmCustomObjectsAddResponse withCreateCustomObjectResponse(CreateCustomObjectResponse createCustomObjectResponse) { - Utils.checkNotNull(createCustomObjectResponse, "createCustomObjectResponse"); - this.createCustomObjectResponse = Optional.ofNullable(createCustomObjectResponse); + public CrmCustomObjectsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCustomObjectsAddResponse withCreateCustomObjectResponse(CreateCustomOb /** * Custom object created */ - public CrmCustomObjectsAddResponse withCreateCustomObjectResponse(Optional createCustomObjectResponse) { - Utils.checkNotNull(createCustomObjectResponse, "createCustomObjectResponse"); + public CrmCustomObjectsAddResponse withCreateCustomObjectResponse(@Nullable CreateCustomObjectResponse createCustomObjectResponse) { this.createCustomObjectResponse = createCustomObjectResponse; return this; } - /** - * Unexpected error - */ - public CrmCustomObjectsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCustomObjectsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCustomObjectsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createCustomObjectResponse = Optional.empty(); + private CreateCustomObjectResponse createCustomObjectResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom object created - */ - public Builder createCustomObjectResponse(CreateCustomObjectResponse createCustomObjectResponse) { - Utils.checkNotNull(createCustomObjectResponse, "createCustomObjectResponse"); - this.createCustomObjectResponse = Optional.ofNullable(createCustomObjectResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom object created */ - public Builder createCustomObjectResponse(Optional createCustomObjectResponse) { - Utils.checkNotNull(createCustomObjectResponse, "createCustomObjectResponse"); + public Builder createCustomObjectResponse(@Nullable CreateCustomObjectResponse createCustomObjectResponse) { this.createCustomObjectResponse = createCustomObjectResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCustomObjectsAddResponse build() { - return new CrmCustomObjectsAddResponse( contentType, statusCode, rawResponse, createCustomObjectResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllRequest.java index 734b725a..5a6b89b2 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllRequest.java @@ -7,14 +7,14 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +25,25 @@ public class CrmCustomObjectsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +55,13 @@ public class CrmCustomObjectsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -77,113 +77,99 @@ public class CrmCustomObjectsAllRequest { @JsonCreator public CrmCustomObjectsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields, - String objectId) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(objectId, "objectId"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields, + @Nonnull String objectId) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; - this.objectId = objectId; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); + this.objectId = Optional.ofNullable(objectId) + .orElseThrow(() -> new IllegalArgumentException("objectId cannot be null")); } public CrmCustomObjectsAllRequest( - String objectId) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), objectId); + @Nonnull String objectId) { + this(null, null, null, + null, null, null, + null, null, objectId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } /** * The id of the custom object to query */ - @JsonIgnore public String objectId() { - return objectId; + return this.objectId; } public static Builder builder() { @@ -194,103 +180,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmCustomObjectsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCustomObjectsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCustomObjectsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCustomObjectsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmCustomObjectsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCustomObjectsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCustomObjectsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCustomObjectsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCustomObjectsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCustomObjectsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCustomObjectsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCustomObjectsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public CrmCustomObjectsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public CrmCustomObjectsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public CrmCustomObjectsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public CrmCustomObjectsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -298,58 +225,39 @@ public CrmCustomObjectsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public CrmCustomObjectsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public CrmCustomObjectsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public CrmCustomObjectsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public CrmCustomObjectsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CrmCustomObjectsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmCustomObjectsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmCustomObjectsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmCustomObjectsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } /** * The id of the custom object to query */ - public CrmCustomObjectsAllRequest withObjectId(String objectId) { - Utils.checkNotNull(objectId, "objectId"); - this.objectId = objectId; + public CrmCustomObjectsAllRequest withObjectId(@Nonnull String objectId) { + this.objectId = Utils.checkNotNull(objectId, "objectId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -396,21 +304,21 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private String objectId; @@ -418,176 +326,79 @@ private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** * The id of the custom object to query */ - public Builder objectId(String objectId) { - Utils.checkNotNull(objectId, "objectId"); - this.objectId = objectId; + public Builder objectId(@Nonnull String objectId) { + this.objectId = Utils.checkNotNull(objectId, "objectId"); return this; } public CrmCustomObjectsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new CrmCustomObjectsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -595,16 +406,16 @@ public CrmCustomObjectsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllRequestBuilder.java index 56f1bf21..854412dd 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class CrmCustomObjectsAllRequestBuilder { - - private CrmCustomObjectsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCustomObjectsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCustomObjectsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCustomObjectsAllRequestBuilder request(CrmCustomObjectsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCustomObjectsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCustomObjectsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCustomObjectsAllRequestBuilder request(@Nonnull CrmCustomObjectsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCustomObjectsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCustomObjectsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCustomObjectsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public CrmCustomObjectsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new CrmCustomObjectsAllOperation( - sdkConfiguration, - options); + CrmCustomObjectsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new CrmCustomObjectsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - CrmCustomObjectsAllRequest::withCursor, + CrmCustomObjectsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllResponse.java index ac0ca737..6a76a6bb 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCustomObjectsAllResponse implements Response { /** * Custom objects */ - private Optional getCustomObjectsResponse; + private GetCustomObjectsResponse getCustomObjectsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCustomObjectsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCustomObjectsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCustomObjectsResponse, "getCustomObjectsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCustomObjectsResponse getCustomObjectsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCustomObjectsResponse = getCustomObjectsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCustomObjectsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom objects */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCustomObjectsResponse() { - return (Optional) getCustomObjectsResponse; + return Optional.ofNullable(this.getCustomObjectsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCustomObjectsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCustomObjectsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCustomObjectsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCustomObjectsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom objects + * Raw HTTP response; suitable for custom response parsing */ - public CrmCustomObjectsAllResponse withGetCustomObjectsResponse(GetCustomObjectsResponse getCustomObjectsResponse) { - Utils.checkNotNull(getCustomObjectsResponse, "getCustomObjectsResponse"); - this.getCustomObjectsResponse = Optional.ofNullable(getCustomObjectsResponse); + public CrmCustomObjectsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCustomObjectsAllResponse withGetCustomObjectsResponse(GetCustomObjects /** * Custom objects */ - public CrmCustomObjectsAllResponse withGetCustomObjectsResponse(Optional getCustomObjectsResponse) { - Utils.checkNotNull(getCustomObjectsResponse, "getCustomObjectsResponse"); + public CrmCustomObjectsAllResponse withGetCustomObjectsResponse(@Nullable GetCustomObjectsResponse getCustomObjectsResponse) { this.getCustomObjectsResponse = getCustomObjectsResponse; return this; } - /** - * Unexpected error - */ - public CrmCustomObjectsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCustomObjectsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCustomObjectsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCustomObjectsResponse = Optional.empty(); + private GetCustomObjectsResponse getCustomObjectsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom objects - */ - public Builder getCustomObjectsResponse(GetCustomObjectsResponse getCustomObjectsResponse) { - Utils.checkNotNull(getCustomObjectsResponse, "getCustomObjectsResponse"); - this.getCustomObjectsResponse = Optional.ofNullable(getCustomObjectsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom objects */ - public Builder getCustomObjectsResponse(Optional getCustomObjectsResponse) { - Utils.checkNotNull(getCustomObjectsResponse, "getCustomObjectsResponse"); + public Builder getCustomObjectsResponse(@Nullable GetCustomObjectsResponse getCustomObjectsResponse) { this.getCustomObjectsResponse = getCustomObjectsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCustomObjectsAllResponse build() { - return new CrmCustomObjectsAllResponse( contentType, statusCode, rawResponse, getCustomObjectsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteRequest.java index 03588edd..946ea8e5 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,25 +27,25 @@ public class CrmCustomObjectsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The id of the custom object to query @@ -54,79 +55,70 @@ public class CrmCustomObjectsDeleteRequest { @JsonCreator public CrmCustomObjectsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - String objectId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(objectId, "objectId"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull String objectId) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.objectId = objectId; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.objectId = Optional.ofNullable(objectId) + .orElseThrow(() -> new IllegalArgumentException("objectId cannot be null")); } public CrmCustomObjectsDeleteRequest( - String id, - String objectId) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), objectId); + @Nonnull String id, + @Nonnull String objectId) { + this(id, null, null, + null, null, objectId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The id of the custom object to query */ - @JsonIgnore public String objectId() { - return objectId; + return this.objectId; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmCustomObjectsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCustomObjectsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmCustomObjectsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,78 +138,48 @@ public CrmCustomObjectsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmCustomObjectsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCustomObjectsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCustomObjectsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCustomObjectsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCustomObjectsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCustomObjectsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCustomObjectsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCustomObjectsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCustomObjectsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmCustomObjectsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCustomObjectsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The id of the custom object to query */ - public CrmCustomObjectsDeleteRequest withObjectId(String objectId) { - Utils.checkNotNull(objectId, "objectId"); - this.objectId = objectId; + public CrmCustomObjectsDeleteRequest withObjectId(@Nonnull String objectId) { + this.objectId = Utils.checkNotNull(objectId, "objectId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -269,13 +221,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private String objectId; @@ -283,117 +235,65 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The id of the custom object to query */ - public Builder objectId(String objectId) { - Utils.checkNotNull(objectId, "objectId"); - this.objectId = objectId; + public Builder objectId(@Nonnull String objectId) { + this.objectId = Utils.checkNotNull(objectId, "objectId"); return this; } public CrmCustomObjectsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCustomObjectsDeleteRequest( id, consumerId, appId, serviceId, raw, objectId); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteRequestBuilder.java index e9b62d46..5a25414b 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCustomObjectsDeleteRequestBuilder { - - private CrmCustomObjectsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCustomObjectsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCustomObjectsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCustomObjectsDeleteRequestBuilder request(CrmCustomObjectsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCustomObjectsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCustomObjectsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCustomObjectsDeleteRequestBuilder request(@Nonnull CrmCustomObjectsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCustomObjectsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCustomObjectsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCustomObjectsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteResponse.java index ba1d3665..350f2003 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCustomObjectsDeleteResponse implements Response { /** * Custom object deleted */ - private Optional deleteCustomObjectResponse; + private DeleteCustomObjectResponse deleteCustomObjectResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCustomObjectsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteCustomObjectResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteCustomObjectResponse, "deleteCustomObjectResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteCustomObjectResponse deleteCustomObjectResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteCustomObjectResponse = deleteCustomObjectResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCustomObjectsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom object deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteCustomObjectResponse() { - return (Optional) deleteCustomObjectResponse; + return Optional.ofNullable(this.deleteCustomObjectResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCustomObjectsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCustomObjectsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCustomObjectsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCustomObjectsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom object deleted + * Raw HTTP response; suitable for custom response parsing */ - public CrmCustomObjectsDeleteResponse withDeleteCustomObjectResponse(DeleteCustomObjectResponse deleteCustomObjectResponse) { - Utils.checkNotNull(deleteCustomObjectResponse, "deleteCustomObjectResponse"); - this.deleteCustomObjectResponse = Optional.ofNullable(deleteCustomObjectResponse); + public CrmCustomObjectsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCustomObjectsDeleteResponse withDeleteCustomObjectResponse(DeleteCusto /** * Custom object deleted */ - public CrmCustomObjectsDeleteResponse withDeleteCustomObjectResponse(Optional deleteCustomObjectResponse) { - Utils.checkNotNull(deleteCustomObjectResponse, "deleteCustomObjectResponse"); + public CrmCustomObjectsDeleteResponse withDeleteCustomObjectResponse(@Nullable DeleteCustomObjectResponse deleteCustomObjectResponse) { this.deleteCustomObjectResponse = deleteCustomObjectResponse; return this; } - /** - * Unexpected error - */ - public CrmCustomObjectsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCustomObjectsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCustomObjectsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteCustomObjectResponse = Optional.empty(); + private DeleteCustomObjectResponse deleteCustomObjectResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom object deleted - */ - public Builder deleteCustomObjectResponse(DeleteCustomObjectResponse deleteCustomObjectResponse) { - Utils.checkNotNull(deleteCustomObjectResponse, "deleteCustomObjectResponse"); - this.deleteCustomObjectResponse = Optional.ofNullable(deleteCustomObjectResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom object deleted */ - public Builder deleteCustomObjectResponse(Optional deleteCustomObjectResponse) { - Utils.checkNotNull(deleteCustomObjectResponse, "deleteCustomObjectResponse"); + public Builder deleteCustomObjectResponse(@Nullable DeleteCustomObjectResponse deleteCustomObjectResponse) { this.deleteCustomObjectResponse = deleteCustomObjectResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCustomObjectsDeleteResponse build() { - return new CrmCustomObjectsDeleteResponse( contentType, statusCode, rawResponse, deleteCustomObjectResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneRequest.java index b19abc2a..d300c52a 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,25 +27,25 @@ public class CrmCustomObjectsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The id of the custom object to query @@ -54,79 +55,70 @@ public class CrmCustomObjectsOneRequest { @JsonCreator public CrmCustomObjectsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - String objectId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(objectId, "objectId"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull String objectId) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.objectId = objectId; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.objectId = Optional.ofNullable(objectId) + .orElseThrow(() -> new IllegalArgumentException("objectId cannot be null")); } public CrmCustomObjectsOneRequest( - String id, - String objectId) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), objectId); + @Nonnull String id, + @Nonnull String objectId) { + this(id, null, null, + null, null, objectId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The id of the custom object to query */ - @JsonIgnore public String objectId() { - return objectId; + return this.objectId; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmCustomObjectsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmCustomObjectsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmCustomObjectsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,78 +138,48 @@ public CrmCustomObjectsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmCustomObjectsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCustomObjectsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCustomObjectsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCustomObjectsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCustomObjectsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCustomObjectsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCustomObjectsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCustomObjectsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCustomObjectsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmCustomObjectsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCustomObjectsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The id of the custom object to query */ - public CrmCustomObjectsOneRequest withObjectId(String objectId) { - Utils.checkNotNull(objectId, "objectId"); - this.objectId = objectId; + public CrmCustomObjectsOneRequest withObjectId(@Nonnull String objectId) { + this.objectId = Utils.checkNotNull(objectId, "objectId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -269,13 +221,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private String objectId; @@ -283,117 +235,65 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The id of the custom object to query */ - public Builder objectId(String objectId) { - Utils.checkNotNull(objectId, "objectId"); - this.objectId = objectId; + public Builder objectId(@Nonnull String objectId) { + this.objectId = Utils.checkNotNull(objectId, "objectId"); return this; } public CrmCustomObjectsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCustomObjectsOneRequest( id, consumerId, appId, serviceId, raw, objectId); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneRequestBuilder.java index 439a98bd..a48cd688 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCustomObjectsOneRequestBuilder { - - private CrmCustomObjectsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCustomObjectsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCustomObjectsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCustomObjectsOneRequestBuilder request(CrmCustomObjectsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCustomObjectsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCustomObjectsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCustomObjectsOneRequestBuilder request(@Nonnull CrmCustomObjectsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCustomObjectsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCustomObjectsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCustomObjectsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneResponse.java index 5224c3b3..6593c3a1 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCustomObjectsOneResponse implements Response { /** * Custom object */ - private Optional getCustomObjectResponse; + private GetCustomObjectResponse getCustomObjectResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCustomObjectsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCustomObjectResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCustomObjectResponse, "getCustomObjectResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCustomObjectResponse getCustomObjectResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCustomObjectResponse = getCustomObjectResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCustomObjectsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom object */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCustomObjectResponse() { - return (Optional) getCustomObjectResponse; + return Optional.ofNullable(this.getCustomObjectResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCustomObjectsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCustomObjectsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCustomObjectsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCustomObjectsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom object + * Raw HTTP response; suitable for custom response parsing */ - public CrmCustomObjectsOneResponse withGetCustomObjectResponse(GetCustomObjectResponse getCustomObjectResponse) { - Utils.checkNotNull(getCustomObjectResponse, "getCustomObjectResponse"); - this.getCustomObjectResponse = Optional.ofNullable(getCustomObjectResponse); + public CrmCustomObjectsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCustomObjectsOneResponse withGetCustomObjectResponse(GetCustomObjectRe /** * Custom object */ - public CrmCustomObjectsOneResponse withGetCustomObjectResponse(Optional getCustomObjectResponse) { - Utils.checkNotNull(getCustomObjectResponse, "getCustomObjectResponse"); + public CrmCustomObjectsOneResponse withGetCustomObjectResponse(@Nullable GetCustomObjectResponse getCustomObjectResponse) { this.getCustomObjectResponse = getCustomObjectResponse; return this; } - /** - * Unexpected error - */ - public CrmCustomObjectsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCustomObjectsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCustomObjectsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCustomObjectResponse = Optional.empty(); + private GetCustomObjectResponse getCustomObjectResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom object - */ - public Builder getCustomObjectResponse(GetCustomObjectResponse getCustomObjectResponse) { - Utils.checkNotNull(getCustomObjectResponse, "getCustomObjectResponse"); - this.getCustomObjectResponse = Optional.ofNullable(getCustomObjectResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom object */ - public Builder getCustomObjectResponse(Optional getCustomObjectResponse) { - Utils.checkNotNull(getCustomObjectResponse, "getCustomObjectResponse"); + public Builder getCustomObjectResponse(@Nullable GetCustomObjectResponse getCustomObjectResponse) { this.getCustomObjectResponse = getCustomObjectResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCustomObjectsOneResponse build() { - return new CrmCustomObjectsOneResponse( contentType, statusCode, rawResponse, getCustomObjectResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateRequest.java index 1d504441..e316dff9 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -33,25 +34,25 @@ public class CrmCustomObjectsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -59,89 +60,79 @@ public class CrmCustomObjectsUpdateRequest { @JsonCreator public CrmCustomObjectsUpdateRequest( - String id, - String objectId, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - CustomObjectInput customObject) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(objectId, "objectId"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(customObject, "customObject"); - this.id = id; - this.objectId = objectId; + @Nonnull String id, + @Nonnull String objectId, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull CustomObjectInput customObject) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.objectId = Optional.ofNullable(objectId) + .orElseThrow(() -> new IllegalArgumentException("objectId cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.customObject = customObject; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.customObject = Optional.ofNullable(customObject) + .orElseThrow(() -> new IllegalArgumentException("customObject cannot be null")); } public CrmCustomObjectsUpdateRequest( - String id, - String objectId, - CustomObjectInput customObject) { - this(id, objectId, Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), + @Nonnull String id, + @Nonnull String objectId, + @Nonnull CustomObjectInput customObject) { + this(id, objectId, null, + null, null, null, customObject); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The id of the custom object to query */ - @JsonIgnore public String objectId() { - return objectId; + return this.objectId; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public CustomObjectInput customObject() { - return customObject; + return this.customObject; } public static Builder builder() { @@ -152,27 +143,17 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmCustomObjectsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public CrmCustomObjectsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** - * The id of the custom object to query - */ - public CrmCustomObjectsUpdateRequest withObjectId(String objectId) { - Utils.checkNotNull(objectId, "objectId"); - this.objectId = objectId; - return this; - } /** - * ID of the consumer which you want to get or push data from + * The id of the custom object to query */ - public CrmCustomObjectsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmCustomObjectsUpdateRequest withObjectId(@Nonnull String objectId) { + this.objectId = Utils.checkNotNull(objectId, "objectId"); return this; } @@ -180,75 +161,45 @@ public CrmCustomObjectsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmCustomObjectsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmCustomObjectsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmCustomObjectsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmCustomObjectsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmCustomObjectsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmCustomObjectsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmCustomObjectsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmCustomObjectsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmCustomObjectsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmCustomObjectsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmCustomObjectsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public CrmCustomObjectsUpdateRequest withCustomObject(CustomObjectInput customObject) { - Utils.checkNotNull(customObject, "customObject"); - this.customObject = customObject; + + public CrmCustomObjectsUpdateRequest withCustomObject(@Nonnull CustomObjectInput customObject) { + this.customObject = Utils.checkNotNull(customObject, "customObject"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -295,13 +246,13 @@ public final static class Builder { private String objectId; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private CustomObjectInput customObject; @@ -309,114 +260,60 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The id of the custom object to query */ - public Builder objectId(String objectId) { - Utils.checkNotNull(objectId, "objectId"); - this.objectId = objectId; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder objectId(@Nonnull String objectId) { + this.objectId = Utils.checkNotNull(objectId, "objectId"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder customObject(CustomObjectInput customObject) { - Utils.checkNotNull(customObject, "customObject"); - this.customObject = customObject; + public Builder customObject(@Nonnull CustomObjectInput customObject) { + this.customObject = Utils.checkNotNull(customObject, "customObject"); return this; } public CrmCustomObjectsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmCustomObjectsUpdateRequest( id, objectId, consumerId, appId, serviceId, raw, @@ -424,10 +321,10 @@ public CrmCustomObjectsUpdateRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateRequestBuilder.java index d2d15fee..12025fd1 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmCustomObjectsUpdateRequestBuilder { - - private CrmCustomObjectsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmCustomObjectsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmCustomObjectsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmCustomObjectsUpdateRequestBuilder request(CrmCustomObjectsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmCustomObjectsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmCustomObjectsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmCustomObjectsUpdateRequestBuilder request(@Nonnull CrmCustomObjectsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmCustomObjectsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmCustomObjectsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmCustomObjectsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateResponse.java index 091b2f6f..8fe128eb 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmCustomObjectsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmCustomObjectsUpdateResponse implements Response { /** * Custom object updated */ - private Optional updateCustomObjectResponse; + private UpdateCustomObjectResponse updateCustomObjectResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmCustomObjectsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateCustomObjectResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateCustomObjectResponse, "updateCustomObjectResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateCustomObjectResponse updateCustomObjectResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateCustomObjectResponse = updateCustomObjectResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmCustomObjectsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom object updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateCustomObjectResponse() { - return (Optional) updateCustomObjectResponse; + return Optional.ofNullable(this.updateCustomObjectResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmCustomObjectsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmCustomObjectsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmCustomObjectsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmCustomObjectsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom object updated + * Raw HTTP response; suitable for custom response parsing */ - public CrmCustomObjectsUpdateResponse withUpdateCustomObjectResponse(UpdateCustomObjectResponse updateCustomObjectResponse) { - Utils.checkNotNull(updateCustomObjectResponse, "updateCustomObjectResponse"); - this.updateCustomObjectResponse = Optional.ofNullable(updateCustomObjectResponse); + public CrmCustomObjectsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmCustomObjectsUpdateResponse withUpdateCustomObjectResponse(UpdateCusto /** * Custom object updated */ - public CrmCustomObjectsUpdateResponse withUpdateCustomObjectResponse(Optional updateCustomObjectResponse) { - Utils.checkNotNull(updateCustomObjectResponse, "updateCustomObjectResponse"); + public CrmCustomObjectsUpdateResponse withUpdateCustomObjectResponse(@Nullable UpdateCustomObjectResponse updateCustomObjectResponse) { this.updateCustomObjectResponse = updateCustomObjectResponse; return this; } - /** - * Unexpected error - */ - public CrmCustomObjectsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmCustomObjectsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmCustomObjectsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateCustomObjectResponse = Optional.empty(); + private UpdateCustomObjectResponse updateCustomObjectResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom object updated - */ - public Builder updateCustomObjectResponse(UpdateCustomObjectResponse updateCustomObjectResponse) { - Utils.checkNotNull(updateCustomObjectResponse, "updateCustomObjectResponse"); - this.updateCustomObjectResponse = Optional.ofNullable(updateCustomObjectResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom object updated */ - public Builder updateCustomObjectResponse(Optional updateCustomObjectResponse) { - Utils.checkNotNull(updateCustomObjectResponse, "updateCustomObjectResponse"); + public Builder updateCustomObjectResponse(@Nullable UpdateCustomObjectResponse updateCustomObjectResponse) { this.updateCustomObjectResponse = updateCustomObjectResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmCustomObjectsUpdateResponse build() { - return new CrmCustomObjectsUpdateResponse( contentType, statusCode, rawResponse, updateCustomObjectResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddRequest.java index 2b343c9b..bb4b27b7 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class CrmLeadsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class CrmLeadsAddRequest { @JsonCreator public CrmLeadsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - LeadInput lead) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(lead, "lead"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull LeadInput lead) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.lead = lead; + this.lead = Optional.ofNullable(lead) + .orElseThrow(() -> new IllegalArgumentException("lead cannot be null")); } public CrmLeadsAddRequest( - LeadInput lead) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), lead); + @Nonnull LeadInput lead) { + this(null, null, null, + null, lead); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public LeadInput lead() { - return lead; + return this.lead; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmLeadsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmLeadsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmLeadsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmLeadsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmLeadsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmLeadsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmLeadsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmLeadsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmLeadsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmLeadsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmLeadsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmLeadsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public CrmLeadsAddRequest withLead(LeadInput lead) { - Utils.checkNotNull(lead, "lead"); - this.lead = lead; + + public CrmLeadsAddRequest withLead(@Nonnull LeadInput lead) { + this.lead = Utils.checkNotNull(lead, "lead"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private LeadInput lead; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder lead(LeadInput lead) { - Utils.checkNotNull(lead, "lead"); - this.lead = lead; + public Builder lead(@Nonnull LeadInput lead) { + this.lead = Utils.checkNotNull(lead, "lead"); return this; } public CrmLeadsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmLeadsAddRequest( raw, consumerId, appId, serviceId, lead); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddRequestBuilder.java index 34d5bd2e..9194d4d9 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmLeadsAddRequestBuilder { - - private CrmLeadsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmLeadsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmLeadsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmLeadsAddRequestBuilder request(CrmLeadsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmLeadsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmLeadsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmLeadsAddRequestBuilder request(@Nonnull CrmLeadsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmLeadsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmLeadsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmLeadsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddResponse.java index c1173062..f2b05de6 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmLeadsAddResponse implements Response { /** * Lead created */ - private Optional createLeadResponse; + private CreateLeadResponse createLeadResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmLeadsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createLeadResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createLeadResponse, "createLeadResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateLeadResponse createLeadResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createLeadResponse = createLeadResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmLeadsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Lead created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createLeadResponse() { - return (Optional) createLeadResponse; + return Optional.ofNullable(this.createLeadResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmLeadsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmLeadsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmLeadsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmLeadsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Lead created + * Raw HTTP response; suitable for custom response parsing */ - public CrmLeadsAddResponse withCreateLeadResponse(CreateLeadResponse createLeadResponse) { - Utils.checkNotNull(createLeadResponse, "createLeadResponse"); - this.createLeadResponse = Optional.ofNullable(createLeadResponse); + public CrmLeadsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmLeadsAddResponse withCreateLeadResponse(CreateLeadResponse createLeadR /** * Lead created */ - public CrmLeadsAddResponse withCreateLeadResponse(Optional createLeadResponse) { - Utils.checkNotNull(createLeadResponse, "createLeadResponse"); + public CrmLeadsAddResponse withCreateLeadResponse(@Nullable CreateLeadResponse createLeadResponse) { this.createLeadResponse = createLeadResponse; return this; } - /** - * Unexpected error - */ - public CrmLeadsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmLeadsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmLeadsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createLeadResponse = Optional.empty(); + private CreateLeadResponse createLeadResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Lead created - */ - public Builder createLeadResponse(CreateLeadResponse createLeadResponse) { - Utils.checkNotNull(createLeadResponse, "createLeadResponse"); - this.createLeadResponse = Optional.ofNullable(createLeadResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Lead created */ - public Builder createLeadResponse(Optional createLeadResponse) { - Utils.checkNotNull(createLeadResponse, "createLeadResponse"); + public Builder createLeadResponse(@Nullable CreateLeadResponse createLeadResponse) { this.createLeadResponse = createLeadResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmLeadsAddResponse build() { - return new CrmLeadsAddResponse( contentType, statusCode, rawResponse, createLeadResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllRequest.java index 0b10642c..8fa30a2c 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class CrmLeadsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class CrmLeadsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private LeadsFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private LeadsSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class CrmLeadsAllRequest { @JsonCreator public CrmLeadsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable LeadsFilter filter, + @Nullable LeadsSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmLeadsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmLeadsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmLeadsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmLeadsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmLeadsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmLeadsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmLeadsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmLeadsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmLeadsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmLeadsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmLeadsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmLeadsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmLeadsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public CrmLeadsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public CrmLeadsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public CrmLeadsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public CrmLeadsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public CrmLeadsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public CrmLeadsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public CrmLeadsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public CrmLeadsAllRequest withFilter(LeadsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public CrmLeadsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public CrmLeadsAllRequest withFilter(@Nullable LeadsFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public CrmLeadsAllRequest withSort(LeadsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public CrmLeadsAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public CrmLeadsAllRequest withSort(@Nullable LeadsSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public CrmLeadsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public CrmLeadsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CrmLeadsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmLeadsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmLeadsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmLeadsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private LeadsFilter filter; - private Optional sort = Optional.empty(); + private LeadsSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(LeadsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable LeadsFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(LeadsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable LeadsSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmLeadsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new CrmLeadsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public CrmLeadsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllRequestBuilder.java index 7561155e..1fb6b9bd 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class CrmLeadsAllRequestBuilder { - - private CrmLeadsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmLeadsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmLeadsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmLeadsAllRequestBuilder request(CrmLeadsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmLeadsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmLeadsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmLeadsAllRequestBuilder request(@Nonnull CrmLeadsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmLeadsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmLeadsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmLeadsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public CrmLeadsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new CrmLeadsAllOperation( - sdkConfiguration, - options); + CrmLeadsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new CrmLeadsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - CrmLeadsAllRequest::withCursor, + CrmLeadsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllResponse.java index 973d23a5..9d8d005d 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmLeadsAllResponse implements Response { /** * Leads */ - private Optional getLeadsResponse; + private GetLeadsResponse getLeadsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmLeadsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getLeadsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getLeadsResponse, "getLeadsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetLeadsResponse getLeadsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getLeadsResponse = getLeadsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmLeadsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getLeadsResponse() { - return (Optional) getLeadsResponse; + return Optional.ofNullable(this.getLeadsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmLeadsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmLeadsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmLeadsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmLeadsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Leads + * Raw HTTP response; suitable for custom response parsing */ - public CrmLeadsAllResponse withGetLeadsResponse(GetLeadsResponse getLeadsResponse) { - Utils.checkNotNull(getLeadsResponse, "getLeadsResponse"); - this.getLeadsResponse = Optional.ofNullable(getLeadsResponse); + public CrmLeadsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmLeadsAllResponse withGetLeadsResponse(GetLeadsResponse getLeadsRespons /** * Leads */ - public CrmLeadsAllResponse withGetLeadsResponse(Optional getLeadsResponse) { - Utils.checkNotNull(getLeadsResponse, "getLeadsResponse"); + public CrmLeadsAllResponse withGetLeadsResponse(@Nullable GetLeadsResponse getLeadsResponse) { this.getLeadsResponse = getLeadsResponse; return this; } - /** - * Unexpected error - */ - public CrmLeadsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmLeadsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmLeadsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getLeadsResponse = Optional.empty(); + private GetLeadsResponse getLeadsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Leads - */ - public Builder getLeadsResponse(GetLeadsResponse getLeadsResponse) { - Utils.checkNotNull(getLeadsResponse, "getLeadsResponse"); - this.getLeadsResponse = Optional.ofNullable(getLeadsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Leads */ - public Builder getLeadsResponse(Optional getLeadsResponse) { - Utils.checkNotNull(getLeadsResponse, "getLeadsResponse"); + public Builder getLeadsResponse(@Nullable GetLeadsResponse getLeadsResponse) { this.getLeadsResponse = getLeadsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmLeadsAllResponse build() { - return new CrmLeadsAllResponse( contentType, statusCode, rawResponse, getLeadsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteRequest.java index 74bb2436..ae7a68ee 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class CrmLeadsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public CrmLeadsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public CrmLeadsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmLeadsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmLeadsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmLeadsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public CrmLeadsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmLeadsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmLeadsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmLeadsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmLeadsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmLeadsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmLeadsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmLeadsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmLeadsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmLeadsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmLeadsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmLeadsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public CrmLeadsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmLeadsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteRequestBuilder.java index 4327d93c..2a3a259a 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmLeadsDeleteRequestBuilder { - - private CrmLeadsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmLeadsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmLeadsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmLeadsDeleteRequestBuilder request(CrmLeadsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmLeadsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmLeadsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmLeadsDeleteRequestBuilder request(@Nonnull CrmLeadsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmLeadsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmLeadsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmLeadsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteResponse.java index f94efb46..d4214b36 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmLeadsDeleteResponse implements Response { /** * Lead deleted */ - private Optional deleteLeadResponse; + private DeleteLeadResponse deleteLeadResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmLeadsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteLeadResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteLeadResponse, "deleteLeadResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteLeadResponse deleteLeadResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteLeadResponse = deleteLeadResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmLeadsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Lead deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteLeadResponse() { - return (Optional) deleteLeadResponse; + return Optional.ofNullable(this.deleteLeadResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmLeadsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmLeadsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmLeadsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmLeadsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Lead deleted + * Raw HTTP response; suitable for custom response parsing */ - public CrmLeadsDeleteResponse withDeleteLeadResponse(DeleteLeadResponse deleteLeadResponse) { - Utils.checkNotNull(deleteLeadResponse, "deleteLeadResponse"); - this.deleteLeadResponse = Optional.ofNullable(deleteLeadResponse); + public CrmLeadsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmLeadsDeleteResponse withDeleteLeadResponse(DeleteLeadResponse deleteLe /** * Lead deleted */ - public CrmLeadsDeleteResponse withDeleteLeadResponse(Optional deleteLeadResponse) { - Utils.checkNotNull(deleteLeadResponse, "deleteLeadResponse"); + public CrmLeadsDeleteResponse withDeleteLeadResponse(@Nullable DeleteLeadResponse deleteLeadResponse) { this.deleteLeadResponse = deleteLeadResponse; return this; } - /** - * Unexpected error - */ - public CrmLeadsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmLeadsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmLeadsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteLeadResponse = Optional.empty(); + private DeleteLeadResponse deleteLeadResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Lead deleted - */ - public Builder deleteLeadResponse(DeleteLeadResponse deleteLeadResponse) { - Utils.checkNotNull(deleteLeadResponse, "deleteLeadResponse"); - this.deleteLeadResponse = Optional.ofNullable(deleteLeadResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Lead deleted */ - public Builder deleteLeadResponse(Optional deleteLeadResponse) { - Utils.checkNotNull(deleteLeadResponse, "deleteLeadResponse"); + public Builder deleteLeadResponse(@Nullable DeleteLeadResponse deleteLeadResponse) { this.deleteLeadResponse = deleteLeadResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmLeadsDeleteResponse build() { - return new CrmLeadsDeleteResponse( contentType, statusCode, rawResponse, deleteLeadResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneRequest.java index eacd588a..8cda1229 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmLeadsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class CrmLeadsOneRequest { @JsonCreator public CrmLeadsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmLeadsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmLeadsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmLeadsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmLeadsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public CrmLeadsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmLeadsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmLeadsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmLeadsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmLeadsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmLeadsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmLeadsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmLeadsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmLeadsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmLeadsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmLeadsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmLeadsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmLeadsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmLeadsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmLeadsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmLeadsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmLeadsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneRequestBuilder.java index 56d903dd..1fc62c12 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmLeadsOneRequestBuilder { - - private CrmLeadsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmLeadsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmLeadsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmLeadsOneRequestBuilder request(CrmLeadsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmLeadsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmLeadsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmLeadsOneRequestBuilder request(@Nonnull CrmLeadsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmLeadsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmLeadsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmLeadsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneResponse.java index a4295bc4..c36f64e3 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmLeadsOneResponse implements Response { /** * Lead */ - private Optional getLeadResponse; + private GetLeadResponse getLeadResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmLeadsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getLeadResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getLeadResponse, "getLeadResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetLeadResponse getLeadResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getLeadResponse = getLeadResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmLeadsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Lead */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getLeadResponse() { - return (Optional) getLeadResponse; + return Optional.ofNullable(this.getLeadResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmLeadsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmLeadsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmLeadsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmLeadsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Lead + * Raw HTTP response; suitable for custom response parsing */ - public CrmLeadsOneResponse withGetLeadResponse(GetLeadResponse getLeadResponse) { - Utils.checkNotNull(getLeadResponse, "getLeadResponse"); - this.getLeadResponse = Optional.ofNullable(getLeadResponse); + public CrmLeadsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmLeadsOneResponse withGetLeadResponse(GetLeadResponse getLeadResponse) /** * Lead */ - public CrmLeadsOneResponse withGetLeadResponse(Optional getLeadResponse) { - Utils.checkNotNull(getLeadResponse, "getLeadResponse"); + public CrmLeadsOneResponse withGetLeadResponse(@Nullable GetLeadResponse getLeadResponse) { this.getLeadResponse = getLeadResponse; return this; } - /** - * Unexpected error - */ - public CrmLeadsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmLeadsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmLeadsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getLeadResponse = Optional.empty(); + private GetLeadResponse getLeadResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Lead - */ - public Builder getLeadResponse(GetLeadResponse getLeadResponse) { - Utils.checkNotNull(getLeadResponse, "getLeadResponse"); - this.getLeadResponse = Optional.ofNullable(getLeadResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Lead */ - public Builder getLeadResponse(Optional getLeadResponse) { - Utils.checkNotNull(getLeadResponse, "getLeadResponse"); + public Builder getLeadResponse(@Nullable GetLeadResponse getLeadResponse) { this.getLeadResponse = getLeadResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmLeadsOneResponse build() { - return new CrmLeadsOneResponse( contentType, statusCode, rawResponse, getLeadResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateRequest.java index aca9fc57..ef14f3c3 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmLeadsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class CrmLeadsUpdateRequest { @JsonCreator public CrmLeadsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - LeadInput lead) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(lead, "lead"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull LeadInput lead) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.lead = lead; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.lead = Optional.ofNullable(lead) + .orElseThrow(() -> new IllegalArgumentException("lead cannot be null")); } public CrmLeadsUpdateRequest( - String id, - LeadInput lead) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), lead); + @Nonnull String id, + @Nonnull LeadInput lead) { + this(id, null, null, + null, null, lead); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public LeadInput lead() { - return lead; + return this.lead; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmLeadsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmLeadsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmLeadsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public CrmLeadsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmLeadsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmLeadsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmLeadsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmLeadsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmLeadsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmLeadsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmLeadsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmLeadsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmLeadsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmLeadsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmLeadsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public CrmLeadsUpdateRequest withLead(LeadInput lead) { - Utils.checkNotNull(lead, "lead"); - this.lead = lead; + + public CrmLeadsUpdateRequest withLead(@Nonnull LeadInput lead) { + this.lead = Utils.checkNotNull(lead, "lead"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private LeadInput lead; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder lead(LeadInput lead) { - Utils.checkNotNull(lead, "lead"); - this.lead = lead; + public Builder lead(@Nonnull LeadInput lead) { + this.lead = Utils.checkNotNull(lead, "lead"); return this; } public CrmLeadsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmLeadsUpdateRequest( id, consumerId, appId, serviceId, raw, lead); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateRequestBuilder.java index ab6426cd..70378307 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmLeadsUpdateRequestBuilder { - - private CrmLeadsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmLeadsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmLeadsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmLeadsUpdateRequestBuilder request(CrmLeadsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmLeadsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmLeadsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmLeadsUpdateRequestBuilder request(@Nonnull CrmLeadsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmLeadsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmLeadsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmLeadsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateResponse.java index 8c52276d..d25b1903 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmLeadsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmLeadsUpdateResponse implements Response { /** * Lead updated */ - private Optional updateLeadResponse; + private UpdateLeadResponse updateLeadResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmLeadsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateLeadResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateLeadResponse, "updateLeadResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateLeadResponse updateLeadResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateLeadResponse = updateLeadResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmLeadsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Lead updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateLeadResponse() { - return (Optional) updateLeadResponse; + return Optional.ofNullable(this.updateLeadResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmLeadsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmLeadsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmLeadsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmLeadsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Lead updated + * Raw HTTP response; suitable for custom response parsing */ - public CrmLeadsUpdateResponse withUpdateLeadResponse(UpdateLeadResponse updateLeadResponse) { - Utils.checkNotNull(updateLeadResponse, "updateLeadResponse"); - this.updateLeadResponse = Optional.ofNullable(updateLeadResponse); + public CrmLeadsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmLeadsUpdateResponse withUpdateLeadResponse(UpdateLeadResponse updateLe /** * Lead updated */ - public CrmLeadsUpdateResponse withUpdateLeadResponse(Optional updateLeadResponse) { - Utils.checkNotNull(updateLeadResponse, "updateLeadResponse"); + public CrmLeadsUpdateResponse withUpdateLeadResponse(@Nullable UpdateLeadResponse updateLeadResponse) { this.updateLeadResponse = updateLeadResponse; return this; } - /** - * Unexpected error - */ - public CrmLeadsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmLeadsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmLeadsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateLeadResponse = Optional.empty(); + private UpdateLeadResponse updateLeadResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Lead updated - */ - public Builder updateLeadResponse(UpdateLeadResponse updateLeadResponse) { - Utils.checkNotNull(updateLeadResponse, "updateLeadResponse"); - this.updateLeadResponse = Optional.ofNullable(updateLeadResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Lead updated */ - public Builder updateLeadResponse(Optional updateLeadResponse) { - Utils.checkNotNull(updateLeadResponse, "updateLeadResponse"); + public Builder updateLeadResponse(@Nullable UpdateLeadResponse updateLeadResponse) { this.updateLeadResponse = updateLeadResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmLeadsUpdateResponse build() { - return new CrmLeadsUpdateResponse( contentType, statusCode, rawResponse, updateLeadResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesAddRequest.java index 08c610a8..bad69de5 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class CrmNotesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class CrmNotesAddRequest { @JsonCreator public CrmNotesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - NoteInput note) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(note, "note"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull NoteInput note) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.note = note; + this.note = Optional.ofNullable(note) + .orElseThrow(() -> new IllegalArgumentException("note cannot be null")); } public CrmNotesAddRequest( - NoteInput note) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), note); + @Nonnull NoteInput note) { + this(null, null, null, + null, note); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public NoteInput note() { - return note; + return this.note; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmNotesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmNotesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmNotesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmNotesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmNotesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmNotesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmNotesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmNotesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmNotesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmNotesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmNotesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmNotesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public CrmNotesAddRequest withNote(NoteInput note) { - Utils.checkNotNull(note, "note"); - this.note = note; + + public CrmNotesAddRequest withNote(@Nonnull NoteInput note) { + this.note = Utils.checkNotNull(note, "note"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private NoteInput note; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder note(NoteInput note) { - Utils.checkNotNull(note, "note"); - this.note = note; + public Builder note(@Nonnull NoteInput note) { + this.note = Utils.checkNotNull(note, "note"); return this; } public CrmNotesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmNotesAddRequest( raw, consumerId, appId, serviceId, note); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesAddRequestBuilder.java index 417f4df2..22142bbe 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmNotesAddRequestBuilder { - - private CrmNotesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmNotesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmNotesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmNotesAddRequestBuilder request(CrmNotesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmNotesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmNotesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmNotesAddRequestBuilder request(@Nonnull CrmNotesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmNotesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmNotesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmNotesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesAddResponse.java index 83b8e124..2c5f40d9 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmNotesAddResponse implements Response { /** * Note created */ - private Optional createNoteResponse; + private CreateNoteResponse createNoteResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmNotesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createNoteResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createNoteResponse, "createNoteResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateNoteResponse createNoteResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createNoteResponse = createNoteResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmNotesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Note created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createNoteResponse() { - return (Optional) createNoteResponse; + return Optional.ofNullable(this.createNoteResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmNotesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmNotesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmNotesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmNotesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Note created + * Raw HTTP response; suitable for custom response parsing */ - public CrmNotesAddResponse withCreateNoteResponse(CreateNoteResponse createNoteResponse) { - Utils.checkNotNull(createNoteResponse, "createNoteResponse"); - this.createNoteResponse = Optional.ofNullable(createNoteResponse); + public CrmNotesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmNotesAddResponse withCreateNoteResponse(CreateNoteResponse createNoteR /** * Note created */ - public CrmNotesAddResponse withCreateNoteResponse(Optional createNoteResponse) { - Utils.checkNotNull(createNoteResponse, "createNoteResponse"); + public CrmNotesAddResponse withCreateNoteResponse(@Nullable CreateNoteResponse createNoteResponse) { this.createNoteResponse = createNoteResponse; return this; } - /** - * Unexpected error - */ - public CrmNotesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmNotesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmNotesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createNoteResponse = Optional.empty(); + private CreateNoteResponse createNoteResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Note created - */ - public Builder createNoteResponse(CreateNoteResponse createNoteResponse) { - Utils.checkNotNull(createNoteResponse, "createNoteResponse"); - this.createNoteResponse = Optional.ofNullable(createNoteResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Note created */ - public Builder createNoteResponse(Optional createNoteResponse) { - Utils.checkNotNull(createNoteResponse, "createNoteResponse"); + public Builder createNoteResponse(@Nullable CreateNoteResponse createNoteResponse) { this.createNoteResponse = createNoteResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmNotesAddResponse build() { - return new CrmNotesAddResponse( contentType, statusCode, rawResponse, createNoteResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesAllRequest.java index d5cb6657..1ea36d1a 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class CrmNotesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class CrmNotesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class CrmNotesAllRequest { @JsonCreator public CrmNotesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmNotesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmNotesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmNotesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmNotesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmNotesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmNotesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmNotesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmNotesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmNotesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmNotesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmNotesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmNotesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmNotesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public CrmNotesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public CrmNotesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public CrmNotesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public CrmNotesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public CrmNotesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public CrmNotesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public CrmNotesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public CrmNotesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public CrmNotesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CrmNotesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmNotesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmNotesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmNotesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmNotesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new CrmNotesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public CrmNotesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesAllRequestBuilder.java index 14f2013e..e51efb63 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class CrmNotesAllRequestBuilder { - - private CrmNotesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmNotesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmNotesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmNotesAllRequestBuilder request(CrmNotesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmNotesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmNotesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmNotesAllRequestBuilder request(@Nonnull CrmNotesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmNotesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmNotesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmNotesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public CrmNotesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new CrmNotesAllOperation( - sdkConfiguration, - options); + CrmNotesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new CrmNotesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - CrmNotesAllRequest::withCursor, + CrmNotesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesAllResponse.java index d92c5613..40f714e6 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmNotesAllResponse implements Response { /** * Notes */ - private Optional getNotesResponse; + private GetNotesResponse getNotesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmNotesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getNotesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getNotesResponse, "getNotesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetNotesResponse getNotesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getNotesResponse = getNotesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmNotesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Notes */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getNotesResponse() { - return (Optional) getNotesResponse; + return Optional.ofNullable(this.getNotesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmNotesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmNotesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmNotesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmNotesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Notes + * Raw HTTP response; suitable for custom response parsing */ - public CrmNotesAllResponse withGetNotesResponse(GetNotesResponse getNotesResponse) { - Utils.checkNotNull(getNotesResponse, "getNotesResponse"); - this.getNotesResponse = Optional.ofNullable(getNotesResponse); + public CrmNotesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmNotesAllResponse withGetNotesResponse(GetNotesResponse getNotesRespons /** * Notes */ - public CrmNotesAllResponse withGetNotesResponse(Optional getNotesResponse) { - Utils.checkNotNull(getNotesResponse, "getNotesResponse"); + public CrmNotesAllResponse withGetNotesResponse(@Nullable GetNotesResponse getNotesResponse) { this.getNotesResponse = getNotesResponse; return this; } - /** - * Unexpected error - */ - public CrmNotesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmNotesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmNotesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getNotesResponse = Optional.empty(); + private GetNotesResponse getNotesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Notes - */ - public Builder getNotesResponse(GetNotesResponse getNotesResponse) { - Utils.checkNotNull(getNotesResponse, "getNotesResponse"); - this.getNotesResponse = Optional.ofNullable(getNotesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Notes */ - public Builder getNotesResponse(Optional getNotesResponse) { - Utils.checkNotNull(getNotesResponse, "getNotesResponse"); + public Builder getNotesResponse(@Nullable GetNotesResponse getNotesResponse) { this.getNotesResponse = getNotesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmNotesAllResponse build() { - return new CrmNotesAllResponse( contentType, statusCode, rawResponse, getNotesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteRequest.java index c4e940a7..4ff41f0f 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class CrmNotesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public CrmNotesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public CrmNotesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmNotesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmNotesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmNotesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public CrmNotesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmNotesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmNotesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmNotesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmNotesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmNotesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmNotesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmNotesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmNotesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmNotesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmNotesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmNotesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public CrmNotesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmNotesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteRequestBuilder.java index e8b634c9..553c8fcf 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmNotesDeleteRequestBuilder { - - private CrmNotesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmNotesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmNotesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmNotesDeleteRequestBuilder request(CrmNotesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmNotesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmNotesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmNotesDeleteRequestBuilder request(@Nonnull CrmNotesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmNotesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmNotesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmNotesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteResponse.java index 2150c188..1e08fb4c 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmNotesDeleteResponse implements Response { /** * Note deleted */ - private Optional deleteNoteResponse; + private DeleteNoteResponse deleteNoteResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmNotesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteNoteResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteNoteResponse, "deleteNoteResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteNoteResponse deleteNoteResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteNoteResponse = deleteNoteResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmNotesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Note deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteNoteResponse() { - return (Optional) deleteNoteResponse; + return Optional.ofNullable(this.deleteNoteResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmNotesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmNotesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmNotesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmNotesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Note deleted + * Raw HTTP response; suitable for custom response parsing */ - public CrmNotesDeleteResponse withDeleteNoteResponse(DeleteNoteResponse deleteNoteResponse) { - Utils.checkNotNull(deleteNoteResponse, "deleteNoteResponse"); - this.deleteNoteResponse = Optional.ofNullable(deleteNoteResponse); + public CrmNotesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmNotesDeleteResponse withDeleteNoteResponse(DeleteNoteResponse deleteNo /** * Note deleted */ - public CrmNotesDeleteResponse withDeleteNoteResponse(Optional deleteNoteResponse) { - Utils.checkNotNull(deleteNoteResponse, "deleteNoteResponse"); + public CrmNotesDeleteResponse withDeleteNoteResponse(@Nullable DeleteNoteResponse deleteNoteResponse) { this.deleteNoteResponse = deleteNoteResponse; return this; } - /** - * Unexpected error - */ - public CrmNotesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmNotesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmNotesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteNoteResponse = Optional.empty(); + private DeleteNoteResponse deleteNoteResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Note deleted - */ - public Builder deleteNoteResponse(DeleteNoteResponse deleteNoteResponse) { - Utils.checkNotNull(deleteNoteResponse, "deleteNoteResponse"); - this.deleteNoteResponse = Optional.ofNullable(deleteNoteResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Note deleted */ - public Builder deleteNoteResponse(Optional deleteNoteResponse) { - Utils.checkNotNull(deleteNoteResponse, "deleteNoteResponse"); + public Builder deleteNoteResponse(@Nullable DeleteNoteResponse deleteNoteResponse) { this.deleteNoteResponse = deleteNoteResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmNotesDeleteResponse build() { - return new CrmNotesDeleteResponse( contentType, statusCode, rawResponse, deleteNoteResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesOneRequest.java index 363b8b07..6b4d56f9 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmNotesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class CrmNotesOneRequest { @JsonCreator public CrmNotesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmNotesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmNotesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmNotesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmNotesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public CrmNotesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmNotesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmNotesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmNotesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmNotesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmNotesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmNotesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmNotesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmNotesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmNotesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmNotesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmNotesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmNotesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmNotesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmNotesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmNotesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmNotesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesOneRequestBuilder.java index 39975ac1..97166c5f 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmNotesOneRequestBuilder { - - private CrmNotesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmNotesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmNotesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmNotesOneRequestBuilder request(CrmNotesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmNotesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmNotesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmNotesOneRequestBuilder request(@Nonnull CrmNotesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmNotesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmNotesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmNotesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesOneResponse.java index 99b51caa..d5814c77 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmNotesOneResponse implements Response { /** * Note */ - private Optional getNoteResponse; + private GetNoteResponse getNoteResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmNotesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getNoteResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getNoteResponse, "getNoteResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetNoteResponse getNoteResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getNoteResponse = getNoteResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmNotesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Note */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getNoteResponse() { - return (Optional) getNoteResponse; + return Optional.ofNullable(this.getNoteResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmNotesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmNotesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmNotesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmNotesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Note + * Raw HTTP response; suitable for custom response parsing */ - public CrmNotesOneResponse withGetNoteResponse(GetNoteResponse getNoteResponse) { - Utils.checkNotNull(getNoteResponse, "getNoteResponse"); - this.getNoteResponse = Optional.ofNullable(getNoteResponse); + public CrmNotesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmNotesOneResponse withGetNoteResponse(GetNoteResponse getNoteResponse) /** * Note */ - public CrmNotesOneResponse withGetNoteResponse(Optional getNoteResponse) { - Utils.checkNotNull(getNoteResponse, "getNoteResponse"); + public CrmNotesOneResponse withGetNoteResponse(@Nullable GetNoteResponse getNoteResponse) { this.getNoteResponse = getNoteResponse; return this; } - /** - * Unexpected error - */ - public CrmNotesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmNotesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmNotesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getNoteResponse = Optional.empty(); + private GetNoteResponse getNoteResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Note - */ - public Builder getNoteResponse(GetNoteResponse getNoteResponse) { - Utils.checkNotNull(getNoteResponse, "getNoteResponse"); - this.getNoteResponse = Optional.ofNullable(getNoteResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Note */ - public Builder getNoteResponse(Optional getNoteResponse) { - Utils.checkNotNull(getNoteResponse, "getNoteResponse"); + public Builder getNoteResponse(@Nullable GetNoteResponse getNoteResponse) { this.getNoteResponse = getNoteResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmNotesOneResponse build() { - return new CrmNotesOneResponse( contentType, statusCode, rawResponse, getNoteResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateRequest.java index 19400763..9897229d 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmNotesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class CrmNotesUpdateRequest { @JsonCreator public CrmNotesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - NoteInput note) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(note, "note"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull NoteInput note) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.note = note; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.note = Optional.ofNullable(note) + .orElseThrow(() -> new IllegalArgumentException("note cannot be null")); } public CrmNotesUpdateRequest( - String id, - NoteInput note) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), note); + @Nonnull String id, + @Nonnull NoteInput note) { + this(id, null, null, + null, null, note); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public NoteInput note() { - return note; + return this.note; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmNotesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmNotesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmNotesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public CrmNotesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmNotesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmNotesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmNotesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmNotesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmNotesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmNotesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmNotesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmNotesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmNotesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmNotesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmNotesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public CrmNotesUpdateRequest withNote(NoteInput note) { - Utils.checkNotNull(note, "note"); - this.note = note; + + public CrmNotesUpdateRequest withNote(@Nonnull NoteInput note) { + this.note = Utils.checkNotNull(note, "note"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private NoteInput note; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder note(NoteInput note) { - Utils.checkNotNull(note, "note"); - this.note = note; + public Builder note(@Nonnull NoteInput note) { + this.note = Utils.checkNotNull(note, "note"); return this; } public CrmNotesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmNotesUpdateRequest( id, consumerId, appId, serviceId, raw, note); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateRequestBuilder.java index 41faf6eb..a7d739da 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmNotesUpdateRequestBuilder { - - private CrmNotesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmNotesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmNotesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmNotesUpdateRequestBuilder request(CrmNotesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmNotesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmNotesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmNotesUpdateRequestBuilder request(@Nonnull CrmNotesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmNotesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmNotesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmNotesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateResponse.java index e7490f27..e0123032 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmNotesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmNotesUpdateResponse implements Response { /** * Note updated */ - private Optional updateNoteResponse; + private UpdateNoteResponse updateNoteResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmNotesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateNoteResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateNoteResponse, "updateNoteResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateNoteResponse updateNoteResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateNoteResponse = updateNoteResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmNotesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Note updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateNoteResponse() { - return (Optional) updateNoteResponse; + return Optional.ofNullable(this.updateNoteResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmNotesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmNotesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmNotesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmNotesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Note updated + * Raw HTTP response; suitable for custom response parsing */ - public CrmNotesUpdateResponse withUpdateNoteResponse(UpdateNoteResponse updateNoteResponse) { - Utils.checkNotNull(updateNoteResponse, "updateNoteResponse"); - this.updateNoteResponse = Optional.ofNullable(updateNoteResponse); + public CrmNotesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmNotesUpdateResponse withUpdateNoteResponse(UpdateNoteResponse updateNo /** * Note updated */ - public CrmNotesUpdateResponse withUpdateNoteResponse(Optional updateNoteResponse) { - Utils.checkNotNull(updateNoteResponse, "updateNoteResponse"); + public CrmNotesUpdateResponse withUpdateNoteResponse(@Nullable UpdateNoteResponse updateNoteResponse) { this.updateNoteResponse = updateNoteResponse; return this; } - /** - * Unexpected error - */ - public CrmNotesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmNotesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmNotesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateNoteResponse = Optional.empty(); + private UpdateNoteResponse updateNoteResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Note updated - */ - public Builder updateNoteResponse(UpdateNoteResponse updateNoteResponse) { - Utils.checkNotNull(updateNoteResponse, "updateNoteResponse"); - this.updateNoteResponse = Optional.ofNullable(updateNoteResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Note updated */ - public Builder updateNoteResponse(Optional updateNoteResponse) { - Utils.checkNotNull(updateNoteResponse, "updateNoteResponse"); + public Builder updateNoteResponse(@Nullable UpdateNoteResponse updateNoteResponse) { this.updateNoteResponse = updateNoteResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmNotesUpdateResponse build() { - return new CrmNotesUpdateResponse( contentType, statusCode, rawResponse, updateNoteResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddRequest.java index dd638248..52df3844 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class CrmOpportunitiesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class CrmOpportunitiesAddRequest { @JsonCreator public CrmOpportunitiesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - OpportunityInput opportunity) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(opportunity, "opportunity"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull OpportunityInput opportunity) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.opportunity = opportunity; + this.opportunity = Optional.ofNullable(opportunity) + .orElseThrow(() -> new IllegalArgumentException("opportunity cannot be null")); } public CrmOpportunitiesAddRequest( - OpportunityInput opportunity) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), opportunity); + @Nonnull OpportunityInput opportunity) { + this(null, null, null, + null, opportunity); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public OpportunityInput opportunity() { - return opportunity; + return this.opportunity; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmOpportunitiesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmOpportunitiesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmOpportunitiesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmOpportunitiesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmOpportunitiesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmOpportunitiesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmOpportunitiesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmOpportunitiesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmOpportunitiesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmOpportunitiesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmOpportunitiesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmOpportunitiesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public CrmOpportunitiesAddRequest withOpportunity(OpportunityInput opportunity) { - Utils.checkNotNull(opportunity, "opportunity"); - this.opportunity = opportunity; + + public CrmOpportunitiesAddRequest withOpportunity(@Nonnull OpportunityInput opportunity) { + this.opportunity = Utils.checkNotNull(opportunity, "opportunity"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private OpportunityInput opportunity; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder opportunity(OpportunityInput opportunity) { - Utils.checkNotNull(opportunity, "opportunity"); - this.opportunity = opportunity; + public Builder opportunity(@Nonnull OpportunityInput opportunity) { + this.opportunity = Utils.checkNotNull(opportunity, "opportunity"); return this; } public CrmOpportunitiesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmOpportunitiesAddRequest( raw, consumerId, appId, serviceId, opportunity); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddRequestBuilder.java index 7bd7c203..54a246b4 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmOpportunitiesAddRequestBuilder { - - private CrmOpportunitiesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmOpportunitiesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmOpportunitiesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmOpportunitiesAddRequestBuilder request(CrmOpportunitiesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmOpportunitiesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmOpportunitiesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmOpportunitiesAddRequestBuilder request(@Nonnull CrmOpportunitiesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmOpportunitiesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmOpportunitiesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmOpportunitiesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddResponse.java index 2f3b5156..1c927eba 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmOpportunitiesAddResponse implements Response { /** * Opportunity created */ - private Optional createOpportunityResponse; + private CreateOpportunityResponse createOpportunityResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmOpportunitiesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createOpportunityResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createOpportunityResponse, "createOpportunityResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateOpportunityResponse createOpportunityResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createOpportunityResponse = createOpportunityResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmOpportunitiesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Opportunity created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createOpportunityResponse() { - return (Optional) createOpportunityResponse; + return Optional.ofNullable(this.createOpportunityResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmOpportunitiesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmOpportunitiesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmOpportunitiesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmOpportunitiesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Opportunity created + * Raw HTTP response; suitable for custom response parsing */ - public CrmOpportunitiesAddResponse withCreateOpportunityResponse(CreateOpportunityResponse createOpportunityResponse) { - Utils.checkNotNull(createOpportunityResponse, "createOpportunityResponse"); - this.createOpportunityResponse = Optional.ofNullable(createOpportunityResponse); + public CrmOpportunitiesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmOpportunitiesAddResponse withCreateOpportunityResponse(CreateOpportuni /** * Opportunity created */ - public CrmOpportunitiesAddResponse withCreateOpportunityResponse(Optional createOpportunityResponse) { - Utils.checkNotNull(createOpportunityResponse, "createOpportunityResponse"); + public CrmOpportunitiesAddResponse withCreateOpportunityResponse(@Nullable CreateOpportunityResponse createOpportunityResponse) { this.createOpportunityResponse = createOpportunityResponse; return this; } - /** - * Unexpected error - */ - public CrmOpportunitiesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmOpportunitiesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmOpportunitiesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createOpportunityResponse = Optional.empty(); + private CreateOpportunityResponse createOpportunityResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Opportunity created - */ - public Builder createOpportunityResponse(CreateOpportunityResponse createOpportunityResponse) { - Utils.checkNotNull(createOpportunityResponse, "createOpportunityResponse"); - this.createOpportunityResponse = Optional.ofNullable(createOpportunityResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Opportunity created */ - public Builder createOpportunityResponse(Optional createOpportunityResponse) { - Utils.checkNotNull(createOpportunityResponse, "createOpportunityResponse"); + public Builder createOpportunityResponse(@Nullable CreateOpportunityResponse createOpportunityResponse) { this.createOpportunityResponse = createOpportunityResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmOpportunitiesAddResponse build() { - return new CrmOpportunitiesAddResponse( contentType, statusCode, rawResponse, createOpportunityResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllRequest.java index 3158611c..5e5aa414 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class CrmOpportunitiesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class CrmOpportunitiesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private OpportunitiesFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private OpportunitiesSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class CrmOpportunitiesAllRequest { @JsonCreator public CrmOpportunitiesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable OpportunitiesFilter filter, + @Nullable OpportunitiesSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmOpportunitiesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmOpportunitiesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmOpportunitiesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmOpportunitiesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmOpportunitiesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmOpportunitiesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmOpportunitiesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmOpportunitiesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmOpportunitiesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmOpportunitiesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmOpportunitiesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmOpportunitiesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmOpportunitiesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public CrmOpportunitiesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public CrmOpportunitiesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public CrmOpportunitiesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public CrmOpportunitiesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public CrmOpportunitiesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public CrmOpportunitiesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public CrmOpportunitiesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public CrmOpportunitiesAllRequest withFilter(OpportunitiesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public CrmOpportunitiesAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public CrmOpportunitiesAllRequest withFilter(@Nullable OpportunitiesFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public CrmOpportunitiesAllRequest withSort(OpportunitiesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public CrmOpportunitiesAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public CrmOpportunitiesAllRequest withSort(@Nullable OpportunitiesSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public CrmOpportunitiesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public CrmOpportunitiesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CrmOpportunitiesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmOpportunitiesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmOpportunitiesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmOpportunitiesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private OpportunitiesFilter filter; - private Optional sort = Optional.empty(); + private OpportunitiesSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(OpportunitiesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable OpportunitiesFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(OpportunitiesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable OpportunitiesSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmOpportunitiesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new CrmOpportunitiesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public CrmOpportunitiesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllRequestBuilder.java index 261270bb..0646c516 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class CrmOpportunitiesAllRequestBuilder { - - private CrmOpportunitiesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmOpportunitiesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmOpportunitiesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmOpportunitiesAllRequestBuilder request(CrmOpportunitiesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmOpportunitiesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmOpportunitiesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmOpportunitiesAllRequestBuilder request(@Nonnull CrmOpportunitiesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmOpportunitiesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmOpportunitiesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmOpportunitiesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public CrmOpportunitiesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new CrmOpportunitiesAllOperation( - sdkConfiguration, - options); + CrmOpportunitiesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new CrmOpportunitiesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - CrmOpportunitiesAllRequest::withCursor, + CrmOpportunitiesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllResponse.java index efe9f923..da271f0b 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmOpportunitiesAllResponse implements Response { /** * Opportunities */ - private Optional getOpportunitiesResponse; + private GetOpportunitiesResponse getOpportunitiesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmOpportunitiesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getOpportunitiesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getOpportunitiesResponse, "getOpportunitiesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetOpportunitiesResponse getOpportunitiesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getOpportunitiesResponse = getOpportunitiesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmOpportunitiesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Opportunities */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getOpportunitiesResponse() { - return (Optional) getOpportunitiesResponse; + return Optional.ofNullable(this.getOpportunitiesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmOpportunitiesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmOpportunitiesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmOpportunitiesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmOpportunitiesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Opportunities + * Raw HTTP response; suitable for custom response parsing */ - public CrmOpportunitiesAllResponse withGetOpportunitiesResponse(GetOpportunitiesResponse getOpportunitiesResponse) { - Utils.checkNotNull(getOpportunitiesResponse, "getOpportunitiesResponse"); - this.getOpportunitiesResponse = Optional.ofNullable(getOpportunitiesResponse); + public CrmOpportunitiesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmOpportunitiesAllResponse withGetOpportunitiesResponse(GetOpportunities /** * Opportunities */ - public CrmOpportunitiesAllResponse withGetOpportunitiesResponse(Optional getOpportunitiesResponse) { - Utils.checkNotNull(getOpportunitiesResponse, "getOpportunitiesResponse"); + public CrmOpportunitiesAllResponse withGetOpportunitiesResponse(@Nullable GetOpportunitiesResponse getOpportunitiesResponse) { this.getOpportunitiesResponse = getOpportunitiesResponse; return this; } - /** - * Unexpected error - */ - public CrmOpportunitiesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmOpportunitiesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmOpportunitiesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getOpportunitiesResponse = Optional.empty(); + private GetOpportunitiesResponse getOpportunitiesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Opportunities - */ - public Builder getOpportunitiesResponse(GetOpportunitiesResponse getOpportunitiesResponse) { - Utils.checkNotNull(getOpportunitiesResponse, "getOpportunitiesResponse"); - this.getOpportunitiesResponse = Optional.ofNullable(getOpportunitiesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Opportunities */ - public Builder getOpportunitiesResponse(Optional getOpportunitiesResponse) { - Utils.checkNotNull(getOpportunitiesResponse, "getOpportunitiesResponse"); + public Builder getOpportunitiesResponse(@Nullable GetOpportunitiesResponse getOpportunitiesResponse) { this.getOpportunitiesResponse = getOpportunitiesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmOpportunitiesAllResponse build() { - return new CrmOpportunitiesAllResponse( contentType, statusCode, rawResponse, getOpportunitiesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteRequest.java index 317358cf..0c66ca60 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class CrmOpportunitiesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public CrmOpportunitiesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public CrmOpportunitiesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmOpportunitiesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmOpportunitiesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmOpportunitiesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public CrmOpportunitiesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmOpportunitiesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmOpportunitiesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmOpportunitiesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmOpportunitiesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmOpportunitiesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmOpportunitiesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmOpportunitiesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmOpportunitiesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmOpportunitiesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmOpportunitiesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmOpportunitiesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public CrmOpportunitiesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmOpportunitiesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteRequestBuilder.java index afd1882b..a0ceb45f 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmOpportunitiesDeleteRequestBuilder { - - private CrmOpportunitiesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmOpportunitiesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmOpportunitiesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmOpportunitiesDeleteRequestBuilder request(CrmOpportunitiesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmOpportunitiesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmOpportunitiesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmOpportunitiesDeleteRequestBuilder request(@Nonnull CrmOpportunitiesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmOpportunitiesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmOpportunitiesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmOpportunitiesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteResponse.java index 955606f2..6c8b0962 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmOpportunitiesDeleteResponse implements Response { /** * Opportunity deleted */ - private Optional deleteOpportunityResponse; + private DeleteOpportunityResponse deleteOpportunityResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmOpportunitiesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteOpportunityResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteOpportunityResponse, "deleteOpportunityResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteOpportunityResponse deleteOpportunityResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteOpportunityResponse = deleteOpportunityResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmOpportunitiesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Opportunity deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteOpportunityResponse() { - return (Optional) deleteOpportunityResponse; + return Optional.ofNullable(this.deleteOpportunityResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmOpportunitiesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmOpportunitiesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmOpportunitiesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmOpportunitiesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Opportunity deleted + * Raw HTTP response; suitable for custom response parsing */ - public CrmOpportunitiesDeleteResponse withDeleteOpportunityResponse(DeleteOpportunityResponse deleteOpportunityResponse) { - Utils.checkNotNull(deleteOpportunityResponse, "deleteOpportunityResponse"); - this.deleteOpportunityResponse = Optional.ofNullable(deleteOpportunityResponse); + public CrmOpportunitiesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmOpportunitiesDeleteResponse withDeleteOpportunityResponse(DeleteOpport /** * Opportunity deleted */ - public CrmOpportunitiesDeleteResponse withDeleteOpportunityResponse(Optional deleteOpportunityResponse) { - Utils.checkNotNull(deleteOpportunityResponse, "deleteOpportunityResponse"); + public CrmOpportunitiesDeleteResponse withDeleteOpportunityResponse(@Nullable DeleteOpportunityResponse deleteOpportunityResponse) { this.deleteOpportunityResponse = deleteOpportunityResponse; return this; } - /** - * Unexpected error - */ - public CrmOpportunitiesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmOpportunitiesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmOpportunitiesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteOpportunityResponse = Optional.empty(); + private DeleteOpportunityResponse deleteOpportunityResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Opportunity deleted - */ - public Builder deleteOpportunityResponse(DeleteOpportunityResponse deleteOpportunityResponse) { - Utils.checkNotNull(deleteOpportunityResponse, "deleteOpportunityResponse"); - this.deleteOpportunityResponse = Optional.ofNullable(deleteOpportunityResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Opportunity deleted */ - public Builder deleteOpportunityResponse(Optional deleteOpportunityResponse) { - Utils.checkNotNull(deleteOpportunityResponse, "deleteOpportunityResponse"); + public Builder deleteOpportunityResponse(@Nullable DeleteOpportunityResponse deleteOpportunityResponse) { this.deleteOpportunityResponse = deleteOpportunityResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmOpportunitiesDeleteResponse build() { - return new CrmOpportunitiesDeleteResponse( contentType, statusCode, rawResponse, deleteOpportunityResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneRequest.java index 27fd3224..41a09128 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmOpportunitiesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class CrmOpportunitiesOneRequest { @JsonCreator public CrmOpportunitiesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmOpportunitiesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmOpportunitiesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmOpportunitiesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmOpportunitiesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public CrmOpportunitiesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmOpportunitiesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmOpportunitiesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmOpportunitiesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmOpportunitiesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmOpportunitiesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmOpportunitiesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmOpportunitiesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmOpportunitiesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmOpportunitiesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmOpportunitiesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmOpportunitiesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmOpportunitiesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmOpportunitiesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmOpportunitiesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmOpportunitiesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmOpportunitiesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneRequestBuilder.java index caf11a02..c8ae09f9 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmOpportunitiesOneRequestBuilder { - - private CrmOpportunitiesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmOpportunitiesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmOpportunitiesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmOpportunitiesOneRequestBuilder request(CrmOpportunitiesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmOpportunitiesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmOpportunitiesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmOpportunitiesOneRequestBuilder request(@Nonnull CrmOpportunitiesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmOpportunitiesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmOpportunitiesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmOpportunitiesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneResponse.java index 51b913c0..eb057f10 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmOpportunitiesOneResponse implements Response { /** * Opportunity */ - private Optional getOpportunityResponse; + private GetOpportunityResponse getOpportunityResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmOpportunitiesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getOpportunityResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getOpportunityResponse, "getOpportunityResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetOpportunityResponse getOpportunityResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getOpportunityResponse = getOpportunityResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmOpportunitiesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Opportunity */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getOpportunityResponse() { - return (Optional) getOpportunityResponse; + return Optional.ofNullable(this.getOpportunityResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmOpportunitiesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmOpportunitiesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmOpportunitiesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmOpportunitiesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Opportunity + * Raw HTTP response; suitable for custom response parsing */ - public CrmOpportunitiesOneResponse withGetOpportunityResponse(GetOpportunityResponse getOpportunityResponse) { - Utils.checkNotNull(getOpportunityResponse, "getOpportunityResponse"); - this.getOpportunityResponse = Optional.ofNullable(getOpportunityResponse); + public CrmOpportunitiesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmOpportunitiesOneResponse withGetOpportunityResponse(GetOpportunityResp /** * Opportunity */ - public CrmOpportunitiesOneResponse withGetOpportunityResponse(Optional getOpportunityResponse) { - Utils.checkNotNull(getOpportunityResponse, "getOpportunityResponse"); + public CrmOpportunitiesOneResponse withGetOpportunityResponse(@Nullable GetOpportunityResponse getOpportunityResponse) { this.getOpportunityResponse = getOpportunityResponse; return this; } - /** - * Unexpected error - */ - public CrmOpportunitiesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmOpportunitiesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmOpportunitiesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getOpportunityResponse = Optional.empty(); + private GetOpportunityResponse getOpportunityResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Opportunity - */ - public Builder getOpportunityResponse(GetOpportunityResponse getOpportunityResponse) { - Utils.checkNotNull(getOpportunityResponse, "getOpportunityResponse"); - this.getOpportunityResponse = Optional.ofNullable(getOpportunityResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Opportunity */ - public Builder getOpportunityResponse(Optional getOpportunityResponse) { - Utils.checkNotNull(getOpportunityResponse, "getOpportunityResponse"); + public Builder getOpportunityResponse(@Nullable GetOpportunityResponse getOpportunityResponse) { this.getOpportunityResponse = getOpportunityResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmOpportunitiesOneResponse build() { - return new CrmOpportunitiesOneResponse( contentType, statusCode, rawResponse, getOpportunityResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateRequest.java index 9d91f993..ca489ddc 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmOpportunitiesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class CrmOpportunitiesUpdateRequest { @JsonCreator public CrmOpportunitiesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - OpportunityInput opportunity) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(opportunity, "opportunity"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull OpportunityInput opportunity) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.opportunity = opportunity; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.opportunity = Optional.ofNullable(opportunity) + .orElseThrow(() -> new IllegalArgumentException("opportunity cannot be null")); } public CrmOpportunitiesUpdateRequest( - String id, - OpportunityInput opportunity) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), opportunity); + @Nonnull String id, + @Nonnull OpportunityInput opportunity) { + this(id, null, null, + null, null, opportunity); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public OpportunityInput opportunity() { - return opportunity; + return this.opportunity; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmOpportunitiesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmOpportunitiesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmOpportunitiesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public CrmOpportunitiesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmOpportunitiesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmOpportunitiesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmOpportunitiesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmOpportunitiesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmOpportunitiesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmOpportunitiesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmOpportunitiesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmOpportunitiesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmOpportunitiesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmOpportunitiesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmOpportunitiesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public CrmOpportunitiesUpdateRequest withOpportunity(OpportunityInput opportunity) { - Utils.checkNotNull(opportunity, "opportunity"); - this.opportunity = opportunity; + + public CrmOpportunitiesUpdateRequest withOpportunity(@Nonnull OpportunityInput opportunity) { + this.opportunity = Utils.checkNotNull(opportunity, "opportunity"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private OpportunityInput opportunity; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder opportunity(OpportunityInput opportunity) { - Utils.checkNotNull(opportunity, "opportunity"); - this.opportunity = opportunity; + public Builder opportunity(@Nonnull OpportunityInput opportunity) { + this.opportunity = Utils.checkNotNull(opportunity, "opportunity"); return this; } public CrmOpportunitiesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmOpportunitiesUpdateRequest( id, consumerId, appId, serviceId, raw, opportunity); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateRequestBuilder.java index 1bf9a5f6..c3e89133 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmOpportunitiesUpdateRequestBuilder { - - private CrmOpportunitiesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmOpportunitiesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmOpportunitiesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmOpportunitiesUpdateRequestBuilder request(CrmOpportunitiesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmOpportunitiesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmOpportunitiesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmOpportunitiesUpdateRequestBuilder request(@Nonnull CrmOpportunitiesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmOpportunitiesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmOpportunitiesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmOpportunitiesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateResponse.java index bceadd5f..df92b792 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmOpportunitiesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmOpportunitiesUpdateResponse implements Response { /** * Opportunity updated */ - private Optional updateOpportunityResponse; + private UpdateOpportunityResponse updateOpportunityResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmOpportunitiesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateOpportunityResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateOpportunityResponse, "updateOpportunityResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateOpportunityResponse updateOpportunityResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateOpportunityResponse = updateOpportunityResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmOpportunitiesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Opportunity updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateOpportunityResponse() { - return (Optional) updateOpportunityResponse; + return Optional.ofNullable(this.updateOpportunityResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmOpportunitiesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmOpportunitiesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmOpportunitiesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmOpportunitiesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Opportunity updated + * Raw HTTP response; suitable for custom response parsing */ - public CrmOpportunitiesUpdateResponse withUpdateOpportunityResponse(UpdateOpportunityResponse updateOpportunityResponse) { - Utils.checkNotNull(updateOpportunityResponse, "updateOpportunityResponse"); - this.updateOpportunityResponse = Optional.ofNullable(updateOpportunityResponse); + public CrmOpportunitiesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmOpportunitiesUpdateResponse withUpdateOpportunityResponse(UpdateOpport /** * Opportunity updated */ - public CrmOpportunitiesUpdateResponse withUpdateOpportunityResponse(Optional updateOpportunityResponse) { - Utils.checkNotNull(updateOpportunityResponse, "updateOpportunityResponse"); + public CrmOpportunitiesUpdateResponse withUpdateOpportunityResponse(@Nullable UpdateOpportunityResponse updateOpportunityResponse) { this.updateOpportunityResponse = updateOpportunityResponse; return this; } - /** - * Unexpected error - */ - public CrmOpportunitiesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmOpportunitiesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmOpportunitiesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateOpportunityResponse = Optional.empty(); + private UpdateOpportunityResponse updateOpportunityResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Opportunity updated - */ - public Builder updateOpportunityResponse(UpdateOpportunityResponse updateOpportunityResponse) { - Utils.checkNotNull(updateOpportunityResponse, "updateOpportunityResponse"); - this.updateOpportunityResponse = Optional.ofNullable(updateOpportunityResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Opportunity updated */ - public Builder updateOpportunityResponse(Optional updateOpportunityResponse) { - Utils.checkNotNull(updateOpportunityResponse, "updateOpportunityResponse"); + public Builder updateOpportunityResponse(@Nullable UpdateOpportunityResponse updateOpportunityResponse) { this.updateOpportunityResponse = updateOpportunityResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmOpportunitiesUpdateResponse build() { - return new CrmOpportunitiesUpdateResponse( contentType, statusCode, rawResponse, updateOpportunityResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddRequest.java index af29f1ed..da443d57 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class CrmPipelinesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class CrmPipelinesAddRequest { @JsonCreator public CrmPipelinesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - PipelineInput pipeline) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(pipeline, "pipeline"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull PipelineInput pipeline) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.pipeline = pipeline; + this.pipeline = Optional.ofNullable(pipeline) + .orElseThrow(() -> new IllegalArgumentException("pipeline cannot be null")); } public CrmPipelinesAddRequest( - PipelineInput pipeline) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), pipeline); + @Nonnull PipelineInput pipeline) { + this(null, null, null, + null, pipeline); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public PipelineInput pipeline() { - return pipeline; + return this.pipeline; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmPipelinesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmPipelinesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmPipelinesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmPipelinesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmPipelinesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmPipelinesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmPipelinesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmPipelinesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmPipelinesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmPipelinesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmPipelinesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmPipelinesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public CrmPipelinesAddRequest withPipeline(PipelineInput pipeline) { - Utils.checkNotNull(pipeline, "pipeline"); - this.pipeline = pipeline; + + public CrmPipelinesAddRequest withPipeline(@Nonnull PipelineInput pipeline) { + this.pipeline = Utils.checkNotNull(pipeline, "pipeline"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private PipelineInput pipeline; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder pipeline(PipelineInput pipeline) { - Utils.checkNotNull(pipeline, "pipeline"); - this.pipeline = pipeline; + public Builder pipeline(@Nonnull PipelineInput pipeline) { + this.pipeline = Utils.checkNotNull(pipeline, "pipeline"); return this; } public CrmPipelinesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmPipelinesAddRequest( raw, consumerId, appId, serviceId, pipeline); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddRequestBuilder.java index bb9cce10..88bc82c9 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmPipelinesAddRequestBuilder { - - private CrmPipelinesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmPipelinesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmPipelinesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmPipelinesAddRequestBuilder request(CrmPipelinesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmPipelinesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmPipelinesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmPipelinesAddRequestBuilder request(@Nonnull CrmPipelinesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmPipelinesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmPipelinesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmPipelinesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddResponse.java index 1d25bbc8..89151996 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmPipelinesAddResponse implements Response { /** * Pipeline created */ - private Optional createPipelineResponse; + private CreatePipelineResponse createPipelineResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmPipelinesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createPipelineResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createPipelineResponse, "createPipelineResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreatePipelineResponse createPipelineResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createPipelineResponse = createPipelineResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmPipelinesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Pipeline created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createPipelineResponse() { - return (Optional) createPipelineResponse; + return Optional.ofNullable(this.createPipelineResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmPipelinesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmPipelinesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmPipelinesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmPipelinesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Pipeline created + * Raw HTTP response; suitable for custom response parsing */ - public CrmPipelinesAddResponse withCreatePipelineResponse(CreatePipelineResponse createPipelineResponse) { - Utils.checkNotNull(createPipelineResponse, "createPipelineResponse"); - this.createPipelineResponse = Optional.ofNullable(createPipelineResponse); + public CrmPipelinesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmPipelinesAddResponse withCreatePipelineResponse(CreatePipelineResponse /** * Pipeline created */ - public CrmPipelinesAddResponse withCreatePipelineResponse(Optional createPipelineResponse) { - Utils.checkNotNull(createPipelineResponse, "createPipelineResponse"); + public CrmPipelinesAddResponse withCreatePipelineResponse(@Nullable CreatePipelineResponse createPipelineResponse) { this.createPipelineResponse = createPipelineResponse; return this; } - /** - * Unexpected error - */ - public CrmPipelinesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmPipelinesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmPipelinesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createPipelineResponse = Optional.empty(); + private CreatePipelineResponse createPipelineResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Pipeline created - */ - public Builder createPipelineResponse(CreatePipelineResponse createPipelineResponse) { - Utils.checkNotNull(createPipelineResponse, "createPipelineResponse"); - this.createPipelineResponse = Optional.ofNullable(createPipelineResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Pipeline created */ - public Builder createPipelineResponse(Optional createPipelineResponse) { - Utils.checkNotNull(createPipelineResponse, "createPipelineResponse"); + public Builder createPipelineResponse(@Nullable CreatePipelineResponse createPipelineResponse) { this.createPipelineResponse = createPipelineResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmPipelinesAddResponse build() { - return new CrmPipelinesAddResponse( contentType, statusCode, rawResponse, createPipelineResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllRequest.java index 2f0ce6ed..c9b475f9 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class CrmPipelinesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class CrmPipelinesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class CrmPipelinesAllRequest { @JsonCreator public CrmPipelinesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmPipelinesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmPipelinesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmPipelinesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmPipelinesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmPipelinesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmPipelinesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmPipelinesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmPipelinesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmPipelinesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmPipelinesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmPipelinesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmPipelinesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmPipelinesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public CrmPipelinesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public CrmPipelinesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public CrmPipelinesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public CrmPipelinesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public CrmPipelinesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public CrmPipelinesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public CrmPipelinesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public CrmPipelinesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public CrmPipelinesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CrmPipelinesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmPipelinesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmPipelinesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmPipelinesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmPipelinesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new CrmPipelinesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public CrmPipelinesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllRequestBuilder.java index 6d6b4231..8170721f 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class CrmPipelinesAllRequestBuilder { - - private CrmPipelinesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmPipelinesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmPipelinesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmPipelinesAllRequestBuilder request(CrmPipelinesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmPipelinesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmPipelinesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmPipelinesAllRequestBuilder request(@Nonnull CrmPipelinesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmPipelinesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmPipelinesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmPipelinesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public CrmPipelinesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new CrmPipelinesAllOperation( - sdkConfiguration, - options); + CrmPipelinesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new CrmPipelinesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - CrmPipelinesAllRequest::withCursor, + CrmPipelinesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllResponse.java index 9116d9dc..2df289e6 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmPipelinesAllResponse implements Response { /** * Pipelines */ - private Optional getPipelinesResponse; + private GetPipelinesResponse getPipelinesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmPipelinesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getPipelinesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getPipelinesResponse, "getPipelinesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetPipelinesResponse getPipelinesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getPipelinesResponse = getPipelinesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmPipelinesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Pipelines */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getPipelinesResponse() { - return (Optional) getPipelinesResponse; + return Optional.ofNullable(this.getPipelinesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmPipelinesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmPipelinesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmPipelinesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmPipelinesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Pipelines + * Raw HTTP response; suitable for custom response parsing */ - public CrmPipelinesAllResponse withGetPipelinesResponse(GetPipelinesResponse getPipelinesResponse) { - Utils.checkNotNull(getPipelinesResponse, "getPipelinesResponse"); - this.getPipelinesResponse = Optional.ofNullable(getPipelinesResponse); + public CrmPipelinesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmPipelinesAllResponse withGetPipelinesResponse(GetPipelinesResponse get /** * Pipelines */ - public CrmPipelinesAllResponse withGetPipelinesResponse(Optional getPipelinesResponse) { - Utils.checkNotNull(getPipelinesResponse, "getPipelinesResponse"); + public CrmPipelinesAllResponse withGetPipelinesResponse(@Nullable GetPipelinesResponse getPipelinesResponse) { this.getPipelinesResponse = getPipelinesResponse; return this; } - /** - * Unexpected error - */ - public CrmPipelinesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmPipelinesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmPipelinesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getPipelinesResponse = Optional.empty(); + private GetPipelinesResponse getPipelinesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Pipelines - */ - public Builder getPipelinesResponse(GetPipelinesResponse getPipelinesResponse) { - Utils.checkNotNull(getPipelinesResponse, "getPipelinesResponse"); - this.getPipelinesResponse = Optional.ofNullable(getPipelinesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Pipelines */ - public Builder getPipelinesResponse(Optional getPipelinesResponse) { - Utils.checkNotNull(getPipelinesResponse, "getPipelinesResponse"); + public Builder getPipelinesResponse(@Nullable GetPipelinesResponse getPipelinesResponse) { this.getPipelinesResponse = getPipelinesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmPipelinesAllResponse build() { - return new CrmPipelinesAllResponse( contentType, statusCode, rawResponse, getPipelinesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteRequest.java index 6328fb79..d80aad30 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class CrmPipelinesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public CrmPipelinesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public CrmPipelinesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmPipelinesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmPipelinesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmPipelinesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public CrmPipelinesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmPipelinesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmPipelinesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmPipelinesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmPipelinesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmPipelinesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmPipelinesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmPipelinesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmPipelinesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmPipelinesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmPipelinesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmPipelinesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public CrmPipelinesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmPipelinesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteRequestBuilder.java index f1eecda8..daea19dd 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmPipelinesDeleteRequestBuilder { - - private CrmPipelinesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmPipelinesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmPipelinesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmPipelinesDeleteRequestBuilder request(CrmPipelinesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmPipelinesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmPipelinesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmPipelinesDeleteRequestBuilder request(@Nonnull CrmPipelinesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmPipelinesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmPipelinesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmPipelinesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteResponse.java index 4a97bd57..b2c6110c 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmPipelinesDeleteResponse implements Response { /** * Pipeline deleted */ - private Optional deletePipelineResponse; + private DeletePipelineResponse deletePipelineResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmPipelinesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deletePipelineResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deletePipelineResponse, "deletePipelineResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeletePipelineResponse deletePipelineResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deletePipelineResponse = deletePipelineResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmPipelinesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Pipeline deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deletePipelineResponse() { - return (Optional) deletePipelineResponse; + return Optional.ofNullable(this.deletePipelineResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmPipelinesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmPipelinesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmPipelinesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmPipelinesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Pipeline deleted + * Raw HTTP response; suitable for custom response parsing */ - public CrmPipelinesDeleteResponse withDeletePipelineResponse(DeletePipelineResponse deletePipelineResponse) { - Utils.checkNotNull(deletePipelineResponse, "deletePipelineResponse"); - this.deletePipelineResponse = Optional.ofNullable(deletePipelineResponse); + public CrmPipelinesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmPipelinesDeleteResponse withDeletePipelineResponse(DeletePipelineRespo /** * Pipeline deleted */ - public CrmPipelinesDeleteResponse withDeletePipelineResponse(Optional deletePipelineResponse) { - Utils.checkNotNull(deletePipelineResponse, "deletePipelineResponse"); + public CrmPipelinesDeleteResponse withDeletePipelineResponse(@Nullable DeletePipelineResponse deletePipelineResponse) { this.deletePipelineResponse = deletePipelineResponse; return this; } - /** - * Unexpected error - */ - public CrmPipelinesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmPipelinesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmPipelinesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deletePipelineResponse = Optional.empty(); + private DeletePipelineResponse deletePipelineResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Pipeline deleted - */ - public Builder deletePipelineResponse(DeletePipelineResponse deletePipelineResponse) { - Utils.checkNotNull(deletePipelineResponse, "deletePipelineResponse"); - this.deletePipelineResponse = Optional.ofNullable(deletePipelineResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Pipeline deleted */ - public Builder deletePipelineResponse(Optional deletePipelineResponse) { - Utils.checkNotNull(deletePipelineResponse, "deletePipelineResponse"); + public Builder deletePipelineResponse(@Nullable DeletePipelineResponse deletePipelineResponse) { this.deletePipelineResponse = deletePipelineResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmPipelinesDeleteResponse build() { - return new CrmPipelinesDeleteResponse( contentType, statusCode, rawResponse, deletePipelineResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneRequest.java index 554bc3db..d54e1316 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmPipelinesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class CrmPipelinesOneRequest { @JsonCreator public CrmPipelinesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmPipelinesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmPipelinesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmPipelinesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmPipelinesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public CrmPipelinesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmPipelinesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmPipelinesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmPipelinesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmPipelinesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmPipelinesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmPipelinesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmPipelinesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmPipelinesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmPipelinesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmPipelinesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmPipelinesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmPipelinesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmPipelinesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmPipelinesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmPipelinesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmPipelinesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneRequestBuilder.java index 7cc2468d..95490d91 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmPipelinesOneRequestBuilder { - - private CrmPipelinesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmPipelinesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmPipelinesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmPipelinesOneRequestBuilder request(CrmPipelinesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmPipelinesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmPipelinesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmPipelinesOneRequestBuilder request(@Nonnull CrmPipelinesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmPipelinesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmPipelinesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmPipelinesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneResponse.java index 992cbd5b..1dc0f947 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmPipelinesOneResponse implements Response { /** * Pipeline */ - private Optional getPipelineResponse; + private GetPipelineResponse getPipelineResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmPipelinesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getPipelineResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getPipelineResponse, "getPipelineResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetPipelineResponse getPipelineResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getPipelineResponse = getPipelineResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmPipelinesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Pipeline */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getPipelineResponse() { - return (Optional) getPipelineResponse; + return Optional.ofNullable(this.getPipelineResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmPipelinesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmPipelinesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmPipelinesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmPipelinesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Pipeline + * Raw HTTP response; suitable for custom response parsing */ - public CrmPipelinesOneResponse withGetPipelineResponse(GetPipelineResponse getPipelineResponse) { - Utils.checkNotNull(getPipelineResponse, "getPipelineResponse"); - this.getPipelineResponse = Optional.ofNullable(getPipelineResponse); + public CrmPipelinesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmPipelinesOneResponse withGetPipelineResponse(GetPipelineResponse getPi /** * Pipeline */ - public CrmPipelinesOneResponse withGetPipelineResponse(Optional getPipelineResponse) { - Utils.checkNotNull(getPipelineResponse, "getPipelineResponse"); + public CrmPipelinesOneResponse withGetPipelineResponse(@Nullable GetPipelineResponse getPipelineResponse) { this.getPipelineResponse = getPipelineResponse; return this; } - /** - * Unexpected error - */ - public CrmPipelinesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmPipelinesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmPipelinesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getPipelineResponse = Optional.empty(); + private GetPipelineResponse getPipelineResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Pipeline - */ - public Builder getPipelineResponse(GetPipelineResponse getPipelineResponse) { - Utils.checkNotNull(getPipelineResponse, "getPipelineResponse"); - this.getPipelineResponse = Optional.ofNullable(getPipelineResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Pipeline */ - public Builder getPipelineResponse(Optional getPipelineResponse) { - Utils.checkNotNull(getPipelineResponse, "getPipelineResponse"); + public Builder getPipelineResponse(@Nullable GetPipelineResponse getPipelineResponse) { this.getPipelineResponse = getPipelineResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmPipelinesOneResponse build() { - return new CrmPipelinesOneResponse( contentType, statusCode, rawResponse, getPipelineResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateRequest.java index d5a9d800..80018429 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmPipelinesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class CrmPipelinesUpdateRequest { @JsonCreator public CrmPipelinesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - PipelineInput pipeline) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(pipeline, "pipeline"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull PipelineInput pipeline) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.pipeline = pipeline; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.pipeline = Optional.ofNullable(pipeline) + .orElseThrow(() -> new IllegalArgumentException("pipeline cannot be null")); } public CrmPipelinesUpdateRequest( - String id, - PipelineInput pipeline) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), pipeline); + @Nonnull String id, + @Nonnull PipelineInput pipeline) { + this(id, null, null, + null, null, pipeline); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public PipelineInput pipeline() { - return pipeline; + return this.pipeline; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmPipelinesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmPipelinesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmPipelinesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public CrmPipelinesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmPipelinesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmPipelinesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmPipelinesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmPipelinesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmPipelinesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmPipelinesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmPipelinesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmPipelinesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmPipelinesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmPipelinesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmPipelinesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public CrmPipelinesUpdateRequest withPipeline(PipelineInput pipeline) { - Utils.checkNotNull(pipeline, "pipeline"); - this.pipeline = pipeline; + + public CrmPipelinesUpdateRequest withPipeline(@Nonnull PipelineInput pipeline) { + this.pipeline = Utils.checkNotNull(pipeline, "pipeline"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private PipelineInput pipeline; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder pipeline(PipelineInput pipeline) { - Utils.checkNotNull(pipeline, "pipeline"); - this.pipeline = pipeline; + public Builder pipeline(@Nonnull PipelineInput pipeline) { + this.pipeline = Utils.checkNotNull(pipeline, "pipeline"); return this; } public CrmPipelinesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmPipelinesUpdateRequest( id, consumerId, appId, serviceId, raw, pipeline); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateRequestBuilder.java index d839521c..524550ce 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmPipelinesUpdateRequestBuilder { - - private CrmPipelinesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmPipelinesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmPipelinesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmPipelinesUpdateRequestBuilder request(CrmPipelinesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmPipelinesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmPipelinesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmPipelinesUpdateRequestBuilder request(@Nonnull CrmPipelinesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmPipelinesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmPipelinesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmPipelinesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateResponse.java index 57b39b1b..8fb4b062 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmPipelinesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmPipelinesUpdateResponse implements Response { /** * Pipeline updated */ - private Optional updatePipelineResponse; + private UpdatePipelineResponse updatePipelineResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmPipelinesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updatePipelineResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updatePipelineResponse, "updatePipelineResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdatePipelineResponse updatePipelineResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updatePipelineResponse = updatePipelineResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmPipelinesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Pipeline updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updatePipelineResponse() { - return (Optional) updatePipelineResponse; + return Optional.ofNullable(this.updatePipelineResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmPipelinesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmPipelinesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmPipelinesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmPipelinesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Pipeline updated + * Raw HTTP response; suitable for custom response parsing */ - public CrmPipelinesUpdateResponse withUpdatePipelineResponse(UpdatePipelineResponse updatePipelineResponse) { - Utils.checkNotNull(updatePipelineResponse, "updatePipelineResponse"); - this.updatePipelineResponse = Optional.ofNullable(updatePipelineResponse); + public CrmPipelinesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmPipelinesUpdateResponse withUpdatePipelineResponse(UpdatePipelineRespo /** * Pipeline updated */ - public CrmPipelinesUpdateResponse withUpdatePipelineResponse(Optional updatePipelineResponse) { - Utils.checkNotNull(updatePipelineResponse, "updatePipelineResponse"); + public CrmPipelinesUpdateResponse withUpdatePipelineResponse(@Nullable UpdatePipelineResponse updatePipelineResponse) { this.updatePipelineResponse = updatePipelineResponse; return this; } - /** - * Unexpected error - */ - public CrmPipelinesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmPipelinesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmPipelinesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updatePipelineResponse = Optional.empty(); + private UpdatePipelineResponse updatePipelineResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Pipeline updated - */ - public Builder updatePipelineResponse(UpdatePipelineResponse updatePipelineResponse) { - Utils.checkNotNull(updatePipelineResponse, "updatePipelineResponse"); - this.updatePipelineResponse = Optional.ofNullable(updatePipelineResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Pipeline updated */ - public Builder updatePipelineResponse(Optional updatePipelineResponse) { - Utils.checkNotNull(updatePipelineResponse, "updatePipelineResponse"); + public Builder updatePipelineResponse(@Nullable UpdatePipelineResponse updatePipelineResponse) { this.updatePipelineResponse = updatePipelineResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmPipelinesUpdateResponse build() { - return new CrmPipelinesUpdateResponse( contentType, statusCode, rawResponse, updatePipelineResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersAddRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersAddRequest.java index b85bb061..150b0981 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class CrmUsersAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class CrmUsersAddRequest { @JsonCreator public CrmUsersAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - UserInput user) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(user, "user"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull UserInput user) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.user = user; + this.user = Optional.ofNullable(user) + .orElseThrow(() -> new IllegalArgumentException("user cannot be null")); } public CrmUsersAddRequest( - UserInput user) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), user); + @Nonnull UserInput user) { + this(null, null, null, + null, user); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public UserInput user() { - return user; + return this.user; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmUsersAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmUsersAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmUsersAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmUsersAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmUsersAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmUsersAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmUsersAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmUsersAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmUsersAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmUsersAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmUsersAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmUsersAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public CrmUsersAddRequest withUser(UserInput user) { - Utils.checkNotNull(user, "user"); - this.user = user; + + public CrmUsersAddRequest withUser(@Nonnull UserInput user) { + this.user = Utils.checkNotNull(user, "user"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private UserInput user; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder user(UserInput user) { - Utils.checkNotNull(user, "user"); - this.user = user; + public Builder user(@Nonnull UserInput user) { + this.user = Utils.checkNotNull(user, "user"); return this; } public CrmUsersAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmUsersAddRequest( raw, consumerId, appId, serviceId, user); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersAddRequestBuilder.java index 43f57021..487cf23f 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmUsersAddRequestBuilder { - - private CrmUsersAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmUsersAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmUsersAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmUsersAddRequestBuilder request(CrmUsersAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmUsersAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmUsersAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmUsersAddRequestBuilder request(@Nonnull CrmUsersAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmUsersAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmUsersAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmUsersAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersAddResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersAddResponse.java index e0081d29..b649f381 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmUsersAddResponse implements Response { /** * User created */ - private Optional createUserResponse; + private CreateUserResponse createUserResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmUsersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createUserResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createUserResponse, "createUserResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateUserResponse createUserResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createUserResponse = createUserResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmUsersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * User created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createUserResponse() { - return (Optional) createUserResponse; + return Optional.ofNullable(this.createUserResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmUsersAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmUsersAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmUsersAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmUsersAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * User created + * Raw HTTP response; suitable for custom response parsing */ - public CrmUsersAddResponse withCreateUserResponse(CreateUserResponse createUserResponse) { - Utils.checkNotNull(createUserResponse, "createUserResponse"); - this.createUserResponse = Optional.ofNullable(createUserResponse); + public CrmUsersAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmUsersAddResponse withCreateUserResponse(CreateUserResponse createUserR /** * User created */ - public CrmUsersAddResponse withCreateUserResponse(Optional createUserResponse) { - Utils.checkNotNull(createUserResponse, "createUserResponse"); + public CrmUsersAddResponse withCreateUserResponse(@Nullable CreateUserResponse createUserResponse) { this.createUserResponse = createUserResponse; return this; } - /** - * Unexpected error - */ - public CrmUsersAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmUsersAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmUsersAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createUserResponse = Optional.empty(); + private CreateUserResponse createUserResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * User created - */ - public Builder createUserResponse(CreateUserResponse createUserResponse) { - Utils.checkNotNull(createUserResponse, "createUserResponse"); - this.createUserResponse = Optional.ofNullable(createUserResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * User created */ - public Builder createUserResponse(Optional createUserResponse) { - Utils.checkNotNull(createUserResponse, "createUserResponse"); + public Builder createUserResponse(@Nullable CreateUserResponse createUserResponse) { this.createUserResponse = createUserResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmUsersAddResponse build() { - return new CrmUsersAddResponse( contentType, statusCode, rawResponse, createUserResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersAllRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersAllRequest.java index 3743c92b..f360d1da 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class CrmUsersAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class CrmUsersAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class CrmUsersAllRequest { @JsonCreator public CrmUsersAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmUsersAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public CrmUsersAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmUsersAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmUsersAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public CrmUsersAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public CrmUsersAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmUsersAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmUsersAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmUsersAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmUsersAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmUsersAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmUsersAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmUsersAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public CrmUsersAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public CrmUsersAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public CrmUsersAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public CrmUsersAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public CrmUsersAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public CrmUsersAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public CrmUsersAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public CrmUsersAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public CrmUsersAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public CrmUsersAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmUsersAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmUsersAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmUsersAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmUsersAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new CrmUsersAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public CrmUsersAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersAllRequestBuilder.java index 2eddc2e8..383c054c 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class CrmUsersAllRequestBuilder { - - private CrmUsersAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmUsersAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmUsersAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmUsersAllRequestBuilder request(CrmUsersAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmUsersAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmUsersAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmUsersAllRequestBuilder request(@Nonnull CrmUsersAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmUsersAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmUsersAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmUsersAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public CrmUsersAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new CrmUsersAllOperation( - sdkConfiguration, - options); + CrmUsersAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new CrmUsersAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - CrmUsersAllRequest::withCursor, + CrmUsersAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersAllResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersAllResponse.java index 059c5c06..6a9686a2 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmUsersAllResponse implements Response { /** * Users */ - private Optional getUsersResponse; + private GetUsersResponse getUsersResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmUsersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getUsersResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getUsersResponse, "getUsersResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetUsersResponse getUsersResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getUsersResponse = getUsersResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmUsersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Users */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getUsersResponse() { - return (Optional) getUsersResponse; + return Optional.ofNullable(this.getUsersResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmUsersAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmUsersAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmUsersAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmUsersAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Users + * Raw HTTP response; suitable for custom response parsing */ - public CrmUsersAllResponse withGetUsersResponse(GetUsersResponse getUsersResponse) { - Utils.checkNotNull(getUsersResponse, "getUsersResponse"); - this.getUsersResponse = Optional.ofNullable(getUsersResponse); + public CrmUsersAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmUsersAllResponse withGetUsersResponse(GetUsersResponse getUsersRespons /** * Users */ - public CrmUsersAllResponse withGetUsersResponse(Optional getUsersResponse) { - Utils.checkNotNull(getUsersResponse, "getUsersResponse"); + public CrmUsersAllResponse withGetUsersResponse(@Nullable GetUsersResponse getUsersResponse) { this.getUsersResponse = getUsersResponse; return this; } - /** - * Unexpected error - */ - public CrmUsersAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmUsersAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmUsersAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getUsersResponse = Optional.empty(); + private GetUsersResponse getUsersResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Users - */ - public Builder getUsersResponse(GetUsersResponse getUsersResponse) { - Utils.checkNotNull(getUsersResponse, "getUsersResponse"); - this.getUsersResponse = Optional.ofNullable(getUsersResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Users */ - public Builder getUsersResponse(Optional getUsersResponse) { - Utils.checkNotNull(getUsersResponse, "getUsersResponse"); + public Builder getUsersResponse(@Nullable GetUsersResponse getUsersResponse) { this.getUsersResponse = getUsersResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmUsersAllResponse build() { - return new CrmUsersAllResponse( contentType, statusCode, rawResponse, getUsersResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteRequest.java index 5ece003d..10b90298 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class CrmUsersDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public CrmUsersDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public CrmUsersDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmUsersDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmUsersDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmUsersDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public CrmUsersDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmUsersDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmUsersDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmUsersDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmUsersDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmUsersDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmUsersDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmUsersDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmUsersDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmUsersDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmUsersDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmUsersDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public CrmUsersDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmUsersDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteRequestBuilder.java index e57f68cc..443d8b4b 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmUsersDeleteRequestBuilder { - - private CrmUsersDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmUsersDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmUsersDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmUsersDeleteRequestBuilder request(CrmUsersDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmUsersDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmUsersDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmUsersDeleteRequestBuilder request(@Nonnull CrmUsersDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmUsersDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmUsersDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmUsersDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteResponse.java index 62e1dc2e..b5566a33 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmUsersDeleteResponse implements Response { /** * User deleted */ - private Optional deleteUserResponse; + private DeleteUserResponse deleteUserResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmUsersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteUserResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteUserResponse, "deleteUserResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteUserResponse deleteUserResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteUserResponse = deleteUserResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmUsersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * User deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteUserResponse() { - return (Optional) deleteUserResponse; + return Optional.ofNullable(this.deleteUserResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmUsersDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmUsersDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmUsersDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmUsersDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * User deleted + * Raw HTTP response; suitable for custom response parsing */ - public CrmUsersDeleteResponse withDeleteUserResponse(DeleteUserResponse deleteUserResponse) { - Utils.checkNotNull(deleteUserResponse, "deleteUserResponse"); - this.deleteUserResponse = Optional.ofNullable(deleteUserResponse); + public CrmUsersDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmUsersDeleteResponse withDeleteUserResponse(DeleteUserResponse deleteUs /** * User deleted */ - public CrmUsersDeleteResponse withDeleteUserResponse(Optional deleteUserResponse) { - Utils.checkNotNull(deleteUserResponse, "deleteUserResponse"); + public CrmUsersDeleteResponse withDeleteUserResponse(@Nullable DeleteUserResponse deleteUserResponse) { this.deleteUserResponse = deleteUserResponse; return this; } - /** - * Unexpected error - */ - public CrmUsersDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmUsersDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmUsersDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteUserResponse = Optional.empty(); + private DeleteUserResponse deleteUserResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * User deleted - */ - public Builder deleteUserResponse(DeleteUserResponse deleteUserResponse) { - Utils.checkNotNull(deleteUserResponse, "deleteUserResponse"); - this.deleteUserResponse = Optional.ofNullable(deleteUserResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * User deleted */ - public Builder deleteUserResponse(Optional deleteUserResponse) { - Utils.checkNotNull(deleteUserResponse, "deleteUserResponse"); + public Builder deleteUserResponse(@Nullable DeleteUserResponse deleteUserResponse) { this.deleteUserResponse = deleteUserResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmUsersDeleteResponse build() { - return new CrmUsersDeleteResponse( contentType, statusCode, rawResponse, deleteUserResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersOneRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersOneRequest.java index 6886fb84..cf3603eb 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmUsersOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class CrmUsersOneRequest { @JsonCreator public CrmUsersOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public CrmUsersOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmUsersOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmUsersOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmUsersOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public CrmUsersOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmUsersOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmUsersOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmUsersOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmUsersOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmUsersOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmUsersOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmUsersOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmUsersOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmUsersOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmUsersOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmUsersOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public CrmUsersOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public CrmUsersOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public CrmUsersOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public CrmUsersOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmUsersOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersOneRequestBuilder.java index 5ebc741a..2ffba495 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmUsersOneRequestBuilder { - - private CrmUsersOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmUsersOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmUsersOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmUsersOneRequestBuilder request(CrmUsersOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmUsersOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmUsersOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmUsersOneRequestBuilder request(@Nonnull CrmUsersOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmUsersOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmUsersOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmUsersOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersOneResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersOneResponse.java index 052d9cfd..6f574b45 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmUsersOneResponse implements Response { /** * User */ - private Optional getUserResponse; + private GetUserResponse getUserResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmUsersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getUserResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getUserResponse, "getUserResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetUserResponse getUserResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getUserResponse = getUserResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmUsersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * User */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getUserResponse() { - return (Optional) getUserResponse; + return Optional.ofNullable(this.getUserResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmUsersOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmUsersOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmUsersOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmUsersOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * User + * Raw HTTP response; suitable for custom response parsing */ - public CrmUsersOneResponse withGetUserResponse(GetUserResponse getUserResponse) { - Utils.checkNotNull(getUserResponse, "getUserResponse"); - this.getUserResponse = Optional.ofNullable(getUserResponse); + public CrmUsersOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmUsersOneResponse withGetUserResponse(GetUserResponse getUserResponse) /** * User */ - public CrmUsersOneResponse withGetUserResponse(Optional getUserResponse) { - Utils.checkNotNull(getUserResponse, "getUserResponse"); + public CrmUsersOneResponse withGetUserResponse(@Nullable GetUserResponse getUserResponse) { this.getUserResponse = getUserResponse; return this; } - /** - * Unexpected error - */ - public CrmUsersOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmUsersOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmUsersOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getUserResponse = Optional.empty(); + private GetUserResponse getUserResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * User - */ - public Builder getUserResponse(GetUserResponse getUserResponse) { - Utils.checkNotNull(getUserResponse, "getUserResponse"); - this.getUserResponse = Optional.ofNullable(getUserResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * User */ - public Builder getUserResponse(Optional getUserResponse) { - Utils.checkNotNull(getUserResponse, "getUserResponse"); + public Builder getUserResponse(@Nullable GetUserResponse getUserResponse) { this.getUserResponse = getUserResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmUsersOneResponse build() { - return new CrmUsersOneResponse( contentType, statusCode, rawResponse, getUserResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateRequest.java index 4a4fd245..f5f92a6c 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class CrmUsersUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class CrmUsersUpdateRequest { @JsonCreator public CrmUsersUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - UserInput user) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(user, "user"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull UserInput user) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.user = user; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.user = Optional.ofNullable(user) + .orElseThrow(() -> new IllegalArgumentException("user cannot be null")); } public CrmUsersUpdateRequest( - String id, - UserInput user) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), user); + @Nonnull String id, + @Nonnull UserInput user) { + this(id, null, null, + null, null, user); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public UserInput user() { - return user; + return this.user; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public CrmUsersUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public CrmUsersUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public CrmUsersUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public CrmUsersUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public CrmUsersUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public CrmUsersUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public CrmUsersUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public CrmUsersUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public CrmUsersUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public CrmUsersUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public CrmUsersUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public CrmUsersUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public CrmUsersUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public CrmUsersUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public CrmUsersUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public CrmUsersUpdateRequest withUser(UserInput user) { - Utils.checkNotNull(user, "user"); - this.user = user; + + public CrmUsersUpdateRequest withUser(@Nonnull UserInput user) { + this.user = Utils.checkNotNull(user, "user"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private UserInput user; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder user(UserInput user) { - Utils.checkNotNull(user, "user"); - this.user = user; + public Builder user(@Nonnull UserInput user) { + this.user = Utils.checkNotNull(user, "user"); return this; } public CrmUsersUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new CrmUsersUpdateRequest( id, consumerId, appId, serviceId, raw, user); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateRequestBuilder.java index 19251d16..9032d4e3 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class CrmUsersUpdateRequestBuilder { - - private CrmUsersUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private CrmUsersUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public CrmUsersUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public CrmUsersUpdateRequestBuilder request(CrmUsersUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public CrmUsersUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public CrmUsersUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public CrmUsersUpdateRequestBuilder request(@Nonnull CrmUsersUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private CrmUsersUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public CrmUsersUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new CrmUsersUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateResponse.java index 6db20fc6..a1c91b48 100644 --- a/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/CrmUsersUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class CrmUsersUpdateResponse implements Response { /** * User updated */ - private Optional updateUserResponse; + private UpdateUserResponse updateUserResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public CrmUsersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateUserResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateUserResponse, "updateUserResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateUserResponse updateUserResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateUserResponse = updateUserResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public CrmUsersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * User updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateUserResponse() { - return (Optional) updateUserResponse; + return Optional.ofNullable(this.updateUserResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public CrmUsersUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public CrmUsersUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public CrmUsersUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public CrmUsersUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * User updated + * Raw HTTP response; suitable for custom response parsing */ - public CrmUsersUpdateResponse withUpdateUserResponse(UpdateUserResponse updateUserResponse) { - Utils.checkNotNull(updateUserResponse, "updateUserResponse"); - this.updateUserResponse = Optional.ofNullable(updateUserResponse); + public CrmUsersUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public CrmUsersUpdateResponse withUpdateUserResponse(UpdateUserResponse updateUs /** * User updated */ - public CrmUsersUpdateResponse withUpdateUserResponse(Optional updateUserResponse) { - Utils.checkNotNull(updateUserResponse, "updateUserResponse"); + public CrmUsersUpdateResponse withUpdateUserResponse(@Nullable UpdateUserResponse updateUserResponse) { this.updateUserResponse = updateUserResponse; return this; } - /** - * Unexpected error - */ - public CrmUsersUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public CrmUsersUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public CrmUsersUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateUserResponse = Optional.empty(); + private UpdateUserResponse updateUserResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * User updated - */ - public Builder updateUserResponse(UpdateUserResponse updateUserResponse) { - Utils.checkNotNull(updateUserResponse, "updateUserResponse"); - this.updateUserResponse = Optional.ofNullable(updateUserResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * User updated */ - public Builder updateUserResponse(Optional updateUserResponse) { - Utils.checkNotNull(updateUserResponse, "updateUserResponse"); + public Builder updateUserResponse(@Nullable UpdateUserResponse updateUserResponse) { this.updateUserResponse = updateUserResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public CrmUsersUpdateResponse build() { - return new CrmUsersUpdateResponse( contentType, statusCode, rawResponse, updateUserResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllRequest.java b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllRequest.java index 28e218aa..411dee78 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllRequest.java @@ -8,14 +8,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,25 +25,25 @@ public class EcommerceCustomersAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -56,19 +55,19 @@ public class EcommerceCustomersAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private EcommerceCustomersFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -78,113 +77,97 @@ public class EcommerceCustomersAllRequest { @JsonCreator public EcommerceCustomersAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable EcommerceCustomersFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public EcommerceCustomersAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -195,103 +178,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public EcommerceCustomersAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public EcommerceCustomersAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public EcommerceCustomersAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public EcommerceCustomersAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public EcommerceCustomersAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public EcommerceCustomersAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public EcommerceCustomersAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public EcommerceCustomersAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public EcommerceCustomersAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public EcommerceCustomersAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public EcommerceCustomersAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public EcommerceCustomersAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public EcommerceCustomersAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public EcommerceCustomersAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public EcommerceCustomersAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public EcommerceCustomersAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -299,67 +223,38 @@ public EcommerceCustomersAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public EcommerceCustomersAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public EcommerceCustomersAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public EcommerceCustomersAllRequest withFilter(EcommerceCustomersFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public EcommerceCustomersAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public EcommerceCustomersAllRequest withFilter(@Nullable EcommerceCustomersFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public EcommerceCustomersAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public EcommerceCustomersAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public EcommerceCustomersAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public EcommerceCustomersAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public EcommerceCustomersAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public EcommerceCustomersAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -407,207 +302,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private EcommerceCustomersFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - - /** - * Apply filters - */ - public Builder filter(EcommerceCustomersFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable EcommerceCustomersFilter filter) { this.filter = filter; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public EcommerceCustomersAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new EcommerceCustomersAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -615,16 +404,16 @@ public EcommerceCustomersAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllRequestBuilder.java index 2b6ed02b..7d257566 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class EcommerceCustomersAllRequestBuilder { - - private EcommerceCustomersAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private EcommerceCustomersAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public EcommerceCustomersAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public EcommerceCustomersAllRequestBuilder request(EcommerceCustomersAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public EcommerceCustomersAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public EcommerceCustomersAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public EcommerceCustomersAllRequestBuilder request(@Nonnull EcommerceCustomersAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private EcommerceCustomersAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public EcommerceCustomersAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new EcommerceCustomersAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public EcommerceCustomersAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new EcommerceCustomersAllOperation( - sdkConfiguration, - options); + EcommerceCustomersAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new EcommerceCustomersAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - EcommerceCustomersAllRequest::withCursor, + EcommerceCustomersAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllResponse.java b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllResponse.java index ec07671c..dd4f374b 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class EcommerceCustomersAllResponse implements Response { /** * Customers */ - private Optional getEcommerceCustomersResponse; + private GetEcommerceCustomersResponse getEcommerceCustomersResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public EcommerceCustomersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getEcommerceCustomersResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getEcommerceCustomersResponse, "getEcommerceCustomersResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetEcommerceCustomersResponse getEcommerceCustomersResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getEcommerceCustomersResponse = getEcommerceCustomersResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public EcommerceCustomersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Customers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getEcommerceCustomersResponse() { - return (Optional) getEcommerceCustomersResponse; + return Optional.ofNullable(this.getEcommerceCustomersResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public EcommerceCustomersAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public EcommerceCustomersAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public EcommerceCustomersAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public EcommerceCustomersAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Customers + * Raw HTTP response; suitable for custom response parsing */ - public EcommerceCustomersAllResponse withGetEcommerceCustomersResponse(GetEcommerceCustomersResponse getEcommerceCustomersResponse) { - Utils.checkNotNull(getEcommerceCustomersResponse, "getEcommerceCustomersResponse"); - this.getEcommerceCustomersResponse = Optional.ofNullable(getEcommerceCustomersResponse); + public EcommerceCustomersAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public EcommerceCustomersAllResponse withGetEcommerceCustomersResponse(GetEcomme /** * Customers */ - public EcommerceCustomersAllResponse withGetEcommerceCustomersResponse(Optional getEcommerceCustomersResponse) { - Utils.checkNotNull(getEcommerceCustomersResponse, "getEcommerceCustomersResponse"); + public EcommerceCustomersAllResponse withGetEcommerceCustomersResponse(@Nullable GetEcommerceCustomersResponse getEcommerceCustomersResponse) { this.getEcommerceCustomersResponse = getEcommerceCustomersResponse; return this; } - /** - * Unexpected error - */ - public EcommerceCustomersAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public EcommerceCustomersAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public EcommerceCustomersAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getEcommerceCustomersResponse = Optional.empty(); + private GetEcommerceCustomersResponse getEcommerceCustomersResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Customers - */ - public Builder getEcommerceCustomersResponse(GetEcommerceCustomersResponse getEcommerceCustomersResponse) { - Utils.checkNotNull(getEcommerceCustomersResponse, "getEcommerceCustomersResponse"); - this.getEcommerceCustomersResponse = Optional.ofNullable(getEcommerceCustomersResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Customers */ - public Builder getEcommerceCustomersResponse(Optional getEcommerceCustomersResponse) { - Utils.checkNotNull(getEcommerceCustomersResponse, "getEcommerceCustomersResponse"); + public Builder getEcommerceCustomersResponse(@Nullable GetEcommerceCustomersResponse getEcommerceCustomersResponse) { this.getEcommerceCustomersResponse = getEcommerceCustomersResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public EcommerceCustomersAllResponse build() { - return new EcommerceCustomersAllResponse( contentType, statusCode, rawResponse, getEcommerceCustomersResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneRequest.java b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneRequest.java index 2ee9e2e5..a40ab4d1 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class EcommerceCustomersOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class EcommerceCustomersOneRequest { @JsonCreator public EcommerceCustomersOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public EcommerceCustomersOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public EcommerceCustomersOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public EcommerceCustomersOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public EcommerceCustomersOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public EcommerceCustomersOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public EcommerceCustomersOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public EcommerceCustomersOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public EcommerceCustomersOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public EcommerceCustomersOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public EcommerceCustomersOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public EcommerceCustomersOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public EcommerceCustomersOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public EcommerceCustomersOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public EcommerceCustomersOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public EcommerceCustomersOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public EcommerceCustomersOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public EcommerceCustomersOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public EcommerceCustomersOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public EcommerceCustomersOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public EcommerceCustomersOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new EcommerceCustomersOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneRequestBuilder.java index 6437b9b0..61f1a3f2 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class EcommerceCustomersOneRequestBuilder { - - private EcommerceCustomersOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private EcommerceCustomersOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public EcommerceCustomersOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public EcommerceCustomersOneRequestBuilder request(EcommerceCustomersOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public EcommerceCustomersOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public EcommerceCustomersOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public EcommerceCustomersOneRequestBuilder request(@Nonnull EcommerceCustomersOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private EcommerceCustomersOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public EcommerceCustomersOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new EcommerceCustomersOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneResponse.java b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneResponse.java index 501578a3..4f5f9a74 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceCustomersOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class EcommerceCustomersOneResponse implements Response { /** * Customers */ - private Optional getEcommerceCustomerResponse; + private GetEcommerceCustomerResponse getEcommerceCustomerResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public EcommerceCustomersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getEcommerceCustomerResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getEcommerceCustomerResponse, "getEcommerceCustomerResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetEcommerceCustomerResponse getEcommerceCustomerResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getEcommerceCustomerResponse = getEcommerceCustomerResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public EcommerceCustomersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Customers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getEcommerceCustomerResponse() { - return (Optional) getEcommerceCustomerResponse; + return Optional.ofNullable(this.getEcommerceCustomerResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public EcommerceCustomersOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public EcommerceCustomersOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public EcommerceCustomersOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public EcommerceCustomersOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Customers + * Raw HTTP response; suitable for custom response parsing */ - public EcommerceCustomersOneResponse withGetEcommerceCustomerResponse(GetEcommerceCustomerResponse getEcommerceCustomerResponse) { - Utils.checkNotNull(getEcommerceCustomerResponse, "getEcommerceCustomerResponse"); - this.getEcommerceCustomerResponse = Optional.ofNullable(getEcommerceCustomerResponse); + public EcommerceCustomersOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public EcommerceCustomersOneResponse withGetEcommerceCustomerResponse(GetEcommer /** * Customers */ - public EcommerceCustomersOneResponse withGetEcommerceCustomerResponse(Optional getEcommerceCustomerResponse) { - Utils.checkNotNull(getEcommerceCustomerResponse, "getEcommerceCustomerResponse"); + public EcommerceCustomersOneResponse withGetEcommerceCustomerResponse(@Nullable GetEcommerceCustomerResponse getEcommerceCustomerResponse) { this.getEcommerceCustomerResponse = getEcommerceCustomerResponse; return this; } - /** - * Unexpected error - */ - public EcommerceCustomersOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public EcommerceCustomersOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public EcommerceCustomersOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getEcommerceCustomerResponse = Optional.empty(); + private GetEcommerceCustomerResponse getEcommerceCustomerResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Customers - */ - public Builder getEcommerceCustomerResponse(GetEcommerceCustomerResponse getEcommerceCustomerResponse) { - Utils.checkNotNull(getEcommerceCustomerResponse, "getEcommerceCustomerResponse"); - this.getEcommerceCustomerResponse = Optional.ofNullable(getEcommerceCustomerResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Customers */ - public Builder getEcommerceCustomerResponse(Optional getEcommerceCustomerResponse) { - Utils.checkNotNull(getEcommerceCustomerResponse, "getEcommerceCustomerResponse"); + public Builder getEcommerceCustomerResponse(@Nullable GetEcommerceCustomerResponse getEcommerceCustomerResponse) { this.getEcommerceCustomerResponse = getEcommerceCustomerResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public EcommerceCustomersOneResponse build() { - return new EcommerceCustomersOneResponse( contentType, statusCode, rawResponse, getEcommerceCustomerResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllRequest.java b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllRequest.java index dbbeff5e..82c1ed80 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class EcommerceOrdersAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class EcommerceOrdersAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private EcommerceOrdersFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private OrdersSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class EcommerceOrdersAllRequest { @JsonCreator public EcommerceOrdersAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable EcommerceOrdersFilter filter, + @Nullable OrdersSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public EcommerceOrdersAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public EcommerceOrdersAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public EcommerceOrdersAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public EcommerceOrdersAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public EcommerceOrdersAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public EcommerceOrdersAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public EcommerceOrdersAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public EcommerceOrdersAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public EcommerceOrdersAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public EcommerceOrdersAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public EcommerceOrdersAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public EcommerceOrdersAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public EcommerceOrdersAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public EcommerceOrdersAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public EcommerceOrdersAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public EcommerceOrdersAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public EcommerceOrdersAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public EcommerceOrdersAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public EcommerceOrdersAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public EcommerceOrdersAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public EcommerceOrdersAllRequest withFilter(EcommerceOrdersFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public EcommerceOrdersAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public EcommerceOrdersAllRequest withFilter(@Nullable EcommerceOrdersFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public EcommerceOrdersAllRequest withSort(OrdersSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public EcommerceOrdersAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public EcommerceOrdersAllRequest withSort(@Nullable OrdersSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public EcommerceOrdersAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public EcommerceOrdersAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public EcommerceOrdersAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public EcommerceOrdersAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public EcommerceOrdersAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public EcommerceOrdersAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private EcommerceOrdersFilter filter; - private Optional sort = Optional.empty(); + private OrdersSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(EcommerceOrdersFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable EcommerceOrdersFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(OrdersSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable OrdersSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public EcommerceOrdersAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new EcommerceOrdersAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public EcommerceOrdersAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllRequestBuilder.java index 50c430d8..fb8f451f 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class EcommerceOrdersAllRequestBuilder { - - private EcommerceOrdersAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private EcommerceOrdersAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public EcommerceOrdersAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public EcommerceOrdersAllRequestBuilder request(EcommerceOrdersAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public EcommerceOrdersAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public EcommerceOrdersAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public EcommerceOrdersAllRequestBuilder request(@Nonnull EcommerceOrdersAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private EcommerceOrdersAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public EcommerceOrdersAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new EcommerceOrdersAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public EcommerceOrdersAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new EcommerceOrdersAllOperation( - sdkConfiguration, - options); + EcommerceOrdersAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new EcommerceOrdersAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - EcommerceOrdersAllRequest::withCursor, + EcommerceOrdersAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllResponse.java b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllResponse.java index ab6fddf2..3d666aba 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class EcommerceOrdersAllResponse implements Response { /** * Orders */ - private Optional getEcommerceOrdersResponse; + private GetEcommerceOrdersResponse getEcommerceOrdersResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public EcommerceOrdersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getEcommerceOrdersResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getEcommerceOrdersResponse, "getEcommerceOrdersResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetEcommerceOrdersResponse getEcommerceOrdersResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getEcommerceOrdersResponse = getEcommerceOrdersResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public EcommerceOrdersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Orders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getEcommerceOrdersResponse() { - return (Optional) getEcommerceOrdersResponse; + return Optional.ofNullable(this.getEcommerceOrdersResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public EcommerceOrdersAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public EcommerceOrdersAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public EcommerceOrdersAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public EcommerceOrdersAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Orders + * Raw HTTP response; suitable for custom response parsing */ - public EcommerceOrdersAllResponse withGetEcommerceOrdersResponse(GetEcommerceOrdersResponse getEcommerceOrdersResponse) { - Utils.checkNotNull(getEcommerceOrdersResponse, "getEcommerceOrdersResponse"); - this.getEcommerceOrdersResponse = Optional.ofNullable(getEcommerceOrdersResponse); + public EcommerceOrdersAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public EcommerceOrdersAllResponse withGetEcommerceOrdersResponse(GetEcommerceOrd /** * Orders */ - public EcommerceOrdersAllResponse withGetEcommerceOrdersResponse(Optional getEcommerceOrdersResponse) { - Utils.checkNotNull(getEcommerceOrdersResponse, "getEcommerceOrdersResponse"); + public EcommerceOrdersAllResponse withGetEcommerceOrdersResponse(@Nullable GetEcommerceOrdersResponse getEcommerceOrdersResponse) { this.getEcommerceOrdersResponse = getEcommerceOrdersResponse; return this; } - /** - * Unexpected error - */ - public EcommerceOrdersAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public EcommerceOrdersAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public EcommerceOrdersAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getEcommerceOrdersResponse = Optional.empty(); + private GetEcommerceOrdersResponse getEcommerceOrdersResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Orders - */ - public Builder getEcommerceOrdersResponse(GetEcommerceOrdersResponse getEcommerceOrdersResponse) { - Utils.checkNotNull(getEcommerceOrdersResponse, "getEcommerceOrdersResponse"); - this.getEcommerceOrdersResponse = Optional.ofNullable(getEcommerceOrdersResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Orders */ - public Builder getEcommerceOrdersResponse(Optional getEcommerceOrdersResponse) { - Utils.checkNotNull(getEcommerceOrdersResponse, "getEcommerceOrdersResponse"); + public Builder getEcommerceOrdersResponse(@Nullable GetEcommerceOrdersResponse getEcommerceOrdersResponse) { this.getEcommerceOrdersResponse = getEcommerceOrdersResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public EcommerceOrdersAllResponse build() { - return new EcommerceOrdersAllResponse( contentType, statusCode, rawResponse, getEcommerceOrdersResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneRequest.java b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneRequest.java index 40fd178d..94afe36a 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class EcommerceOrdersOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class EcommerceOrdersOneRequest { @JsonCreator public EcommerceOrdersOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public EcommerceOrdersOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public EcommerceOrdersOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public EcommerceOrdersOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public EcommerceOrdersOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public EcommerceOrdersOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public EcommerceOrdersOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public EcommerceOrdersOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public EcommerceOrdersOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public EcommerceOrdersOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public EcommerceOrdersOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public EcommerceOrdersOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public EcommerceOrdersOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public EcommerceOrdersOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public EcommerceOrdersOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public EcommerceOrdersOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public EcommerceOrdersOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public EcommerceOrdersOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public EcommerceOrdersOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public EcommerceOrdersOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public EcommerceOrdersOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new EcommerceOrdersOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneRequestBuilder.java index c1dab9f7..b15c1fd8 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class EcommerceOrdersOneRequestBuilder { - - private EcommerceOrdersOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private EcommerceOrdersOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public EcommerceOrdersOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public EcommerceOrdersOneRequestBuilder request(EcommerceOrdersOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public EcommerceOrdersOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public EcommerceOrdersOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public EcommerceOrdersOneRequestBuilder request(@Nonnull EcommerceOrdersOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private EcommerceOrdersOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public EcommerceOrdersOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new EcommerceOrdersOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneResponse.java b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneResponse.java index b2d2c025..daffcb5e 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceOrdersOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class EcommerceOrdersOneResponse implements Response { /** * Orders */ - private Optional getEcommerceOrderResponse; + private GetEcommerceOrderResponse getEcommerceOrderResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public EcommerceOrdersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getEcommerceOrderResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getEcommerceOrderResponse, "getEcommerceOrderResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetEcommerceOrderResponse getEcommerceOrderResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getEcommerceOrderResponse = getEcommerceOrderResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public EcommerceOrdersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Orders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getEcommerceOrderResponse() { - return (Optional) getEcommerceOrderResponse; + return Optional.ofNullable(this.getEcommerceOrderResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public EcommerceOrdersOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public EcommerceOrdersOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public EcommerceOrdersOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public EcommerceOrdersOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Orders + * Raw HTTP response; suitable for custom response parsing */ - public EcommerceOrdersOneResponse withGetEcommerceOrderResponse(GetEcommerceOrderResponse getEcommerceOrderResponse) { - Utils.checkNotNull(getEcommerceOrderResponse, "getEcommerceOrderResponse"); - this.getEcommerceOrderResponse = Optional.ofNullable(getEcommerceOrderResponse); + public EcommerceOrdersOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public EcommerceOrdersOneResponse withGetEcommerceOrderResponse(GetEcommerceOrde /** * Orders */ - public EcommerceOrdersOneResponse withGetEcommerceOrderResponse(Optional getEcommerceOrderResponse) { - Utils.checkNotNull(getEcommerceOrderResponse, "getEcommerceOrderResponse"); + public EcommerceOrdersOneResponse withGetEcommerceOrderResponse(@Nullable GetEcommerceOrderResponse getEcommerceOrderResponse) { this.getEcommerceOrderResponse = getEcommerceOrderResponse; return this; } - /** - * Unexpected error - */ - public EcommerceOrdersOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public EcommerceOrdersOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public EcommerceOrdersOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getEcommerceOrderResponse = Optional.empty(); + private GetEcommerceOrderResponse getEcommerceOrderResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Orders - */ - public Builder getEcommerceOrderResponse(GetEcommerceOrderResponse getEcommerceOrderResponse) { - Utils.checkNotNull(getEcommerceOrderResponse, "getEcommerceOrderResponse"); - this.getEcommerceOrderResponse = Optional.ofNullable(getEcommerceOrderResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Orders */ - public Builder getEcommerceOrderResponse(Optional getEcommerceOrderResponse) { - Utils.checkNotNull(getEcommerceOrderResponse, "getEcommerceOrderResponse"); + public Builder getEcommerceOrderResponse(@Nullable GetEcommerceOrderResponse getEcommerceOrderResponse) { this.getEcommerceOrderResponse = getEcommerceOrderResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public EcommerceOrdersOneResponse build() { - return new EcommerceOrdersOneResponse( contentType, statusCode, rawResponse, getEcommerceOrderResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllRequest.java index cdfd253b..d5f80f18 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class EcommerceProductsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class EcommerceProductsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class EcommerceProductsAllRequest { @JsonCreator public EcommerceProductsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public EcommerceProductsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public EcommerceProductsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public EcommerceProductsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public EcommerceProductsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public EcommerceProductsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public EcommerceProductsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public EcommerceProductsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public EcommerceProductsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public EcommerceProductsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public EcommerceProductsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public EcommerceProductsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public EcommerceProductsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public EcommerceProductsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public EcommerceProductsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public EcommerceProductsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public EcommerceProductsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public EcommerceProductsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public EcommerceProductsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public EcommerceProductsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public EcommerceProductsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public EcommerceProductsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public EcommerceProductsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public EcommerceProductsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public EcommerceProductsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public EcommerceProductsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public EcommerceProductsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public EcommerceProductsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new EcommerceProductsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public EcommerceProductsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllRequestBuilder.java index 85f8944f..a5215bff 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class EcommerceProductsAllRequestBuilder { - - private EcommerceProductsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private EcommerceProductsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public EcommerceProductsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public EcommerceProductsAllRequestBuilder request(EcommerceProductsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public EcommerceProductsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public EcommerceProductsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public EcommerceProductsAllRequestBuilder request(@Nonnull EcommerceProductsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private EcommerceProductsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public EcommerceProductsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new EcommerceProductsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public EcommerceProductsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new EcommerceProductsAllOperation( - sdkConfiguration, - options); + EcommerceProductsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new EcommerceProductsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - EcommerceProductsAllRequest::withCursor, + EcommerceProductsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllResponse.java index badecad2..1b20aea9 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class EcommerceProductsAllResponse implements Response { /** * Products */ - private Optional getProductsResponse; + private GetProductsResponse getProductsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public EcommerceProductsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getProductsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getProductsResponse, "getProductsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetProductsResponse getProductsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getProductsResponse = getProductsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public EcommerceProductsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Products */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getProductsResponse() { - return (Optional) getProductsResponse; + return Optional.ofNullable(this.getProductsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public EcommerceProductsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public EcommerceProductsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public EcommerceProductsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public EcommerceProductsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Products + * Raw HTTP response; suitable for custom response parsing */ - public EcommerceProductsAllResponse withGetProductsResponse(GetProductsResponse getProductsResponse) { - Utils.checkNotNull(getProductsResponse, "getProductsResponse"); - this.getProductsResponse = Optional.ofNullable(getProductsResponse); + public EcommerceProductsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public EcommerceProductsAllResponse withGetProductsResponse(GetProductsResponse /** * Products */ - public EcommerceProductsAllResponse withGetProductsResponse(Optional getProductsResponse) { - Utils.checkNotNull(getProductsResponse, "getProductsResponse"); + public EcommerceProductsAllResponse withGetProductsResponse(@Nullable GetProductsResponse getProductsResponse) { this.getProductsResponse = getProductsResponse; return this; } - /** - * Unexpected error - */ - public EcommerceProductsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public EcommerceProductsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public EcommerceProductsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getProductsResponse = Optional.empty(); + private GetProductsResponse getProductsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Products - */ - public Builder getProductsResponse(GetProductsResponse getProductsResponse) { - Utils.checkNotNull(getProductsResponse, "getProductsResponse"); - this.getProductsResponse = Optional.ofNullable(getProductsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Products */ - public Builder getProductsResponse(Optional getProductsResponse) { - Utils.checkNotNull(getProductsResponse, "getProductsResponse"); + public Builder getProductsResponse(@Nullable GetProductsResponse getProductsResponse) { this.getProductsResponse = getProductsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public EcommerceProductsAllResponse build() { - return new EcommerceProductsAllResponse( contentType, statusCode, rawResponse, getProductsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneRequest.java index 6b5bfba5..3f83728c 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class EcommerceProductsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class EcommerceProductsOneRequest { @JsonCreator public EcommerceProductsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public EcommerceProductsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public EcommerceProductsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public EcommerceProductsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public EcommerceProductsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public EcommerceProductsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public EcommerceProductsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public EcommerceProductsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public EcommerceProductsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public EcommerceProductsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public EcommerceProductsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public EcommerceProductsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public EcommerceProductsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public EcommerceProductsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public EcommerceProductsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public EcommerceProductsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public EcommerceProductsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public EcommerceProductsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public EcommerceProductsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public EcommerceProductsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public EcommerceProductsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new EcommerceProductsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneRequestBuilder.java index a28d8b46..4b8cecbe 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class EcommerceProductsOneRequestBuilder { - - private EcommerceProductsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private EcommerceProductsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public EcommerceProductsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public EcommerceProductsOneRequestBuilder request(EcommerceProductsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public EcommerceProductsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public EcommerceProductsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public EcommerceProductsOneRequestBuilder request(@Nonnull EcommerceProductsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private EcommerceProductsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public EcommerceProductsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new EcommerceProductsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneResponse.java index 06ef25a0..8f6f4d05 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceProductsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class EcommerceProductsOneResponse implements Response { /** * Products */ - private Optional getProductResponse; + private GetProductResponse getProductResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public EcommerceProductsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getProductResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getProductResponse, "getProductResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetProductResponse getProductResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getProductResponse = getProductResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public EcommerceProductsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Products */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getProductResponse() { - return (Optional) getProductResponse; + return Optional.ofNullable(this.getProductResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public EcommerceProductsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public EcommerceProductsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public EcommerceProductsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public EcommerceProductsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Products + * Raw HTTP response; suitable for custom response parsing */ - public EcommerceProductsOneResponse withGetProductResponse(GetProductResponse getProductResponse) { - Utils.checkNotNull(getProductResponse, "getProductResponse"); - this.getProductResponse = Optional.ofNullable(getProductResponse); + public EcommerceProductsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public EcommerceProductsOneResponse withGetProductResponse(GetProductResponse ge /** * Products */ - public EcommerceProductsOneResponse withGetProductResponse(Optional getProductResponse) { - Utils.checkNotNull(getProductResponse, "getProductResponse"); + public EcommerceProductsOneResponse withGetProductResponse(@Nullable GetProductResponse getProductResponse) { this.getProductResponse = getProductResponse; return this; } - /** - * Unexpected error - */ - public EcommerceProductsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public EcommerceProductsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public EcommerceProductsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getProductResponse = Optional.empty(); + private GetProductResponse getProductResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Products - */ - public Builder getProductResponse(GetProductResponse getProductResponse) { - Utils.checkNotNull(getProductResponse, "getProductResponse"); - this.getProductResponse = Optional.ofNullable(getProductResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Products */ - public Builder getProductResponse(Optional getProductResponse) { - Utils.checkNotNull(getProductResponse, "getProductResponse"); + public Builder getProductResponse(@Nullable GetProductResponse getProductResponse) { this.getProductResponse = getProductResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public EcommerceProductsOneResponse build() { - return new EcommerceProductsOneResponse( contentType, statusCode, rawResponse, getProductResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneRequest.java b/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneRequest.java index 7caa8544..4fa02bea 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneRequest.java @@ -7,8 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +21,25 @@ public class EcommerceStoresOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -49,66 +49,58 @@ public class EcommerceStoresOneRequest { @JsonCreator public EcommerceStoresOneRequest( - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public EcommerceStoresOneRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -119,96 +111,47 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public EcommerceStoresOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public EcommerceStoresOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public EcommerceStoresOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public EcommerceStoresOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public EcommerceStoresOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public EcommerceStoresOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public EcommerceStoresOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public EcommerceStoresOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public EcommerceStoresOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public EcommerceStoresOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public EcommerceStoresOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public EcommerceStoresOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public EcommerceStoresOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public EcommerceStoresOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public EcommerceStoresOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -247,130 +190,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public EcommerceStoresOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new EcommerceStoresOneRequest( consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneRequestBuilder.java index 3f059ca4..1146646a 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class EcommerceStoresOneRequestBuilder { - - private EcommerceStoresOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private EcommerceStoresOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public EcommerceStoresOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public EcommerceStoresOneRequestBuilder request(EcommerceStoresOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public EcommerceStoresOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public EcommerceStoresOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public EcommerceStoresOneRequestBuilder request(@Nonnull EcommerceStoresOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private EcommerceStoresOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public EcommerceStoresOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new EcommerceStoresOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneResponse.java b/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneResponse.java index 01f0d5d9..3b3786a7 100644 --- a/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/EcommerceStoresOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class EcommerceStoresOneResponse implements Response { /** * Stores */ - private Optional getStoreResponse; + private GetStoreResponse getStoreResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public EcommerceStoresOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getStoreResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getStoreResponse, "getStoreResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetStoreResponse getStoreResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getStoreResponse = getStoreResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public EcommerceStoresOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Stores */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getStoreResponse() { - return (Optional) getStoreResponse; + return Optional.ofNullable(this.getStoreResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public EcommerceStoresOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public EcommerceStoresOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public EcommerceStoresOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public EcommerceStoresOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Stores + * Raw HTTP response; suitable for custom response parsing */ - public EcommerceStoresOneResponse withGetStoreResponse(GetStoreResponse getStoreResponse) { - Utils.checkNotNull(getStoreResponse, "getStoreResponse"); - this.getStoreResponse = Optional.ofNullable(getStoreResponse); + public EcommerceStoresOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public EcommerceStoresOneResponse withGetStoreResponse(GetStoreResponse getStore /** * Stores */ - public EcommerceStoresOneResponse withGetStoreResponse(Optional getStoreResponse) { - Utils.checkNotNull(getStoreResponse, "getStoreResponse"); + public EcommerceStoresOneResponse withGetStoreResponse(@Nullable GetStoreResponse getStoreResponse) { this.getStoreResponse = getStoreResponse; return this; } - /** - * Unexpected error - */ - public EcommerceStoresOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public EcommerceStoresOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public EcommerceStoresOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getStoreResponse = Optional.empty(); + private GetStoreResponse getStoreResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Stores - */ - public Builder getStoreResponse(GetStoreResponse getStoreResponse) { - Utils.checkNotNull(getStoreResponse, "getStoreResponse"); - this.getStoreResponse = Optional.ofNullable(getStoreResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Stores */ - public Builder getStoreResponse(Optional getStoreResponse) { - Utils.checkNotNull(getStoreResponse, "getStoreResponse"); + public Builder getStoreResponse(@Nullable GetStoreResponse getStoreResponse) { this.getStoreResponse = getStoreResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public EcommerceStoresOneResponse build() { - return new EcommerceStoresOneResponse( contentType, statusCode, rawResponse, getStoreResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddRequest.java index f8339f58..f5270e28 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class FileStorageDriveGroupsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class FileStorageDriveGroupsAddRequest { @JsonCreator public FileStorageDriveGroupsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - DriveGroupInput driveGroup) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(driveGroup, "driveGroup"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull DriveGroupInput driveGroup) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.driveGroup = driveGroup; + this.driveGroup = Optional.ofNullable(driveGroup) + .orElseThrow(() -> new IllegalArgumentException("driveGroup cannot be null")); } public FileStorageDriveGroupsAddRequest( - DriveGroupInput driveGroup) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), driveGroup); + @Nonnull DriveGroupInput driveGroup) { + this(null, null, null, + null, driveGroup); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public DriveGroupInput driveGroup() { - return driveGroup; + return this.driveGroup; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageDriveGroupsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageDriveGroupsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageDriveGroupsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageDriveGroupsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public FileStorageDriveGroupsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageDriveGroupsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageDriveGroupsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageDriveGroupsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageDriveGroupsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageDriveGroupsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageDriveGroupsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageDriveGroupsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public FileStorageDriveGroupsAddRequest withDriveGroup(DriveGroupInput driveGroup) { - Utils.checkNotNull(driveGroup, "driveGroup"); - this.driveGroup = driveGroup; + + public FileStorageDriveGroupsAddRequest withDriveGroup(@Nonnull DriveGroupInput driveGroup) { + this.driveGroup = Utils.checkNotNull(driveGroup, "driveGroup"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private DriveGroupInput driveGroup; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder driveGroup(DriveGroupInput driveGroup) { - Utils.checkNotNull(driveGroup, "driveGroup"); - this.driveGroup = driveGroup; + public Builder driveGroup(@Nonnull DriveGroupInput driveGroup) { + this.driveGroup = Utils.checkNotNull(driveGroup, "driveGroup"); return this; } public FileStorageDriveGroupsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageDriveGroupsAddRequest( raw, consumerId, appId, serviceId, driveGroup); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddRequestBuilder.java index b90933ec..644d9103 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageDriveGroupsAddRequestBuilder { - - private FileStorageDriveGroupsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageDriveGroupsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageDriveGroupsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageDriveGroupsAddRequestBuilder request(FileStorageDriveGroupsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageDriveGroupsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageDriveGroupsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageDriveGroupsAddRequestBuilder request(@Nonnull FileStorageDriveGroupsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageDriveGroupsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageDriveGroupsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageDriveGroupsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddResponse.java index c51838f4..4dfc8521 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageDriveGroupsAddResponse implements Response { /** * DriveGroups */ - private Optional createDriveGroupResponse; + private CreateDriveGroupResponse createDriveGroupResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageDriveGroupsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createDriveGroupResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createDriveGroupResponse, "createDriveGroupResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateDriveGroupResponse createDriveGroupResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createDriveGroupResponse = createDriveGroupResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageDriveGroupsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * DriveGroups */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createDriveGroupResponse() { - return (Optional) createDriveGroupResponse; + return Optional.ofNullable(this.createDriveGroupResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageDriveGroupsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageDriveGroupsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageDriveGroupsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageDriveGroupsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * DriveGroups + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageDriveGroupsAddResponse withCreateDriveGroupResponse(CreateDriveGroupResponse createDriveGroupResponse) { - Utils.checkNotNull(createDriveGroupResponse, "createDriveGroupResponse"); - this.createDriveGroupResponse = Optional.ofNullable(createDriveGroupResponse); + public FileStorageDriveGroupsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageDriveGroupsAddResponse withCreateDriveGroupResponse(CreateDriv /** * DriveGroups */ - public FileStorageDriveGroupsAddResponse withCreateDriveGroupResponse(Optional createDriveGroupResponse) { - Utils.checkNotNull(createDriveGroupResponse, "createDriveGroupResponse"); + public FileStorageDriveGroupsAddResponse withCreateDriveGroupResponse(@Nullable CreateDriveGroupResponse createDriveGroupResponse) { this.createDriveGroupResponse = createDriveGroupResponse; return this; } - /** - * Unexpected error - */ - public FileStorageDriveGroupsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageDriveGroupsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageDriveGroupsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createDriveGroupResponse = Optional.empty(); + private CreateDriveGroupResponse createDriveGroupResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * DriveGroups - */ - public Builder createDriveGroupResponse(CreateDriveGroupResponse createDriveGroupResponse) { - Utils.checkNotNull(createDriveGroupResponse, "createDriveGroupResponse"); - this.createDriveGroupResponse = Optional.ofNullable(createDriveGroupResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * DriveGroups */ - public Builder createDriveGroupResponse(Optional createDriveGroupResponse) { - Utils.checkNotNull(createDriveGroupResponse, "createDriveGroupResponse"); + public Builder createDriveGroupResponse(@Nullable CreateDriveGroupResponse createDriveGroupResponse) { this.createDriveGroupResponse = createDriveGroupResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageDriveGroupsAddResponse build() { - return new FileStorageDriveGroupsAddResponse( contentType, statusCode, rawResponse, createDriveGroupResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllRequest.java index 7e41d62c..8a84b591 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllRequest.java @@ -8,14 +8,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,25 +25,25 @@ public class FileStorageDriveGroupsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -56,19 +55,19 @@ public class FileStorageDriveGroupsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private DriveGroupsFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -78,113 +77,97 @@ public class FileStorageDriveGroupsAllRequest { @JsonCreator public FileStorageDriveGroupsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable DriveGroupsFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageDriveGroupsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -195,103 +178,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageDriveGroupsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageDriveGroupsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageDriveGroupsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageDriveGroupsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public FileStorageDriveGroupsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageDriveGroupsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageDriveGroupsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageDriveGroupsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageDriveGroupsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageDriveGroupsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageDriveGroupsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageDriveGroupsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public FileStorageDriveGroupsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public FileStorageDriveGroupsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public FileStorageDriveGroupsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public FileStorageDriveGroupsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -299,67 +223,38 @@ public FileStorageDriveGroupsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public FileStorageDriveGroupsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public FileStorageDriveGroupsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public FileStorageDriveGroupsAllRequest withFilter(DriveGroupsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public FileStorageDriveGroupsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public FileStorageDriveGroupsAllRequest withFilter(@Nullable DriveGroupsFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public FileStorageDriveGroupsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public FileStorageDriveGroupsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public FileStorageDriveGroupsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageDriveGroupsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageDriveGroupsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageDriveGroupsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -407,207 +302,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private DriveGroupsFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - - /** - * Apply filters - */ - public Builder filter(DriveGroupsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable DriveGroupsFilter filter) { this.filter = filter; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageDriveGroupsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new FileStorageDriveGroupsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -615,16 +404,16 @@ public FileStorageDriveGroupsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllRequestBuilder.java index 4b65bcef..2d33324c 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class FileStorageDriveGroupsAllRequestBuilder { - - private FileStorageDriveGroupsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageDriveGroupsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageDriveGroupsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageDriveGroupsAllRequestBuilder request(FileStorageDriveGroupsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageDriveGroupsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageDriveGroupsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageDriveGroupsAllRequestBuilder request(@Nonnull FileStorageDriveGroupsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageDriveGroupsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageDriveGroupsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageDriveGroupsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public FileStorageDriveGroupsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new FileStorageDriveGroupsAllOperation( - sdkConfiguration, - options); + FileStorageDriveGroupsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new FileStorageDriveGroupsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - FileStorageDriveGroupsAllRequest::withCursor, + FileStorageDriveGroupsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllResponse.java index 6ff87e80..6942b185 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageDriveGroupsAllResponse implements Response { /** * DriveGroups */ - private Optional getDriveGroupsResponse; + private GetDriveGroupsResponse getDriveGroupsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageDriveGroupsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getDriveGroupsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getDriveGroupsResponse, "getDriveGroupsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetDriveGroupsResponse getDriveGroupsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getDriveGroupsResponse = getDriveGroupsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageDriveGroupsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * DriveGroups */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getDriveGroupsResponse() { - return (Optional) getDriveGroupsResponse; + return Optional.ofNullable(this.getDriveGroupsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageDriveGroupsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageDriveGroupsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageDriveGroupsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageDriveGroupsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * DriveGroups + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageDriveGroupsAllResponse withGetDriveGroupsResponse(GetDriveGroupsResponse getDriveGroupsResponse) { - Utils.checkNotNull(getDriveGroupsResponse, "getDriveGroupsResponse"); - this.getDriveGroupsResponse = Optional.ofNullable(getDriveGroupsResponse); + public FileStorageDriveGroupsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageDriveGroupsAllResponse withGetDriveGroupsResponse(GetDriveGrou /** * DriveGroups */ - public FileStorageDriveGroupsAllResponse withGetDriveGroupsResponse(Optional getDriveGroupsResponse) { - Utils.checkNotNull(getDriveGroupsResponse, "getDriveGroupsResponse"); + public FileStorageDriveGroupsAllResponse withGetDriveGroupsResponse(@Nullable GetDriveGroupsResponse getDriveGroupsResponse) { this.getDriveGroupsResponse = getDriveGroupsResponse; return this; } - /** - * Unexpected error - */ - public FileStorageDriveGroupsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageDriveGroupsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageDriveGroupsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getDriveGroupsResponse = Optional.empty(); + private GetDriveGroupsResponse getDriveGroupsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * DriveGroups - */ - public Builder getDriveGroupsResponse(GetDriveGroupsResponse getDriveGroupsResponse) { - Utils.checkNotNull(getDriveGroupsResponse, "getDriveGroupsResponse"); - this.getDriveGroupsResponse = Optional.ofNullable(getDriveGroupsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * DriveGroups */ - public Builder getDriveGroupsResponse(Optional getDriveGroupsResponse) { - Utils.checkNotNull(getDriveGroupsResponse, "getDriveGroupsResponse"); + public Builder getDriveGroupsResponse(@Nullable GetDriveGroupsResponse getDriveGroupsResponse) { this.getDriveGroupsResponse = getDriveGroupsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageDriveGroupsAllResponse build() { - return new FileStorageDriveGroupsAllResponse( contentType, statusCode, rawResponse, getDriveGroupsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteRequest.java index d9d28a2b..ece92a3c 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class FileStorageDriveGroupsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public FileStorageDriveGroupsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public FileStorageDriveGroupsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageDriveGroupsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageDriveGroupsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageDriveGroupsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public FileStorageDriveGroupsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageDriveGroupsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageDriveGroupsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageDriveGroupsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageDriveGroupsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageDriveGroupsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageDriveGroupsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageDriveGroupsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageDriveGroupsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageDriveGroupsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageDriveGroupsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageDriveGroupsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public FileStorageDriveGroupsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageDriveGroupsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteRequestBuilder.java index 37918a52..63475730 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageDriveGroupsDeleteRequestBuilder { - - private FileStorageDriveGroupsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageDriveGroupsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageDriveGroupsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageDriveGroupsDeleteRequestBuilder request(FileStorageDriveGroupsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageDriveGroupsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageDriveGroupsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageDriveGroupsDeleteRequestBuilder request(@Nonnull FileStorageDriveGroupsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageDriveGroupsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageDriveGroupsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageDriveGroupsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteResponse.java index 301edf27..b9a9fecb 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageDriveGroupsDeleteResponse implements Response { /** * DriveGroups */ - private Optional deleteDriveGroupResponse; + private DeleteDriveGroupResponse deleteDriveGroupResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageDriveGroupsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteDriveGroupResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteDriveGroupResponse, "deleteDriveGroupResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteDriveGroupResponse deleteDriveGroupResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteDriveGroupResponse = deleteDriveGroupResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageDriveGroupsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * DriveGroups */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteDriveGroupResponse() { - return (Optional) deleteDriveGroupResponse; + return Optional.ofNullable(this.deleteDriveGroupResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageDriveGroupsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageDriveGroupsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageDriveGroupsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageDriveGroupsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * DriveGroups + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageDriveGroupsDeleteResponse withDeleteDriveGroupResponse(DeleteDriveGroupResponse deleteDriveGroupResponse) { - Utils.checkNotNull(deleteDriveGroupResponse, "deleteDriveGroupResponse"); - this.deleteDriveGroupResponse = Optional.ofNullable(deleteDriveGroupResponse); + public FileStorageDriveGroupsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageDriveGroupsDeleteResponse withDeleteDriveGroupResponse(DeleteD /** * DriveGroups */ - public FileStorageDriveGroupsDeleteResponse withDeleteDriveGroupResponse(Optional deleteDriveGroupResponse) { - Utils.checkNotNull(deleteDriveGroupResponse, "deleteDriveGroupResponse"); + public FileStorageDriveGroupsDeleteResponse withDeleteDriveGroupResponse(@Nullable DeleteDriveGroupResponse deleteDriveGroupResponse) { this.deleteDriveGroupResponse = deleteDriveGroupResponse; return this; } - /** - * Unexpected error - */ - public FileStorageDriveGroupsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageDriveGroupsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageDriveGroupsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteDriveGroupResponse = Optional.empty(); + private DeleteDriveGroupResponse deleteDriveGroupResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * DriveGroups - */ - public Builder deleteDriveGroupResponse(DeleteDriveGroupResponse deleteDriveGroupResponse) { - Utils.checkNotNull(deleteDriveGroupResponse, "deleteDriveGroupResponse"); - this.deleteDriveGroupResponse = Optional.ofNullable(deleteDriveGroupResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * DriveGroups */ - public Builder deleteDriveGroupResponse(Optional deleteDriveGroupResponse) { - Utils.checkNotNull(deleteDriveGroupResponse, "deleteDriveGroupResponse"); + public Builder deleteDriveGroupResponse(@Nullable DeleteDriveGroupResponse deleteDriveGroupResponse) { this.deleteDriveGroupResponse = deleteDriveGroupResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageDriveGroupsDeleteResponse build() { - return new FileStorageDriveGroupsDeleteResponse( contentType, statusCode, rawResponse, deleteDriveGroupResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneRequest.java index df5cfcd6..beb55a09 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageDriveGroupsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class FileStorageDriveGroupsOneRequest { @JsonCreator public FileStorageDriveGroupsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageDriveGroupsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageDriveGroupsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageDriveGroupsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageDriveGroupsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public FileStorageDriveGroupsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageDriveGroupsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageDriveGroupsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageDriveGroupsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageDriveGroupsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageDriveGroupsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageDriveGroupsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageDriveGroupsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageDriveGroupsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageDriveGroupsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageDriveGroupsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageDriveGroupsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageDriveGroupsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageDriveGroupsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageDriveGroupsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageDriveGroupsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageDriveGroupsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneRequestBuilder.java index 97dd3bae..42bc8509 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageDriveGroupsOneRequestBuilder { - - private FileStorageDriveGroupsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageDriveGroupsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageDriveGroupsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageDriveGroupsOneRequestBuilder request(FileStorageDriveGroupsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageDriveGroupsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageDriveGroupsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageDriveGroupsOneRequestBuilder request(@Nonnull FileStorageDriveGroupsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageDriveGroupsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageDriveGroupsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageDriveGroupsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneResponse.java index 25781b95..28beee7b 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageDriveGroupsOneResponse implements Response { /** * DriveGroups */ - private Optional getDriveGroupResponse; + private GetDriveGroupResponse getDriveGroupResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageDriveGroupsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getDriveGroupResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getDriveGroupResponse, "getDriveGroupResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetDriveGroupResponse getDriveGroupResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getDriveGroupResponse = getDriveGroupResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageDriveGroupsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * DriveGroups */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getDriveGroupResponse() { - return (Optional) getDriveGroupResponse; + return Optional.ofNullable(this.getDriveGroupResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageDriveGroupsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageDriveGroupsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageDriveGroupsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageDriveGroupsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * DriveGroups + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageDriveGroupsOneResponse withGetDriveGroupResponse(GetDriveGroupResponse getDriveGroupResponse) { - Utils.checkNotNull(getDriveGroupResponse, "getDriveGroupResponse"); - this.getDriveGroupResponse = Optional.ofNullable(getDriveGroupResponse); + public FileStorageDriveGroupsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageDriveGroupsOneResponse withGetDriveGroupResponse(GetDriveGroup /** * DriveGroups */ - public FileStorageDriveGroupsOneResponse withGetDriveGroupResponse(Optional getDriveGroupResponse) { - Utils.checkNotNull(getDriveGroupResponse, "getDriveGroupResponse"); + public FileStorageDriveGroupsOneResponse withGetDriveGroupResponse(@Nullable GetDriveGroupResponse getDriveGroupResponse) { this.getDriveGroupResponse = getDriveGroupResponse; return this; } - /** - * Unexpected error - */ - public FileStorageDriveGroupsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageDriveGroupsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageDriveGroupsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getDriveGroupResponse = Optional.empty(); + private GetDriveGroupResponse getDriveGroupResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * DriveGroups - */ - public Builder getDriveGroupResponse(GetDriveGroupResponse getDriveGroupResponse) { - Utils.checkNotNull(getDriveGroupResponse, "getDriveGroupResponse"); - this.getDriveGroupResponse = Optional.ofNullable(getDriveGroupResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * DriveGroups */ - public Builder getDriveGroupResponse(Optional getDriveGroupResponse) { - Utils.checkNotNull(getDriveGroupResponse, "getDriveGroupResponse"); + public Builder getDriveGroupResponse(@Nullable GetDriveGroupResponse getDriveGroupResponse) { this.getDriveGroupResponse = getDriveGroupResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageDriveGroupsOneResponse build() { - return new FileStorageDriveGroupsOneResponse( contentType, statusCode, rawResponse, getDriveGroupResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateRequest.java index 806a21bb..fae5082d 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageDriveGroupsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class FileStorageDriveGroupsUpdateRequest { @JsonCreator public FileStorageDriveGroupsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - DriveGroupInput driveGroup) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(driveGroup, "driveGroup"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull DriveGroupInput driveGroup) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.driveGroup = driveGroup; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.driveGroup = Optional.ofNullable(driveGroup) + .orElseThrow(() -> new IllegalArgumentException("driveGroup cannot be null")); } public FileStorageDriveGroupsUpdateRequest( - String id, - DriveGroupInput driveGroup) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), driveGroup); + @Nonnull String id, + @Nonnull DriveGroupInput driveGroup) { + this(id, null, null, + null, null, driveGroup); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public DriveGroupInput driveGroup() { - return driveGroup; + return this.driveGroup; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageDriveGroupsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageDriveGroupsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageDriveGroupsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public FileStorageDriveGroupsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageDriveGroupsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageDriveGroupsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageDriveGroupsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageDriveGroupsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageDriveGroupsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageDriveGroupsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageDriveGroupsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageDriveGroupsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageDriveGroupsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageDriveGroupsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageDriveGroupsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public FileStorageDriveGroupsUpdateRequest withDriveGroup(DriveGroupInput driveGroup) { - Utils.checkNotNull(driveGroup, "driveGroup"); - this.driveGroup = driveGroup; + + public FileStorageDriveGroupsUpdateRequest withDriveGroup(@Nonnull DriveGroupInput driveGroup) { + this.driveGroup = Utils.checkNotNull(driveGroup, "driveGroup"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private DriveGroupInput driveGroup; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder driveGroup(DriveGroupInput driveGroup) { - Utils.checkNotNull(driveGroup, "driveGroup"); - this.driveGroup = driveGroup; + public Builder driveGroup(@Nonnull DriveGroupInput driveGroup) { + this.driveGroup = Utils.checkNotNull(driveGroup, "driveGroup"); return this; } public FileStorageDriveGroupsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageDriveGroupsUpdateRequest( id, consumerId, appId, serviceId, raw, driveGroup); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateRequestBuilder.java index 35c09a6d..13bba964 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageDriveGroupsUpdateRequestBuilder { - - private FileStorageDriveGroupsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageDriveGroupsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageDriveGroupsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageDriveGroupsUpdateRequestBuilder request(FileStorageDriveGroupsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageDriveGroupsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageDriveGroupsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageDriveGroupsUpdateRequestBuilder request(@Nonnull FileStorageDriveGroupsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageDriveGroupsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageDriveGroupsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageDriveGroupsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateResponse.java index a0f5abf1..81b7c13e 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDriveGroupsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageDriveGroupsUpdateResponse implements Response { /** * DriveGroups */ - private Optional updateDriveGroupResponse; + private UpdateDriveGroupResponse updateDriveGroupResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageDriveGroupsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateDriveGroupResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateDriveGroupResponse, "updateDriveGroupResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateDriveGroupResponse updateDriveGroupResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateDriveGroupResponse = updateDriveGroupResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageDriveGroupsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * DriveGroups */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateDriveGroupResponse() { - return (Optional) updateDriveGroupResponse; + return Optional.ofNullable(this.updateDriveGroupResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageDriveGroupsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageDriveGroupsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageDriveGroupsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageDriveGroupsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * DriveGroups + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageDriveGroupsUpdateResponse withUpdateDriveGroupResponse(UpdateDriveGroupResponse updateDriveGroupResponse) { - Utils.checkNotNull(updateDriveGroupResponse, "updateDriveGroupResponse"); - this.updateDriveGroupResponse = Optional.ofNullable(updateDriveGroupResponse); + public FileStorageDriveGroupsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageDriveGroupsUpdateResponse withUpdateDriveGroupResponse(UpdateD /** * DriveGroups */ - public FileStorageDriveGroupsUpdateResponse withUpdateDriveGroupResponse(Optional updateDriveGroupResponse) { - Utils.checkNotNull(updateDriveGroupResponse, "updateDriveGroupResponse"); + public FileStorageDriveGroupsUpdateResponse withUpdateDriveGroupResponse(@Nullable UpdateDriveGroupResponse updateDriveGroupResponse) { this.updateDriveGroupResponse = updateDriveGroupResponse; return this; } - /** - * Unexpected error - */ - public FileStorageDriveGroupsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageDriveGroupsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageDriveGroupsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateDriveGroupResponse = Optional.empty(); + private UpdateDriveGroupResponse updateDriveGroupResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * DriveGroups - */ - public Builder updateDriveGroupResponse(UpdateDriveGroupResponse updateDriveGroupResponse) { - Utils.checkNotNull(updateDriveGroupResponse, "updateDriveGroupResponse"); - this.updateDriveGroupResponse = Optional.ofNullable(updateDriveGroupResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * DriveGroups */ - public Builder updateDriveGroupResponse(Optional updateDriveGroupResponse) { - Utils.checkNotNull(updateDriveGroupResponse, "updateDriveGroupResponse"); + public Builder updateDriveGroupResponse(@Nullable UpdateDriveGroupResponse updateDriveGroupResponse) { this.updateDriveGroupResponse = updateDriveGroupResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageDriveGroupsUpdateResponse build() { - return new FileStorageDriveGroupsUpdateResponse( contentType, statusCode, rawResponse, updateDriveGroupResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddRequest.java index d101d20f..c5eea792 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class FileStorageDrivesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class FileStorageDrivesAddRequest { @JsonCreator public FileStorageDrivesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - DriveInput drive) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(drive, "drive"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull DriveInput drive) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.drive = drive; + this.drive = Optional.ofNullable(drive) + .orElseThrow(() -> new IllegalArgumentException("drive cannot be null")); } public FileStorageDrivesAddRequest( - DriveInput drive) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), drive); + @Nonnull DriveInput drive) { + this(null, null, null, + null, drive); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public DriveInput drive() { - return drive; + return this.drive; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageDrivesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageDrivesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageDrivesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageDrivesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public FileStorageDrivesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageDrivesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageDrivesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageDrivesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageDrivesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageDrivesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageDrivesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageDrivesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public FileStorageDrivesAddRequest withDrive(DriveInput drive) { - Utils.checkNotNull(drive, "drive"); - this.drive = drive; + + public FileStorageDrivesAddRequest withDrive(@Nonnull DriveInput drive) { + this.drive = Utils.checkNotNull(drive, "drive"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private DriveInput drive; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder drive(DriveInput drive) { - Utils.checkNotNull(drive, "drive"); - this.drive = drive; + public Builder drive(@Nonnull DriveInput drive) { + this.drive = Utils.checkNotNull(drive, "drive"); return this; } public FileStorageDrivesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageDrivesAddRequest( raw, consumerId, appId, serviceId, drive); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddRequestBuilder.java index bcc2fe94..801791af 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageDrivesAddRequestBuilder { - - private FileStorageDrivesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageDrivesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageDrivesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageDrivesAddRequestBuilder request(FileStorageDrivesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageDrivesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageDrivesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageDrivesAddRequestBuilder request(@Nonnull FileStorageDrivesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageDrivesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageDrivesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageDrivesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddResponse.java index d9801b13..9b465722 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageDrivesAddResponse implements Response { /** * Drives */ - private Optional createDriveResponse; + private CreateDriveResponse createDriveResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageDrivesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createDriveResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createDriveResponse, "createDriveResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateDriveResponse createDriveResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createDriveResponse = createDriveResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageDrivesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Drives */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createDriveResponse() { - return (Optional) createDriveResponse; + return Optional.ofNullable(this.createDriveResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageDrivesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageDrivesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageDrivesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageDrivesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Drives + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageDrivesAddResponse withCreateDriveResponse(CreateDriveResponse createDriveResponse) { - Utils.checkNotNull(createDriveResponse, "createDriveResponse"); - this.createDriveResponse = Optional.ofNullable(createDriveResponse); + public FileStorageDrivesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageDrivesAddResponse withCreateDriveResponse(CreateDriveResponse /** * Drives */ - public FileStorageDrivesAddResponse withCreateDriveResponse(Optional createDriveResponse) { - Utils.checkNotNull(createDriveResponse, "createDriveResponse"); + public FileStorageDrivesAddResponse withCreateDriveResponse(@Nullable CreateDriveResponse createDriveResponse) { this.createDriveResponse = createDriveResponse; return this; } - /** - * Unexpected error - */ - public FileStorageDrivesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageDrivesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageDrivesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createDriveResponse = Optional.empty(); + private CreateDriveResponse createDriveResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Drives - */ - public Builder createDriveResponse(CreateDriveResponse createDriveResponse) { - Utils.checkNotNull(createDriveResponse, "createDriveResponse"); - this.createDriveResponse = Optional.ofNullable(createDriveResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Drives */ - public Builder createDriveResponse(Optional createDriveResponse) { - Utils.checkNotNull(createDriveResponse, "createDriveResponse"); + public Builder createDriveResponse(@Nullable CreateDriveResponse createDriveResponse) { this.createDriveResponse = createDriveResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageDrivesAddResponse build() { - return new FileStorageDrivesAddResponse( contentType, statusCode, rawResponse, createDriveResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllRequest.java index 15202a37..848c0765 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllRequest.java @@ -8,13 +8,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -24,25 +23,25 @@ public class FileStorageDrivesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -54,13 +53,13 @@ public class FileStorageDrivesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private DrivesFilter filter; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -70,101 +69,88 @@ public class FileStorageDrivesAllRequest { @JsonCreator public FileStorageDrivesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable DrivesFilter filter, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageDrivesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -175,103 +161,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageDrivesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageDrivesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageDrivesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageDrivesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public FileStorageDrivesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageDrivesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageDrivesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageDrivesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageDrivesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageDrivesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageDrivesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageDrivesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public FileStorageDrivesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public FileStorageDrivesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public FileStorageDrivesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public FileStorageDrivesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -279,48 +206,29 @@ public FileStorageDrivesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public FileStorageDrivesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public FileStorageDrivesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public FileStorageDrivesAllRequest withFilter(DrivesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public FileStorageDrivesAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public FileStorageDrivesAllRequest withFilter(@Nullable DrivesFilter filter) { this.filter = filter; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageDrivesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageDrivesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageDrivesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -366,186 +274,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private DrivesFilter filter; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(DrivesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable DrivesFilter filter) { this.filter = filter; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageDrivesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new FileStorageDrivesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -553,16 +366,16 @@ public FileStorageDrivesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllRequestBuilder.java index a7021229..362f9f68 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class FileStorageDrivesAllRequestBuilder { - - private FileStorageDrivesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageDrivesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageDrivesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageDrivesAllRequestBuilder request(FileStorageDrivesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageDrivesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageDrivesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageDrivesAllRequestBuilder request(@Nonnull FileStorageDrivesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageDrivesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageDrivesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageDrivesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public FileStorageDrivesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new FileStorageDrivesAllOperation( - sdkConfiguration, - options); + FileStorageDrivesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new FileStorageDrivesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - FileStorageDrivesAllRequest::withCursor, + FileStorageDrivesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllResponse.java index 0e1cf87c..88cdbbc4 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageDrivesAllResponse implements Response { /** * Drives */ - private Optional getDrivesResponse; + private GetDrivesResponse getDrivesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageDrivesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getDrivesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getDrivesResponse, "getDrivesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetDrivesResponse getDrivesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getDrivesResponse = getDrivesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageDrivesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Drives */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getDrivesResponse() { - return (Optional) getDrivesResponse; + return Optional.ofNullable(this.getDrivesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageDrivesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageDrivesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageDrivesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageDrivesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Drives + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageDrivesAllResponse withGetDrivesResponse(GetDrivesResponse getDrivesResponse) { - Utils.checkNotNull(getDrivesResponse, "getDrivesResponse"); - this.getDrivesResponse = Optional.ofNullable(getDrivesResponse); + public FileStorageDrivesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageDrivesAllResponse withGetDrivesResponse(GetDrivesResponse getD /** * Drives */ - public FileStorageDrivesAllResponse withGetDrivesResponse(Optional getDrivesResponse) { - Utils.checkNotNull(getDrivesResponse, "getDrivesResponse"); + public FileStorageDrivesAllResponse withGetDrivesResponse(@Nullable GetDrivesResponse getDrivesResponse) { this.getDrivesResponse = getDrivesResponse; return this; } - /** - * Unexpected error - */ - public FileStorageDrivesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageDrivesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageDrivesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getDrivesResponse = Optional.empty(); + private GetDrivesResponse getDrivesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Drives - */ - public Builder getDrivesResponse(GetDrivesResponse getDrivesResponse) { - Utils.checkNotNull(getDrivesResponse, "getDrivesResponse"); - this.getDrivesResponse = Optional.ofNullable(getDrivesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Drives */ - public Builder getDrivesResponse(Optional getDrivesResponse) { - Utils.checkNotNull(getDrivesResponse, "getDrivesResponse"); + public Builder getDrivesResponse(@Nullable GetDrivesResponse getDrivesResponse) { this.getDrivesResponse = getDrivesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageDrivesAllResponse build() { - return new FileStorageDrivesAllResponse( contentType, statusCode, rawResponse, getDrivesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteRequest.java index d20aef17..13f9023a 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class FileStorageDrivesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public FileStorageDrivesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public FileStorageDrivesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageDrivesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageDrivesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageDrivesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public FileStorageDrivesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageDrivesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageDrivesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageDrivesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageDrivesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageDrivesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageDrivesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageDrivesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageDrivesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageDrivesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageDrivesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageDrivesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public FileStorageDrivesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageDrivesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteRequestBuilder.java index 97c678da..fdedfbc4 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageDrivesDeleteRequestBuilder { - - private FileStorageDrivesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageDrivesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageDrivesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageDrivesDeleteRequestBuilder request(FileStorageDrivesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageDrivesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageDrivesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageDrivesDeleteRequestBuilder request(@Nonnull FileStorageDrivesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageDrivesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageDrivesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageDrivesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteResponse.java index c1c09b3b..d2ff73e0 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageDrivesDeleteResponse implements Response { /** * Drives */ - private Optional deleteDriveResponse; + private DeleteDriveResponse deleteDriveResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageDrivesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteDriveResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteDriveResponse, "deleteDriveResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteDriveResponse deleteDriveResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteDriveResponse = deleteDriveResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageDrivesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Drives */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteDriveResponse() { - return (Optional) deleteDriveResponse; + return Optional.ofNullable(this.deleteDriveResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageDrivesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageDrivesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageDrivesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageDrivesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Drives + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageDrivesDeleteResponse withDeleteDriveResponse(DeleteDriveResponse deleteDriveResponse) { - Utils.checkNotNull(deleteDriveResponse, "deleteDriveResponse"); - this.deleteDriveResponse = Optional.ofNullable(deleteDriveResponse); + public FileStorageDrivesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageDrivesDeleteResponse withDeleteDriveResponse(DeleteDriveRespon /** * Drives */ - public FileStorageDrivesDeleteResponse withDeleteDriveResponse(Optional deleteDriveResponse) { - Utils.checkNotNull(deleteDriveResponse, "deleteDriveResponse"); + public FileStorageDrivesDeleteResponse withDeleteDriveResponse(@Nullable DeleteDriveResponse deleteDriveResponse) { this.deleteDriveResponse = deleteDriveResponse; return this; } - /** - * Unexpected error - */ - public FileStorageDrivesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageDrivesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageDrivesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteDriveResponse = Optional.empty(); + private DeleteDriveResponse deleteDriveResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Drives - */ - public Builder deleteDriveResponse(DeleteDriveResponse deleteDriveResponse) { - Utils.checkNotNull(deleteDriveResponse, "deleteDriveResponse"); - this.deleteDriveResponse = Optional.ofNullable(deleteDriveResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Drives */ - public Builder deleteDriveResponse(Optional deleteDriveResponse) { - Utils.checkNotNull(deleteDriveResponse, "deleteDriveResponse"); + public Builder deleteDriveResponse(@Nullable DeleteDriveResponse deleteDriveResponse) { this.deleteDriveResponse = deleteDriveResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageDrivesDeleteResponse build() { - return new FileStorageDrivesDeleteResponse( contentType, statusCode, rawResponse, deleteDriveResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneRequest.java index 777e6831..77206fea 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageDrivesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class FileStorageDrivesOneRequest { @JsonCreator public FileStorageDrivesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageDrivesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageDrivesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageDrivesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageDrivesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public FileStorageDrivesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageDrivesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageDrivesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageDrivesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageDrivesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageDrivesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageDrivesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageDrivesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageDrivesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageDrivesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageDrivesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageDrivesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageDrivesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageDrivesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageDrivesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageDrivesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageDrivesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneRequestBuilder.java index ef87c622..f86d1bb8 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageDrivesOneRequestBuilder { - - private FileStorageDrivesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageDrivesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageDrivesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageDrivesOneRequestBuilder request(FileStorageDrivesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageDrivesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageDrivesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageDrivesOneRequestBuilder request(@Nonnull FileStorageDrivesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageDrivesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageDrivesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageDrivesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneResponse.java index 8907d264..ca51cf05 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageDrivesOneResponse implements Response { /** * Drives */ - private Optional getDriveResponse; + private GetDriveResponse getDriveResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageDrivesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getDriveResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getDriveResponse, "getDriveResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetDriveResponse getDriveResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getDriveResponse = getDriveResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageDrivesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Drives */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getDriveResponse() { - return (Optional) getDriveResponse; + return Optional.ofNullable(this.getDriveResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageDrivesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageDrivesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageDrivesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageDrivesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Drives + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageDrivesOneResponse withGetDriveResponse(GetDriveResponse getDriveResponse) { - Utils.checkNotNull(getDriveResponse, "getDriveResponse"); - this.getDriveResponse = Optional.ofNullable(getDriveResponse); + public FileStorageDrivesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageDrivesOneResponse withGetDriveResponse(GetDriveResponse getDri /** * Drives */ - public FileStorageDrivesOneResponse withGetDriveResponse(Optional getDriveResponse) { - Utils.checkNotNull(getDriveResponse, "getDriveResponse"); + public FileStorageDrivesOneResponse withGetDriveResponse(@Nullable GetDriveResponse getDriveResponse) { this.getDriveResponse = getDriveResponse; return this; } - /** - * Unexpected error - */ - public FileStorageDrivesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageDrivesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageDrivesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getDriveResponse = Optional.empty(); + private GetDriveResponse getDriveResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Drives - */ - public Builder getDriveResponse(GetDriveResponse getDriveResponse) { - Utils.checkNotNull(getDriveResponse, "getDriveResponse"); - this.getDriveResponse = Optional.ofNullable(getDriveResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Drives */ - public Builder getDriveResponse(Optional getDriveResponse) { - Utils.checkNotNull(getDriveResponse, "getDriveResponse"); + public Builder getDriveResponse(@Nullable GetDriveResponse getDriveResponse) { this.getDriveResponse = getDriveResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageDrivesOneResponse build() { - return new FileStorageDrivesOneResponse( contentType, statusCode, rawResponse, getDriveResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateRequest.java index ebb8d220..cfd14e2a 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageDrivesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class FileStorageDrivesUpdateRequest { @JsonCreator public FileStorageDrivesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - DriveInput drive) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(drive, "drive"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull DriveInput drive) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.drive = drive; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.drive = Optional.ofNullable(drive) + .orElseThrow(() -> new IllegalArgumentException("drive cannot be null")); } public FileStorageDrivesUpdateRequest( - String id, - DriveInput drive) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), drive); + @Nonnull String id, + @Nonnull DriveInput drive) { + this(id, null, null, + null, null, drive); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public DriveInput drive() { - return drive; + return this.drive; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageDrivesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageDrivesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageDrivesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public FileStorageDrivesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageDrivesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageDrivesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageDrivesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageDrivesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageDrivesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageDrivesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageDrivesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageDrivesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageDrivesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageDrivesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageDrivesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public FileStorageDrivesUpdateRequest withDrive(DriveInput drive) { - Utils.checkNotNull(drive, "drive"); - this.drive = drive; + + public FileStorageDrivesUpdateRequest withDrive(@Nonnull DriveInput drive) { + this.drive = Utils.checkNotNull(drive, "drive"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private DriveInput drive; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder drive(DriveInput drive) { - Utils.checkNotNull(drive, "drive"); - this.drive = drive; + public Builder drive(@Nonnull DriveInput drive) { + this.drive = Utils.checkNotNull(drive, "drive"); return this; } public FileStorageDrivesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageDrivesUpdateRequest( id, consumerId, appId, serviceId, raw, drive); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateRequestBuilder.java index dce2f899..54c8f777 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageDrivesUpdateRequestBuilder { - - private FileStorageDrivesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageDrivesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageDrivesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageDrivesUpdateRequestBuilder request(FileStorageDrivesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageDrivesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageDrivesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageDrivesUpdateRequestBuilder request(@Nonnull FileStorageDrivesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageDrivesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageDrivesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageDrivesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateResponse.java index 0da5dec0..a42132c7 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageDrivesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageDrivesUpdateResponse implements Response { /** * Drives */ - private Optional updateDriveResponse; + private UpdateDriveResponse updateDriveResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageDrivesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateDriveResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateDriveResponse, "updateDriveResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateDriveResponse updateDriveResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateDriveResponse = updateDriveResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageDrivesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Drives */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateDriveResponse() { - return (Optional) updateDriveResponse; + return Optional.ofNullable(this.updateDriveResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageDrivesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageDrivesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageDrivesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageDrivesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Drives + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageDrivesUpdateResponse withUpdateDriveResponse(UpdateDriveResponse updateDriveResponse) { - Utils.checkNotNull(updateDriveResponse, "updateDriveResponse"); - this.updateDriveResponse = Optional.ofNullable(updateDriveResponse); + public FileStorageDrivesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageDrivesUpdateResponse withUpdateDriveResponse(UpdateDriveRespon /** * Drives */ - public FileStorageDrivesUpdateResponse withUpdateDriveResponse(Optional updateDriveResponse) { - Utils.checkNotNull(updateDriveResponse, "updateDriveResponse"); + public FileStorageDrivesUpdateResponse withUpdateDriveResponse(@Nullable UpdateDriveResponse updateDriveResponse) { this.updateDriveResponse = updateDriveResponse; return this; } - /** - * Unexpected error - */ - public FileStorageDrivesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageDrivesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageDrivesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateDriveResponse = Optional.empty(); + private UpdateDriveResponse updateDriveResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Drives - */ - public Builder updateDriveResponse(UpdateDriveResponse updateDriveResponse) { - Utils.checkNotNull(updateDriveResponse, "updateDriveResponse"); - this.updateDriveResponse = Optional.ofNullable(updateDriveResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Drives */ - public Builder updateDriveResponse(Optional updateDriveResponse) { - Utils.checkNotNull(updateDriveResponse, "updateDriveResponse"); + public Builder updateDriveResponse(@Nullable UpdateDriveResponse updateDriveResponse) { this.updateDriveResponse = updateDriveResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageDrivesUpdateResponse build() { - return new FileStorageDrivesUpdateResponse( contentType, statusCode, rawResponse, updateDriveResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllRequest.java index e2ca24ca..a421b773 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class FileStorageFilesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class FileStorageFilesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private FilesFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private FilesSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class FileStorageFilesAllRequest { @JsonCreator public FileStorageFilesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable FilesFilter filter, + @Nullable FilesSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageFilesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageFilesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageFilesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageFilesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFilesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public FileStorageFilesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFilesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFilesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFilesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFilesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFilesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFilesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFilesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public FileStorageFilesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public FileStorageFilesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public FileStorageFilesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public FileStorageFilesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public FileStorageFilesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public FileStorageFilesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public FileStorageFilesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public FileStorageFilesAllRequest withFilter(FilesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public FileStorageFilesAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public FileStorageFilesAllRequest withFilter(@Nullable FilesFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public FileStorageFilesAllRequest withSort(FilesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public FileStorageFilesAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public FileStorageFilesAllRequest withSort(@Nullable FilesSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public FileStorageFilesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public FileStorageFilesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public FileStorageFilesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageFilesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageFilesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageFilesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private FilesFilter filter; - private Optional sort = Optional.empty(); + private FilesSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(FilesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable FilesFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(FilesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable FilesSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageFilesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new FileStorageFilesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public FileStorageFilesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllRequestBuilder.java index 231daaaf..8cc275a8 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class FileStorageFilesAllRequestBuilder { - - private FileStorageFilesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFilesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFilesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFilesAllRequestBuilder request(FileStorageFilesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFilesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFilesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFilesAllRequestBuilder request(@Nonnull FileStorageFilesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFilesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFilesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFilesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public FileStorageFilesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new FileStorageFilesAllOperation( - sdkConfiguration, - options); + FileStorageFilesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new FileStorageFilesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - FileStorageFilesAllRequest::withCursor, + FileStorageFilesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllResponse.java index 393a4d9e..f82452d5 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageFilesAllResponse implements Response { /** * Files */ - private Optional getFilesResponse; + private GetFilesResponse getFilesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFilesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getFilesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getFilesResponse, "getFilesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetFilesResponse getFilesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getFilesResponse = getFilesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFilesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Files */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getFilesResponse() { - return (Optional) getFilesResponse; + return Optional.ofNullable(this.getFilesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFilesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFilesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFilesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFilesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Files + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFilesAllResponse withGetFilesResponse(GetFilesResponse getFilesResponse) { - Utils.checkNotNull(getFilesResponse, "getFilesResponse"); - this.getFilesResponse = Optional.ofNullable(getFilesResponse); + public FileStorageFilesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageFilesAllResponse withGetFilesResponse(GetFilesResponse getFile /** * Files */ - public FileStorageFilesAllResponse withGetFilesResponse(Optional getFilesResponse) { - Utils.checkNotNull(getFilesResponse, "getFilesResponse"); + public FileStorageFilesAllResponse withGetFilesResponse(@Nullable GetFilesResponse getFilesResponse) { this.getFilesResponse = getFilesResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFilesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFilesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFilesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getFilesResponse = Optional.empty(); + private GetFilesResponse getFilesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Files - */ - public Builder getFilesResponse(GetFilesResponse getFilesResponse) { - Utils.checkNotNull(getFilesResponse, "getFilesResponse"); - this.getFilesResponse = Optional.ofNullable(getFilesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Files */ - public Builder getFilesResponse(Optional getFilesResponse) { - Utils.checkNotNull(getFilesResponse, "getFilesResponse"); + public Builder getFilesResponse(@Nullable GetFilesResponse getFilesResponse) { this.getFilesResponse = getFilesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFilesAllResponse build() { - return new FileStorageFilesAllResponse( contentType, statusCode, rawResponse, getFilesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteRequest.java index 1f028f50..0a2f70db 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class FileStorageFilesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public FileStorageFilesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public FileStorageFilesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageFilesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFilesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageFilesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public FileStorageFilesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageFilesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFilesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFilesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFilesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFilesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFilesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFilesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFilesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageFilesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageFilesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageFilesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public FileStorageFilesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageFilesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteRequestBuilder.java index 3d85d0f1..b2e8279e 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFilesDeleteRequestBuilder { - - private FileStorageFilesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFilesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFilesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFilesDeleteRequestBuilder request(FileStorageFilesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFilesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFilesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFilesDeleteRequestBuilder request(@Nonnull FileStorageFilesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFilesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFilesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFilesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteResponse.java index 5a687718..55a79b78 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageFilesDeleteResponse implements Response { /** * Files */ - private Optional deleteFileResponse; + private DeleteFileResponse deleteFileResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFilesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteFileResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteFileResponse, "deleteFileResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteFileResponse deleteFileResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteFileResponse = deleteFileResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFilesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Files */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteFileResponse() { - return (Optional) deleteFileResponse; + return Optional.ofNullable(this.deleteFileResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFilesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFilesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFilesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFilesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Files + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFilesDeleteResponse withDeleteFileResponse(DeleteFileResponse deleteFileResponse) { - Utils.checkNotNull(deleteFileResponse, "deleteFileResponse"); - this.deleteFileResponse = Optional.ofNullable(deleteFileResponse); + public FileStorageFilesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageFilesDeleteResponse withDeleteFileResponse(DeleteFileResponse /** * Files */ - public FileStorageFilesDeleteResponse withDeleteFileResponse(Optional deleteFileResponse) { - Utils.checkNotNull(deleteFileResponse, "deleteFileResponse"); + public FileStorageFilesDeleteResponse withDeleteFileResponse(@Nullable DeleteFileResponse deleteFileResponse) { this.deleteFileResponse = deleteFileResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFilesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFilesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFilesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteFileResponse = Optional.empty(); + private DeleteFileResponse deleteFileResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Files - */ - public Builder deleteFileResponse(DeleteFileResponse deleteFileResponse) { - Utils.checkNotNull(deleteFileResponse, "deleteFileResponse"); - this.deleteFileResponse = Optional.ofNullable(deleteFileResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Files */ - public Builder deleteFileResponse(Optional deleteFileResponse) { - Utils.checkNotNull(deleteFileResponse, "deleteFileResponse"); + public Builder deleteFileResponse(@Nullable DeleteFileResponse deleteFileResponse) { this.deleteFileResponse = deleteFileResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFilesDeleteResponse build() { - return new FileStorageFilesDeleteResponse( contentType, statusCode, rawResponse, deleteFileResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadRequest.java index 5295c016..b8e67661 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -24,19 +25,19 @@ public class FileStorageFilesDownloadRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -46,67 +47,59 @@ public class FileStorageFilesDownloadRequest { @JsonCreator public FileStorageFilesDownloadRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageFilesDownloadRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -117,18 +110,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageFilesDownloadRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFilesDownloadRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageFilesDownloadRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -136,67 +119,38 @@ public FileStorageFilesDownloadRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageFilesDownloadRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFilesDownloadRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFilesDownloadRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFilesDownloadRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFilesDownloadRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFilesDownloadRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFilesDownloadRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFilesDownloadRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageFilesDownloadRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageFilesDownloadRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageFilesDownloadRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -237,106 +191,59 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageFilesDownloadRequest build() { - return new FileStorageFilesDownloadRequest( id, consumerId, appId, serviceId, fields); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadRequestBuilder.java index 6ed08f7f..fb370c1b 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFilesDownloadRequestBuilder { - - private FileStorageFilesDownloadRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFilesDownloadRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFilesDownloadRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFilesDownloadRequestBuilder request(FileStorageFilesDownloadRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFilesDownloadRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFilesDownloadRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFilesDownloadRequestBuilder request(@Nonnull FileStorageFilesDownloadRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFilesDownloadRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFilesDownloadResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFilesDownloadOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadResponse.java index b189ee59..cdff4171 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesDownloadResponse.java @@ -7,12 +7,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -36,80 +35,70 @@ public class FileStorageFilesDownloadResponse implements Response { /** * File Download */ - private Optional getFileDownloadResponse; + private InputStream getFileDownloadResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFilesDownloadResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getFileDownloadResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getFileDownloadResponse, "getFileDownloadResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable InputStream getFileDownloadResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getFileDownloadResponse = getFileDownloadResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFilesDownloadResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * File Download */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getFileDownloadResponse() { - return (Optional) getFileDownloadResponse; + return Optional.ofNullable(this.getFileDownloadResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -120,36 +109,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFilesDownloadResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFilesDownloadResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFilesDownloadResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFilesDownloadResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * File Download + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFilesDownloadResponse withGetFileDownloadResponse(InputStream getFileDownloadResponse) { - Utils.checkNotNull(getFileDownloadResponse, "getFileDownloadResponse"); - this.getFileDownloadResponse = Optional.ofNullable(getFileDownloadResponse); + public FileStorageFilesDownloadResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -157,31 +136,21 @@ public FileStorageFilesDownloadResponse withGetFileDownloadResponse(InputStream /** * File Download */ - public FileStorageFilesDownloadResponse withGetFileDownloadResponse(Optional getFileDownloadResponse) { - Utils.checkNotNull(getFileDownloadResponse, "getFileDownloadResponse"); + public FileStorageFilesDownloadResponse withGetFileDownloadResponse(@Nullable InputStream getFileDownloadResponse) { this.getFileDownloadResponse = getFileDownloadResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFilesDownloadResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFilesDownloadResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFilesDownloadResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -221,88 +190,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getFileDownloadResponse = Optional.empty(); + private InputStream getFileDownloadResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * File Download - */ - public Builder getFileDownloadResponse(InputStream getFileDownloadResponse) { - Utils.checkNotNull(getFileDownloadResponse, "getFileDownloadResponse"); - this.getFileDownloadResponse = Optional.ofNullable(getFileDownloadResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * File Download */ - public Builder getFileDownloadResponse(Optional getFileDownloadResponse) { - Utils.checkNotNull(getFileDownloadResponse, "getFileDownloadResponse"); + public Builder getFileDownloadResponse(@Nullable InputStream getFileDownloadResponse) { this.getFileDownloadResponse = getFileDownloadResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFilesDownloadResponse build() { - return new FileStorageFilesDownloadResponse( contentType, statusCode, rawResponse, getFileDownloadResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportRequest.java index 8021c731..261de29c 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -24,19 +25,19 @@ public class FileStorageFilesExportRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -52,79 +53,70 @@ public class FileStorageFilesExportRequest { @JsonCreator public FileStorageFilesExportRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable fields, - String format) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(format, "format"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable fields, + @Nonnull String format) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.fields = fields; - this.format = format; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); + this.format = Optional.ofNullable(format) + .orElseThrow(() -> new IllegalArgumentException("format cannot be null")); } public FileStorageFilesExportRequest( - String id, - String format) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), format); + @Nonnull String id, + @Nonnull String format) { + this(id, null, null, + null, null, format); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } /** * File format to export this file to. A list of available file formats for the current file is available as `export_formats` on the File resource. */ - @JsonIgnore public String format() { - return format; + return this.format; } public static Builder builder() { @@ -135,18 +127,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageFilesExportRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFilesExportRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageFilesExportRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -154,77 +136,48 @@ public FileStorageFilesExportRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageFilesExportRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFilesExportRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFilesExportRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFilesExportRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFilesExportRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFilesExportRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFilesExportRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFilesExportRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageFilesExportRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageFilesExportRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageFilesExportRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } /** * File format to export this file to. A list of available file formats for the current file is available as `export_formats` on the File resource. */ - public FileStorageFilesExportRequest withFormat(String format) { - Utils.checkNotNull(format, "format"); - this.format = format; + public FileStorageFilesExportRequest withFormat(@Nonnull String format) { + this.format = Utils.checkNotNull(format, "format"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -266,13 +219,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private String format; @@ -280,104 +233,55 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** * File format to export this file to. A list of available file formats for the current file is available as `export_formats` on the File resource. */ - public Builder format(String format) { - Utils.checkNotNull(format, "format"); - this.format = format; + public Builder format(@Nonnull String format) { + this.format = Utils.checkNotNull(format, "format"); return this; } public FileStorageFilesExportRequest build() { - return new FileStorageFilesExportRequest( id, consumerId, appId, serviceId, fields, format); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportRequestBuilder.java index bc02208b..8e1d3ada 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFilesExportRequestBuilder { - - private FileStorageFilesExportRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFilesExportRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFilesExportRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFilesExportRequestBuilder request(FileStorageFilesExportRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFilesExportRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFilesExportRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFilesExportRequestBuilder request(@Nonnull FileStorageFilesExportRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFilesExportRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFilesExportResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFilesExportOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportResponse.java index 2a46706a..5cbcb0e9 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesExportResponse.java @@ -7,12 +7,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -36,80 +35,70 @@ public class FileStorageFilesExportResponse implements Response { /** * File Download */ - private Optional getFileDownloadResponse; + private InputStream getFileDownloadResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFilesExportResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getFileDownloadResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getFileDownloadResponse, "getFileDownloadResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable InputStream getFileDownloadResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getFileDownloadResponse = getFileDownloadResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFilesExportResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * File Download */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getFileDownloadResponse() { - return (Optional) getFileDownloadResponse; + return Optional.ofNullable(this.getFileDownloadResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -120,36 +109,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFilesExportResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFilesExportResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFilesExportResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFilesExportResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * File Download + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFilesExportResponse withGetFileDownloadResponse(InputStream getFileDownloadResponse) { - Utils.checkNotNull(getFileDownloadResponse, "getFileDownloadResponse"); - this.getFileDownloadResponse = Optional.ofNullable(getFileDownloadResponse); + public FileStorageFilesExportResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -157,31 +136,21 @@ public FileStorageFilesExportResponse withGetFileDownloadResponse(InputStream ge /** * File Download */ - public FileStorageFilesExportResponse withGetFileDownloadResponse(Optional getFileDownloadResponse) { - Utils.checkNotNull(getFileDownloadResponse, "getFileDownloadResponse"); + public FileStorageFilesExportResponse withGetFileDownloadResponse(@Nullable InputStream getFileDownloadResponse) { this.getFileDownloadResponse = getFileDownloadResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFilesExportResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFilesExportResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFilesExportResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -221,88 +190,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getFileDownloadResponse = Optional.empty(); + private InputStream getFileDownloadResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * File Download - */ - public Builder getFileDownloadResponse(InputStream getFileDownloadResponse) { - Utils.checkNotNull(getFileDownloadResponse, "getFileDownloadResponse"); - this.getFileDownloadResponse = Optional.ofNullable(getFileDownloadResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * File Download */ - public Builder getFileDownloadResponse(Optional getFileDownloadResponse) { - Utils.checkNotNull(getFileDownloadResponse, "getFileDownloadResponse"); + public Builder getFileDownloadResponse(@Nullable InputStream getFileDownloadResponse) { this.getFileDownloadResponse = getFileDownloadResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFilesExportResponse build() { - return new FileStorageFilesExportResponse( contentType, statusCode, rawResponse, getFileDownloadResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneRequest.java index 0c735266..5ea963ee 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageFilesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class FileStorageFilesOneRequest { @JsonCreator public FileStorageFilesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageFilesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageFilesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFilesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageFilesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public FileStorageFilesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageFilesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFilesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFilesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFilesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFilesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFilesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFilesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFilesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageFilesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageFilesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageFilesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageFilesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageFilesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageFilesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageFilesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageFilesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneRequestBuilder.java index e123a82c..a94b00a9 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFilesOneRequestBuilder { - - private FileStorageFilesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFilesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFilesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFilesOneRequestBuilder request(FileStorageFilesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFilesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFilesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFilesOneRequestBuilder request(@Nonnull FileStorageFilesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFilesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFilesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFilesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneResponse.java index c1927906..597661e3 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageFilesOneResponse implements Response { /** * File */ - private Optional getFileResponse; + private GetFileResponse getFileResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFilesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getFileResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getFileResponse, "getFileResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetFileResponse getFileResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getFileResponse = getFileResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFilesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * File */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getFileResponse() { - return (Optional) getFileResponse; + return Optional.ofNullable(this.getFileResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFilesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFilesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFilesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFilesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * File + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFilesOneResponse withGetFileResponse(GetFileResponse getFileResponse) { - Utils.checkNotNull(getFileResponse, "getFileResponse"); - this.getFileResponse = Optional.ofNullable(getFileResponse); + public FileStorageFilesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageFilesOneResponse withGetFileResponse(GetFileResponse getFileRe /** * File */ - public FileStorageFilesOneResponse withGetFileResponse(Optional getFileResponse) { - Utils.checkNotNull(getFileResponse, "getFileResponse"); + public FileStorageFilesOneResponse withGetFileResponse(@Nullable GetFileResponse getFileResponse) { this.getFileResponse = getFileResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFilesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFilesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFilesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getFileResponse = Optional.empty(); + private GetFileResponse getFileResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * File - */ - public Builder getFileResponse(GetFileResponse getFileResponse) { - Utils.checkNotNull(getFileResponse, "getFileResponse"); - this.getFileResponse = Optional.ofNullable(getFileResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * File */ - public Builder getFileResponse(Optional getFileResponse) { - Utils.checkNotNull(getFileResponse, "getFileResponse"); + public Builder getFileResponse(@Nullable GetFileResponse getFileResponse) { this.getFileResponse = getFileResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFilesOneResponse build() { - return new FileStorageFilesOneResponse( contentType, statusCode, rawResponse, getFileResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchRequest.java index 48bd2ca3..0c97b013 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchRequest.java @@ -9,14 +9,14 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +27,25 @@ public class FileStorageFilesSearchRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -63,19 +63,19 @@ public class FileStorageFilesSearchRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private FilesFilter filter; @SpeakeasyMetadata("request:mediaType=application/json") @@ -83,123 +83,106 @@ public class FileStorageFilesSearchRequest { @JsonCreator public FileStorageFilesSearchRequest( - Optional consumerId, - Optional appId, - Optional serviceId, - Optional> passThrough, - JsonNullable fields, - JsonNullable cursor, - Optional limit, - Optional raw, - Optional filter, - FilesSearch filesSearch) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(filesSearch, "filesSearch"); + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Map passThrough, + @Nullable JsonNullable fields, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Boolean raw, + @Nullable FilesFilter filter, + @Nonnull FilesSearch filesSearch) { this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; this.passThrough = passThrough; - this.fields = fields; - this.cursor = cursor; - this.limit = limit; - this.raw = raw; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.filter = filter; - this.filesSearch = filesSearch; + this.filesSearch = Optional.ofNullable(filesSearch) + .orElseThrow(() -> new IllegalArgumentException("filesSearch cannot be null")); } public FileStorageFilesSearchRequest( - FilesSearch filesSearch) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), Optional.empty(), + @Nonnull FilesSearch filesSearch) { + this(null, null, null, + null, null, null, + null, null, null, filesSearch); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } - @JsonIgnore public FilesSearch filesSearch() { - return filesSearch; + return this.filesSearch; } public static Builder builder() { @@ -210,178 +193,90 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public FileStorageFilesSearchRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFilesSearchRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFilesSearchRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFilesSearchRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFilesSearchRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFilesSearchRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFilesSearchRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFilesSearchRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFilesSearchRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public FileStorageFilesSearchRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public FileStorageFilesSearchRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public FileStorageFilesSearchRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageFilesSearchRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageFilesSearchRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageFilesSearchRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public FileStorageFilesSearchRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public FileStorageFilesSearchRequest withCursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public FileStorageFilesSearchRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public FileStorageFilesSearchRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public FileStorageFilesSearchRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public FileStorageFilesSearchRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageFilesSearchRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageFilesSearchRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageFilesSearchRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * Apply filters - */ - public FileStorageFilesSearchRequest withFilter(FilesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public FileStorageFilesSearchRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public FileStorageFilesSearchRequest withFilter(@Nullable FilesFilter filter) { this.filter = filter; return this; } - public FileStorageFilesSearchRequest withFilesSearch(FilesSearch filesSearch) { - Utils.checkNotNull(filesSearch, "filesSearch"); - this.filesSearch = filesSearch; + + public FileStorageFilesSearchRequest withFilesSearch(@Nonnull FilesSearch filesSearch) { + this.filesSearch = Utils.checkNotNull(filesSearch, "filesSearch"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -431,23 +326,23 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional raw; + private Boolean raw; - private Optional filter = Optional.empty(); + private FilesFilter filter; private FilesSearch filesSearch; @@ -455,192 +350,84 @@ private Builder() { // force use of static builder() method } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * Apply filters */ - public Builder filter(FilesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable FilesFilter filter) { this.filter = filter; return this; } - - public Builder filesSearch(FilesSearch filesSearch) { - Utils.checkNotNull(filesSearch, "filesSearch"); - this.filesSearch = filesSearch; + public Builder filesSearch(@Nonnull FilesSearch filesSearch) { + this.filesSearch = Utils.checkNotNull(filesSearch, "filesSearch"); return this; } public FileStorageFilesSearchRequest build() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageFilesSearchRequest( consumerId, appId, serviceId, passThrough, fields, cursor, @@ -649,16 +436,16 @@ public FileStorageFilesSearchRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchRequestBuilder.java index 4ddd3a71..c4b3fcd6 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFilesSearchRequestBuilder { - - private FileStorageFilesSearchRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFilesSearchRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFilesSearchRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFilesSearchRequestBuilder request(FileStorageFilesSearchRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFilesSearchRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFilesSearchRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFilesSearchRequestBuilder request(@Nonnull FileStorageFilesSearchRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFilesSearchRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFilesSearchResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFilesSearchOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchResponse.java index 7fa15c53..01295ba8 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesSearchResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageFilesSearchResponse implements Response { /** * Files */ - private Optional getFilesResponse; + private GetFilesResponse getFilesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFilesSearchResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getFilesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getFilesResponse, "getFilesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetFilesResponse getFilesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getFilesResponse = getFilesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFilesSearchResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Files */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getFilesResponse() { - return (Optional) getFilesResponse; + return Optional.ofNullable(this.getFilesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFilesSearchResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFilesSearchResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFilesSearchResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFilesSearchResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Files + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFilesSearchResponse withGetFilesResponse(GetFilesResponse getFilesResponse) { - Utils.checkNotNull(getFilesResponse, "getFilesResponse"); - this.getFilesResponse = Optional.ofNullable(getFilesResponse); + public FileStorageFilesSearchResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageFilesSearchResponse withGetFilesResponse(GetFilesResponse getF /** * Files */ - public FileStorageFilesSearchResponse withGetFilesResponse(Optional getFilesResponse) { - Utils.checkNotNull(getFilesResponse, "getFilesResponse"); + public FileStorageFilesSearchResponse withGetFilesResponse(@Nullable GetFilesResponse getFilesResponse) { this.getFilesResponse = getFilesResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFilesSearchResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFilesSearchResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFilesSearchResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getFilesResponse = Optional.empty(); + private GetFilesResponse getFilesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Files - */ - public Builder getFilesResponse(GetFilesResponse getFilesResponse) { - Utils.checkNotNull(getFilesResponse, "getFilesResponse"); - this.getFilesResponse = Optional.ofNullable(getFilesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Files */ - public Builder getFilesResponse(Optional getFilesResponse) { - Utils.checkNotNull(getFilesResponse, "getFilesResponse"); + public Builder getFilesResponse(@Nullable GetFilesResponse getFilesResponse) { this.getFilesResponse = getFilesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFilesSearchResponse build() { - return new FileStorageFilesSearchResponse( contentType, statusCode, rawResponse, getFilesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateRequest.java index f882ac83..99a20139 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageFilesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class FileStorageFilesUpdateRequest { @JsonCreator public FileStorageFilesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - UpdateFileRequest updateFileRequest) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(updateFileRequest, "updateFileRequest"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull UpdateFileRequest updateFileRequest) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.updateFileRequest = updateFileRequest; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.updateFileRequest = Optional.ofNullable(updateFileRequest) + .orElseThrow(() -> new IllegalArgumentException("updateFileRequest cannot be null")); } public FileStorageFilesUpdateRequest( - String id, - UpdateFileRequest updateFileRequest) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), updateFileRequest); + @Nonnull String id, + @Nonnull UpdateFileRequest updateFileRequest) { + this(id, null, null, + null, null, updateFileRequest); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public UpdateFileRequest updateFileRequest() { - return updateFileRequest; + return this.updateFileRequest; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageFilesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFilesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageFilesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public FileStorageFilesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageFilesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFilesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFilesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFilesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFilesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFilesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFilesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFilesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageFilesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageFilesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageFilesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public FileStorageFilesUpdateRequest withUpdateFileRequest(UpdateFileRequest updateFileRequest) { - Utils.checkNotNull(updateFileRequest, "updateFileRequest"); - this.updateFileRequest = updateFileRequest; + + public FileStorageFilesUpdateRequest withUpdateFileRequest(@Nonnull UpdateFileRequest updateFileRequest) { + this.updateFileRequest = Utils.checkNotNull(updateFileRequest, "updateFileRequest"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private UpdateFileRequest updateFileRequest; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder updateFileRequest(UpdateFileRequest updateFileRequest) { - Utils.checkNotNull(updateFileRequest, "updateFileRequest"); - this.updateFileRequest = updateFileRequest; + public Builder updateFileRequest(@Nonnull UpdateFileRequest updateFileRequest) { + this.updateFileRequest = Utils.checkNotNull(updateFileRequest, "updateFileRequest"); return this; } public FileStorageFilesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageFilesUpdateRequest( id, consumerId, appId, serviceId, raw, updateFileRequest); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateRequestBuilder.java index 858d4810..539979b4 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFilesUpdateRequestBuilder { - - private FileStorageFilesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFilesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFilesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFilesUpdateRequestBuilder request(FileStorageFilesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFilesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFilesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFilesUpdateRequestBuilder request(@Nonnull FileStorageFilesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFilesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFilesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFilesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateResponse.java index 18bb1b19..d0010672 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFilesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageFilesUpdateResponse implements Response { /** * Files */ - private Optional updateFileResponse; + private UpdateFileResponse updateFileResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFilesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateFileResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateFileResponse, "updateFileResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateFileResponse updateFileResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateFileResponse = updateFileResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFilesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Files */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateFileResponse() { - return (Optional) updateFileResponse; + return Optional.ofNullable(this.updateFileResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFilesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFilesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFilesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFilesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Files + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFilesUpdateResponse withUpdateFileResponse(UpdateFileResponse updateFileResponse) { - Utils.checkNotNull(updateFileResponse, "updateFileResponse"); - this.updateFileResponse = Optional.ofNullable(updateFileResponse); + public FileStorageFilesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageFilesUpdateResponse withUpdateFileResponse(UpdateFileResponse /** * Files */ - public FileStorageFilesUpdateResponse withUpdateFileResponse(Optional updateFileResponse) { - Utils.checkNotNull(updateFileResponse, "updateFileResponse"); + public FileStorageFilesUpdateResponse withUpdateFileResponse(@Nullable UpdateFileResponse updateFileResponse) { this.updateFileResponse = updateFileResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFilesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFilesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFilesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateFileResponse = Optional.empty(); + private UpdateFileResponse updateFileResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Files - */ - public Builder updateFileResponse(UpdateFileResponse updateFileResponse) { - Utils.checkNotNull(updateFileResponse, "updateFileResponse"); - this.updateFileResponse = Optional.ofNullable(updateFileResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Files */ - public Builder updateFileResponse(Optional updateFileResponse) { - Utils.checkNotNull(updateFileResponse, "updateFileResponse"); + public Builder updateFileResponse(@Nullable UpdateFileResponse updateFileResponse) { this.updateFileResponse = updateFileResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFilesUpdateResponse build() { - return new FileStorageFilesUpdateResponse( contentType, statusCode, rawResponse, updateFileResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddRequest.java index 46219d98..1e1c253d 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -22,25 +23,25 @@ public class FileStorageFoldersAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -54,75 +55,66 @@ public class FileStorageFoldersAddRequest { @JsonCreator public FileStorageFoldersAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable fields, - CreateFolderRequest createFolderRequest) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(createFolderRequest, "createFolderRequest"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable fields, + @Nonnull CreateFolderRequest createFolderRequest) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.fields = fields; - this.createFolderRequest = createFolderRequest; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); + this.createFolderRequest = Optional.ofNullable(createFolderRequest) + .orElseThrow(() -> new IllegalArgumentException("createFolderRequest cannot be null")); } public FileStorageFoldersAddRequest( - CreateFolderRequest createFolderRequest) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), createFolderRequest); + @Nonnull CreateFolderRequest createFolderRequest) { + this(null, null, null, + null, null, createFolderRequest); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } - @JsonIgnore public CreateFolderRequest createFolderRequest() { - return createFolderRequest; + return this.createFolderRequest; } public static Builder builder() { @@ -133,103 +125,54 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageFoldersAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageFoldersAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageFoldersAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFoldersAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public FileStorageFoldersAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFoldersAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFoldersAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFoldersAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFoldersAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFoldersAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFoldersAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFoldersAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageFoldersAddRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageFoldersAddRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageFoldersAddRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageFoldersAddRequest withCreateFolderRequest(CreateFolderRequest createFolderRequest) { - Utils.checkNotNull(createFolderRequest, "createFolderRequest"); - this.createFolderRequest = createFolderRequest; + public FileStorageFoldersAddRequest withCreateFolderRequest(@Nonnull CreateFolderRequest createFolderRequest) { + this.createFolderRequest = Utils.checkNotNull(createFolderRequest, "createFolderRequest"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -269,15 +212,15 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private CreateFolderRequest createFolderRequest; @@ -285,123 +228,62 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - - public Builder createFolderRequest(CreateFolderRequest createFolderRequest) { - Utils.checkNotNull(createFolderRequest, "createFolderRequest"); - this.createFolderRequest = createFolderRequest; + public Builder createFolderRequest(@Nonnull CreateFolderRequest createFolderRequest) { + this.createFolderRequest = Utils.checkNotNull(createFolderRequest, "createFolderRequest"); return this; } public FileStorageFoldersAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageFoldersAddRequest( raw, consumerId, appId, serviceId, fields, createFolderRequest); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddRequestBuilder.java index c51b7173..74cb9dea 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFoldersAddRequestBuilder { - - private FileStorageFoldersAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFoldersAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFoldersAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFoldersAddRequestBuilder request(FileStorageFoldersAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFoldersAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFoldersAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFoldersAddRequestBuilder request(@Nonnull FileStorageFoldersAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFoldersAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFoldersAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFoldersAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddResponse.java index 7a736658..5f9da612 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageFoldersAddResponse implements Response { /** * Folders */ - private Optional createFolderResponse; + private CreateFolderResponse createFolderResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFoldersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createFolderResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createFolderResponse, "createFolderResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateFolderResponse createFolderResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createFolderResponse = createFolderResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFoldersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Folders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createFolderResponse() { - return (Optional) createFolderResponse; + return Optional.ofNullable(this.createFolderResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFoldersAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFoldersAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFoldersAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFoldersAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Folders + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFoldersAddResponse withCreateFolderResponse(CreateFolderResponse createFolderResponse) { - Utils.checkNotNull(createFolderResponse, "createFolderResponse"); - this.createFolderResponse = Optional.ofNullable(createFolderResponse); + public FileStorageFoldersAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageFoldersAddResponse withCreateFolderResponse(CreateFolderRespon /** * Folders */ - public FileStorageFoldersAddResponse withCreateFolderResponse(Optional createFolderResponse) { - Utils.checkNotNull(createFolderResponse, "createFolderResponse"); + public FileStorageFoldersAddResponse withCreateFolderResponse(@Nullable CreateFolderResponse createFolderResponse) { this.createFolderResponse = createFolderResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFoldersAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFoldersAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFoldersAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createFolderResponse = Optional.empty(); + private CreateFolderResponse createFolderResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Folders - */ - public Builder createFolderResponse(CreateFolderResponse createFolderResponse) { - Utils.checkNotNull(createFolderResponse, "createFolderResponse"); - this.createFolderResponse = Optional.ofNullable(createFolderResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Folders */ - public Builder createFolderResponse(Optional createFolderResponse) { - Utils.checkNotNull(createFolderResponse, "createFolderResponse"); + public Builder createFolderResponse(@Nullable CreateFolderResponse createFolderResponse) { this.createFolderResponse = createFolderResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFoldersAddResponse build() { - return new FileStorageFoldersAddResponse( contentType, statusCode, rawResponse, createFolderResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyRequest.java index e987469d..cd81d4f1 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -28,25 +29,25 @@ public class FileStorageFoldersCopyRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -60,88 +61,78 @@ public class FileStorageFoldersCopyRequest { @JsonCreator public FileStorageFoldersCopyRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields, - CopyFolderRequest copyFolderRequest) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(copyFolderRequest, "copyFolderRequest"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields, + @Nonnull CopyFolderRequest copyFolderRequest) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; - this.copyFolderRequest = copyFolderRequest; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); + this.copyFolderRequest = Optional.ofNullable(copyFolderRequest) + .orElseThrow(() -> new IllegalArgumentException("copyFolderRequest cannot be null")); } public FileStorageFoldersCopyRequest( - String id, - CopyFolderRequest copyFolderRequest) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), + @Nonnull String id, + @Nonnull CopyFolderRequest copyFolderRequest) { + this(id, null, null, + null, null, null, copyFolderRequest); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } - @JsonIgnore public CopyFolderRequest copyFolderRequest() { - return copyFolderRequest; + return this.copyFolderRequest; } public static Builder builder() { @@ -152,18 +143,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageFoldersCopyRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFoldersCopyRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageFoldersCopyRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -171,93 +152,54 @@ public FileStorageFoldersCopyRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageFoldersCopyRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFoldersCopyRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFoldersCopyRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFoldersCopyRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFoldersCopyRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFoldersCopyRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFoldersCopyRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFoldersCopyRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageFoldersCopyRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageFoldersCopyRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageFoldersCopyRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageFoldersCopyRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageFoldersCopyRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageFoldersCopyRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageFoldersCopyRequest withCopyFolderRequest(CopyFolderRequest copyFolderRequest) { - Utils.checkNotNull(copyFolderRequest, "copyFolderRequest"); - this.copyFolderRequest = copyFolderRequest; + public FileStorageFoldersCopyRequest withCopyFolderRequest(@Nonnull CopyFolderRequest copyFolderRequest) { + this.copyFolderRequest = Utils.checkNotNull(copyFolderRequest, "copyFolderRequest"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -302,15 +244,15 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private CopyFolderRequest copyFolderRequest; @@ -318,123 +260,60 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - - public Builder copyFolderRequest(CopyFolderRequest copyFolderRequest) { - Utils.checkNotNull(copyFolderRequest, "copyFolderRequest"); - this.copyFolderRequest = copyFolderRequest; + public Builder copyFolderRequest(@Nonnull CopyFolderRequest copyFolderRequest) { + this.copyFolderRequest = Utils.checkNotNull(copyFolderRequest, "copyFolderRequest"); return this; } public FileStorageFoldersCopyRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageFoldersCopyRequest( id, consumerId, appId, serviceId, raw, fields, @@ -442,10 +321,10 @@ public FileStorageFoldersCopyRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyRequestBuilder.java index 8ffa27a2..395f317d 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFoldersCopyRequestBuilder { - - private FileStorageFoldersCopyRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFoldersCopyRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFoldersCopyRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFoldersCopyRequestBuilder request(FileStorageFoldersCopyRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFoldersCopyRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFoldersCopyRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFoldersCopyRequestBuilder request(@Nonnull FileStorageFoldersCopyRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFoldersCopyRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFoldersCopyResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFoldersCopyOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyResponse.java index e3fcc6d9..c9f23fbf 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersCopyResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageFoldersCopyResponse implements Response { /** * Folders */ - private Optional updateFolderResponse; + private UpdateFolderResponse updateFolderResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFoldersCopyResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateFolderResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateFolderResponse, "updateFolderResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateFolderResponse updateFolderResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateFolderResponse = updateFolderResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFoldersCopyResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Folders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateFolderResponse() { - return (Optional) updateFolderResponse; + return Optional.ofNullable(this.updateFolderResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFoldersCopyResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFoldersCopyResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFoldersCopyResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFoldersCopyResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Folders + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFoldersCopyResponse withUpdateFolderResponse(UpdateFolderResponse updateFolderResponse) { - Utils.checkNotNull(updateFolderResponse, "updateFolderResponse"); - this.updateFolderResponse = Optional.ofNullable(updateFolderResponse); + public FileStorageFoldersCopyResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageFoldersCopyResponse withUpdateFolderResponse(UpdateFolderRespo /** * Folders */ - public FileStorageFoldersCopyResponse withUpdateFolderResponse(Optional updateFolderResponse) { - Utils.checkNotNull(updateFolderResponse, "updateFolderResponse"); + public FileStorageFoldersCopyResponse withUpdateFolderResponse(@Nullable UpdateFolderResponse updateFolderResponse) { this.updateFolderResponse = updateFolderResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFoldersCopyResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFoldersCopyResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFoldersCopyResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateFolderResponse = Optional.empty(); + private UpdateFolderResponse updateFolderResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Folders - */ - public Builder updateFolderResponse(UpdateFolderResponse updateFolderResponse) { - Utils.checkNotNull(updateFolderResponse, "updateFolderResponse"); - this.updateFolderResponse = Optional.ofNullable(updateFolderResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Folders */ - public Builder updateFolderResponse(Optional updateFolderResponse) { - Utils.checkNotNull(updateFolderResponse, "updateFolderResponse"); + public Builder updateFolderResponse(@Nullable UpdateFolderResponse updateFolderResponse) { this.updateFolderResponse = updateFolderResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFoldersCopyResponse build() { - return new FileStorageFoldersCopyResponse( contentType, statusCode, rawResponse, updateFolderResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteRequest.java index e7b5a1f0..6482294d 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class FileStorageFoldersDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public FileStorageFoldersDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public FileStorageFoldersDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageFoldersDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFoldersDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageFoldersDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public FileStorageFoldersDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageFoldersDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFoldersDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFoldersDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFoldersDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFoldersDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFoldersDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFoldersDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFoldersDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageFoldersDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageFoldersDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageFoldersDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public FileStorageFoldersDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageFoldersDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteRequestBuilder.java index 0e3f9a4d..8b194a72 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFoldersDeleteRequestBuilder { - - private FileStorageFoldersDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFoldersDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFoldersDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFoldersDeleteRequestBuilder request(FileStorageFoldersDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFoldersDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFoldersDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFoldersDeleteRequestBuilder request(@Nonnull FileStorageFoldersDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFoldersDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFoldersDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFoldersDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteResponse.java index 65fa1eae..bb44d340 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageFoldersDeleteResponse implements Response { /** * Folders */ - private Optional deleteFolderResponse; + private DeleteFolderResponse deleteFolderResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFoldersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteFolderResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteFolderResponse, "deleteFolderResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteFolderResponse deleteFolderResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteFolderResponse = deleteFolderResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFoldersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Folders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteFolderResponse() { - return (Optional) deleteFolderResponse; + return Optional.ofNullable(this.deleteFolderResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFoldersDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFoldersDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFoldersDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFoldersDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Folders + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFoldersDeleteResponse withDeleteFolderResponse(DeleteFolderResponse deleteFolderResponse) { - Utils.checkNotNull(deleteFolderResponse, "deleteFolderResponse"); - this.deleteFolderResponse = Optional.ofNullable(deleteFolderResponse); + public FileStorageFoldersDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageFoldersDeleteResponse withDeleteFolderResponse(DeleteFolderRes /** * Folders */ - public FileStorageFoldersDeleteResponse withDeleteFolderResponse(Optional deleteFolderResponse) { - Utils.checkNotNull(deleteFolderResponse, "deleteFolderResponse"); + public FileStorageFoldersDeleteResponse withDeleteFolderResponse(@Nullable DeleteFolderResponse deleteFolderResponse) { this.deleteFolderResponse = deleteFolderResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFoldersDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFoldersDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFoldersDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteFolderResponse = Optional.empty(); + private DeleteFolderResponse deleteFolderResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Folders - */ - public Builder deleteFolderResponse(DeleteFolderResponse deleteFolderResponse) { - Utils.checkNotNull(deleteFolderResponse, "deleteFolderResponse"); - this.deleteFolderResponse = Optional.ofNullable(deleteFolderResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Folders */ - public Builder deleteFolderResponse(Optional deleteFolderResponse) { - Utils.checkNotNull(deleteFolderResponse, "deleteFolderResponse"); + public Builder deleteFolderResponse(@Nullable DeleteFolderResponse deleteFolderResponse) { this.deleteFolderResponse = deleteFolderResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFoldersDeleteResponse build() { - return new FileStorageFoldersDeleteResponse( contentType, statusCode, rawResponse, deleteFolderResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneRequest.java index ef8c2230..a4104990 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageFoldersOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class FileStorageFoldersOneRequest { @JsonCreator public FileStorageFoldersOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageFoldersOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageFoldersOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFoldersOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageFoldersOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public FileStorageFoldersOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageFoldersOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFoldersOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFoldersOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFoldersOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFoldersOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFoldersOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFoldersOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFoldersOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageFoldersOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageFoldersOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageFoldersOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageFoldersOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageFoldersOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageFoldersOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageFoldersOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageFoldersOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneRequestBuilder.java index b8f773ed..81924bf7 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFoldersOneRequestBuilder { - - private FileStorageFoldersOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFoldersOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFoldersOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFoldersOneRequestBuilder request(FileStorageFoldersOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFoldersOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFoldersOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFoldersOneRequestBuilder request(@Nonnull FileStorageFoldersOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFoldersOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFoldersOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFoldersOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneResponse.java index a646552c..4cc95ff3 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageFoldersOneResponse implements Response { /** * Folders */ - private Optional getFolderResponse; + private GetFolderResponse getFolderResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFoldersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getFolderResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getFolderResponse, "getFolderResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetFolderResponse getFolderResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getFolderResponse = getFolderResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFoldersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Folders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getFolderResponse() { - return (Optional) getFolderResponse; + return Optional.ofNullable(this.getFolderResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFoldersOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFoldersOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFoldersOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFoldersOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Folders + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFoldersOneResponse withGetFolderResponse(GetFolderResponse getFolderResponse) { - Utils.checkNotNull(getFolderResponse, "getFolderResponse"); - this.getFolderResponse = Optional.ofNullable(getFolderResponse); + public FileStorageFoldersOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageFoldersOneResponse withGetFolderResponse(GetFolderResponse get /** * Folders */ - public FileStorageFoldersOneResponse withGetFolderResponse(Optional getFolderResponse) { - Utils.checkNotNull(getFolderResponse, "getFolderResponse"); + public FileStorageFoldersOneResponse withGetFolderResponse(@Nullable GetFolderResponse getFolderResponse) { this.getFolderResponse = getFolderResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFoldersOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFoldersOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFoldersOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getFolderResponse = Optional.empty(); + private GetFolderResponse getFolderResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Folders - */ - public Builder getFolderResponse(GetFolderResponse getFolderResponse) { - Utils.checkNotNull(getFolderResponse, "getFolderResponse"); - this.getFolderResponse = Optional.ofNullable(getFolderResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Folders */ - public Builder getFolderResponse(Optional getFolderResponse) { - Utils.checkNotNull(getFolderResponse, "getFolderResponse"); + public Builder getFolderResponse(@Nullable GetFolderResponse getFolderResponse) { this.getFolderResponse = getFolderResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFoldersOneResponse build() { - return new FileStorageFoldersOneResponse( contentType, statusCode, rawResponse, getFolderResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateRequest.java index e7079d9c..06307680 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageFoldersUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class FileStorageFoldersUpdateRequest { @JsonCreator public FileStorageFoldersUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - UpdateFolderRequest updateFolderRequest) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(updateFolderRequest, "updateFolderRequest"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull UpdateFolderRequest updateFolderRequest) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.updateFolderRequest = updateFolderRequest; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.updateFolderRequest = Optional.ofNullable(updateFolderRequest) + .orElseThrow(() -> new IllegalArgumentException("updateFolderRequest cannot be null")); } public FileStorageFoldersUpdateRequest( - String id, - UpdateFolderRequest updateFolderRequest) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), updateFolderRequest); + @Nonnull String id, + @Nonnull UpdateFolderRequest updateFolderRequest) { + this(id, null, null, + null, null, updateFolderRequest); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public UpdateFolderRequest updateFolderRequest() { - return updateFolderRequest; + return this.updateFolderRequest; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageFoldersUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageFoldersUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageFoldersUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public FileStorageFoldersUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageFoldersUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageFoldersUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageFoldersUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageFoldersUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageFoldersUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageFoldersUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageFoldersUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageFoldersUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageFoldersUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageFoldersUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageFoldersUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public FileStorageFoldersUpdateRequest withUpdateFolderRequest(UpdateFolderRequest updateFolderRequest) { - Utils.checkNotNull(updateFolderRequest, "updateFolderRequest"); - this.updateFolderRequest = updateFolderRequest; + + public FileStorageFoldersUpdateRequest withUpdateFolderRequest(@Nonnull UpdateFolderRequest updateFolderRequest) { + this.updateFolderRequest = Utils.checkNotNull(updateFolderRequest, "updateFolderRequest"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private UpdateFolderRequest updateFolderRequest; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder updateFolderRequest(UpdateFolderRequest updateFolderRequest) { - Utils.checkNotNull(updateFolderRequest, "updateFolderRequest"); - this.updateFolderRequest = updateFolderRequest; + public Builder updateFolderRequest(@Nonnull UpdateFolderRequest updateFolderRequest) { + this.updateFolderRequest = Utils.checkNotNull(updateFolderRequest, "updateFolderRequest"); return this; } public FileStorageFoldersUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageFoldersUpdateRequest( id, consumerId, appId, serviceId, raw, updateFolderRequest); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateRequestBuilder.java index 4b4f0203..44640988 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageFoldersUpdateRequestBuilder { - - private FileStorageFoldersUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageFoldersUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageFoldersUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageFoldersUpdateRequestBuilder request(FileStorageFoldersUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageFoldersUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageFoldersUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageFoldersUpdateRequestBuilder request(@Nonnull FileStorageFoldersUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageFoldersUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageFoldersUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageFoldersUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateResponse.java index 0431c78b..bc8582f3 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageFoldersUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageFoldersUpdateResponse implements Response { /** * Folders */ - private Optional updateFolderResponse; + private UpdateFolderResponse updateFolderResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageFoldersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateFolderResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateFolderResponse, "updateFolderResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateFolderResponse updateFolderResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateFolderResponse = updateFolderResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageFoldersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Folders */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateFolderResponse() { - return (Optional) updateFolderResponse; + return Optional.ofNullable(this.updateFolderResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageFoldersUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageFoldersUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageFoldersUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageFoldersUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Folders + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageFoldersUpdateResponse withUpdateFolderResponse(UpdateFolderResponse updateFolderResponse) { - Utils.checkNotNull(updateFolderResponse, "updateFolderResponse"); - this.updateFolderResponse = Optional.ofNullable(updateFolderResponse); + public FileStorageFoldersUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageFoldersUpdateResponse withUpdateFolderResponse(UpdateFolderRes /** * Folders */ - public FileStorageFoldersUpdateResponse withUpdateFolderResponse(Optional updateFolderResponse) { - Utils.checkNotNull(updateFolderResponse, "updateFolderResponse"); + public FileStorageFoldersUpdateResponse withUpdateFolderResponse(@Nullable UpdateFolderResponse updateFolderResponse) { this.updateFolderResponse = updateFolderResponse; return this; } - /** - * Unexpected error - */ - public FileStorageFoldersUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageFoldersUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageFoldersUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateFolderResponse = Optional.empty(); + private UpdateFolderResponse updateFolderResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Folders - */ - public Builder updateFolderResponse(UpdateFolderResponse updateFolderResponse) { - Utils.checkNotNull(updateFolderResponse, "updateFolderResponse"); - this.updateFolderResponse = Optional.ofNullable(updateFolderResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Folders */ - public Builder updateFolderResponse(Optional updateFolderResponse) { - Utils.checkNotNull(updateFolderResponse, "updateFolderResponse"); + public Builder updateFolderResponse(@Nullable UpdateFolderResponse updateFolderResponse) { this.updateFolderResponse = updateFolderResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageFoldersUpdateResponse build() { - return new FileStorageFoldersUpdateResponse( contentType, statusCode, rawResponse, updateFolderResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddRequest.java index 774245f5..449f7a94 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class FileStorageSharedLinksAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class FileStorageSharedLinksAddRequest { @JsonCreator public FileStorageSharedLinksAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - SharedLinkInput sharedLink) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(sharedLink, "sharedLink"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull SharedLinkInput sharedLink) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.sharedLink = sharedLink; + this.sharedLink = Optional.ofNullable(sharedLink) + .orElseThrow(() -> new IllegalArgumentException("sharedLink cannot be null")); } public FileStorageSharedLinksAddRequest( - SharedLinkInput sharedLink) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), sharedLink); + @Nonnull SharedLinkInput sharedLink) { + this(null, null, null, + null, sharedLink); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public SharedLinkInput sharedLink() { - return sharedLink; + return this.sharedLink; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageSharedLinksAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageSharedLinksAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageSharedLinksAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageSharedLinksAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public FileStorageSharedLinksAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageSharedLinksAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageSharedLinksAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageSharedLinksAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageSharedLinksAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageSharedLinksAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageSharedLinksAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageSharedLinksAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public FileStorageSharedLinksAddRequest withSharedLink(SharedLinkInput sharedLink) { - Utils.checkNotNull(sharedLink, "sharedLink"); - this.sharedLink = sharedLink; + + public FileStorageSharedLinksAddRequest withSharedLink(@Nonnull SharedLinkInput sharedLink) { + this.sharedLink = Utils.checkNotNull(sharedLink, "sharedLink"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private SharedLinkInput sharedLink; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder sharedLink(SharedLinkInput sharedLink) { - Utils.checkNotNull(sharedLink, "sharedLink"); - this.sharedLink = sharedLink; + public Builder sharedLink(@Nonnull SharedLinkInput sharedLink) { + this.sharedLink = Utils.checkNotNull(sharedLink, "sharedLink"); return this; } public FileStorageSharedLinksAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageSharedLinksAddRequest( raw, consumerId, appId, serviceId, sharedLink); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddRequestBuilder.java index cfc3fbe8..3d92b4f3 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageSharedLinksAddRequestBuilder { - - private FileStorageSharedLinksAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageSharedLinksAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageSharedLinksAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageSharedLinksAddRequestBuilder request(FileStorageSharedLinksAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageSharedLinksAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageSharedLinksAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageSharedLinksAddRequestBuilder request(@Nonnull FileStorageSharedLinksAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageSharedLinksAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageSharedLinksAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageSharedLinksAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddResponse.java index 952b5169..c52fa0e9 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageSharedLinksAddResponse implements Response { /** * Shared Links */ - private Optional createSharedLinkResponse; + private CreateSharedLinkResponse createSharedLinkResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageSharedLinksAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createSharedLinkResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createSharedLinkResponse, "createSharedLinkResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateSharedLinkResponse createSharedLinkResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createSharedLinkResponse = createSharedLinkResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageSharedLinksAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Shared Links */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createSharedLinkResponse() { - return (Optional) createSharedLinkResponse; + return Optional.ofNullable(this.createSharedLinkResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageSharedLinksAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageSharedLinksAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageSharedLinksAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageSharedLinksAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Shared Links + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageSharedLinksAddResponse withCreateSharedLinkResponse(CreateSharedLinkResponse createSharedLinkResponse) { - Utils.checkNotNull(createSharedLinkResponse, "createSharedLinkResponse"); - this.createSharedLinkResponse = Optional.ofNullable(createSharedLinkResponse); + public FileStorageSharedLinksAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageSharedLinksAddResponse withCreateSharedLinkResponse(CreateShar /** * Shared Links */ - public FileStorageSharedLinksAddResponse withCreateSharedLinkResponse(Optional createSharedLinkResponse) { - Utils.checkNotNull(createSharedLinkResponse, "createSharedLinkResponse"); + public FileStorageSharedLinksAddResponse withCreateSharedLinkResponse(@Nullable CreateSharedLinkResponse createSharedLinkResponse) { this.createSharedLinkResponse = createSharedLinkResponse; return this; } - /** - * Unexpected error - */ - public FileStorageSharedLinksAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageSharedLinksAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageSharedLinksAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createSharedLinkResponse = Optional.empty(); + private CreateSharedLinkResponse createSharedLinkResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Shared Links - */ - public Builder createSharedLinkResponse(CreateSharedLinkResponse createSharedLinkResponse) { - Utils.checkNotNull(createSharedLinkResponse, "createSharedLinkResponse"); - this.createSharedLinkResponse = Optional.ofNullable(createSharedLinkResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Shared Links */ - public Builder createSharedLinkResponse(Optional createSharedLinkResponse) { - Utils.checkNotNull(createSharedLinkResponse, "createSharedLinkResponse"); + public Builder createSharedLinkResponse(@Nullable CreateSharedLinkResponse createSharedLinkResponse) { this.createSharedLinkResponse = createSharedLinkResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageSharedLinksAddResponse build() { - return new FileStorageSharedLinksAddResponse( contentType, statusCode, rawResponse, createSharedLinkResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllRequest.java index dfc067aa..313dd7c6 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class FileStorageSharedLinksAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class FileStorageSharedLinksAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class FileStorageSharedLinksAllRequest { @JsonCreator public FileStorageSharedLinksAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageSharedLinksAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageSharedLinksAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageSharedLinksAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageSharedLinksAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageSharedLinksAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public FileStorageSharedLinksAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageSharedLinksAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageSharedLinksAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageSharedLinksAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageSharedLinksAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageSharedLinksAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageSharedLinksAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageSharedLinksAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public FileStorageSharedLinksAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public FileStorageSharedLinksAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public FileStorageSharedLinksAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public FileStorageSharedLinksAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public FileStorageSharedLinksAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public FileStorageSharedLinksAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public FileStorageSharedLinksAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public FileStorageSharedLinksAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public FileStorageSharedLinksAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public FileStorageSharedLinksAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageSharedLinksAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageSharedLinksAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageSharedLinksAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageSharedLinksAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new FileStorageSharedLinksAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public FileStorageSharedLinksAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllRequestBuilder.java index 2195057f..035bd807 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class FileStorageSharedLinksAllRequestBuilder { - - private FileStorageSharedLinksAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageSharedLinksAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageSharedLinksAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageSharedLinksAllRequestBuilder request(FileStorageSharedLinksAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageSharedLinksAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageSharedLinksAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageSharedLinksAllRequestBuilder request(@Nonnull FileStorageSharedLinksAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageSharedLinksAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageSharedLinksAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageSharedLinksAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public FileStorageSharedLinksAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new FileStorageSharedLinksAllOperation( - sdkConfiguration, - options); + FileStorageSharedLinksAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new FileStorageSharedLinksAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - FileStorageSharedLinksAllRequest::withCursor, + FileStorageSharedLinksAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllResponse.java index 29f66dfd..eb37c162 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageSharedLinksAllResponse implements Response { /** * Shared Links */ - private Optional getSharedLinksResponse; + private GetSharedLinksResponse getSharedLinksResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageSharedLinksAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getSharedLinksResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getSharedLinksResponse, "getSharedLinksResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetSharedLinksResponse getSharedLinksResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getSharedLinksResponse = getSharedLinksResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageSharedLinksAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Shared Links */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getSharedLinksResponse() { - return (Optional) getSharedLinksResponse; + return Optional.ofNullable(this.getSharedLinksResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageSharedLinksAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageSharedLinksAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageSharedLinksAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageSharedLinksAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Shared Links + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageSharedLinksAllResponse withGetSharedLinksResponse(GetSharedLinksResponse getSharedLinksResponse) { - Utils.checkNotNull(getSharedLinksResponse, "getSharedLinksResponse"); - this.getSharedLinksResponse = Optional.ofNullable(getSharedLinksResponse); + public FileStorageSharedLinksAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageSharedLinksAllResponse withGetSharedLinksResponse(GetSharedLin /** * Shared Links */ - public FileStorageSharedLinksAllResponse withGetSharedLinksResponse(Optional getSharedLinksResponse) { - Utils.checkNotNull(getSharedLinksResponse, "getSharedLinksResponse"); + public FileStorageSharedLinksAllResponse withGetSharedLinksResponse(@Nullable GetSharedLinksResponse getSharedLinksResponse) { this.getSharedLinksResponse = getSharedLinksResponse; return this; } - /** - * Unexpected error - */ - public FileStorageSharedLinksAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageSharedLinksAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageSharedLinksAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getSharedLinksResponse = Optional.empty(); + private GetSharedLinksResponse getSharedLinksResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Shared Links - */ - public Builder getSharedLinksResponse(GetSharedLinksResponse getSharedLinksResponse) { - Utils.checkNotNull(getSharedLinksResponse, "getSharedLinksResponse"); - this.getSharedLinksResponse = Optional.ofNullable(getSharedLinksResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Shared Links */ - public Builder getSharedLinksResponse(Optional getSharedLinksResponse) { - Utils.checkNotNull(getSharedLinksResponse, "getSharedLinksResponse"); + public Builder getSharedLinksResponse(@Nullable GetSharedLinksResponse getSharedLinksResponse) { this.getSharedLinksResponse = getSharedLinksResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageSharedLinksAllResponse build() { - return new FileStorageSharedLinksAllResponse( contentType, statusCode, rawResponse, getSharedLinksResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteRequest.java index 6d0dca56..30b21cdf 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class FileStorageSharedLinksDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public FileStorageSharedLinksDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public FileStorageSharedLinksDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageSharedLinksDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageSharedLinksDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageSharedLinksDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public FileStorageSharedLinksDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageSharedLinksDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageSharedLinksDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageSharedLinksDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageSharedLinksDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageSharedLinksDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageSharedLinksDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageSharedLinksDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageSharedLinksDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageSharedLinksDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageSharedLinksDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageSharedLinksDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public FileStorageSharedLinksDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageSharedLinksDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteRequestBuilder.java index f5e04b1d..d24a7564 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageSharedLinksDeleteRequestBuilder { - - private FileStorageSharedLinksDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageSharedLinksDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageSharedLinksDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageSharedLinksDeleteRequestBuilder request(FileStorageSharedLinksDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageSharedLinksDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageSharedLinksDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageSharedLinksDeleteRequestBuilder request(@Nonnull FileStorageSharedLinksDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageSharedLinksDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageSharedLinksDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageSharedLinksDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteResponse.java index 0a5554f1..71a9e4b8 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageSharedLinksDeleteResponse implements Response { /** * Shared Links */ - private Optional deleteSharedLinkResponse; + private DeleteSharedLinkResponse deleteSharedLinkResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageSharedLinksDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteSharedLinkResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteSharedLinkResponse, "deleteSharedLinkResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteSharedLinkResponse deleteSharedLinkResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteSharedLinkResponse = deleteSharedLinkResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageSharedLinksDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Shared Links */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteSharedLinkResponse() { - return (Optional) deleteSharedLinkResponse; + return Optional.ofNullable(this.deleteSharedLinkResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageSharedLinksDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageSharedLinksDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageSharedLinksDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageSharedLinksDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Shared Links + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageSharedLinksDeleteResponse withDeleteSharedLinkResponse(DeleteSharedLinkResponse deleteSharedLinkResponse) { - Utils.checkNotNull(deleteSharedLinkResponse, "deleteSharedLinkResponse"); - this.deleteSharedLinkResponse = Optional.ofNullable(deleteSharedLinkResponse); + public FileStorageSharedLinksDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageSharedLinksDeleteResponse withDeleteSharedLinkResponse(DeleteS /** * Shared Links */ - public FileStorageSharedLinksDeleteResponse withDeleteSharedLinkResponse(Optional deleteSharedLinkResponse) { - Utils.checkNotNull(deleteSharedLinkResponse, "deleteSharedLinkResponse"); + public FileStorageSharedLinksDeleteResponse withDeleteSharedLinkResponse(@Nullable DeleteSharedLinkResponse deleteSharedLinkResponse) { this.deleteSharedLinkResponse = deleteSharedLinkResponse; return this; } - /** - * Unexpected error - */ - public FileStorageSharedLinksDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageSharedLinksDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageSharedLinksDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteSharedLinkResponse = Optional.empty(); + private DeleteSharedLinkResponse deleteSharedLinkResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Shared Links - */ - public Builder deleteSharedLinkResponse(DeleteSharedLinkResponse deleteSharedLinkResponse) { - Utils.checkNotNull(deleteSharedLinkResponse, "deleteSharedLinkResponse"); - this.deleteSharedLinkResponse = Optional.ofNullable(deleteSharedLinkResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Shared Links */ - public Builder deleteSharedLinkResponse(Optional deleteSharedLinkResponse) { - Utils.checkNotNull(deleteSharedLinkResponse, "deleteSharedLinkResponse"); + public Builder deleteSharedLinkResponse(@Nullable DeleteSharedLinkResponse deleteSharedLinkResponse) { this.deleteSharedLinkResponse = deleteSharedLinkResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageSharedLinksDeleteResponse build() { - return new FileStorageSharedLinksDeleteResponse( contentType, statusCode, rawResponse, deleteSharedLinkResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneRequest.java index 06212825..d4fdcd8d 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageSharedLinksOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class FileStorageSharedLinksOneRequest { @JsonCreator public FileStorageSharedLinksOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageSharedLinksOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageSharedLinksOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageSharedLinksOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageSharedLinksOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public FileStorageSharedLinksOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageSharedLinksOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageSharedLinksOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageSharedLinksOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageSharedLinksOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageSharedLinksOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageSharedLinksOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageSharedLinksOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageSharedLinksOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageSharedLinksOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageSharedLinksOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageSharedLinksOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageSharedLinksOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageSharedLinksOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageSharedLinksOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageSharedLinksOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageSharedLinksOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneRequestBuilder.java index 1900cd64..0c6642dd 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageSharedLinksOneRequestBuilder { - - private FileStorageSharedLinksOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageSharedLinksOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageSharedLinksOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageSharedLinksOneRequestBuilder request(FileStorageSharedLinksOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageSharedLinksOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageSharedLinksOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageSharedLinksOneRequestBuilder request(@Nonnull FileStorageSharedLinksOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageSharedLinksOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageSharedLinksOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageSharedLinksOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneResponse.java index a6039fa0..5b3a6d8a 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageSharedLinksOneResponse implements Response { /** * Shared Link */ - private Optional getSharedLinkResponse; + private GetSharedLinkResponse getSharedLinkResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageSharedLinksOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getSharedLinkResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getSharedLinkResponse, "getSharedLinkResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetSharedLinkResponse getSharedLinkResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getSharedLinkResponse = getSharedLinkResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageSharedLinksOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Shared Link */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getSharedLinkResponse() { - return (Optional) getSharedLinkResponse; + return Optional.ofNullable(this.getSharedLinkResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageSharedLinksOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageSharedLinksOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageSharedLinksOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageSharedLinksOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Shared Link + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageSharedLinksOneResponse withGetSharedLinkResponse(GetSharedLinkResponse getSharedLinkResponse) { - Utils.checkNotNull(getSharedLinkResponse, "getSharedLinkResponse"); - this.getSharedLinkResponse = Optional.ofNullable(getSharedLinkResponse); + public FileStorageSharedLinksOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageSharedLinksOneResponse withGetSharedLinkResponse(GetSharedLink /** * Shared Link */ - public FileStorageSharedLinksOneResponse withGetSharedLinkResponse(Optional getSharedLinkResponse) { - Utils.checkNotNull(getSharedLinkResponse, "getSharedLinkResponse"); + public FileStorageSharedLinksOneResponse withGetSharedLinkResponse(@Nullable GetSharedLinkResponse getSharedLinkResponse) { this.getSharedLinkResponse = getSharedLinkResponse; return this; } - /** - * Unexpected error - */ - public FileStorageSharedLinksOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageSharedLinksOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageSharedLinksOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getSharedLinkResponse = Optional.empty(); + private GetSharedLinkResponse getSharedLinkResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Shared Link - */ - public Builder getSharedLinkResponse(GetSharedLinkResponse getSharedLinkResponse) { - Utils.checkNotNull(getSharedLinkResponse, "getSharedLinkResponse"); - this.getSharedLinkResponse = Optional.ofNullable(getSharedLinkResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Shared Link */ - public Builder getSharedLinkResponse(Optional getSharedLinkResponse) { - Utils.checkNotNull(getSharedLinkResponse, "getSharedLinkResponse"); + public Builder getSharedLinkResponse(@Nullable GetSharedLinkResponse getSharedLinkResponse) { this.getSharedLinkResponse = getSharedLinkResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageSharedLinksOneResponse build() { - return new FileStorageSharedLinksOneResponse( contentType, statusCode, rawResponse, getSharedLinkResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateRequest.java index 2f891a35..b3286f36 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageSharedLinksUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class FileStorageSharedLinksUpdateRequest { @JsonCreator public FileStorageSharedLinksUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - SharedLinkInput sharedLink) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(sharedLink, "sharedLink"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull SharedLinkInput sharedLink) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.sharedLink = sharedLink; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.sharedLink = Optional.ofNullable(sharedLink) + .orElseThrow(() -> new IllegalArgumentException("sharedLink cannot be null")); } public FileStorageSharedLinksUpdateRequest( - String id, - SharedLinkInput sharedLink) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), sharedLink); + @Nonnull String id, + @Nonnull SharedLinkInput sharedLink) { + this(id, null, null, + null, null, sharedLink); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public SharedLinkInput sharedLink() { - return sharedLink; + return this.sharedLink; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageSharedLinksUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageSharedLinksUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageSharedLinksUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public FileStorageSharedLinksUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageSharedLinksUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageSharedLinksUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageSharedLinksUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageSharedLinksUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageSharedLinksUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageSharedLinksUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageSharedLinksUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageSharedLinksUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageSharedLinksUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageSharedLinksUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageSharedLinksUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public FileStorageSharedLinksUpdateRequest withSharedLink(SharedLinkInput sharedLink) { - Utils.checkNotNull(sharedLink, "sharedLink"); - this.sharedLink = sharedLink; + + public FileStorageSharedLinksUpdateRequest withSharedLink(@Nonnull SharedLinkInput sharedLink) { + this.sharedLink = Utils.checkNotNull(sharedLink, "sharedLink"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private SharedLinkInput sharedLink; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder sharedLink(SharedLinkInput sharedLink) { - Utils.checkNotNull(sharedLink, "sharedLink"); - this.sharedLink = sharedLink; + public Builder sharedLink(@Nonnull SharedLinkInput sharedLink) { + this.sharedLink = Utils.checkNotNull(sharedLink, "sharedLink"); return this; } public FileStorageSharedLinksUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageSharedLinksUpdateRequest( id, consumerId, appId, serviceId, raw, sharedLink); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateRequestBuilder.java index e65bb5d8..979847b4 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageSharedLinksUpdateRequestBuilder { - - private FileStorageSharedLinksUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageSharedLinksUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageSharedLinksUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageSharedLinksUpdateRequestBuilder request(FileStorageSharedLinksUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageSharedLinksUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageSharedLinksUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageSharedLinksUpdateRequestBuilder request(@Nonnull FileStorageSharedLinksUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageSharedLinksUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageSharedLinksUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageSharedLinksUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateResponse.java index 569e3ad9..43ec16df 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageSharedLinksUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageSharedLinksUpdateResponse implements Response { /** * Shared Links */ - private Optional updateSharedLinkResponse; + private UpdateSharedLinkResponse updateSharedLinkResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageSharedLinksUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateSharedLinkResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateSharedLinkResponse, "updateSharedLinkResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateSharedLinkResponse updateSharedLinkResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateSharedLinkResponse = updateSharedLinkResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageSharedLinksUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Shared Links */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateSharedLinkResponse() { - return (Optional) updateSharedLinkResponse; + return Optional.ofNullable(this.updateSharedLinkResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageSharedLinksUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageSharedLinksUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageSharedLinksUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageSharedLinksUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Shared Links + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageSharedLinksUpdateResponse withUpdateSharedLinkResponse(UpdateSharedLinkResponse updateSharedLinkResponse) { - Utils.checkNotNull(updateSharedLinkResponse, "updateSharedLinkResponse"); - this.updateSharedLinkResponse = Optional.ofNullable(updateSharedLinkResponse); + public FileStorageSharedLinksUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageSharedLinksUpdateResponse withUpdateSharedLinkResponse(UpdateS /** * Shared Links */ - public FileStorageSharedLinksUpdateResponse withUpdateSharedLinkResponse(Optional updateSharedLinkResponse) { - Utils.checkNotNull(updateSharedLinkResponse, "updateSharedLinkResponse"); + public FileStorageSharedLinksUpdateResponse withUpdateSharedLinkResponse(@Nullable UpdateSharedLinkResponse updateSharedLinkResponse) { this.updateSharedLinkResponse = updateSharedLinkResponse; return this; } - /** - * Unexpected error - */ - public FileStorageSharedLinksUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageSharedLinksUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageSharedLinksUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateSharedLinkResponse = Optional.empty(); + private UpdateSharedLinkResponse updateSharedLinkResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Shared Links - */ - public Builder updateSharedLinkResponse(UpdateSharedLinkResponse updateSharedLinkResponse) { - Utils.checkNotNull(updateSharedLinkResponse, "updateSharedLinkResponse"); - this.updateSharedLinkResponse = Optional.ofNullable(updateSharedLinkResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Shared Links */ - public Builder updateSharedLinkResponse(Optional updateSharedLinkResponse) { - Utils.checkNotNull(updateSharedLinkResponse, "updateSharedLinkResponse"); + public Builder updateSharedLinkResponse(@Nullable UpdateSharedLinkResponse updateSharedLinkResponse) { this.updateSharedLinkResponse = updateSharedLinkResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageSharedLinksUpdateResponse build() { - return new FileStorageSharedLinksUpdateResponse( contentType, statusCode, rawResponse, updateSharedLinkResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddRequest.java index 1a1c36e4..b7452d56 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class FileStorageUploadSessionsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class FileStorageUploadSessionsAddRequest { @JsonCreator public FileStorageUploadSessionsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - CreateUploadSessionRequest createUploadSessionRequest) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(createUploadSessionRequest, "createUploadSessionRequest"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull CreateUploadSessionRequest createUploadSessionRequest) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.createUploadSessionRequest = createUploadSessionRequest; + this.createUploadSessionRequest = Optional.ofNullable(createUploadSessionRequest) + .orElseThrow(() -> new IllegalArgumentException("createUploadSessionRequest cannot be null")); } public FileStorageUploadSessionsAddRequest( - CreateUploadSessionRequest createUploadSessionRequest) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), createUploadSessionRequest); + @Nonnull CreateUploadSessionRequest createUploadSessionRequest) { + this(null, null, null, + null, createUploadSessionRequest); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public CreateUploadSessionRequest createUploadSessionRequest() { - return createUploadSessionRequest; + return this.createUploadSessionRequest; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageUploadSessionsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageUploadSessionsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageUploadSessionsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageUploadSessionsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public FileStorageUploadSessionsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageUploadSessionsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageUploadSessionsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageUploadSessionsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageUploadSessionsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageUploadSessionsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageUploadSessionsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageUploadSessionsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public FileStorageUploadSessionsAddRequest withCreateUploadSessionRequest(CreateUploadSessionRequest createUploadSessionRequest) { - Utils.checkNotNull(createUploadSessionRequest, "createUploadSessionRequest"); - this.createUploadSessionRequest = createUploadSessionRequest; + + public FileStorageUploadSessionsAddRequest withCreateUploadSessionRequest(@Nonnull CreateUploadSessionRequest createUploadSessionRequest) { + this.createUploadSessionRequest = Utils.checkNotNull(createUploadSessionRequest, "createUploadSessionRequest"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private CreateUploadSessionRequest createUploadSessionRequest; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder createUploadSessionRequest(CreateUploadSessionRequest createUploadSessionRequest) { - Utils.checkNotNull(createUploadSessionRequest, "createUploadSessionRequest"); - this.createUploadSessionRequest = createUploadSessionRequest; + public Builder createUploadSessionRequest(@Nonnull CreateUploadSessionRequest createUploadSessionRequest) { + this.createUploadSessionRequest = Utils.checkNotNull(createUploadSessionRequest, "createUploadSessionRequest"); return this; } public FileStorageUploadSessionsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageUploadSessionsAddRequest( raw, consumerId, appId, serviceId, createUploadSessionRequest); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddRequestBuilder.java index 8d5bd048..267a88e0 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddRequestBuilder.java @@ -10,62 +10,54 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class FileStorageUploadSessionsAddRequestBuilder { - - private FileStorageUploadSessionsAddRequest request; - private Optional serverURL = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageUploadSessionsAddRequest request; + private String serverURL; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageUploadSessionsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageUploadSessionsAddRequestBuilder request(FileStorageUploadSessionsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; + public FileStorageUploadSessionsAddRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - public FileStorageUploadSessionsAddRequestBuilder serverURL(String serverURL) { - Utils.checkNotNull(serverURL, "serverURL"); - this.serverURL = Optional.of(serverURL); + + public FileStorageUploadSessionsAddRequestBuilder request(@Nonnull FileStorageUploadSessionsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } - public FileStorageUploadSessionsAddRequestBuilder serverURL(Optional serverURL) { - Utils.checkNotNull(serverURL, "serverURL"); + public FileStorageUploadSessionsAddRequestBuilder serverURL(@Nullable String serverURL) { this.serverURL = serverURL; return this; } - - public FileStorageUploadSessionsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); - return this; - } - public FileStorageUploadSessionsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; - return this; + private FileStorageUploadSessionsAddRequest _buildRequest() { + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageUploadSessionsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageUploadSessionsAddOperation( sdkConfiguration, serverURL, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddResponse.java index 243c371e..cfc1528e 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageUploadSessionsAddResponse implements Response { /** * UploadSessions */ - private Optional createUploadSessionResponse; + private CreateUploadSessionResponse createUploadSessionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageUploadSessionsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createUploadSessionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createUploadSessionResponse, "createUploadSessionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateUploadSessionResponse createUploadSessionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createUploadSessionResponse = createUploadSessionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageUploadSessionsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * UploadSessions */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createUploadSessionResponse() { - return (Optional) createUploadSessionResponse; + return Optional.ofNullable(this.createUploadSessionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageUploadSessionsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageUploadSessionsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageUploadSessionsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageUploadSessionsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * UploadSessions + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageUploadSessionsAddResponse withCreateUploadSessionResponse(CreateUploadSessionResponse createUploadSessionResponse) { - Utils.checkNotNull(createUploadSessionResponse, "createUploadSessionResponse"); - this.createUploadSessionResponse = Optional.ofNullable(createUploadSessionResponse); + public FileStorageUploadSessionsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageUploadSessionsAddResponse withCreateUploadSessionResponse(Crea /** * UploadSessions */ - public FileStorageUploadSessionsAddResponse withCreateUploadSessionResponse(Optional createUploadSessionResponse) { - Utils.checkNotNull(createUploadSessionResponse, "createUploadSessionResponse"); + public FileStorageUploadSessionsAddResponse withCreateUploadSessionResponse(@Nullable CreateUploadSessionResponse createUploadSessionResponse) { this.createUploadSessionResponse = createUploadSessionResponse; return this; } - /** - * Unexpected error - */ - public FileStorageUploadSessionsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageUploadSessionsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageUploadSessionsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createUploadSessionResponse = Optional.empty(); + private CreateUploadSessionResponse createUploadSessionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * UploadSessions - */ - public Builder createUploadSessionResponse(CreateUploadSessionResponse createUploadSessionResponse) { - Utils.checkNotNull(createUploadSessionResponse, "createUploadSessionResponse"); - this.createUploadSessionResponse = Optional.ofNullable(createUploadSessionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * UploadSessions */ - public Builder createUploadSessionResponse(Optional createUploadSessionResponse) { - Utils.checkNotNull(createUploadSessionResponse, "createUploadSessionResponse"); + public Builder createUploadSessionResponse(@Nullable CreateUploadSessionResponse createUploadSessionResponse) { this.createUploadSessionResponse = createUploadSessionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageUploadSessionsAddResponse build() { - return new FileStorageUploadSessionsAddResponse( contentType, statusCode, rawResponse, createUploadSessionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteRequest.java index 69712256..a7a9c387 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class FileStorageUploadSessionsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public FileStorageUploadSessionsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public FileStorageUploadSessionsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageUploadSessionsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageUploadSessionsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageUploadSessionsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public FileStorageUploadSessionsDeleteRequest withConsumerId(String consumerId) /** * ID of the consumer which you want to get or push data from */ - public FileStorageUploadSessionsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageUploadSessionsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageUploadSessionsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageUploadSessionsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageUploadSessionsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageUploadSessionsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageUploadSessionsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageUploadSessionsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageUploadSessionsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageUploadSessionsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageUploadSessionsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public FileStorageUploadSessionsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageUploadSessionsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteRequestBuilder.java index c6b23629..6aeff4fc 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class FileStorageUploadSessionsDeleteRequestBuilder { - - private FileStorageUploadSessionsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageUploadSessionsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageUploadSessionsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageUploadSessionsDeleteRequestBuilder request(FileStorageUploadSessionsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public FileStorageUploadSessionsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public FileStorageUploadSessionsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public FileStorageUploadSessionsDeleteRequestBuilder request(@Nonnull FileStorageUploadSessionsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private FileStorageUploadSessionsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageUploadSessionsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageUploadSessionsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteResponse.java index 801dba4e..813e2c8c 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageUploadSessionsDeleteResponse implements Response { /** * UploadSessions */ - private Optional deleteUploadSessionResponse; + private DeleteUploadSessionResponse deleteUploadSessionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageUploadSessionsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteUploadSessionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteUploadSessionResponse, "deleteUploadSessionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteUploadSessionResponse deleteUploadSessionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteUploadSessionResponse = deleteUploadSessionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageUploadSessionsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * UploadSessions */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteUploadSessionResponse() { - return (Optional) deleteUploadSessionResponse; + return Optional.ofNullable(this.deleteUploadSessionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageUploadSessionsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageUploadSessionsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageUploadSessionsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageUploadSessionsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * UploadSessions + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageUploadSessionsDeleteResponse withDeleteUploadSessionResponse(DeleteUploadSessionResponse deleteUploadSessionResponse) { - Utils.checkNotNull(deleteUploadSessionResponse, "deleteUploadSessionResponse"); - this.deleteUploadSessionResponse = Optional.ofNullable(deleteUploadSessionResponse); + public FileStorageUploadSessionsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageUploadSessionsDeleteResponse withDeleteUploadSessionResponse(D /** * UploadSessions */ - public FileStorageUploadSessionsDeleteResponse withDeleteUploadSessionResponse(Optional deleteUploadSessionResponse) { - Utils.checkNotNull(deleteUploadSessionResponse, "deleteUploadSessionResponse"); + public FileStorageUploadSessionsDeleteResponse withDeleteUploadSessionResponse(@Nullable DeleteUploadSessionResponse deleteUploadSessionResponse) { this.deleteUploadSessionResponse = deleteUploadSessionResponse; return this; } - /** - * Unexpected error - */ - public FileStorageUploadSessionsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageUploadSessionsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageUploadSessionsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteUploadSessionResponse = Optional.empty(); + private DeleteUploadSessionResponse deleteUploadSessionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * UploadSessions - */ - public Builder deleteUploadSessionResponse(DeleteUploadSessionResponse deleteUploadSessionResponse) { - Utils.checkNotNull(deleteUploadSessionResponse, "deleteUploadSessionResponse"); - this.deleteUploadSessionResponse = Optional.ofNullable(deleteUploadSessionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * UploadSessions */ - public Builder deleteUploadSessionResponse(Optional deleteUploadSessionResponse) { - Utils.checkNotNull(deleteUploadSessionResponse, "deleteUploadSessionResponse"); + public Builder deleteUploadSessionResponse(@Nullable DeleteUploadSessionResponse deleteUploadSessionResponse) { this.deleteUploadSessionResponse = deleteUploadSessionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageUploadSessionsDeleteResponse build() { - return new FileStorageUploadSessionsDeleteResponse( contentType, statusCode, rawResponse, deleteUploadSessionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequest.java index 8bc109aa..549100d9 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequest.java @@ -7,12 +7,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -27,54 +27,49 @@ public class FileStorageUploadSessionsFinishRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) */ @SpeakeasyMetadata("header:style=simple,explode=false,name=digest") - private Optional digest; + private String digest; @SpeakeasyMetadata("request:mediaType=application/json") - private Optional requestBody; + private FileStorageUploadSessionsFinishRequestBody requestBody; @JsonCreator public FileStorageUploadSessionsFinishRequest( - String id, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional digest, - Optional requestBody) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(digest, "digest"); - Utils.checkNotNull(requestBody, "requestBody"); - this.id = id; - this.raw = raw; + @Nonnull String id, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable String digest, + @Nullable FileStorageUploadSessionsFinishRequestBody requestBody) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; @@ -83,64 +78,56 @@ public FileStorageUploadSessionsFinishRequest( } public FileStorageUploadSessionsFinishRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) */ - @JsonIgnore public Optional digest() { - return digest; + return Optional.ofNullable(this.digest); } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional requestBody() { - return (Optional) requestBody; + return Optional.ofNullable(this.requestBody); } public static Builder builder() { @@ -151,18 +138,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageUploadSessionsFinishRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageUploadSessionsFinishRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public FileStorageUploadSessionsFinishRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -170,101 +147,54 @@ public FileStorageUploadSessionsFinishRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageUploadSessionsFinishRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageUploadSessionsFinishRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageUploadSessionsFinishRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public FileStorageUploadSessionsFinishRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageUploadSessionsFinishRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageUploadSessionsFinishRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageUploadSessionsFinishRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageUploadSessionsFinishRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageUploadSessionsFinishRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageUploadSessionsFinishRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageUploadSessionsFinishRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) - */ - public FileStorageUploadSessionsFinishRequest withDigest(String digest) { - Utils.checkNotNull(digest, "digest"); - this.digest = Optional.ofNullable(digest); - return this; - } - /** * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) */ - public FileStorageUploadSessionsFinishRequest withDigest(Optional digest) { - Utils.checkNotNull(digest, "digest"); + public FileStorageUploadSessionsFinishRequest withDigest(@Nullable String digest) { this.digest = digest; return this; } - public FileStorageUploadSessionsFinishRequest withRequestBody(FileStorageUploadSessionsFinishRequestBody requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = Optional.ofNullable(requestBody); - return this; - } - - public FileStorageUploadSessionsFinishRequest withRequestBody(Optional requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); + public FileStorageUploadSessionsFinishRequest withRequestBody(@Nullable FileStorageUploadSessionsFinishRequestBody requestBody) { this.requestBody = requestBody; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -309,145 +239,76 @@ public final static class Builder { private String id; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional digest = Optional.empty(); + private String digest; - private Optional requestBody = Optional.empty(); + private FileStorageUploadSessionsFinishRequestBody requestBody; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) */ - public Builder digest(String digest) { - Utils.checkNotNull(digest, "digest"); - this.digest = Optional.ofNullable(digest); - return this; - } - - /** - * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) - */ - public Builder digest(Optional digest) { - Utils.checkNotNull(digest, "digest"); + public Builder digest(@Nullable String digest) { this.digest = digest; return this; } - - public Builder requestBody(FileStorageUploadSessionsFinishRequestBody requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = Optional.ofNullable(requestBody); - return this; - } - - public Builder requestBody(Optional requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); + public Builder requestBody(@Nullable FileStorageUploadSessionsFinishRequestBody requestBody) { this.requestBody = requestBody; return this; } public FileStorageUploadSessionsFinishRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageUploadSessionsFinishRequest( id, raw, consumerId, appId, serviceId, digest, @@ -455,10 +316,10 @@ public FileStorageUploadSessionsFinishRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequestBody.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequestBody.java index 2a8bc267..5c1276c4 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequestBody.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequestBody.java @@ -49,7 +49,6 @@ private Builder() { } public FileStorageUploadSessionsFinishRequestBody build() { - return new FileStorageUploadSessionsFinishRequestBody( ); } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequestBuilder.java index f6bc095d..5765ceb8 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishRequestBuilder.java @@ -10,62 +10,54 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class FileStorageUploadSessionsFinishRequestBuilder { - - private FileStorageUploadSessionsFinishRequest request; - private Optional serverURL = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageUploadSessionsFinishRequest request; + private String serverURL; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageUploadSessionsFinishRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageUploadSessionsFinishRequestBuilder request(FileStorageUploadSessionsFinishRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; + public FileStorageUploadSessionsFinishRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - public FileStorageUploadSessionsFinishRequestBuilder serverURL(String serverURL) { - Utils.checkNotNull(serverURL, "serverURL"); - this.serverURL = Optional.of(serverURL); + + public FileStorageUploadSessionsFinishRequestBuilder request(@Nonnull FileStorageUploadSessionsFinishRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } - public FileStorageUploadSessionsFinishRequestBuilder serverURL(Optional serverURL) { - Utils.checkNotNull(serverURL, "serverURL"); + public FileStorageUploadSessionsFinishRequestBuilder serverURL(@Nullable String serverURL) { this.serverURL = serverURL; return this; } - - public FileStorageUploadSessionsFinishRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); - return this; - } - public FileStorageUploadSessionsFinishRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; - return this; + private FileStorageUploadSessionsFinishRequest _buildRequest() { + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageUploadSessionsFinishResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageUploadSessionsFinishOperation( sdkConfiguration, serverURL, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishResponse.java index 9bc74ad7..90226c7c 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsFinishResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageUploadSessionsFinishResponse implements Response { /** * File */ - private Optional getFileResponse; + private GetFileResponse getFileResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageUploadSessionsFinishResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getFileResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getFileResponse, "getFileResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetFileResponse getFileResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getFileResponse = getFileResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageUploadSessionsFinishResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * File */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getFileResponse() { - return (Optional) getFileResponse; + return Optional.ofNullable(this.getFileResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageUploadSessionsFinishResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageUploadSessionsFinishResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageUploadSessionsFinishResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageUploadSessionsFinishResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * File + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageUploadSessionsFinishResponse withGetFileResponse(GetFileResponse getFileResponse) { - Utils.checkNotNull(getFileResponse, "getFileResponse"); - this.getFileResponse = Optional.ofNullable(getFileResponse); + public FileStorageUploadSessionsFinishResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageUploadSessionsFinishResponse withGetFileResponse(GetFileRespon /** * File */ - public FileStorageUploadSessionsFinishResponse withGetFileResponse(Optional getFileResponse) { - Utils.checkNotNull(getFileResponse, "getFileResponse"); + public FileStorageUploadSessionsFinishResponse withGetFileResponse(@Nullable GetFileResponse getFileResponse) { this.getFileResponse = getFileResponse; return this; } - /** - * Unexpected error - */ - public FileStorageUploadSessionsFinishResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageUploadSessionsFinishResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageUploadSessionsFinishResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getFileResponse = Optional.empty(); + private GetFileResponse getFileResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * File - */ - public Builder getFileResponse(GetFileResponse getFileResponse) { - Utils.checkNotNull(getFileResponse, "getFileResponse"); - this.getFileResponse = Optional.ofNullable(getFileResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * File */ - public Builder getFileResponse(Optional getFileResponse) { - Utils.checkNotNull(getFileResponse, "getFileResponse"); + public Builder getFileResponse(@Nullable GetFileResponse getFileResponse) { this.getFileResponse = getFileResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageUploadSessionsFinishResponse build() { - return new FileStorageUploadSessionsFinishResponse( contentType, statusCode, rawResponse, getFileResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneRequest.java index 8717e238..5a50d289 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class FileStorageUploadSessionsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class FileStorageUploadSessionsOneRequest { @JsonCreator public FileStorageUploadSessionsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public FileStorageUploadSessionsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageUploadSessionsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageUploadSessionsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageUploadSessionsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public FileStorageUploadSessionsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public FileStorageUploadSessionsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageUploadSessionsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageUploadSessionsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageUploadSessionsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageUploadSessionsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageUploadSessionsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageUploadSessionsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageUploadSessionsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageUploadSessionsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageUploadSessionsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageUploadSessionsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public FileStorageUploadSessionsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public FileStorageUploadSessionsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public FileStorageUploadSessionsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public FileStorageUploadSessionsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageUploadSessionsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneRequestBuilder.java index a74dff69..99c4920e 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneRequestBuilder.java @@ -10,62 +10,54 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class FileStorageUploadSessionsOneRequestBuilder { - - private FileStorageUploadSessionsOneRequest request; - private Optional serverURL = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageUploadSessionsOneRequest request; + private String serverURL; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageUploadSessionsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageUploadSessionsOneRequestBuilder request(FileStorageUploadSessionsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; + public FileStorageUploadSessionsOneRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - public FileStorageUploadSessionsOneRequestBuilder serverURL(String serverURL) { - Utils.checkNotNull(serverURL, "serverURL"); - this.serverURL = Optional.of(serverURL); + + public FileStorageUploadSessionsOneRequestBuilder request(@Nonnull FileStorageUploadSessionsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } - public FileStorageUploadSessionsOneRequestBuilder serverURL(Optional serverURL) { - Utils.checkNotNull(serverURL, "serverURL"); + public FileStorageUploadSessionsOneRequestBuilder serverURL(@Nullable String serverURL) { this.serverURL = serverURL; return this; } - - public FileStorageUploadSessionsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); - return this; - } - public FileStorageUploadSessionsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; - return this; + private FileStorageUploadSessionsOneRequest _buildRequest() { + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageUploadSessionsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageUploadSessionsOneOperation( sdkConfiguration, serverURL, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneResponse.java index 29f35fed..94b67827 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageUploadSessionsOneResponse implements Response { /** * UploadSessions */ - private Optional getUploadSessionResponse; + private GetUploadSessionResponse getUploadSessionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageUploadSessionsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getUploadSessionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getUploadSessionResponse, "getUploadSessionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetUploadSessionResponse getUploadSessionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getUploadSessionResponse = getUploadSessionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageUploadSessionsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * UploadSessions */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getUploadSessionResponse() { - return (Optional) getUploadSessionResponse; + return Optional.ofNullable(this.getUploadSessionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageUploadSessionsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageUploadSessionsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageUploadSessionsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageUploadSessionsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * UploadSessions + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageUploadSessionsOneResponse withGetUploadSessionResponse(GetUploadSessionResponse getUploadSessionResponse) { - Utils.checkNotNull(getUploadSessionResponse, "getUploadSessionResponse"); - this.getUploadSessionResponse = Optional.ofNullable(getUploadSessionResponse); + public FileStorageUploadSessionsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageUploadSessionsOneResponse withGetUploadSessionResponse(GetUplo /** * UploadSessions */ - public FileStorageUploadSessionsOneResponse withGetUploadSessionResponse(Optional getUploadSessionResponse) { - Utils.checkNotNull(getUploadSessionResponse, "getUploadSessionResponse"); + public FileStorageUploadSessionsOneResponse withGetUploadSessionResponse(@Nullable GetUploadSessionResponse getUploadSessionResponse) { this.getUploadSessionResponse = getUploadSessionResponse; return this; } - /** - * Unexpected error - */ - public FileStorageUploadSessionsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageUploadSessionsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageUploadSessionsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getUploadSessionResponse = Optional.empty(); + private GetUploadSessionResponse getUploadSessionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * UploadSessions - */ - public Builder getUploadSessionResponse(GetUploadSessionResponse getUploadSessionResponse) { - Utils.checkNotNull(getUploadSessionResponse, "getUploadSessionResponse"); - this.getUploadSessionResponse = Optional.ofNullable(getUploadSessionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * UploadSessions */ - public Builder getUploadSessionResponse(Optional getUploadSessionResponse) { - Utils.checkNotNull(getUploadSessionResponse, "getUploadSessionResponse"); + public Builder getUploadSessionResponse(@Nullable GetUploadSessionResponse getUploadSessionResponse) { this.getUploadSessionResponse = getUploadSessionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageUploadSessionsOneResponse build() { - return new FileStorageUploadSessionsOneResponse( contentType, statusCode, rawResponse, getUploadSessionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadRequest.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadRequest.java index 820aaa5f..0856dc60 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadRequest.java @@ -7,10 +7,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; -import java.lang.Double; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -27,19 +27,19 @@ public class FileStorageUploadSessionsUploadRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Part number of the file part being uploaded. @@ -51,13 +51,13 @@ public class FileStorageUploadSessionsUploadRequest { * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) */ @SpeakeasyMetadata("header:style=simple,explode=false,name=digest") - private Optional digest; + private String digest; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=*/*") @@ -65,100 +65,87 @@ public class FileStorageUploadSessionsUploadRequest { @JsonCreator public FileStorageUploadSessionsUploadRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, double partNumber, - Optional digest, - Optional raw, - byte[] requestBody) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(partNumber, "partNumber"); - Utils.checkNotNull(digest, "digest"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(requestBody, "requestBody"); - this.id = id; + @Nullable String digest, + @Nullable Boolean raw, + @Nonnull byte[] requestBody) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; this.partNumber = partNumber; this.digest = digest; - this.raw = raw; - this.requestBody = requestBody; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.requestBody = Optional.ofNullable(requestBody) + .orElseThrow(() -> new IllegalArgumentException("requestBody cannot be null")); } public FileStorageUploadSessionsUploadRequest( - String id, + @Nonnull String id, double partNumber, - byte[] requestBody) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), partNumber, Optional.empty(), - Optional.empty(), requestBody); + @Nonnull byte[] requestBody) { + this(id, null, null, + null, partNumber, null, + null, requestBody); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Part number of the file part being uploaded. */ - @JsonIgnore public double partNumber() { - return partNumber; + return this.partNumber; } /** * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) */ - @JsonIgnore public Optional digest() { - return digest; + return Optional.ofNullable(this.digest); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public byte[] requestBody() { - return requestBody; + return this.requestBody; } public static Builder builder() { @@ -169,18 +156,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public FileStorageUploadSessionsUploadRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public FileStorageUploadSessionsUploadRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public FileStorageUploadSessionsUploadRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -188,103 +165,63 @@ public FileStorageUploadSessionsUploadRequest withConsumerId(String consumerId) /** * ID of the consumer which you want to get or push data from */ - public FileStorageUploadSessionsUploadRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public FileStorageUploadSessionsUploadRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public FileStorageUploadSessionsUploadRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public FileStorageUploadSessionsUploadRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public FileStorageUploadSessionsUploadRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public FileStorageUploadSessionsUploadRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public FileStorageUploadSessionsUploadRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public FileStorageUploadSessionsUploadRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * Part number of the file part being uploaded. */ public FileStorageUploadSessionsUploadRequest withPartNumber(double partNumber) { - Utils.checkNotNull(partNumber, "partNumber"); this.partNumber = partNumber; return this; } - /** - * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) - */ - public FileStorageUploadSessionsUploadRequest withDigest(String digest) { - Utils.checkNotNull(digest, "digest"); - this.digest = Optional.ofNullable(digest); - return this; - } - /** * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) */ - public FileStorageUploadSessionsUploadRequest withDigest(Optional digest) { - Utils.checkNotNull(digest, "digest"); + public FileStorageUploadSessionsUploadRequest withDigest(@Nullable String digest) { this.digest = digest; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public FileStorageUploadSessionsUploadRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public FileStorageUploadSessionsUploadRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public FileStorageUploadSessionsUploadRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public FileStorageUploadSessionsUploadRequest withRequestBody(byte[] requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = requestBody; + + public FileStorageUploadSessionsUploadRequest withRequestBody(@Nonnull byte[] requestBody) { + this.requestBody = Utils.checkNotNull(requestBody, "requestBody"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -331,17 +268,17 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Double partNumber; + private double partNumber; - private Optional digest = Optional.empty(); + private String digest; - private Optional raw; + private Boolean raw; private byte[] requestBody; @@ -349,133 +286,68 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Part number of the file part being uploaded. */ public Builder partNumber(double partNumber) { - Utils.checkNotNull(partNumber, "partNumber"); this.partNumber = partNumber; return this; } - - /** - * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) - */ - public Builder digest(String digest) { - Utils.checkNotNull(digest, "digest"); - this.digest = Optional.ofNullable(digest); - return this; - } - /** * The RFC3230 message digest of the uploaded part. Only required for the Box connector. More information on the Box API docs [here](https://developer.box.com/reference/put-files-upload-sessions-id/#param-digest) */ - public Builder digest(Optional digest) { - Utils.checkNotNull(digest, "digest"); + public Builder digest(@Nullable String digest) { this.digest = digest; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder requestBody(byte[] requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = requestBody; + public Builder requestBody(@Nonnull byte[] requestBody) { + this.requestBody = Utils.checkNotNull(requestBody, "requestBody"); return this; } public FileStorageUploadSessionsUploadRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new FileStorageUploadSessionsUploadRequest( id, consumerId, appId, serviceId, partNumber, digest, @@ -483,10 +355,10 @@ public FileStorageUploadSessionsUploadRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadRequestBuilder.java index d590b515..934df229 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadRequestBuilder.java @@ -10,62 +10,54 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class FileStorageUploadSessionsUploadRequestBuilder { - - private FileStorageUploadSessionsUploadRequest request; - private Optional serverURL = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private FileStorageUploadSessionsUploadRequest request; + private String serverURL; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public FileStorageUploadSessionsUploadRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public FileStorageUploadSessionsUploadRequestBuilder request(FileStorageUploadSessionsUploadRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; + public FileStorageUploadSessionsUploadRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - public FileStorageUploadSessionsUploadRequestBuilder serverURL(String serverURL) { - Utils.checkNotNull(serverURL, "serverURL"); - this.serverURL = Optional.of(serverURL); + + public FileStorageUploadSessionsUploadRequestBuilder request(@Nonnull FileStorageUploadSessionsUploadRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } - public FileStorageUploadSessionsUploadRequestBuilder serverURL(Optional serverURL) { - Utils.checkNotNull(serverURL, "serverURL"); + public FileStorageUploadSessionsUploadRequestBuilder serverURL(@Nullable String serverURL) { this.serverURL = serverURL; return this; } - - public FileStorageUploadSessionsUploadRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); - return this; - } - public FileStorageUploadSessionsUploadRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; - return this; + private FileStorageUploadSessionsUploadRequest _buildRequest() { + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public FileStorageUploadSessionsUploadResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new FileStorageUploadSessionsUploadOperation( sdkConfiguration, serverURL, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadResponse.java b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadResponse.java index 1f9e7e5c..fe83d77a 100644 --- a/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/FileStorageUploadSessionsUploadResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class FileStorageUploadSessionsUploadResponse implements Response { /** * UploadSessions */ - private Optional updateUploadSessionResponse; + private UpdateUploadSessionResponse updateUploadSessionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public FileStorageUploadSessionsUploadResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateUploadSessionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateUploadSessionResponse, "updateUploadSessionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateUploadSessionResponse updateUploadSessionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateUploadSessionResponse = updateUploadSessionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public FileStorageUploadSessionsUploadResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * UploadSessions */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateUploadSessionResponse() { - return (Optional) updateUploadSessionResponse; + return Optional.ofNullable(this.updateUploadSessionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public FileStorageUploadSessionsUploadResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public FileStorageUploadSessionsUploadResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public FileStorageUploadSessionsUploadResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public FileStorageUploadSessionsUploadResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * UploadSessions + * Raw HTTP response; suitable for custom response parsing */ - public FileStorageUploadSessionsUploadResponse withUpdateUploadSessionResponse(UpdateUploadSessionResponse updateUploadSessionResponse) { - Utils.checkNotNull(updateUploadSessionResponse, "updateUploadSessionResponse"); - this.updateUploadSessionResponse = Optional.ofNullable(updateUploadSessionResponse); + public FileStorageUploadSessionsUploadResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public FileStorageUploadSessionsUploadResponse withUpdateUploadSessionResponse(U /** * UploadSessions */ - public FileStorageUploadSessionsUploadResponse withUpdateUploadSessionResponse(Optional updateUploadSessionResponse) { - Utils.checkNotNull(updateUploadSessionResponse, "updateUploadSessionResponse"); + public FileStorageUploadSessionsUploadResponse withUpdateUploadSessionResponse(@Nullable UpdateUploadSessionResponse updateUploadSessionResponse) { this.updateUploadSessionResponse = updateUploadSessionResponse; return this; } - /** - * Unexpected error - */ - public FileStorageUploadSessionsUploadResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public FileStorageUploadSessionsUploadResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public FileStorageUploadSessionsUploadResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateUploadSessionResponse = Optional.empty(); + private UpdateUploadSessionResponse updateUploadSessionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * UploadSessions - */ - public Builder updateUploadSessionResponse(UpdateUploadSessionResponse updateUploadSessionResponse) { - Utils.checkNotNull(updateUploadSessionResponse, "updateUploadSessionResponse"); - this.updateUploadSessionResponse = Optional.ofNullable(updateUploadSessionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * UploadSessions */ - public Builder updateUploadSessionResponse(Optional updateUploadSessionResponse) { - Utils.checkNotNull(updateUploadSessionResponse, "updateUploadSessionResponse"); + public Builder updateUploadSessionResponse(@Nullable UpdateUploadSessionResponse updateUploadSessionResponse) { this.updateUploadSessionResponse = updateUploadSessionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public FileStorageUploadSessionsUploadResponse build() { - return new FileStorageUploadSessionsUploadResponse( contentType, statusCode, rawResponse, updateUploadSessionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddRequest.java index 08c87dfc..60896b2c 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class HrisCompaniesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class HrisCompaniesAddRequest { @JsonCreator public HrisCompaniesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - HrisCompanyInput hrisCompany) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(hrisCompany, "hrisCompany"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull HrisCompanyInput hrisCompany) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.hrisCompany = hrisCompany; + this.hrisCompany = Optional.ofNullable(hrisCompany) + .orElseThrow(() -> new IllegalArgumentException("hrisCompany cannot be null")); } public HrisCompaniesAddRequest( - HrisCompanyInput hrisCompany) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), hrisCompany); + @Nonnull HrisCompanyInput hrisCompany) { + this(null, null, null, + null, hrisCompany); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public HrisCompanyInput hrisCompany() { - return hrisCompany; + return this.hrisCompany; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public HrisCompaniesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisCompaniesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisCompaniesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisCompaniesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisCompaniesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisCompaniesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisCompaniesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisCompaniesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisCompaniesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisCompaniesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisCompaniesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisCompaniesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public HrisCompaniesAddRequest withHrisCompany(HrisCompanyInput hrisCompany) { - Utils.checkNotNull(hrisCompany, "hrisCompany"); - this.hrisCompany = hrisCompany; + + public HrisCompaniesAddRequest withHrisCompany(@Nonnull HrisCompanyInput hrisCompany) { + this.hrisCompany = Utils.checkNotNull(hrisCompany, "hrisCompany"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private HrisCompanyInput hrisCompany; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder hrisCompany(HrisCompanyInput hrisCompany) { - Utils.checkNotNull(hrisCompany, "hrisCompany"); - this.hrisCompany = hrisCompany; + public Builder hrisCompany(@Nonnull HrisCompanyInput hrisCompany) { + this.hrisCompany = Utils.checkNotNull(hrisCompany, "hrisCompany"); return this; } public HrisCompaniesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisCompaniesAddRequest( raw, consumerId, appId, serviceId, hrisCompany); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddRequestBuilder.java index 0ad6af6a..1166984c 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisCompaniesAddRequestBuilder { - - private HrisCompaniesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisCompaniesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisCompaniesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisCompaniesAddRequestBuilder request(HrisCompaniesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisCompaniesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisCompaniesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisCompaniesAddRequestBuilder request(@Nonnull HrisCompaniesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisCompaniesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisCompaniesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisCompaniesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddResponse.java index 726950e7..4890d69e 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisCompaniesAddResponse implements Response { /** * Companies */ - private Optional createHrisCompanyResponse; + private CreateHrisCompanyResponse createHrisCompanyResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisCompaniesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createHrisCompanyResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createHrisCompanyResponse, "createHrisCompanyResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateHrisCompanyResponse createHrisCompanyResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createHrisCompanyResponse = createHrisCompanyResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisCompaniesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Companies */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createHrisCompanyResponse() { - return (Optional) createHrisCompanyResponse; + return Optional.ofNullable(this.createHrisCompanyResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisCompaniesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisCompaniesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisCompaniesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisCompaniesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Companies + * Raw HTTP response; suitable for custom response parsing */ - public HrisCompaniesAddResponse withCreateHrisCompanyResponse(CreateHrisCompanyResponse createHrisCompanyResponse) { - Utils.checkNotNull(createHrisCompanyResponse, "createHrisCompanyResponse"); - this.createHrisCompanyResponse = Optional.ofNullable(createHrisCompanyResponse); + public HrisCompaniesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisCompaniesAddResponse withCreateHrisCompanyResponse(CreateHrisCompanyR /** * Companies */ - public HrisCompaniesAddResponse withCreateHrisCompanyResponse(Optional createHrisCompanyResponse) { - Utils.checkNotNull(createHrisCompanyResponse, "createHrisCompanyResponse"); + public HrisCompaniesAddResponse withCreateHrisCompanyResponse(@Nullable CreateHrisCompanyResponse createHrisCompanyResponse) { this.createHrisCompanyResponse = createHrisCompanyResponse; return this; } - /** - * Unexpected error - */ - public HrisCompaniesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisCompaniesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisCompaniesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createHrisCompanyResponse = Optional.empty(); + private CreateHrisCompanyResponse createHrisCompanyResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Companies - */ - public Builder createHrisCompanyResponse(CreateHrisCompanyResponse createHrisCompanyResponse) { - Utils.checkNotNull(createHrisCompanyResponse, "createHrisCompanyResponse"); - this.createHrisCompanyResponse = Optional.ofNullable(createHrisCompanyResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Companies */ - public Builder createHrisCompanyResponse(Optional createHrisCompanyResponse) { - Utils.checkNotNull(createHrisCompanyResponse, "createHrisCompanyResponse"); + public Builder createHrisCompanyResponse(@Nullable CreateHrisCompanyResponse createHrisCompanyResponse) { this.createHrisCompanyResponse = createHrisCompanyResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisCompaniesAddResponse build() { - return new HrisCompaniesAddResponse( contentType, statusCode, rawResponse, createHrisCompanyResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllRequest.java index d488817f..7c1f9a89 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class HrisCompaniesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class HrisCompaniesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class HrisCompaniesAllRequest { @JsonCreator public HrisCompaniesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisCompaniesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public HrisCompaniesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisCompaniesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisCompaniesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisCompaniesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisCompaniesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisCompaniesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisCompaniesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisCompaniesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisCompaniesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisCompaniesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisCompaniesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisCompaniesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public HrisCompaniesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public HrisCompaniesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public HrisCompaniesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public HrisCompaniesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public HrisCompaniesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public HrisCompaniesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public HrisCompaniesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public HrisCompaniesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public HrisCompaniesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public HrisCompaniesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisCompaniesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisCompaniesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisCompaniesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisCompaniesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new HrisCompaniesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public HrisCompaniesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllRequestBuilder.java index fe67122d..64953dba 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class HrisCompaniesAllRequestBuilder { - - private HrisCompaniesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisCompaniesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisCompaniesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisCompaniesAllRequestBuilder request(HrisCompaniesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisCompaniesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisCompaniesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisCompaniesAllRequestBuilder request(@Nonnull HrisCompaniesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisCompaniesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisCompaniesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisCompaniesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public HrisCompaniesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new HrisCompaniesAllOperation( - sdkConfiguration, - options); + HrisCompaniesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new HrisCompaniesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - HrisCompaniesAllRequest::withCursor, + HrisCompaniesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllResponse.java index a58c960c..8a83cd92 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisCompaniesAllResponse implements Response { /** * Companies */ - private Optional getHrisCompaniesResponse; + private GetHrisCompaniesResponse getHrisCompaniesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisCompaniesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getHrisCompaniesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getHrisCompaniesResponse, "getHrisCompaniesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetHrisCompaniesResponse getHrisCompaniesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getHrisCompaniesResponse = getHrisCompaniesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisCompaniesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Companies */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getHrisCompaniesResponse() { - return (Optional) getHrisCompaniesResponse; + return Optional.ofNullable(this.getHrisCompaniesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisCompaniesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisCompaniesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisCompaniesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisCompaniesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Companies + * Raw HTTP response; suitable for custom response parsing */ - public HrisCompaniesAllResponse withGetHrisCompaniesResponse(GetHrisCompaniesResponse getHrisCompaniesResponse) { - Utils.checkNotNull(getHrisCompaniesResponse, "getHrisCompaniesResponse"); - this.getHrisCompaniesResponse = Optional.ofNullable(getHrisCompaniesResponse); + public HrisCompaniesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisCompaniesAllResponse withGetHrisCompaniesResponse(GetHrisCompaniesRes /** * Companies */ - public HrisCompaniesAllResponse withGetHrisCompaniesResponse(Optional getHrisCompaniesResponse) { - Utils.checkNotNull(getHrisCompaniesResponse, "getHrisCompaniesResponse"); + public HrisCompaniesAllResponse withGetHrisCompaniesResponse(@Nullable GetHrisCompaniesResponse getHrisCompaniesResponse) { this.getHrisCompaniesResponse = getHrisCompaniesResponse; return this; } - /** - * Unexpected error - */ - public HrisCompaniesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisCompaniesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisCompaniesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getHrisCompaniesResponse = Optional.empty(); + private GetHrisCompaniesResponse getHrisCompaniesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Companies - */ - public Builder getHrisCompaniesResponse(GetHrisCompaniesResponse getHrisCompaniesResponse) { - Utils.checkNotNull(getHrisCompaniesResponse, "getHrisCompaniesResponse"); - this.getHrisCompaniesResponse = Optional.ofNullable(getHrisCompaniesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Companies */ - public Builder getHrisCompaniesResponse(Optional getHrisCompaniesResponse) { - Utils.checkNotNull(getHrisCompaniesResponse, "getHrisCompaniesResponse"); + public Builder getHrisCompaniesResponse(@Nullable GetHrisCompaniesResponse getHrisCompaniesResponse) { this.getHrisCompaniesResponse = getHrisCompaniesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisCompaniesAllResponse build() { - return new HrisCompaniesAllResponse( contentType, statusCode, rawResponse, getHrisCompaniesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteRequest.java index c3f9a210..ce781566 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class HrisCompaniesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public HrisCompaniesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public HrisCompaniesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisCompaniesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisCompaniesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisCompaniesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public HrisCompaniesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisCompaniesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisCompaniesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisCompaniesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisCompaniesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisCompaniesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisCompaniesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisCompaniesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisCompaniesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisCompaniesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisCompaniesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisCompaniesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public HrisCompaniesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisCompaniesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteRequestBuilder.java index 0fbe38cb..2dd15c5c 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisCompaniesDeleteRequestBuilder { - - private HrisCompaniesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisCompaniesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisCompaniesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisCompaniesDeleteRequestBuilder request(HrisCompaniesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisCompaniesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisCompaniesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisCompaniesDeleteRequestBuilder request(@Nonnull HrisCompaniesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisCompaniesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisCompaniesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisCompaniesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteResponse.java index a6b7708b..74863381 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisCompaniesDeleteResponse implements Response { /** * Companies */ - private Optional deleteHrisCompanyResponse; + private DeleteHrisCompanyResponse deleteHrisCompanyResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisCompaniesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteHrisCompanyResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteHrisCompanyResponse, "deleteHrisCompanyResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteHrisCompanyResponse deleteHrisCompanyResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteHrisCompanyResponse = deleteHrisCompanyResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisCompaniesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Companies */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteHrisCompanyResponse() { - return (Optional) deleteHrisCompanyResponse; + return Optional.ofNullable(this.deleteHrisCompanyResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisCompaniesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisCompaniesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisCompaniesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisCompaniesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Companies + * Raw HTTP response; suitable for custom response parsing */ - public HrisCompaniesDeleteResponse withDeleteHrisCompanyResponse(DeleteHrisCompanyResponse deleteHrisCompanyResponse) { - Utils.checkNotNull(deleteHrisCompanyResponse, "deleteHrisCompanyResponse"); - this.deleteHrisCompanyResponse = Optional.ofNullable(deleteHrisCompanyResponse); + public HrisCompaniesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisCompaniesDeleteResponse withDeleteHrisCompanyResponse(DeleteHrisCompa /** * Companies */ - public HrisCompaniesDeleteResponse withDeleteHrisCompanyResponse(Optional deleteHrisCompanyResponse) { - Utils.checkNotNull(deleteHrisCompanyResponse, "deleteHrisCompanyResponse"); + public HrisCompaniesDeleteResponse withDeleteHrisCompanyResponse(@Nullable DeleteHrisCompanyResponse deleteHrisCompanyResponse) { this.deleteHrisCompanyResponse = deleteHrisCompanyResponse; return this; } - /** - * Unexpected error - */ - public HrisCompaniesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisCompaniesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisCompaniesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteHrisCompanyResponse = Optional.empty(); + private DeleteHrisCompanyResponse deleteHrisCompanyResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Companies - */ - public Builder deleteHrisCompanyResponse(DeleteHrisCompanyResponse deleteHrisCompanyResponse) { - Utils.checkNotNull(deleteHrisCompanyResponse, "deleteHrisCompanyResponse"); - this.deleteHrisCompanyResponse = Optional.ofNullable(deleteHrisCompanyResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Companies */ - public Builder deleteHrisCompanyResponse(Optional deleteHrisCompanyResponse) { - Utils.checkNotNull(deleteHrisCompanyResponse, "deleteHrisCompanyResponse"); + public Builder deleteHrisCompanyResponse(@Nullable DeleteHrisCompanyResponse deleteHrisCompanyResponse) { this.deleteHrisCompanyResponse = deleteHrisCompanyResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisCompaniesDeleteResponse build() { - return new HrisCompaniesDeleteResponse( contentType, statusCode, rawResponse, deleteHrisCompanyResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneRequest.java index 431d6b1c..a028f400 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class HrisCompaniesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class HrisCompaniesOneRequest { @JsonCreator public HrisCompaniesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisCompaniesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisCompaniesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisCompaniesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisCompaniesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public HrisCompaniesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisCompaniesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisCompaniesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisCompaniesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisCompaniesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisCompaniesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisCompaniesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisCompaniesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisCompaniesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisCompaniesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisCompaniesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisCompaniesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisCompaniesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisCompaniesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisCompaniesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisCompaniesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisCompaniesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneRequestBuilder.java index 2e063b60..9676fe91 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisCompaniesOneRequestBuilder { - - private HrisCompaniesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisCompaniesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisCompaniesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisCompaniesOneRequestBuilder request(HrisCompaniesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisCompaniesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisCompaniesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisCompaniesOneRequestBuilder request(@Nonnull HrisCompaniesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisCompaniesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisCompaniesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisCompaniesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneResponse.java index 68e796a2..805e189c 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisCompaniesOneResponse implements Response { /** * Company */ - private Optional getHrisCompanyResponse; + private GetHrisCompanyResponse getHrisCompanyResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisCompaniesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getHrisCompanyResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getHrisCompanyResponse, "getHrisCompanyResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetHrisCompanyResponse getHrisCompanyResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getHrisCompanyResponse = getHrisCompanyResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisCompaniesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Company */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getHrisCompanyResponse() { - return (Optional) getHrisCompanyResponse; + return Optional.ofNullable(this.getHrisCompanyResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisCompaniesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisCompaniesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisCompaniesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisCompaniesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Company + * Raw HTTP response; suitable for custom response parsing */ - public HrisCompaniesOneResponse withGetHrisCompanyResponse(GetHrisCompanyResponse getHrisCompanyResponse) { - Utils.checkNotNull(getHrisCompanyResponse, "getHrisCompanyResponse"); - this.getHrisCompanyResponse = Optional.ofNullable(getHrisCompanyResponse); + public HrisCompaniesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisCompaniesOneResponse withGetHrisCompanyResponse(GetHrisCompanyRespons /** * Company */ - public HrisCompaniesOneResponse withGetHrisCompanyResponse(Optional getHrisCompanyResponse) { - Utils.checkNotNull(getHrisCompanyResponse, "getHrisCompanyResponse"); + public HrisCompaniesOneResponse withGetHrisCompanyResponse(@Nullable GetHrisCompanyResponse getHrisCompanyResponse) { this.getHrisCompanyResponse = getHrisCompanyResponse; return this; } - /** - * Unexpected error - */ - public HrisCompaniesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisCompaniesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisCompaniesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getHrisCompanyResponse = Optional.empty(); + private GetHrisCompanyResponse getHrisCompanyResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Company - */ - public Builder getHrisCompanyResponse(GetHrisCompanyResponse getHrisCompanyResponse) { - Utils.checkNotNull(getHrisCompanyResponse, "getHrisCompanyResponse"); - this.getHrisCompanyResponse = Optional.ofNullable(getHrisCompanyResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Company */ - public Builder getHrisCompanyResponse(Optional getHrisCompanyResponse) { - Utils.checkNotNull(getHrisCompanyResponse, "getHrisCompanyResponse"); + public Builder getHrisCompanyResponse(@Nullable GetHrisCompanyResponse getHrisCompanyResponse) { this.getHrisCompanyResponse = getHrisCompanyResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisCompaniesOneResponse build() { - return new HrisCompaniesOneResponse( contentType, statusCode, rawResponse, getHrisCompanyResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateRequest.java index 35b69ee7..be567fec 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class HrisCompaniesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class HrisCompaniesUpdateRequest { @JsonCreator public HrisCompaniesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - HrisCompanyInput hrisCompany) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(hrisCompany, "hrisCompany"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull HrisCompanyInput hrisCompany) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.hrisCompany = hrisCompany; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.hrisCompany = Optional.ofNullable(hrisCompany) + .orElseThrow(() -> new IllegalArgumentException("hrisCompany cannot be null")); } public HrisCompaniesUpdateRequest( - String id, - HrisCompanyInput hrisCompany) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), hrisCompany); + @Nonnull String id, + @Nonnull HrisCompanyInput hrisCompany) { + this(id, null, null, + null, null, hrisCompany); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public HrisCompanyInput hrisCompany() { - return hrisCompany; + return this.hrisCompany; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisCompaniesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisCompaniesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisCompaniesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public HrisCompaniesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisCompaniesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisCompaniesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisCompaniesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisCompaniesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisCompaniesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisCompaniesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisCompaniesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisCompaniesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisCompaniesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisCompaniesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisCompaniesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public HrisCompaniesUpdateRequest withHrisCompany(HrisCompanyInput hrisCompany) { - Utils.checkNotNull(hrisCompany, "hrisCompany"); - this.hrisCompany = hrisCompany; + + public HrisCompaniesUpdateRequest withHrisCompany(@Nonnull HrisCompanyInput hrisCompany) { + this.hrisCompany = Utils.checkNotNull(hrisCompany, "hrisCompany"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private HrisCompanyInput hrisCompany; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder hrisCompany(HrisCompanyInput hrisCompany) { - Utils.checkNotNull(hrisCompany, "hrisCompany"); - this.hrisCompany = hrisCompany; + public Builder hrisCompany(@Nonnull HrisCompanyInput hrisCompany) { + this.hrisCompany = Utils.checkNotNull(hrisCompany, "hrisCompany"); return this; } public HrisCompaniesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisCompaniesUpdateRequest( id, consumerId, appId, serviceId, raw, hrisCompany); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateRequestBuilder.java index d6e23814..6b145586 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisCompaniesUpdateRequestBuilder { - - private HrisCompaniesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisCompaniesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisCompaniesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisCompaniesUpdateRequestBuilder request(HrisCompaniesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisCompaniesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisCompaniesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisCompaniesUpdateRequestBuilder request(@Nonnull HrisCompaniesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisCompaniesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisCompaniesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisCompaniesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateResponse.java index 95cf22d5..384e1ea9 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisCompaniesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisCompaniesUpdateResponse implements Response { /** * Companies */ - private Optional updateHrisCompanyResponse; + private UpdateHrisCompanyResponse updateHrisCompanyResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisCompaniesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateHrisCompanyResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateHrisCompanyResponse, "updateHrisCompanyResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateHrisCompanyResponse updateHrisCompanyResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateHrisCompanyResponse = updateHrisCompanyResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisCompaniesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Companies */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateHrisCompanyResponse() { - return (Optional) updateHrisCompanyResponse; + return Optional.ofNullable(this.updateHrisCompanyResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisCompaniesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisCompaniesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisCompaniesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisCompaniesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Companies + * Raw HTTP response; suitable for custom response parsing */ - public HrisCompaniesUpdateResponse withUpdateHrisCompanyResponse(UpdateHrisCompanyResponse updateHrisCompanyResponse) { - Utils.checkNotNull(updateHrisCompanyResponse, "updateHrisCompanyResponse"); - this.updateHrisCompanyResponse = Optional.ofNullable(updateHrisCompanyResponse); + public HrisCompaniesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisCompaniesUpdateResponse withUpdateHrisCompanyResponse(UpdateHrisCompa /** * Companies */ - public HrisCompaniesUpdateResponse withUpdateHrisCompanyResponse(Optional updateHrisCompanyResponse) { - Utils.checkNotNull(updateHrisCompanyResponse, "updateHrisCompanyResponse"); + public HrisCompaniesUpdateResponse withUpdateHrisCompanyResponse(@Nullable UpdateHrisCompanyResponse updateHrisCompanyResponse) { this.updateHrisCompanyResponse = updateHrisCompanyResponse; return this; } - /** - * Unexpected error - */ - public HrisCompaniesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisCompaniesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisCompaniesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateHrisCompanyResponse = Optional.empty(); + private UpdateHrisCompanyResponse updateHrisCompanyResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Companies - */ - public Builder updateHrisCompanyResponse(UpdateHrisCompanyResponse updateHrisCompanyResponse) { - Utils.checkNotNull(updateHrisCompanyResponse, "updateHrisCompanyResponse"); - this.updateHrisCompanyResponse = Optional.ofNullable(updateHrisCompanyResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Companies */ - public Builder updateHrisCompanyResponse(Optional updateHrisCompanyResponse) { - Utils.checkNotNull(updateHrisCompanyResponse, "updateHrisCompanyResponse"); + public Builder updateHrisCompanyResponse(@Nullable UpdateHrisCompanyResponse updateHrisCompanyResponse) { this.updateHrisCompanyResponse = updateHrisCompanyResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisCompaniesUpdateResponse build() { - return new HrisCompaniesUpdateResponse( contentType, statusCode, rawResponse, updateHrisCompanyResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddRequest.java index 87fc9533..ec2b75a8 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class HrisDepartmentsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class HrisDepartmentsAddRequest { @JsonCreator public HrisDepartmentsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - DepartmentInput department) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(department, "department"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull DepartmentInput department) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.department = department; + this.department = Optional.ofNullable(department) + .orElseThrow(() -> new IllegalArgumentException("department cannot be null")); } public HrisDepartmentsAddRequest( - DepartmentInput department) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), department); + @Nonnull DepartmentInput department) { + this(null, null, null, + null, department); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public DepartmentInput department() { - return department; + return this.department; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public HrisDepartmentsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisDepartmentsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisDepartmentsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisDepartmentsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisDepartmentsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisDepartmentsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisDepartmentsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisDepartmentsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisDepartmentsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisDepartmentsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisDepartmentsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisDepartmentsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public HrisDepartmentsAddRequest withDepartment(DepartmentInput department) { - Utils.checkNotNull(department, "department"); - this.department = department; + + public HrisDepartmentsAddRequest withDepartment(@Nonnull DepartmentInput department) { + this.department = Utils.checkNotNull(department, "department"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private DepartmentInput department; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder department(DepartmentInput department) { - Utils.checkNotNull(department, "department"); - this.department = department; + public Builder department(@Nonnull DepartmentInput department) { + this.department = Utils.checkNotNull(department, "department"); return this; } public HrisDepartmentsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisDepartmentsAddRequest( raw, consumerId, appId, serviceId, department); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddRequestBuilder.java index 51e9d630..926eb058 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisDepartmentsAddRequestBuilder { - - private HrisDepartmentsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisDepartmentsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisDepartmentsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisDepartmentsAddRequestBuilder request(HrisDepartmentsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisDepartmentsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisDepartmentsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisDepartmentsAddRequestBuilder request(@Nonnull HrisDepartmentsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisDepartmentsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisDepartmentsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisDepartmentsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddResponse.java index 9808a8e3..1809ca92 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisDepartmentsAddResponse implements Response { /** * Departments */ - private Optional createDepartmentResponse; + private CreateDepartmentResponse createDepartmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisDepartmentsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createDepartmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createDepartmentResponse, "createDepartmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateDepartmentResponse createDepartmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createDepartmentResponse = createDepartmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisDepartmentsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Departments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createDepartmentResponse() { - return (Optional) createDepartmentResponse; + return Optional.ofNullable(this.createDepartmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisDepartmentsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisDepartmentsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisDepartmentsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisDepartmentsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Departments + * Raw HTTP response; suitable for custom response parsing */ - public HrisDepartmentsAddResponse withCreateDepartmentResponse(CreateDepartmentResponse createDepartmentResponse) { - Utils.checkNotNull(createDepartmentResponse, "createDepartmentResponse"); - this.createDepartmentResponse = Optional.ofNullable(createDepartmentResponse); + public HrisDepartmentsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisDepartmentsAddResponse withCreateDepartmentResponse(CreateDepartmentR /** * Departments */ - public HrisDepartmentsAddResponse withCreateDepartmentResponse(Optional createDepartmentResponse) { - Utils.checkNotNull(createDepartmentResponse, "createDepartmentResponse"); + public HrisDepartmentsAddResponse withCreateDepartmentResponse(@Nullable CreateDepartmentResponse createDepartmentResponse) { this.createDepartmentResponse = createDepartmentResponse; return this; } - /** - * Unexpected error - */ - public HrisDepartmentsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisDepartmentsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisDepartmentsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createDepartmentResponse = Optional.empty(); + private CreateDepartmentResponse createDepartmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Departments - */ - public Builder createDepartmentResponse(CreateDepartmentResponse createDepartmentResponse) { - Utils.checkNotNull(createDepartmentResponse, "createDepartmentResponse"); - this.createDepartmentResponse = Optional.ofNullable(createDepartmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Departments */ - public Builder createDepartmentResponse(Optional createDepartmentResponse) { - Utils.checkNotNull(createDepartmentResponse, "createDepartmentResponse"); + public Builder createDepartmentResponse(@Nullable CreateDepartmentResponse createDepartmentResponse) { this.createDepartmentResponse = createDepartmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisDepartmentsAddResponse build() { - return new HrisDepartmentsAddResponse( contentType, statusCode, rawResponse, createDepartmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllRequest.java index f20af7ec..f5de1303 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllRequest.java @@ -7,14 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,25 +24,25 @@ public class HrisDepartmentsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -55,13 +54,13 @@ public class HrisDepartmentsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,101 +70,88 @@ public class HrisDepartmentsAllRequest { @JsonCreator public HrisDepartmentsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisDepartmentsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -176,103 +162,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public HrisDepartmentsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisDepartmentsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisDepartmentsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisDepartmentsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisDepartmentsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisDepartmentsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisDepartmentsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisDepartmentsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisDepartmentsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisDepartmentsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisDepartmentsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisDepartmentsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public HrisDepartmentsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public HrisDepartmentsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public HrisDepartmentsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public HrisDepartmentsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -280,48 +207,29 @@ public HrisDepartmentsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public HrisDepartmentsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public HrisDepartmentsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public HrisDepartmentsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public HrisDepartmentsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public HrisDepartmentsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisDepartmentsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisDepartmentsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisDepartmentsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -367,186 +275,91 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisDepartmentsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new HrisDepartmentsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -554,16 +367,16 @@ public HrisDepartmentsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllRequestBuilder.java index b70a07a7..531b420e 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class HrisDepartmentsAllRequestBuilder { - - private HrisDepartmentsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisDepartmentsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisDepartmentsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisDepartmentsAllRequestBuilder request(HrisDepartmentsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisDepartmentsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisDepartmentsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisDepartmentsAllRequestBuilder request(@Nonnull HrisDepartmentsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisDepartmentsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisDepartmentsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisDepartmentsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public HrisDepartmentsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new HrisDepartmentsAllOperation( - sdkConfiguration, - options); + HrisDepartmentsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new HrisDepartmentsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - HrisDepartmentsAllRequest::withCursor, + HrisDepartmentsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllResponse.java index 75b9aa61..1ef2ef2e 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisDepartmentsAllResponse implements Response { /** * Departments */ - private Optional getDepartmentsResponse; + private GetDepartmentsResponse getDepartmentsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisDepartmentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getDepartmentsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getDepartmentsResponse, "getDepartmentsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetDepartmentsResponse getDepartmentsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getDepartmentsResponse = getDepartmentsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisDepartmentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Departments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getDepartmentsResponse() { - return (Optional) getDepartmentsResponse; + return Optional.ofNullable(this.getDepartmentsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisDepartmentsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisDepartmentsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisDepartmentsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisDepartmentsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Departments + * Raw HTTP response; suitable for custom response parsing */ - public HrisDepartmentsAllResponse withGetDepartmentsResponse(GetDepartmentsResponse getDepartmentsResponse) { - Utils.checkNotNull(getDepartmentsResponse, "getDepartmentsResponse"); - this.getDepartmentsResponse = Optional.ofNullable(getDepartmentsResponse); + public HrisDepartmentsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisDepartmentsAllResponse withGetDepartmentsResponse(GetDepartmentsRespo /** * Departments */ - public HrisDepartmentsAllResponse withGetDepartmentsResponse(Optional getDepartmentsResponse) { - Utils.checkNotNull(getDepartmentsResponse, "getDepartmentsResponse"); + public HrisDepartmentsAllResponse withGetDepartmentsResponse(@Nullable GetDepartmentsResponse getDepartmentsResponse) { this.getDepartmentsResponse = getDepartmentsResponse; return this; } - /** - * Unexpected error - */ - public HrisDepartmentsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisDepartmentsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisDepartmentsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getDepartmentsResponse = Optional.empty(); + private GetDepartmentsResponse getDepartmentsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Departments - */ - public Builder getDepartmentsResponse(GetDepartmentsResponse getDepartmentsResponse) { - Utils.checkNotNull(getDepartmentsResponse, "getDepartmentsResponse"); - this.getDepartmentsResponse = Optional.ofNullable(getDepartmentsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Departments */ - public Builder getDepartmentsResponse(Optional getDepartmentsResponse) { - Utils.checkNotNull(getDepartmentsResponse, "getDepartmentsResponse"); + public Builder getDepartmentsResponse(@Nullable GetDepartmentsResponse getDepartmentsResponse) { this.getDepartmentsResponse = getDepartmentsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisDepartmentsAllResponse build() { - return new HrisDepartmentsAllResponse( contentType, statusCode, rawResponse, getDepartmentsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteRequest.java index e19f2c9b..41f58128 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class HrisDepartmentsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public HrisDepartmentsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public HrisDepartmentsDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisDepartmentsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisDepartmentsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisDepartmentsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public HrisDepartmentsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisDepartmentsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisDepartmentsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisDepartmentsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisDepartmentsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisDepartmentsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisDepartmentsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisDepartmentsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisDepartmentsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisDepartmentsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisDepartmentsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisDepartmentsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public HrisDepartmentsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisDepartmentsDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteRequestBuilder.java index 15e8c44a..79bbfacd 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisDepartmentsDeleteRequestBuilder { - - private HrisDepartmentsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisDepartmentsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisDepartmentsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisDepartmentsDeleteRequestBuilder request(HrisDepartmentsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisDepartmentsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisDepartmentsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisDepartmentsDeleteRequestBuilder request(@Nonnull HrisDepartmentsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisDepartmentsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisDepartmentsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisDepartmentsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteResponse.java index e327626c..9cd288e3 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisDepartmentsDeleteResponse implements Response { /** * Departments */ - private Optional deleteDepartmentResponse; + private DeleteDepartmentResponse deleteDepartmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisDepartmentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteDepartmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteDepartmentResponse, "deleteDepartmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteDepartmentResponse deleteDepartmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteDepartmentResponse = deleteDepartmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisDepartmentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Departments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteDepartmentResponse() { - return (Optional) deleteDepartmentResponse; + return Optional.ofNullable(this.deleteDepartmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisDepartmentsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisDepartmentsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisDepartmentsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisDepartmentsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Departments + * Raw HTTP response; suitable for custom response parsing */ - public HrisDepartmentsDeleteResponse withDeleteDepartmentResponse(DeleteDepartmentResponse deleteDepartmentResponse) { - Utils.checkNotNull(deleteDepartmentResponse, "deleteDepartmentResponse"); - this.deleteDepartmentResponse = Optional.ofNullable(deleteDepartmentResponse); + public HrisDepartmentsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisDepartmentsDeleteResponse withDeleteDepartmentResponse(DeleteDepartme /** * Departments */ - public HrisDepartmentsDeleteResponse withDeleteDepartmentResponse(Optional deleteDepartmentResponse) { - Utils.checkNotNull(deleteDepartmentResponse, "deleteDepartmentResponse"); + public HrisDepartmentsDeleteResponse withDeleteDepartmentResponse(@Nullable DeleteDepartmentResponse deleteDepartmentResponse) { this.deleteDepartmentResponse = deleteDepartmentResponse; return this; } - /** - * Unexpected error - */ - public HrisDepartmentsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisDepartmentsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisDepartmentsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteDepartmentResponse = Optional.empty(); + private DeleteDepartmentResponse deleteDepartmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Departments - */ - public Builder deleteDepartmentResponse(DeleteDepartmentResponse deleteDepartmentResponse) { - Utils.checkNotNull(deleteDepartmentResponse, "deleteDepartmentResponse"); - this.deleteDepartmentResponse = Optional.ofNullable(deleteDepartmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Departments */ - public Builder deleteDepartmentResponse(Optional deleteDepartmentResponse) { - Utils.checkNotNull(deleteDepartmentResponse, "deleteDepartmentResponse"); + public Builder deleteDepartmentResponse(@Nullable DeleteDepartmentResponse deleteDepartmentResponse) { this.deleteDepartmentResponse = deleteDepartmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisDepartmentsDeleteResponse build() { - return new HrisDepartmentsDeleteResponse( contentType, statusCode, rawResponse, deleteDepartmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneRequest.java index 82511b08..c0b74338 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class HrisDepartmentsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class HrisDepartmentsOneRequest { @JsonCreator public HrisDepartmentsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisDepartmentsOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisDepartmentsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisDepartmentsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisDepartmentsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public HrisDepartmentsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisDepartmentsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisDepartmentsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisDepartmentsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisDepartmentsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisDepartmentsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisDepartmentsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisDepartmentsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisDepartmentsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisDepartmentsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisDepartmentsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisDepartmentsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisDepartmentsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisDepartmentsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisDepartmentsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisDepartmentsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisDepartmentsOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneRequestBuilder.java index 78c9304f..658ecaf6 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisDepartmentsOneRequestBuilder { - - private HrisDepartmentsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisDepartmentsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisDepartmentsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisDepartmentsOneRequestBuilder request(HrisDepartmentsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisDepartmentsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisDepartmentsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisDepartmentsOneRequestBuilder request(@Nonnull HrisDepartmentsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisDepartmentsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisDepartmentsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisDepartmentsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneResponse.java index f4515b48..ea28673b 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisDepartmentsOneResponse implements Response { /** * Departments */ - private Optional getDepartmentResponse; + private GetDepartmentResponse getDepartmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisDepartmentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getDepartmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getDepartmentResponse, "getDepartmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetDepartmentResponse getDepartmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getDepartmentResponse = getDepartmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisDepartmentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Departments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getDepartmentResponse() { - return (Optional) getDepartmentResponse; + return Optional.ofNullable(this.getDepartmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisDepartmentsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisDepartmentsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisDepartmentsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisDepartmentsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Departments + * Raw HTTP response; suitable for custom response parsing */ - public HrisDepartmentsOneResponse withGetDepartmentResponse(GetDepartmentResponse getDepartmentResponse) { - Utils.checkNotNull(getDepartmentResponse, "getDepartmentResponse"); - this.getDepartmentResponse = Optional.ofNullable(getDepartmentResponse); + public HrisDepartmentsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisDepartmentsOneResponse withGetDepartmentResponse(GetDepartmentRespons /** * Departments */ - public HrisDepartmentsOneResponse withGetDepartmentResponse(Optional getDepartmentResponse) { - Utils.checkNotNull(getDepartmentResponse, "getDepartmentResponse"); + public HrisDepartmentsOneResponse withGetDepartmentResponse(@Nullable GetDepartmentResponse getDepartmentResponse) { this.getDepartmentResponse = getDepartmentResponse; return this; } - /** - * Unexpected error - */ - public HrisDepartmentsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisDepartmentsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisDepartmentsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getDepartmentResponse = Optional.empty(); + private GetDepartmentResponse getDepartmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Departments - */ - public Builder getDepartmentResponse(GetDepartmentResponse getDepartmentResponse) { - Utils.checkNotNull(getDepartmentResponse, "getDepartmentResponse"); - this.getDepartmentResponse = Optional.ofNullable(getDepartmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Departments */ - public Builder getDepartmentResponse(Optional getDepartmentResponse) { - Utils.checkNotNull(getDepartmentResponse, "getDepartmentResponse"); + public Builder getDepartmentResponse(@Nullable GetDepartmentResponse getDepartmentResponse) { this.getDepartmentResponse = getDepartmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisDepartmentsOneResponse build() { - return new HrisDepartmentsOneResponse( contentType, statusCode, rawResponse, getDepartmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateRequest.java index fd8ca2ff..1e7ecdaa 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class HrisDepartmentsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class HrisDepartmentsUpdateRequest { @JsonCreator public HrisDepartmentsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - DepartmentInput department) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(department, "department"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull DepartmentInput department) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.department = department; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.department = Optional.ofNullable(department) + .orElseThrow(() -> new IllegalArgumentException("department cannot be null")); } public HrisDepartmentsUpdateRequest( - String id, - DepartmentInput department) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), department); + @Nonnull String id, + @Nonnull DepartmentInput department) { + this(id, null, null, + null, null, department); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public DepartmentInput department() { - return department; + return this.department; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisDepartmentsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisDepartmentsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisDepartmentsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public HrisDepartmentsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisDepartmentsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisDepartmentsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisDepartmentsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisDepartmentsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisDepartmentsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisDepartmentsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisDepartmentsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisDepartmentsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisDepartmentsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisDepartmentsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisDepartmentsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public HrisDepartmentsUpdateRequest withDepartment(DepartmentInput department) { - Utils.checkNotNull(department, "department"); - this.department = department; + + public HrisDepartmentsUpdateRequest withDepartment(@Nonnull DepartmentInput department) { + this.department = Utils.checkNotNull(department, "department"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private DepartmentInput department; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder department(DepartmentInput department) { - Utils.checkNotNull(department, "department"); - this.department = department; + public Builder department(@Nonnull DepartmentInput department) { + this.department = Utils.checkNotNull(department, "department"); return this; } public HrisDepartmentsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisDepartmentsUpdateRequest( id, consumerId, appId, serviceId, raw, department); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateRequestBuilder.java index 90f179c6..c02cdfba 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisDepartmentsUpdateRequestBuilder { - - private HrisDepartmentsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisDepartmentsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisDepartmentsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisDepartmentsUpdateRequestBuilder request(HrisDepartmentsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisDepartmentsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisDepartmentsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisDepartmentsUpdateRequestBuilder request(@Nonnull HrisDepartmentsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisDepartmentsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisDepartmentsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisDepartmentsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateResponse.java index e4699e21..69eb6e0b 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisDepartmentsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisDepartmentsUpdateResponse implements Response { /** * Departments */ - private Optional updateDepartmentResponse; + private UpdateDepartmentResponse updateDepartmentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisDepartmentsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateDepartmentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateDepartmentResponse, "updateDepartmentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateDepartmentResponse updateDepartmentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateDepartmentResponse = updateDepartmentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisDepartmentsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Departments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateDepartmentResponse() { - return (Optional) updateDepartmentResponse; + return Optional.ofNullable(this.updateDepartmentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisDepartmentsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisDepartmentsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisDepartmentsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisDepartmentsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Departments + * Raw HTTP response; suitable for custom response parsing */ - public HrisDepartmentsUpdateResponse withUpdateDepartmentResponse(UpdateDepartmentResponse updateDepartmentResponse) { - Utils.checkNotNull(updateDepartmentResponse, "updateDepartmentResponse"); - this.updateDepartmentResponse = Optional.ofNullable(updateDepartmentResponse); + public HrisDepartmentsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisDepartmentsUpdateResponse withUpdateDepartmentResponse(UpdateDepartme /** * Departments */ - public HrisDepartmentsUpdateResponse withUpdateDepartmentResponse(Optional updateDepartmentResponse) { - Utils.checkNotNull(updateDepartmentResponse, "updateDepartmentResponse"); + public HrisDepartmentsUpdateResponse withUpdateDepartmentResponse(@Nullable UpdateDepartmentResponse updateDepartmentResponse) { this.updateDepartmentResponse = updateDepartmentResponse; return this; } - /** - * Unexpected error - */ - public HrisDepartmentsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisDepartmentsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisDepartmentsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateDepartmentResponse = Optional.empty(); + private UpdateDepartmentResponse updateDepartmentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Departments - */ - public Builder updateDepartmentResponse(UpdateDepartmentResponse updateDepartmentResponse) { - Utils.checkNotNull(updateDepartmentResponse, "updateDepartmentResponse"); - this.updateDepartmentResponse = Optional.ofNullable(updateDepartmentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Departments */ - public Builder updateDepartmentResponse(Optional updateDepartmentResponse) { - Utils.checkNotNull(updateDepartmentResponse, "updateDepartmentResponse"); + public Builder updateDepartmentResponse(@Nullable UpdateDepartmentResponse updateDepartmentResponse) { this.updateDepartmentResponse = updateDepartmentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisDepartmentsUpdateResponse build() { - return new HrisDepartmentsUpdateResponse( contentType, statusCode, rawResponse, updateDepartmentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllRequest.java index 85c7b24d..47421800 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllRequest.java @@ -8,13 +8,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -31,37 +31,37 @@ public class HrisEmployeePayrollsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private PayrollsFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -71,103 +71,88 @@ public class HrisEmployeePayrollsAllRequest { @JsonCreator public HrisEmployeePayrollsAllRequest( - String employeeId, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(employeeId, "employeeId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.employeeId = employeeId; - this.raw = raw; + @Nonnull String employeeId, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable PayrollsFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.employeeId = Optional.ofNullable(employeeId) + .orElseThrow(() -> new IllegalArgumentException("employeeId cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisEmployeePayrollsAllRequest( - String employeeId) { - this(employeeId, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + @Nonnull String employeeId) { + this(employeeId, null, null, + null, null, null, + null, null); } /** * ID of the employee you are acting upon. */ - @JsonIgnore public String employeeId() { - return employeeId; + return this.employeeId; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -178,18 +163,8 @@ public static Builder builder() { /** * ID of the employee you are acting upon. */ - public HrisEmployeePayrollsAllRequest withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisEmployeePayrollsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public HrisEmployeePayrollsAllRequest withEmployeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } @@ -197,124 +172,65 @@ public HrisEmployeePayrollsAllRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public HrisEmployeePayrollsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisEmployeePayrollsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisEmployeePayrollsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisEmployeePayrollsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisEmployeePayrollsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisEmployeePayrollsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisEmployeePayrollsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisEmployeePayrollsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisEmployeePayrollsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisEmployeePayrollsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisEmployeePayrollsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Apply filters - */ - public HrisEmployeePayrollsAllRequest withFilter(PayrollsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public HrisEmployeePayrollsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public HrisEmployeePayrollsAllRequest withFilter(@Nullable PayrollsFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public HrisEmployeePayrollsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public HrisEmployeePayrollsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public HrisEmployeePayrollsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisEmployeePayrollsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisEmployeePayrollsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisEmployeePayrollsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -362,172 +278,89 @@ public final static class Builder { private String employeeId; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional filter = Optional.empty(); + private PayrollsFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the employee you are acting upon. */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public Builder employeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Apply filters - */ - public Builder filter(PayrollsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable PayrollsFilter filter) { this.filter = filter; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisEmployeePayrollsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisEmployeePayrollsAllRequest( employeeId, raw, consumerId, appId, serviceId, filter, @@ -535,10 +368,10 @@ public HrisEmployeePayrollsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllRequestBuilder.java index 95c5849a..e3db2d3d 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisEmployeePayrollsAllRequestBuilder { - - private HrisEmployeePayrollsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisEmployeePayrollsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisEmployeePayrollsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisEmployeePayrollsAllRequestBuilder request(HrisEmployeePayrollsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisEmployeePayrollsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisEmployeePayrollsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisEmployeePayrollsAllRequestBuilder request(@Nonnull HrisEmployeePayrollsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisEmployeePayrollsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisEmployeePayrollsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisEmployeePayrollsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllResponse.java index 80a1d7e4..fcdde794 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisEmployeePayrollsAllResponse implements Response { /** * EmployeePayrolls */ - private Optional getEmployeePayrollsResponse; + private GetEmployeePayrollsResponse getEmployeePayrollsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisEmployeePayrollsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getEmployeePayrollsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getEmployeePayrollsResponse, "getEmployeePayrollsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetEmployeePayrollsResponse getEmployeePayrollsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getEmployeePayrollsResponse = getEmployeePayrollsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisEmployeePayrollsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * EmployeePayrolls */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getEmployeePayrollsResponse() { - return (Optional) getEmployeePayrollsResponse; + return Optional.ofNullable(this.getEmployeePayrollsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisEmployeePayrollsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisEmployeePayrollsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisEmployeePayrollsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisEmployeePayrollsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * EmployeePayrolls + * Raw HTTP response; suitable for custom response parsing */ - public HrisEmployeePayrollsAllResponse withGetEmployeePayrollsResponse(GetEmployeePayrollsResponse getEmployeePayrollsResponse) { - Utils.checkNotNull(getEmployeePayrollsResponse, "getEmployeePayrollsResponse"); - this.getEmployeePayrollsResponse = Optional.ofNullable(getEmployeePayrollsResponse); + public HrisEmployeePayrollsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisEmployeePayrollsAllResponse withGetEmployeePayrollsResponse(GetEmploy /** * EmployeePayrolls */ - public HrisEmployeePayrollsAllResponse withGetEmployeePayrollsResponse(Optional getEmployeePayrollsResponse) { - Utils.checkNotNull(getEmployeePayrollsResponse, "getEmployeePayrollsResponse"); + public HrisEmployeePayrollsAllResponse withGetEmployeePayrollsResponse(@Nullable GetEmployeePayrollsResponse getEmployeePayrollsResponse) { this.getEmployeePayrollsResponse = getEmployeePayrollsResponse; return this; } - /** - * Unexpected error - */ - public HrisEmployeePayrollsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisEmployeePayrollsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisEmployeePayrollsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getEmployeePayrollsResponse = Optional.empty(); + private GetEmployeePayrollsResponse getEmployeePayrollsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * EmployeePayrolls - */ - public Builder getEmployeePayrollsResponse(GetEmployeePayrollsResponse getEmployeePayrollsResponse) { - Utils.checkNotNull(getEmployeePayrollsResponse, "getEmployeePayrollsResponse"); - this.getEmployeePayrollsResponse = Optional.ofNullable(getEmployeePayrollsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * EmployeePayrolls */ - public Builder getEmployeePayrollsResponse(Optional getEmployeePayrollsResponse) { - Utils.checkNotNull(getEmployeePayrollsResponse, "getEmployeePayrollsResponse"); + public Builder getEmployeePayrollsResponse(@Nullable GetEmployeePayrollsResponse getEmployeePayrollsResponse) { this.getEmployeePayrollsResponse = getEmployeePayrollsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisEmployeePayrollsAllResponse build() { - return new HrisEmployeePayrollsAllResponse( contentType, statusCode, rawResponse, getEmployeePayrollsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneRequest.java index e80cd687..0d3fccfe 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -33,25 +34,25 @@ public class HrisEmployeePayrollsOneRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -61,91 +62,81 @@ public class HrisEmployeePayrollsOneRequest { @JsonCreator public HrisEmployeePayrollsOneRequest( - String payrollId, - String employeeId, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable fields) { - Utils.checkNotNull(payrollId, "payrollId"); - Utils.checkNotNull(employeeId, "employeeId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(fields, "fields"); - this.payrollId = payrollId; - this.employeeId = employeeId; - this.raw = raw; + @Nonnull String payrollId, + @Nonnull String employeeId, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable fields) { + this.payrollId = Optional.ofNullable(payrollId) + .orElseThrow(() -> new IllegalArgumentException("payrollId cannot be null")); + this.employeeId = Optional.ofNullable(employeeId) + .orElseThrow(() -> new IllegalArgumentException("employeeId cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisEmployeePayrollsOneRequest( - String payrollId, - String employeeId) { - this(payrollId, employeeId, Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + @Nonnull String payrollId, + @Nonnull String employeeId) { + this(payrollId, employeeId, null, + null, null, null, + null); } /** * ID of the payroll you are acting upon. */ - @JsonIgnore public String payrollId() { - return payrollId; + return this.payrollId; } /** * ID of the employee you are acting upon. */ - @JsonIgnore public String employeeId() { - return employeeId; + return this.employeeId; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -156,27 +147,17 @@ public static Builder builder() { /** * ID of the payroll you are acting upon. */ - public HrisEmployeePayrollsOneRequest withPayrollId(String payrollId) { - Utils.checkNotNull(payrollId, "payrollId"); - this.payrollId = payrollId; + public HrisEmployeePayrollsOneRequest withPayrollId(@Nonnull String payrollId) { + this.payrollId = Utils.checkNotNull(payrollId, "payrollId"); return this; } - /** - * ID of the employee you are acting upon. - */ - public HrisEmployeePayrollsOneRequest withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } /** - * Include raw response. Mostly used for debugging purposes + * ID of the employee you are acting upon. */ - public HrisEmployeePayrollsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public HrisEmployeePayrollsOneRequest withEmployeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } @@ -184,86 +165,47 @@ public HrisEmployeePayrollsOneRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public HrisEmployeePayrollsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisEmployeePayrollsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisEmployeePayrollsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisEmployeePayrollsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisEmployeePayrollsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisEmployeePayrollsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisEmployeePayrollsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisEmployeePayrollsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisEmployeePayrollsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisEmployeePayrollsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisEmployeePayrollsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisEmployeePayrollsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisEmployeePayrollsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisEmployeePayrollsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -311,140 +253,77 @@ public final static class Builder { private String employeeId; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the payroll you are acting upon. */ - public Builder payrollId(String payrollId) { - Utils.checkNotNull(payrollId, "payrollId"); - this.payrollId = payrollId; + public Builder payrollId(@Nonnull String payrollId) { + this.payrollId = Utils.checkNotNull(payrollId, "payrollId"); return this; } - /** * ID of the employee you are acting upon. */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public Builder employeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisEmployeePayrollsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisEmployeePayrollsOneRequest( payrollId, employeeId, raw, consumerId, appId, serviceId, @@ -452,10 +331,10 @@ public HrisEmployeePayrollsOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneRequestBuilder.java index 6aba048f..c8e56fa3 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisEmployeePayrollsOneRequestBuilder { - - private HrisEmployeePayrollsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisEmployeePayrollsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisEmployeePayrollsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisEmployeePayrollsOneRequestBuilder request(HrisEmployeePayrollsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisEmployeePayrollsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisEmployeePayrollsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisEmployeePayrollsOneRequestBuilder request(@Nonnull HrisEmployeePayrollsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisEmployeePayrollsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisEmployeePayrollsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisEmployeePayrollsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneResponse.java index 2d1c6a63..547822f2 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeePayrollsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisEmployeePayrollsOneResponse implements Response { /** * Payrolls */ - private Optional getEmployeePayrollResponse; + private GetEmployeePayrollResponse getEmployeePayrollResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisEmployeePayrollsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getEmployeePayrollResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getEmployeePayrollResponse, "getEmployeePayrollResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetEmployeePayrollResponse getEmployeePayrollResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getEmployeePayrollResponse = getEmployeePayrollResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisEmployeePayrollsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Payrolls */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getEmployeePayrollResponse() { - return (Optional) getEmployeePayrollResponse; + return Optional.ofNullable(this.getEmployeePayrollResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisEmployeePayrollsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisEmployeePayrollsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisEmployeePayrollsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisEmployeePayrollsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Payrolls + * Raw HTTP response; suitable for custom response parsing */ - public HrisEmployeePayrollsOneResponse withGetEmployeePayrollResponse(GetEmployeePayrollResponse getEmployeePayrollResponse) { - Utils.checkNotNull(getEmployeePayrollResponse, "getEmployeePayrollResponse"); - this.getEmployeePayrollResponse = Optional.ofNullable(getEmployeePayrollResponse); + public HrisEmployeePayrollsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisEmployeePayrollsOneResponse withGetEmployeePayrollResponse(GetEmploye /** * Payrolls */ - public HrisEmployeePayrollsOneResponse withGetEmployeePayrollResponse(Optional getEmployeePayrollResponse) { - Utils.checkNotNull(getEmployeePayrollResponse, "getEmployeePayrollResponse"); + public HrisEmployeePayrollsOneResponse withGetEmployeePayrollResponse(@Nullable GetEmployeePayrollResponse getEmployeePayrollResponse) { this.getEmployeePayrollResponse = getEmployeePayrollResponse; return this; } - /** - * Unexpected error - */ - public HrisEmployeePayrollsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisEmployeePayrollsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisEmployeePayrollsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getEmployeePayrollResponse = Optional.empty(); + private GetEmployeePayrollResponse getEmployeePayrollResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Payrolls - */ - public Builder getEmployeePayrollResponse(GetEmployeePayrollResponse getEmployeePayrollResponse) { - Utils.checkNotNull(getEmployeePayrollResponse, "getEmployeePayrollResponse"); - this.getEmployeePayrollResponse = Optional.ofNullable(getEmployeePayrollResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Payrolls */ - public Builder getEmployeePayrollResponse(Optional getEmployeePayrollResponse) { - Utils.checkNotNull(getEmployeePayrollResponse, "getEmployeePayrollResponse"); + public Builder getEmployeePayrollResponse(@Nullable GetEmployeePayrollResponse getEmployeePayrollResponse) { this.getEmployeePayrollResponse = getEmployeePayrollResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisEmployeePayrollsOneResponse build() { - return new HrisEmployeePayrollsOneResponse( contentType, statusCode, rawResponse, getEmployeePayrollResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllRequest.java index f613b6fc..ffac839b 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllRequest.java @@ -7,13 +7,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -30,31 +30,31 @@ public class HrisEmployeeSchedulesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -64,91 +64,79 @@ public class HrisEmployeeSchedulesAllRequest { @JsonCreator public HrisEmployeeSchedulesAllRequest( - String employeeId, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(employeeId, "employeeId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.employeeId = employeeId; - this.raw = raw; + @Nonnull String employeeId, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.employeeId = Optional.ofNullable(employeeId) + .orElseThrow(() -> new IllegalArgumentException("employeeId cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisEmployeeSchedulesAllRequest( - String employeeId) { - this(employeeId, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + @Nonnull String employeeId) { + this(employeeId, null, null, + null, null, null, + null); } /** * ID of the employee you are acting upon. */ - @JsonIgnore public String employeeId() { - return employeeId; + return this.employeeId; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -159,18 +147,8 @@ public static Builder builder() { /** * ID of the employee you are acting upon. */ - public HrisEmployeeSchedulesAllRequest withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisEmployeeSchedulesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public HrisEmployeeSchedulesAllRequest withEmployeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } @@ -178,105 +156,56 @@ public HrisEmployeeSchedulesAllRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public HrisEmployeeSchedulesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisEmployeeSchedulesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisEmployeeSchedulesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisEmployeeSchedulesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisEmployeeSchedulesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisEmployeeSchedulesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisEmployeeSchedulesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisEmployeeSchedulesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisEmployeeSchedulesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisEmployeeSchedulesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisEmployeeSchedulesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public HrisEmployeeSchedulesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public HrisEmployeeSchedulesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public HrisEmployeeSchedulesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisEmployeeSchedulesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisEmployeeSchedulesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisEmployeeSchedulesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -322,151 +251,79 @@ public final static class Builder { private String employeeId; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the employee you are acting upon. */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; + public Builder employeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisEmployeeSchedulesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisEmployeeSchedulesAllRequest( employeeId, raw, consumerId, appId, serviceId, passThrough, @@ -474,10 +331,10 @@ public HrisEmployeeSchedulesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllRequestBuilder.java index 119bef13..b4369532 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisEmployeeSchedulesAllRequestBuilder { - - private HrisEmployeeSchedulesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisEmployeeSchedulesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisEmployeeSchedulesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisEmployeeSchedulesAllRequestBuilder request(HrisEmployeeSchedulesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisEmployeeSchedulesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisEmployeeSchedulesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisEmployeeSchedulesAllRequestBuilder request(@Nonnull HrisEmployeeSchedulesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisEmployeeSchedulesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisEmployeeSchedulesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisEmployeeSchedulesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllResponse.java index 0776fbf2..9a1964ae 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeeSchedulesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisEmployeeSchedulesAllResponse implements Response { /** * EmployeeSchedules */ - private Optional getEmployeeSchedulesResponse; + private GetEmployeeSchedulesResponse getEmployeeSchedulesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisEmployeeSchedulesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getEmployeeSchedulesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getEmployeeSchedulesResponse, "getEmployeeSchedulesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetEmployeeSchedulesResponse getEmployeeSchedulesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getEmployeeSchedulesResponse = getEmployeeSchedulesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisEmployeeSchedulesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * EmployeeSchedules */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getEmployeeSchedulesResponse() { - return (Optional) getEmployeeSchedulesResponse; + return Optional.ofNullable(this.getEmployeeSchedulesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisEmployeeSchedulesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisEmployeeSchedulesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisEmployeeSchedulesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisEmployeeSchedulesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * EmployeeSchedules + * Raw HTTP response; suitable for custom response parsing */ - public HrisEmployeeSchedulesAllResponse withGetEmployeeSchedulesResponse(GetEmployeeSchedulesResponse getEmployeeSchedulesResponse) { - Utils.checkNotNull(getEmployeeSchedulesResponse, "getEmployeeSchedulesResponse"); - this.getEmployeeSchedulesResponse = Optional.ofNullable(getEmployeeSchedulesResponse); + public HrisEmployeeSchedulesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisEmployeeSchedulesAllResponse withGetEmployeeSchedulesResponse(GetEmpl /** * EmployeeSchedules */ - public HrisEmployeeSchedulesAllResponse withGetEmployeeSchedulesResponse(Optional getEmployeeSchedulesResponse) { - Utils.checkNotNull(getEmployeeSchedulesResponse, "getEmployeeSchedulesResponse"); + public HrisEmployeeSchedulesAllResponse withGetEmployeeSchedulesResponse(@Nullable GetEmployeeSchedulesResponse getEmployeeSchedulesResponse) { this.getEmployeeSchedulesResponse = getEmployeeSchedulesResponse; return this; } - /** - * Unexpected error - */ - public HrisEmployeeSchedulesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisEmployeeSchedulesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisEmployeeSchedulesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getEmployeeSchedulesResponse = Optional.empty(); + private GetEmployeeSchedulesResponse getEmployeeSchedulesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * EmployeeSchedules - */ - public Builder getEmployeeSchedulesResponse(GetEmployeeSchedulesResponse getEmployeeSchedulesResponse) { - Utils.checkNotNull(getEmployeeSchedulesResponse, "getEmployeeSchedulesResponse"); - this.getEmployeeSchedulesResponse = Optional.ofNullable(getEmployeeSchedulesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * EmployeeSchedules */ - public Builder getEmployeeSchedulesResponse(Optional getEmployeeSchedulesResponse) { - Utils.checkNotNull(getEmployeeSchedulesResponse, "getEmployeeSchedulesResponse"); + public Builder getEmployeeSchedulesResponse(@Nullable GetEmployeeSchedulesResponse getEmployeeSchedulesResponse) { this.getEmployeeSchedulesResponse = getEmployeeSchedulesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisEmployeeSchedulesAllResponse build() { - return new HrisEmployeeSchedulesAllResponse( contentType, statusCode, rawResponse, getEmployeeSchedulesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddRequest.java index 39867bc5..1e697fa9 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class HrisEmployeesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class HrisEmployeesAddRequest { @JsonCreator public HrisEmployeesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - EmployeeInput employee) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(employee, "employee"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull EmployeeInput employee) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.employee = employee; + this.employee = Optional.ofNullable(employee) + .orElseThrow(() -> new IllegalArgumentException("employee cannot be null")); } public HrisEmployeesAddRequest( - EmployeeInput employee) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), employee); + @Nonnull EmployeeInput employee) { + this(null, null, null, + null, employee); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public EmployeeInput employee() { - return employee; + return this.employee; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public HrisEmployeesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisEmployeesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisEmployeesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisEmployeesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisEmployeesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisEmployeesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisEmployeesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisEmployeesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisEmployeesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisEmployeesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisEmployeesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisEmployeesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public HrisEmployeesAddRequest withEmployee(EmployeeInput employee) { - Utils.checkNotNull(employee, "employee"); - this.employee = employee; + + public HrisEmployeesAddRequest withEmployee(@Nonnull EmployeeInput employee) { + this.employee = Utils.checkNotNull(employee, "employee"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private EmployeeInput employee; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder employee(EmployeeInput employee) { - Utils.checkNotNull(employee, "employee"); - this.employee = employee; + public Builder employee(@Nonnull EmployeeInput employee) { + this.employee = Utils.checkNotNull(employee, "employee"); return this; } public HrisEmployeesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisEmployeesAddRequest( raw, consumerId, appId, serviceId, employee); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddRequestBuilder.java index 9169ebfd..989b0875 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisEmployeesAddRequestBuilder { - - private HrisEmployeesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisEmployeesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisEmployeesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisEmployeesAddRequestBuilder request(HrisEmployeesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisEmployeesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisEmployeesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisEmployeesAddRequestBuilder request(@Nonnull HrisEmployeesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisEmployeesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisEmployeesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisEmployeesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddResponse.java index 284134ee..6cd41c4e 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisEmployeesAddResponse implements Response { /** * Employees */ - private Optional createEmployeeResponse; + private CreateEmployeeResponse createEmployeeResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisEmployeesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createEmployeeResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createEmployeeResponse, "createEmployeeResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateEmployeeResponse createEmployeeResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createEmployeeResponse = createEmployeeResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisEmployeesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Employees */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createEmployeeResponse() { - return (Optional) createEmployeeResponse; + return Optional.ofNullable(this.createEmployeeResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisEmployeesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisEmployeesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisEmployeesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisEmployeesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Employees + * Raw HTTP response; suitable for custom response parsing */ - public HrisEmployeesAddResponse withCreateEmployeeResponse(CreateEmployeeResponse createEmployeeResponse) { - Utils.checkNotNull(createEmployeeResponse, "createEmployeeResponse"); - this.createEmployeeResponse = Optional.ofNullable(createEmployeeResponse); + public HrisEmployeesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisEmployeesAddResponse withCreateEmployeeResponse(CreateEmployeeRespons /** * Employees */ - public HrisEmployeesAddResponse withCreateEmployeeResponse(Optional createEmployeeResponse) { - Utils.checkNotNull(createEmployeeResponse, "createEmployeeResponse"); + public HrisEmployeesAddResponse withCreateEmployeeResponse(@Nullable CreateEmployeeResponse createEmployeeResponse) { this.createEmployeeResponse = createEmployeeResponse; return this; } - /** - * Unexpected error - */ - public HrisEmployeesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisEmployeesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisEmployeesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createEmployeeResponse = Optional.empty(); + private CreateEmployeeResponse createEmployeeResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Employees - */ - public Builder createEmployeeResponse(CreateEmployeeResponse createEmployeeResponse) { - Utils.checkNotNull(createEmployeeResponse, "createEmployeeResponse"); - this.createEmployeeResponse = Optional.ofNullable(createEmployeeResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Employees */ - public Builder createEmployeeResponse(Optional createEmployeeResponse) { - Utils.checkNotNull(createEmployeeResponse, "createEmployeeResponse"); + public Builder createEmployeeResponse(@Nullable CreateEmployeeResponse createEmployeeResponse) { this.createEmployeeResponse = createEmployeeResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisEmployeesAddResponse build() { - return new HrisEmployeesAddResponse( contentType, statusCode, rawResponse, createEmployeeResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllRequest.java index dca86437..408791ba 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllRequest.java @@ -9,14 +9,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +26,25 @@ public class HrisEmployeesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,25 +56,25 @@ public class HrisEmployeesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private EmployeesFilter filter; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private EmployeesSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -85,126 +84,107 @@ public class HrisEmployeesAllRequest { @JsonCreator public HrisEmployeesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable EmployeesFilter filter, + @Nullable EmployeesSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisEmployeesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -215,103 +195,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public HrisEmployeesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisEmployeesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisEmployeesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisEmployeesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisEmployeesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisEmployeesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisEmployeesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisEmployeesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisEmployeesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisEmployeesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisEmployeesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisEmployeesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public HrisEmployeesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public HrisEmployeesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public HrisEmployeesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public HrisEmployeesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -319,86 +240,47 @@ public HrisEmployeesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public HrisEmployeesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public HrisEmployeesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public HrisEmployeesAllRequest withFilter(EmployeesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public HrisEmployeesAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public HrisEmployeesAllRequest withFilter(@Nullable EmployeesFilter filter) { this.filter = filter; return this; } - /** - * Apply sorting - */ - public HrisEmployeesAllRequest withSort(EmployeesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public HrisEmployeesAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public HrisEmployeesAllRequest withSort(@Nullable EmployeesSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public HrisEmployeesAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public HrisEmployeesAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public HrisEmployeesAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisEmployeesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisEmployeesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisEmployeesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -449,228 +331,111 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private EmployeesFilter filter; - private Optional sort = Optional.empty(); + private EmployeesSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Apply filters */ - public Builder filter(EmployeesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Apply filters - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable EmployeesFilter filter) { this.filter = filter; return this; } - /** * Apply sorting */ - public Builder sort(EmployeesSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable EmployeesSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisEmployeesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new HrisEmployeesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -679,16 +444,16 @@ public HrisEmployeesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllRequestBuilder.java index c7f369d9..e5bcb7fe 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class HrisEmployeesAllRequestBuilder { - - private HrisEmployeesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisEmployeesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisEmployeesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisEmployeesAllRequestBuilder request(HrisEmployeesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisEmployeesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisEmployeesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisEmployeesAllRequestBuilder request(@Nonnull HrisEmployeesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisEmployeesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisEmployeesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisEmployeesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public HrisEmployeesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new HrisEmployeesAllOperation( - sdkConfiguration, - options); + HrisEmployeesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new HrisEmployeesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - HrisEmployeesAllRequest::withCursor, + HrisEmployeesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllResponse.java index d1c4b94f..c54d13cc 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisEmployeesAllResponse implements Response { /** * Employees */ - private Optional getEmployeesResponse; + private GetEmployeesResponse getEmployeesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisEmployeesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getEmployeesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getEmployeesResponse, "getEmployeesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetEmployeesResponse getEmployeesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getEmployeesResponse = getEmployeesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisEmployeesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Employees */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getEmployeesResponse() { - return (Optional) getEmployeesResponse; + return Optional.ofNullable(this.getEmployeesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisEmployeesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisEmployeesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisEmployeesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisEmployeesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Employees + * Raw HTTP response; suitable for custom response parsing */ - public HrisEmployeesAllResponse withGetEmployeesResponse(GetEmployeesResponse getEmployeesResponse) { - Utils.checkNotNull(getEmployeesResponse, "getEmployeesResponse"); - this.getEmployeesResponse = Optional.ofNullable(getEmployeesResponse); + public HrisEmployeesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisEmployeesAllResponse withGetEmployeesResponse(GetEmployeesResponse ge /** * Employees */ - public HrisEmployeesAllResponse withGetEmployeesResponse(Optional getEmployeesResponse) { - Utils.checkNotNull(getEmployeesResponse, "getEmployeesResponse"); + public HrisEmployeesAllResponse withGetEmployeesResponse(@Nullable GetEmployeesResponse getEmployeesResponse) { this.getEmployeesResponse = getEmployeesResponse; return this; } - /** - * Unexpected error - */ - public HrisEmployeesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisEmployeesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisEmployeesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getEmployeesResponse = Optional.empty(); + private GetEmployeesResponse getEmployeesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Employees - */ - public Builder getEmployeesResponse(GetEmployeesResponse getEmployeesResponse) { - Utils.checkNotNull(getEmployeesResponse, "getEmployeesResponse"); - this.getEmployeesResponse = Optional.ofNullable(getEmployeesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Employees */ - public Builder getEmployeesResponse(Optional getEmployeesResponse) { - Utils.checkNotNull(getEmployeesResponse, "getEmployeesResponse"); + public Builder getEmployeesResponse(@Nullable GetEmployeesResponse getEmployeesResponse) { this.getEmployeesResponse = getEmployeesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisEmployeesAllResponse build() { - return new HrisEmployeesAllResponse( contentType, statusCode, rawResponse, getEmployeesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteRequest.java index a4d3a73f..aaa787bf 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class HrisEmployeesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public HrisEmployeesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public HrisEmployeesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisEmployeesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisEmployeesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisEmployeesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public HrisEmployeesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisEmployeesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisEmployeesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisEmployeesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisEmployeesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisEmployeesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisEmployeesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisEmployeesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisEmployeesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisEmployeesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisEmployeesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisEmployeesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public HrisEmployeesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisEmployeesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteRequestBuilder.java index a4dc18b9..ea709026 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisEmployeesDeleteRequestBuilder { - - private HrisEmployeesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisEmployeesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisEmployeesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisEmployeesDeleteRequestBuilder request(HrisEmployeesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisEmployeesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisEmployeesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisEmployeesDeleteRequestBuilder request(@Nonnull HrisEmployeesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisEmployeesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisEmployeesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisEmployeesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteResponse.java index 2f452ad6..3c36a67b 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisEmployeesDeleteResponse implements Response { /** * Employees */ - private Optional deleteEmployeeResponse; + private DeleteEmployeeResponse deleteEmployeeResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisEmployeesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteEmployeeResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteEmployeeResponse, "deleteEmployeeResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteEmployeeResponse deleteEmployeeResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteEmployeeResponse = deleteEmployeeResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisEmployeesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Employees */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteEmployeeResponse() { - return (Optional) deleteEmployeeResponse; + return Optional.ofNullable(this.deleteEmployeeResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisEmployeesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisEmployeesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisEmployeesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisEmployeesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Employees + * Raw HTTP response; suitable for custom response parsing */ - public HrisEmployeesDeleteResponse withDeleteEmployeeResponse(DeleteEmployeeResponse deleteEmployeeResponse) { - Utils.checkNotNull(deleteEmployeeResponse, "deleteEmployeeResponse"); - this.deleteEmployeeResponse = Optional.ofNullable(deleteEmployeeResponse); + public HrisEmployeesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisEmployeesDeleteResponse withDeleteEmployeeResponse(DeleteEmployeeResp /** * Employees */ - public HrisEmployeesDeleteResponse withDeleteEmployeeResponse(Optional deleteEmployeeResponse) { - Utils.checkNotNull(deleteEmployeeResponse, "deleteEmployeeResponse"); + public HrisEmployeesDeleteResponse withDeleteEmployeeResponse(@Nullable DeleteEmployeeResponse deleteEmployeeResponse) { this.deleteEmployeeResponse = deleteEmployeeResponse; return this; } - /** - * Unexpected error - */ - public HrisEmployeesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisEmployeesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisEmployeesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteEmployeeResponse = Optional.empty(); + private DeleteEmployeeResponse deleteEmployeeResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Employees - */ - public Builder deleteEmployeeResponse(DeleteEmployeeResponse deleteEmployeeResponse) { - Utils.checkNotNull(deleteEmployeeResponse, "deleteEmployeeResponse"); - this.deleteEmployeeResponse = Optional.ofNullable(deleteEmployeeResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Employees */ - public Builder deleteEmployeeResponse(Optional deleteEmployeeResponse) { - Utils.checkNotNull(deleteEmployeeResponse, "deleteEmployeeResponse"); + public Builder deleteEmployeeResponse(@Nullable DeleteEmployeeResponse deleteEmployeeResponse) { this.deleteEmployeeResponse = deleteEmployeeResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisEmployeesDeleteResponse build() { - return new HrisEmployeesDeleteResponse( contentType, statusCode, rawResponse, deleteEmployeeResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneRequest.java index 5984767d..08832964 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneRequest.java @@ -8,13 +8,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -31,25 +31,25 @@ public class HrisEmployeesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -61,113 +61,98 @@ public class HrisEmployeesOneRequest { * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private EmployeesOneFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; @JsonCreator public HrisEmployeesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields, - Optional filter, - Optional> passThrough) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields, + @Nullable EmployeesOneFilter filter, + @Nullable Map passThrough) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); this.filter = filter; this.passThrough = passThrough; } public HrisEmployeesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } public static Builder builder() { @@ -178,18 +163,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisEmployeesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisEmployeesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisEmployeesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -197,93 +172,44 @@ public HrisEmployeesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisEmployeesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisEmployeesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisEmployeesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisEmployeesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisEmployeesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisEmployeesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisEmployeesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisEmployeesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisEmployeesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisEmployeesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisEmployeesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisEmployeesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = JsonNullable.of(fields); - return this; - } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisEmployeesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** - * Apply filters - */ - public HrisEmployeesOneRequest withFilter(EmployeesOneFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); + public HrisEmployeesOneRequest withFields(@Nullable String fields) { + this.fields = JsonNullable.of(fields); return this; } @@ -291,31 +217,21 @@ public HrisEmployeesOneRequest withFilter(EmployeesOneFilter filter) { /** * Apply filters */ - public HrisEmployeesOneRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public HrisEmployeesOneRequest withFilter(@Nullable EmployeesOneFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public HrisEmployeesOneRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public HrisEmployeesOneRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public HrisEmployeesOneRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -362,172 +278,89 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; - private Optional filter = Optional.empty(); + private EmployeesOneFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - - /** - * Apply filters - */ - public Builder filter(EmployeesOneFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable EmployeesOneFilter filter) { this.filter = filter; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } public HrisEmployeesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisEmployeesOneRequest( id, consumerId, appId, serviceId, raw, fields, @@ -535,10 +368,10 @@ public HrisEmployeesOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneRequestBuilder.java index 9840b5a2..c4773bc4 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisEmployeesOneRequestBuilder { - - private HrisEmployeesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisEmployeesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisEmployeesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisEmployeesOneRequestBuilder request(HrisEmployeesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisEmployeesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisEmployeesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisEmployeesOneRequestBuilder request(@Nonnull HrisEmployeesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisEmployeesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisEmployeesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisEmployeesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneResponse.java index d045744c..b44f116e 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisEmployeesOneResponse implements Response { /** * Employees */ - private Optional getEmployeeResponse; + private GetEmployeeResponse getEmployeeResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisEmployeesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getEmployeeResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getEmployeeResponse, "getEmployeeResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetEmployeeResponse getEmployeeResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getEmployeeResponse = getEmployeeResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisEmployeesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Employees */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getEmployeeResponse() { - return (Optional) getEmployeeResponse; + return Optional.ofNullable(this.getEmployeeResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisEmployeesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisEmployeesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisEmployeesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisEmployeesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Employees + * Raw HTTP response; suitable for custom response parsing */ - public HrisEmployeesOneResponse withGetEmployeeResponse(GetEmployeeResponse getEmployeeResponse) { - Utils.checkNotNull(getEmployeeResponse, "getEmployeeResponse"); - this.getEmployeeResponse = Optional.ofNullable(getEmployeeResponse); + public HrisEmployeesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisEmployeesOneResponse withGetEmployeeResponse(GetEmployeeResponse getE /** * Employees */ - public HrisEmployeesOneResponse withGetEmployeeResponse(Optional getEmployeeResponse) { - Utils.checkNotNull(getEmployeeResponse, "getEmployeeResponse"); + public HrisEmployeesOneResponse withGetEmployeeResponse(@Nullable GetEmployeeResponse getEmployeeResponse) { this.getEmployeeResponse = getEmployeeResponse; return this; } - /** - * Unexpected error - */ - public HrisEmployeesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisEmployeesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisEmployeesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getEmployeeResponse = Optional.empty(); + private GetEmployeeResponse getEmployeeResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Employees - */ - public Builder getEmployeeResponse(GetEmployeeResponse getEmployeeResponse) { - Utils.checkNotNull(getEmployeeResponse, "getEmployeeResponse"); - this.getEmployeeResponse = Optional.ofNullable(getEmployeeResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Employees */ - public Builder getEmployeeResponse(Optional getEmployeeResponse) { - Utils.checkNotNull(getEmployeeResponse, "getEmployeeResponse"); + public Builder getEmployeeResponse(@Nullable GetEmployeeResponse getEmployeeResponse) { this.getEmployeeResponse = getEmployeeResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisEmployeesOneResponse build() { - return new HrisEmployeesOneResponse( contentType, statusCode, rawResponse, getEmployeeResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateRequest.java index 0b703501..2849c453 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class HrisEmployeesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class HrisEmployeesUpdateRequest { @JsonCreator public HrisEmployeesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - EmployeeInput employee) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(employee, "employee"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull EmployeeInput employee) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.employee = employee; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.employee = Optional.ofNullable(employee) + .orElseThrow(() -> new IllegalArgumentException("employee cannot be null")); } public HrisEmployeesUpdateRequest( - String id, - EmployeeInput employee) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), employee); + @Nonnull String id, + @Nonnull EmployeeInput employee) { + this(id, null, null, + null, null, employee); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public EmployeeInput employee() { - return employee; + return this.employee; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisEmployeesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisEmployeesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisEmployeesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public HrisEmployeesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisEmployeesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisEmployeesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisEmployeesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisEmployeesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisEmployeesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisEmployeesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisEmployeesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisEmployeesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisEmployeesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisEmployeesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisEmployeesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public HrisEmployeesUpdateRequest withEmployee(EmployeeInput employee) { - Utils.checkNotNull(employee, "employee"); - this.employee = employee; + + public HrisEmployeesUpdateRequest withEmployee(@Nonnull EmployeeInput employee) { + this.employee = Utils.checkNotNull(employee, "employee"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private EmployeeInput employee; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder employee(EmployeeInput employee) { - Utils.checkNotNull(employee, "employee"); - this.employee = employee; + public Builder employee(@Nonnull EmployeeInput employee) { + this.employee = Utils.checkNotNull(employee, "employee"); return this; } public HrisEmployeesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisEmployeesUpdateRequest( id, consumerId, appId, serviceId, raw, employee); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateRequestBuilder.java index 0525916e..c3ab475d 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisEmployeesUpdateRequestBuilder { - - private HrisEmployeesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisEmployeesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisEmployeesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisEmployeesUpdateRequestBuilder request(HrisEmployeesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisEmployeesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisEmployeesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisEmployeesUpdateRequestBuilder request(@Nonnull HrisEmployeesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisEmployeesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisEmployeesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisEmployeesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateResponse.java index 883ffeca..790852b1 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisEmployeesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisEmployeesUpdateResponse implements Response { /** * Employees */ - private Optional updateEmployeeResponse; + private UpdateEmployeeResponse updateEmployeeResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisEmployeesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateEmployeeResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateEmployeeResponse, "updateEmployeeResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateEmployeeResponse updateEmployeeResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateEmployeeResponse = updateEmployeeResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisEmployeesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Employees */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateEmployeeResponse() { - return (Optional) updateEmployeeResponse; + return Optional.ofNullable(this.updateEmployeeResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisEmployeesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisEmployeesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisEmployeesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisEmployeesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Employees + * Raw HTTP response; suitable for custom response parsing */ - public HrisEmployeesUpdateResponse withUpdateEmployeeResponse(UpdateEmployeeResponse updateEmployeeResponse) { - Utils.checkNotNull(updateEmployeeResponse, "updateEmployeeResponse"); - this.updateEmployeeResponse = Optional.ofNullable(updateEmployeeResponse); + public HrisEmployeesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisEmployeesUpdateResponse withUpdateEmployeeResponse(UpdateEmployeeResp /** * Employees */ - public HrisEmployeesUpdateResponse withUpdateEmployeeResponse(Optional updateEmployeeResponse) { - Utils.checkNotNull(updateEmployeeResponse, "updateEmployeeResponse"); + public HrisEmployeesUpdateResponse withUpdateEmployeeResponse(@Nullable UpdateEmployeeResponse updateEmployeeResponse) { this.updateEmployeeResponse = updateEmployeeResponse; return this; } - /** - * Unexpected error - */ - public HrisEmployeesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisEmployeesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisEmployeesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateEmployeeResponse = Optional.empty(); + private UpdateEmployeeResponse updateEmployeeResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Employees - */ - public Builder updateEmployeeResponse(UpdateEmployeeResponse updateEmployeeResponse) { - Utils.checkNotNull(updateEmployeeResponse, "updateEmployeeResponse"); - this.updateEmployeeResponse = Optional.ofNullable(updateEmployeeResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Employees */ - public Builder updateEmployeeResponse(Optional updateEmployeeResponse) { - Utils.checkNotNull(updateEmployeeResponse, "updateEmployeeResponse"); + public Builder updateEmployeeResponse(@Nullable UpdateEmployeeResponse updateEmployeeResponse) { this.updateEmployeeResponse = updateEmployeeResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisEmployeesUpdateResponse build() { - return new HrisEmployeesUpdateResponse( contentType, statusCode, rawResponse, updateEmployeeResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllRequest.java index e2228646..81362039 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllRequest.java @@ -8,13 +8,12 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -25,37 +24,37 @@ public class HrisPayrollsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private PayrollsFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -65,91 +64,77 @@ public class HrisPayrollsAllRequest { @JsonCreator public HrisPayrollsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable PayrollsFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisPayrollsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -160,134 +145,65 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public HrisPayrollsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisPayrollsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisPayrollsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisPayrollsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisPayrollsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisPayrollsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisPayrollsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisPayrollsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisPayrollsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisPayrollsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisPayrollsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisPayrollsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Apply filters - */ - public HrisPayrollsAllRequest withFilter(PayrollsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public HrisPayrollsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public HrisPayrollsAllRequest withFilter(@Nullable PayrollsFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public HrisPayrollsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public HrisPayrollsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public HrisPayrollsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisPayrollsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisPayrollsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisPayrollsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -331,162 +247,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional filter = Optional.empty(); + private PayrollsFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Apply filters - */ - public Builder filter(PayrollsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable PayrollsFilter filter) { this.filter = filter; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisPayrollsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisPayrollsAllRequest( raw, consumerId, appId, serviceId, filter, passThrough, @@ -494,10 +329,10 @@ public HrisPayrollsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllRequestBuilder.java index 8f7a62f9..b4b83ad7 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisPayrollsAllRequestBuilder { - - private HrisPayrollsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisPayrollsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisPayrollsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisPayrollsAllRequestBuilder request(HrisPayrollsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisPayrollsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisPayrollsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisPayrollsAllRequestBuilder request(@Nonnull HrisPayrollsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisPayrollsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisPayrollsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisPayrollsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllResponse.java index eedeaebc..bea5a416 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisPayrollsAllResponse implements Response { /** * Payrolls */ - private Optional getPayrollsResponse; + private GetPayrollsResponse getPayrollsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisPayrollsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getPayrollsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getPayrollsResponse, "getPayrollsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetPayrollsResponse getPayrollsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getPayrollsResponse = getPayrollsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisPayrollsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Payrolls */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getPayrollsResponse() { - return (Optional) getPayrollsResponse; + return Optional.ofNullable(this.getPayrollsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisPayrollsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisPayrollsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisPayrollsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisPayrollsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Payrolls + * Raw HTTP response; suitable for custom response parsing */ - public HrisPayrollsAllResponse withGetPayrollsResponse(GetPayrollsResponse getPayrollsResponse) { - Utils.checkNotNull(getPayrollsResponse, "getPayrollsResponse"); - this.getPayrollsResponse = Optional.ofNullable(getPayrollsResponse); + public HrisPayrollsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisPayrollsAllResponse withGetPayrollsResponse(GetPayrollsResponse getPa /** * Payrolls */ - public HrisPayrollsAllResponse withGetPayrollsResponse(Optional getPayrollsResponse) { - Utils.checkNotNull(getPayrollsResponse, "getPayrollsResponse"); + public HrisPayrollsAllResponse withGetPayrollsResponse(@Nullable GetPayrollsResponse getPayrollsResponse) { this.getPayrollsResponse = getPayrollsResponse; return this; } - /** - * Unexpected error - */ - public HrisPayrollsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisPayrollsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisPayrollsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getPayrollsResponse = Optional.empty(); + private GetPayrollsResponse getPayrollsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Payrolls - */ - public Builder getPayrollsResponse(GetPayrollsResponse getPayrollsResponse) { - Utils.checkNotNull(getPayrollsResponse, "getPayrollsResponse"); - this.getPayrollsResponse = Optional.ofNullable(getPayrollsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Payrolls */ - public Builder getPayrollsResponse(Optional getPayrollsResponse) { - Utils.checkNotNull(getPayrollsResponse, "getPayrollsResponse"); + public Builder getPayrollsResponse(@Nullable GetPayrollsResponse getPayrollsResponse) { this.getPayrollsResponse = getPayrollsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisPayrollsAllResponse build() { - return new HrisPayrollsAllResponse( contentType, statusCode, rawResponse, getPayrollsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneRequest.java index 8b2c5888..d021635f 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class HrisPayrollsOneRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class HrisPayrollsOneRequest { @JsonCreator public HrisPayrollsOneRequest( - String payrollId, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable fields) { - Utils.checkNotNull(payrollId, "payrollId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(fields, "fields"); - this.payrollId = payrollId; - this.raw = raw; + @Nonnull String payrollId, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable fields) { + this.payrollId = Optional.ofNullable(payrollId) + .orElseThrow(() -> new IllegalArgumentException("payrollId cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisPayrollsOneRequest( - String payrollId) { - this(payrollId, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String payrollId) { + this(payrollId, null, null, + null, null, null); } /** * ID of the payroll you are acting upon. */ - @JsonIgnore public String payrollId() { - return payrollId; + return this.payrollId; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the payroll you are acting upon. */ - public HrisPayrollsOneRequest withPayrollId(String payrollId) { - Utils.checkNotNull(payrollId, "payrollId"); - this.payrollId = payrollId; - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisPayrollsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public HrisPayrollsOneRequest withPayrollId(@Nonnull String payrollId) { + this.payrollId = Utils.checkNotNull(payrollId, "payrollId"); return this; } @@ -156,86 +138,47 @@ public HrisPayrollsOneRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public HrisPayrollsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisPayrollsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisPayrollsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisPayrollsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisPayrollsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisPayrollsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisPayrollsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisPayrollsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisPayrollsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisPayrollsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisPayrollsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisPayrollsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisPayrollsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisPayrollsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String payrollId; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the payroll you are acting upon. */ - public Builder payrollId(String payrollId) { - Utils.checkNotNull(payrollId, "payrollId"); - this.payrollId = payrollId; - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public Builder payrollId(@Nonnull String payrollId) { + this.payrollId = Utils.checkNotNull(payrollId, "payrollId"); return this; } /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisPayrollsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisPayrollsOneRequest( payrollId, raw, consumerId, appId, serviceId, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneRequestBuilder.java index b6a04065..a178f790 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisPayrollsOneRequestBuilder { - - private HrisPayrollsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisPayrollsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisPayrollsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisPayrollsOneRequestBuilder request(HrisPayrollsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisPayrollsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisPayrollsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisPayrollsOneRequestBuilder request(@Nonnull HrisPayrollsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisPayrollsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisPayrollsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisPayrollsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneResponse.java index 14e511b2..f0b80a81 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisPayrollsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisPayrollsOneResponse implements Response { /** * Payrolls */ - private Optional getPayrollResponse; + private GetPayrollResponse getPayrollResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisPayrollsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getPayrollResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getPayrollResponse, "getPayrollResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetPayrollResponse getPayrollResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getPayrollResponse = getPayrollResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisPayrollsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Payrolls */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getPayrollResponse() { - return (Optional) getPayrollResponse; + return Optional.ofNullable(this.getPayrollResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisPayrollsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisPayrollsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisPayrollsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisPayrollsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Payrolls + * Raw HTTP response; suitable for custom response parsing */ - public HrisPayrollsOneResponse withGetPayrollResponse(GetPayrollResponse getPayrollResponse) { - Utils.checkNotNull(getPayrollResponse, "getPayrollResponse"); - this.getPayrollResponse = Optional.ofNullable(getPayrollResponse); + public HrisPayrollsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisPayrollsOneResponse withGetPayrollResponse(GetPayrollResponse getPayr /** * Payrolls */ - public HrisPayrollsOneResponse withGetPayrollResponse(Optional getPayrollResponse) { - Utils.checkNotNull(getPayrollResponse, "getPayrollResponse"); + public HrisPayrollsOneResponse withGetPayrollResponse(@Nullable GetPayrollResponse getPayrollResponse) { this.getPayrollResponse = getPayrollResponse; return this; } - /** - * Unexpected error - */ - public HrisPayrollsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisPayrollsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisPayrollsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getPayrollResponse = Optional.empty(); + private GetPayrollResponse getPayrollResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Payrolls - */ - public Builder getPayrollResponse(GetPayrollResponse getPayrollResponse) { - Utils.checkNotNull(getPayrollResponse, "getPayrollResponse"); - this.getPayrollResponse = Optional.ofNullable(getPayrollResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Payrolls */ - public Builder getPayrollResponse(Optional getPayrollResponse) { - Utils.checkNotNull(getPayrollResponse, "getPayrollResponse"); + public Builder getPayrollResponse(@Nullable GetPayrollResponse getPayrollResponse) { this.getPayrollResponse = getPayrollResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisPayrollsOneResponse build() { - return new HrisPayrollsOneResponse( contentType, statusCode, rawResponse, getPayrollResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddRequest.java index 68de3780..26b4f025 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class HrisTimeOffRequestsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class HrisTimeOffRequestsAddRequest { @JsonCreator public HrisTimeOffRequestsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - TimeOffRequestInput timeOffRequest) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(timeOffRequest, "timeOffRequest"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull TimeOffRequestInput timeOffRequest) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.timeOffRequest = timeOffRequest; + this.timeOffRequest = Optional.ofNullable(timeOffRequest) + .orElseThrow(() -> new IllegalArgumentException("timeOffRequest cannot be null")); } public HrisTimeOffRequestsAddRequest( - TimeOffRequestInput timeOffRequest) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), timeOffRequest); + @Nonnull TimeOffRequestInput timeOffRequest) { + this(null, null, null, + null, timeOffRequest); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public TimeOffRequestInput timeOffRequest() { - return timeOffRequest; + return this.timeOffRequest; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public HrisTimeOffRequestsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisTimeOffRequestsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisTimeOffRequestsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisTimeOffRequestsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisTimeOffRequestsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisTimeOffRequestsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisTimeOffRequestsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisTimeOffRequestsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisTimeOffRequestsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisTimeOffRequestsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisTimeOffRequestsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisTimeOffRequestsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public HrisTimeOffRequestsAddRequest withTimeOffRequest(TimeOffRequestInput timeOffRequest) { - Utils.checkNotNull(timeOffRequest, "timeOffRequest"); - this.timeOffRequest = timeOffRequest; + + public HrisTimeOffRequestsAddRequest withTimeOffRequest(@Nonnull TimeOffRequestInput timeOffRequest) { + this.timeOffRequest = Utils.checkNotNull(timeOffRequest, "timeOffRequest"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private TimeOffRequestInput timeOffRequest; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder timeOffRequest(TimeOffRequestInput timeOffRequest) { - Utils.checkNotNull(timeOffRequest, "timeOffRequest"); - this.timeOffRequest = timeOffRequest; + public Builder timeOffRequest(@Nonnull TimeOffRequestInput timeOffRequest) { + this.timeOffRequest = Utils.checkNotNull(timeOffRequest, "timeOffRequest"); return this; } public HrisTimeOffRequestsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisTimeOffRequestsAddRequest( raw, consumerId, appId, serviceId, timeOffRequest); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddRequestBuilder.java index 1850f919..7893a80c 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisTimeOffRequestsAddRequestBuilder { - - private HrisTimeOffRequestsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisTimeOffRequestsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisTimeOffRequestsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisTimeOffRequestsAddRequestBuilder request(HrisTimeOffRequestsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisTimeOffRequestsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisTimeOffRequestsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisTimeOffRequestsAddRequestBuilder request(@Nonnull HrisTimeOffRequestsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisTimeOffRequestsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisTimeOffRequestsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisTimeOffRequestsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddResponse.java index 7d11568b..9e1f82f4 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisTimeOffRequestsAddResponse implements Response { /** * TimeOffRequests */ - private Optional createTimeOffRequestResponse; + private CreateTimeOffRequestResponse createTimeOffRequestResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisTimeOffRequestsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createTimeOffRequestResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createTimeOffRequestResponse, "createTimeOffRequestResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateTimeOffRequestResponse createTimeOffRequestResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createTimeOffRequestResponse = createTimeOffRequestResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisTimeOffRequestsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * TimeOffRequests */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createTimeOffRequestResponse() { - return (Optional) createTimeOffRequestResponse; + return Optional.ofNullable(this.createTimeOffRequestResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisTimeOffRequestsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisTimeOffRequestsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisTimeOffRequestsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisTimeOffRequestsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * TimeOffRequests + * Raw HTTP response; suitable for custom response parsing */ - public HrisTimeOffRequestsAddResponse withCreateTimeOffRequestResponse(CreateTimeOffRequestResponse createTimeOffRequestResponse) { - Utils.checkNotNull(createTimeOffRequestResponse, "createTimeOffRequestResponse"); - this.createTimeOffRequestResponse = Optional.ofNullable(createTimeOffRequestResponse); + public HrisTimeOffRequestsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisTimeOffRequestsAddResponse withCreateTimeOffRequestResponse(CreateTim /** * TimeOffRequests */ - public HrisTimeOffRequestsAddResponse withCreateTimeOffRequestResponse(Optional createTimeOffRequestResponse) { - Utils.checkNotNull(createTimeOffRequestResponse, "createTimeOffRequestResponse"); + public HrisTimeOffRequestsAddResponse withCreateTimeOffRequestResponse(@Nullable CreateTimeOffRequestResponse createTimeOffRequestResponse) { this.createTimeOffRequestResponse = createTimeOffRequestResponse; return this; } - /** - * Unexpected error - */ - public HrisTimeOffRequestsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisTimeOffRequestsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisTimeOffRequestsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createTimeOffRequestResponse = Optional.empty(); + private CreateTimeOffRequestResponse createTimeOffRequestResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * TimeOffRequests - */ - public Builder createTimeOffRequestResponse(CreateTimeOffRequestResponse createTimeOffRequestResponse) { - Utils.checkNotNull(createTimeOffRequestResponse, "createTimeOffRequestResponse"); - this.createTimeOffRequestResponse = Optional.ofNullable(createTimeOffRequestResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * TimeOffRequests */ - public Builder createTimeOffRequestResponse(Optional createTimeOffRequestResponse) { - Utils.checkNotNull(createTimeOffRequestResponse, "createTimeOffRequestResponse"); + public Builder createTimeOffRequestResponse(@Nullable CreateTimeOffRequestResponse createTimeOffRequestResponse) { this.createTimeOffRequestResponse = createTimeOffRequestResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisTimeOffRequestsAddResponse build() { - return new HrisTimeOffRequestsAddResponse( contentType, statusCode, rawResponse, createTimeOffRequestResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllRequest.java index d794b7a5..6010001c 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllRequest.java @@ -8,14 +8,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,25 +25,25 @@ public class HrisTimeOffRequestsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -56,19 +55,19 @@ public class HrisTimeOffRequestsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private TimeOffRequestsFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -78,113 +77,97 @@ public class HrisTimeOffRequestsAllRequest { @JsonCreator public HrisTimeOffRequestsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable TimeOffRequestsFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public HrisTimeOffRequestsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -195,103 +178,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public HrisTimeOffRequestsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisTimeOffRequestsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisTimeOffRequestsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public HrisTimeOffRequestsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public HrisTimeOffRequestsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisTimeOffRequestsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisTimeOffRequestsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisTimeOffRequestsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisTimeOffRequestsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisTimeOffRequestsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisTimeOffRequestsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisTimeOffRequestsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public HrisTimeOffRequestsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public HrisTimeOffRequestsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public HrisTimeOffRequestsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public HrisTimeOffRequestsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -299,67 +223,38 @@ public HrisTimeOffRequestsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public HrisTimeOffRequestsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public HrisTimeOffRequestsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply filters - */ - public HrisTimeOffRequestsAllRequest withFilter(TimeOffRequestsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public HrisTimeOffRequestsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public HrisTimeOffRequestsAllRequest withFilter(@Nullable TimeOffRequestsFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public HrisTimeOffRequestsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public HrisTimeOffRequestsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public HrisTimeOffRequestsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisTimeOffRequestsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisTimeOffRequestsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisTimeOffRequestsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -407,207 +302,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional filter = Optional.empty(); + private TimeOffRequestsFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - - /** - * Apply filters - */ - public Builder filter(TimeOffRequestsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable TimeOffRequestsFilter filter) { this.filter = filter; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public HrisTimeOffRequestsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new HrisTimeOffRequestsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -615,16 +404,16 @@ public HrisTimeOffRequestsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllRequestBuilder.java index 0bfa2437..87b1832f 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class HrisTimeOffRequestsAllRequestBuilder { - - private HrisTimeOffRequestsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisTimeOffRequestsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisTimeOffRequestsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisTimeOffRequestsAllRequestBuilder request(HrisTimeOffRequestsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisTimeOffRequestsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisTimeOffRequestsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisTimeOffRequestsAllRequestBuilder request(@Nonnull HrisTimeOffRequestsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisTimeOffRequestsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisTimeOffRequestsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisTimeOffRequestsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public HrisTimeOffRequestsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new HrisTimeOffRequestsAllOperation( - sdkConfiguration, - options); + HrisTimeOffRequestsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new HrisTimeOffRequestsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - HrisTimeOffRequestsAllRequest::withCursor, + HrisTimeOffRequestsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllResponse.java index a0a2a7dd..2d66842e 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisTimeOffRequestsAllResponse implements Response { /** * TimeOffRequests */ - private Optional getTimeOffRequestsResponse; + private GetTimeOffRequestsResponse getTimeOffRequestsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisTimeOffRequestsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getTimeOffRequestsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getTimeOffRequestsResponse, "getTimeOffRequestsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetTimeOffRequestsResponse getTimeOffRequestsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getTimeOffRequestsResponse = getTimeOffRequestsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisTimeOffRequestsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * TimeOffRequests */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getTimeOffRequestsResponse() { - return (Optional) getTimeOffRequestsResponse; + return Optional.ofNullable(this.getTimeOffRequestsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisTimeOffRequestsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisTimeOffRequestsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisTimeOffRequestsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisTimeOffRequestsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * TimeOffRequests + * Raw HTTP response; suitable for custom response parsing */ - public HrisTimeOffRequestsAllResponse withGetTimeOffRequestsResponse(GetTimeOffRequestsResponse getTimeOffRequestsResponse) { - Utils.checkNotNull(getTimeOffRequestsResponse, "getTimeOffRequestsResponse"); - this.getTimeOffRequestsResponse = Optional.ofNullable(getTimeOffRequestsResponse); + public HrisTimeOffRequestsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisTimeOffRequestsAllResponse withGetTimeOffRequestsResponse(GetTimeOffR /** * TimeOffRequests */ - public HrisTimeOffRequestsAllResponse withGetTimeOffRequestsResponse(Optional getTimeOffRequestsResponse) { - Utils.checkNotNull(getTimeOffRequestsResponse, "getTimeOffRequestsResponse"); + public HrisTimeOffRequestsAllResponse withGetTimeOffRequestsResponse(@Nullable GetTimeOffRequestsResponse getTimeOffRequestsResponse) { this.getTimeOffRequestsResponse = getTimeOffRequestsResponse; return this; } - /** - * Unexpected error - */ - public HrisTimeOffRequestsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisTimeOffRequestsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisTimeOffRequestsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getTimeOffRequestsResponse = Optional.empty(); + private GetTimeOffRequestsResponse getTimeOffRequestsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * TimeOffRequests - */ - public Builder getTimeOffRequestsResponse(GetTimeOffRequestsResponse getTimeOffRequestsResponse) { - Utils.checkNotNull(getTimeOffRequestsResponse, "getTimeOffRequestsResponse"); - this.getTimeOffRequestsResponse = Optional.ofNullable(getTimeOffRequestsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * TimeOffRequests */ - public Builder getTimeOffRequestsResponse(Optional getTimeOffRequestsResponse) { - Utils.checkNotNull(getTimeOffRequestsResponse, "getTimeOffRequestsResponse"); + public Builder getTimeOffRequestsResponse(@Nullable GetTimeOffRequestsResponse getTimeOffRequestsResponse) { this.getTimeOffRequestsResponse = getTimeOffRequestsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisTimeOffRequestsAllResponse build() { - return new HrisTimeOffRequestsAllResponse( contentType, statusCode, rawResponse, getTimeOffRequestsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteRequest.java index b8d54a08..d2aa162b 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,25 +27,25 @@ public class HrisTimeOffRequestsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the employee you are acting upon. @@ -54,79 +55,70 @@ public class HrisTimeOffRequestsDeleteRequest { @JsonCreator public HrisTimeOffRequestsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - String employeeId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(employeeId, "employeeId"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull String employeeId) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.employeeId = employeeId; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.employeeId = Optional.ofNullable(employeeId) + .orElseThrow(() -> new IllegalArgumentException("employeeId cannot be null")); } public HrisTimeOffRequestsDeleteRequest( - String id, - String employeeId) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), employeeId); + @Nonnull String id, + @Nonnull String employeeId) { + this(id, null, null, + null, null, employeeId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the employee you are acting upon. */ - @JsonIgnore public String employeeId() { - return employeeId; + return this.employeeId; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisTimeOffRequestsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisTimeOffRequestsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisTimeOffRequestsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,78 +138,48 @@ public HrisTimeOffRequestsDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisTimeOffRequestsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisTimeOffRequestsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisTimeOffRequestsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisTimeOffRequestsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisTimeOffRequestsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisTimeOffRequestsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisTimeOffRequestsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisTimeOffRequestsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisTimeOffRequestsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisTimeOffRequestsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisTimeOffRequestsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * ID of the employee you are acting upon. */ - public HrisTimeOffRequestsDeleteRequest withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; + public HrisTimeOffRequestsDeleteRequest withEmployeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -269,13 +221,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private String employeeId; @@ -283,117 +235,65 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the employee you are acting upon. */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; + public Builder employeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } public HrisTimeOffRequestsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisTimeOffRequestsDeleteRequest( id, consumerId, appId, serviceId, raw, employeeId); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteRequestBuilder.java index d50c2d82..d2e87b4c 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisTimeOffRequestsDeleteRequestBuilder { - - private HrisTimeOffRequestsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisTimeOffRequestsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisTimeOffRequestsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisTimeOffRequestsDeleteRequestBuilder request(HrisTimeOffRequestsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisTimeOffRequestsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisTimeOffRequestsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisTimeOffRequestsDeleteRequestBuilder request(@Nonnull HrisTimeOffRequestsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisTimeOffRequestsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisTimeOffRequestsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisTimeOffRequestsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteResponse.java index 5224cc2a..fb276d99 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisTimeOffRequestsDeleteResponse implements Response { /** * TimeOffRequests */ - private Optional deleteTimeOffRequestResponse; + private DeleteTimeOffRequestResponse deleteTimeOffRequestResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisTimeOffRequestsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteTimeOffRequestResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteTimeOffRequestResponse, "deleteTimeOffRequestResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteTimeOffRequestResponse deleteTimeOffRequestResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteTimeOffRequestResponse = deleteTimeOffRequestResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisTimeOffRequestsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * TimeOffRequests */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteTimeOffRequestResponse() { - return (Optional) deleteTimeOffRequestResponse; + return Optional.ofNullable(this.deleteTimeOffRequestResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisTimeOffRequestsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisTimeOffRequestsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisTimeOffRequestsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisTimeOffRequestsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * TimeOffRequests + * Raw HTTP response; suitable for custom response parsing */ - public HrisTimeOffRequestsDeleteResponse withDeleteTimeOffRequestResponse(DeleteTimeOffRequestResponse deleteTimeOffRequestResponse) { - Utils.checkNotNull(deleteTimeOffRequestResponse, "deleteTimeOffRequestResponse"); - this.deleteTimeOffRequestResponse = Optional.ofNullable(deleteTimeOffRequestResponse); + public HrisTimeOffRequestsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisTimeOffRequestsDeleteResponse withDeleteTimeOffRequestResponse(Delete /** * TimeOffRequests */ - public HrisTimeOffRequestsDeleteResponse withDeleteTimeOffRequestResponse(Optional deleteTimeOffRequestResponse) { - Utils.checkNotNull(deleteTimeOffRequestResponse, "deleteTimeOffRequestResponse"); + public HrisTimeOffRequestsDeleteResponse withDeleteTimeOffRequestResponse(@Nullable DeleteTimeOffRequestResponse deleteTimeOffRequestResponse) { this.deleteTimeOffRequestResponse = deleteTimeOffRequestResponse; return this; } - /** - * Unexpected error - */ - public HrisTimeOffRequestsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisTimeOffRequestsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisTimeOffRequestsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteTimeOffRequestResponse = Optional.empty(); + private DeleteTimeOffRequestResponse deleteTimeOffRequestResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * TimeOffRequests - */ - public Builder deleteTimeOffRequestResponse(DeleteTimeOffRequestResponse deleteTimeOffRequestResponse) { - Utils.checkNotNull(deleteTimeOffRequestResponse, "deleteTimeOffRequestResponse"); - this.deleteTimeOffRequestResponse = Optional.ofNullable(deleteTimeOffRequestResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * TimeOffRequests */ - public Builder deleteTimeOffRequestResponse(Optional deleteTimeOffRequestResponse) { - Utils.checkNotNull(deleteTimeOffRequestResponse, "deleteTimeOffRequestResponse"); + public Builder deleteTimeOffRequestResponse(@Nullable DeleteTimeOffRequestResponse deleteTimeOffRequestResponse) { this.deleteTimeOffRequestResponse = deleteTimeOffRequestResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisTimeOffRequestsDeleteResponse build() { - return new HrisTimeOffRequestsDeleteResponse( contentType, statusCode, rawResponse, deleteTimeOffRequestResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneRequest.java index a701aedb..ad99efb9 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class HrisTimeOffRequestsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -61,91 +62,81 @@ public class HrisTimeOffRequestsOneRequest { @JsonCreator public HrisTimeOffRequestsOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields, - String employeeId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - Utils.checkNotNull(employeeId, "employeeId"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields, + @Nonnull String employeeId) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; - this.employeeId = employeeId; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); + this.employeeId = Optional.ofNullable(employeeId) + .orElseThrow(() -> new IllegalArgumentException("employeeId cannot be null")); } public HrisTimeOffRequestsOneRequest( - String id, - String employeeId) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), + @Nonnull String id, + @Nonnull String employeeId) { + this(id, null, null, + null, null, null, employeeId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } /** * ID of the employee you are acting upon. */ - @JsonIgnore public String employeeId() { - return employeeId; + return this.employeeId; } public static Builder builder() { @@ -156,18 +147,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisTimeOffRequestsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisTimeOffRequestsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisTimeOffRequestsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -175,96 +156,57 @@ public HrisTimeOffRequestsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisTimeOffRequestsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisTimeOffRequestsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisTimeOffRequestsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisTimeOffRequestsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisTimeOffRequestsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisTimeOffRequestsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisTimeOffRequestsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisTimeOffRequestsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisTimeOffRequestsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisTimeOffRequestsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisTimeOffRequestsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public HrisTimeOffRequestsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public HrisTimeOffRequestsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public HrisTimeOffRequestsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } /** * ID of the employee you are acting upon. */ - public HrisTimeOffRequestsOneRequest withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; + public HrisTimeOffRequestsOneRequest withEmployeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -309,15 +251,15 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private String employeeId; @@ -325,126 +267,63 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - - /** * ID of the employee you are acting upon. */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; + public Builder employeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } public HrisTimeOffRequestsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisTimeOffRequestsOneRequest( id, consumerId, appId, serviceId, raw, fields, @@ -452,10 +331,10 @@ public HrisTimeOffRequestsOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneRequestBuilder.java index 8187509b..17486a55 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisTimeOffRequestsOneRequestBuilder { - - private HrisTimeOffRequestsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisTimeOffRequestsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisTimeOffRequestsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisTimeOffRequestsOneRequestBuilder request(HrisTimeOffRequestsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisTimeOffRequestsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisTimeOffRequestsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisTimeOffRequestsOneRequestBuilder request(@Nonnull HrisTimeOffRequestsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisTimeOffRequestsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisTimeOffRequestsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisTimeOffRequestsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneResponse.java index c0986528..8cc607d8 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisTimeOffRequestsOneResponse implements Response { /** * TimeOffRequests */ - private Optional getTimeOffRequestResponse; + private GetTimeOffRequestResponse getTimeOffRequestResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisTimeOffRequestsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getTimeOffRequestResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getTimeOffRequestResponse, "getTimeOffRequestResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetTimeOffRequestResponse getTimeOffRequestResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getTimeOffRequestResponse = getTimeOffRequestResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisTimeOffRequestsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * TimeOffRequests */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getTimeOffRequestResponse() { - return (Optional) getTimeOffRequestResponse; + return Optional.ofNullable(this.getTimeOffRequestResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisTimeOffRequestsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisTimeOffRequestsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisTimeOffRequestsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisTimeOffRequestsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * TimeOffRequests + * Raw HTTP response; suitable for custom response parsing */ - public HrisTimeOffRequestsOneResponse withGetTimeOffRequestResponse(GetTimeOffRequestResponse getTimeOffRequestResponse) { - Utils.checkNotNull(getTimeOffRequestResponse, "getTimeOffRequestResponse"); - this.getTimeOffRequestResponse = Optional.ofNullable(getTimeOffRequestResponse); + public HrisTimeOffRequestsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisTimeOffRequestsOneResponse withGetTimeOffRequestResponse(GetTimeOffRe /** * TimeOffRequests */ - public HrisTimeOffRequestsOneResponse withGetTimeOffRequestResponse(Optional getTimeOffRequestResponse) { - Utils.checkNotNull(getTimeOffRequestResponse, "getTimeOffRequestResponse"); + public HrisTimeOffRequestsOneResponse withGetTimeOffRequestResponse(@Nullable GetTimeOffRequestResponse getTimeOffRequestResponse) { this.getTimeOffRequestResponse = getTimeOffRequestResponse; return this; } - /** - * Unexpected error - */ - public HrisTimeOffRequestsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisTimeOffRequestsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisTimeOffRequestsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getTimeOffRequestResponse = Optional.empty(); + private GetTimeOffRequestResponse getTimeOffRequestResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * TimeOffRequests - */ - public Builder getTimeOffRequestResponse(GetTimeOffRequestResponse getTimeOffRequestResponse) { - Utils.checkNotNull(getTimeOffRequestResponse, "getTimeOffRequestResponse"); - this.getTimeOffRequestResponse = Optional.ofNullable(getTimeOffRequestResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * TimeOffRequests */ - public Builder getTimeOffRequestResponse(Optional getTimeOffRequestResponse) { - Utils.checkNotNull(getTimeOffRequestResponse, "getTimeOffRequestResponse"); + public Builder getTimeOffRequestResponse(@Nullable GetTimeOffRequestResponse getTimeOffRequestResponse) { this.getTimeOffRequestResponse = getTimeOffRequestResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisTimeOffRequestsOneResponse build() { - return new HrisTimeOffRequestsOneResponse( contentType, statusCode, rawResponse, getTimeOffRequestResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateRequest.java index 02b8e79e..53712193 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class HrisTimeOffRequestsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the employee you are acting upon. @@ -59,89 +60,79 @@ public class HrisTimeOffRequestsUpdateRequest { @JsonCreator public HrisTimeOffRequestsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - String employeeId, - TimeOffRequestInput timeOffRequest) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(employeeId, "employeeId"); - Utils.checkNotNull(timeOffRequest, "timeOffRequest"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull String employeeId, + @Nonnull TimeOffRequestInput timeOffRequest) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.employeeId = employeeId; - this.timeOffRequest = timeOffRequest; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.employeeId = Optional.ofNullable(employeeId) + .orElseThrow(() -> new IllegalArgumentException("employeeId cannot be null")); + this.timeOffRequest = Optional.ofNullable(timeOffRequest) + .orElseThrow(() -> new IllegalArgumentException("timeOffRequest cannot be null")); } public HrisTimeOffRequestsUpdateRequest( - String id, - String employeeId, - TimeOffRequestInput timeOffRequest) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), employeeId, + @Nonnull String id, + @Nonnull String employeeId, + @Nonnull TimeOffRequestInput timeOffRequest) { + this(id, null, null, + null, null, employeeId, timeOffRequest); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the employee you are acting upon. */ - @JsonIgnore public String employeeId() { - return employeeId; + return this.employeeId; } - @JsonIgnore public TimeOffRequestInput timeOffRequest() { - return timeOffRequest; + return this.timeOffRequest; } public static Builder builder() { @@ -152,18 +143,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public HrisTimeOffRequestsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public HrisTimeOffRequestsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public HrisTimeOffRequestsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -171,84 +152,54 @@ public HrisTimeOffRequestsUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public HrisTimeOffRequestsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public HrisTimeOffRequestsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public HrisTimeOffRequestsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public HrisTimeOffRequestsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public HrisTimeOffRequestsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public HrisTimeOffRequestsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public HrisTimeOffRequestsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public HrisTimeOffRequestsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public HrisTimeOffRequestsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public HrisTimeOffRequestsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public HrisTimeOffRequestsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * ID of the employee you are acting upon. */ - public HrisTimeOffRequestsUpdateRequest withEmployeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; + public HrisTimeOffRequestsUpdateRequest withEmployeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } - public HrisTimeOffRequestsUpdateRequest withTimeOffRequest(TimeOffRequestInput timeOffRequest) { - Utils.checkNotNull(timeOffRequest, "timeOffRequest"); - this.timeOffRequest = timeOffRequest; + + public HrisTimeOffRequestsUpdateRequest withTimeOffRequest(@Nonnull TimeOffRequestInput timeOffRequest) { + this.timeOffRequest = Utils.checkNotNull(timeOffRequest, "timeOffRequest"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -293,13 +244,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private String employeeId; @@ -309,114 +260,60 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the employee you are acting upon. */ - public Builder employeeId(String employeeId) { - Utils.checkNotNull(employeeId, "employeeId"); - this.employeeId = employeeId; + public Builder employeeId(@Nonnull String employeeId) { + this.employeeId = Utils.checkNotNull(employeeId, "employeeId"); return this; } - - public Builder timeOffRequest(TimeOffRequestInput timeOffRequest) { - Utils.checkNotNull(timeOffRequest, "timeOffRequest"); - this.timeOffRequest = timeOffRequest; + public Builder timeOffRequest(@Nonnull TimeOffRequestInput timeOffRequest) { + this.timeOffRequest = Utils.checkNotNull(timeOffRequest, "timeOffRequest"); return this; } public HrisTimeOffRequestsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new HrisTimeOffRequestsUpdateRequest( id, consumerId, appId, serviceId, raw, employeeId, @@ -424,10 +321,10 @@ public HrisTimeOffRequestsUpdateRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateRequestBuilder.java index 33e6e78b..35f9de2e 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class HrisTimeOffRequestsUpdateRequestBuilder { - - private HrisTimeOffRequestsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private HrisTimeOffRequestsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public HrisTimeOffRequestsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public HrisTimeOffRequestsUpdateRequestBuilder request(HrisTimeOffRequestsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public HrisTimeOffRequestsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public HrisTimeOffRequestsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public HrisTimeOffRequestsUpdateRequestBuilder request(@Nonnull HrisTimeOffRequestsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private HrisTimeOffRequestsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public HrisTimeOffRequestsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new HrisTimeOffRequestsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateResponse.java index b4dca497..d4f25398 100644 --- a/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/HrisTimeOffRequestsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class HrisTimeOffRequestsUpdateResponse implements Response { /** * TimeOffRequests */ - private Optional updateTimeOffRequestResponse; + private UpdateTimeOffRequestResponse updateTimeOffRequestResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public HrisTimeOffRequestsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateTimeOffRequestResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateTimeOffRequestResponse, "updateTimeOffRequestResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateTimeOffRequestResponse updateTimeOffRequestResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateTimeOffRequestResponse = updateTimeOffRequestResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public HrisTimeOffRequestsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * TimeOffRequests */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateTimeOffRequestResponse() { - return (Optional) updateTimeOffRequestResponse; + return Optional.ofNullable(this.updateTimeOffRequestResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public HrisTimeOffRequestsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public HrisTimeOffRequestsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public HrisTimeOffRequestsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public HrisTimeOffRequestsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * TimeOffRequests + * Raw HTTP response; suitable for custom response parsing */ - public HrisTimeOffRequestsUpdateResponse withUpdateTimeOffRequestResponse(UpdateTimeOffRequestResponse updateTimeOffRequestResponse) { - Utils.checkNotNull(updateTimeOffRequestResponse, "updateTimeOffRequestResponse"); - this.updateTimeOffRequestResponse = Optional.ofNullable(updateTimeOffRequestResponse); + public HrisTimeOffRequestsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public HrisTimeOffRequestsUpdateResponse withUpdateTimeOffRequestResponse(Update /** * TimeOffRequests */ - public HrisTimeOffRequestsUpdateResponse withUpdateTimeOffRequestResponse(Optional updateTimeOffRequestResponse) { - Utils.checkNotNull(updateTimeOffRequestResponse, "updateTimeOffRequestResponse"); + public HrisTimeOffRequestsUpdateResponse withUpdateTimeOffRequestResponse(@Nullable UpdateTimeOffRequestResponse updateTimeOffRequestResponse) { this.updateTimeOffRequestResponse = updateTimeOffRequestResponse; return this; } - /** - * Unexpected error - */ - public HrisTimeOffRequestsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public HrisTimeOffRequestsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public HrisTimeOffRequestsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateTimeOffRequestResponse = Optional.empty(); + private UpdateTimeOffRequestResponse updateTimeOffRequestResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * TimeOffRequests - */ - public Builder updateTimeOffRequestResponse(UpdateTimeOffRequestResponse updateTimeOffRequestResponse) { - Utils.checkNotNull(updateTimeOffRequestResponse, "updateTimeOffRequestResponse"); - this.updateTimeOffRequestResponse = Optional.ofNullable(updateTimeOffRequestResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * TimeOffRequests */ - public Builder updateTimeOffRequestResponse(Optional updateTimeOffRequestResponse) { - Utils.checkNotNull(updateTimeOffRequestResponse, "updateTimeOffRequestResponse"); + public Builder updateTimeOffRequestResponse(@Nullable UpdateTimeOffRequestResponse updateTimeOffRequestResponse) { this.updateTimeOffRequestResponse = updateTimeOffRequestResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public HrisTimeOffRequestsUpdateResponse build() { - return new HrisTimeOffRequestsUpdateResponse( contentType, statusCode, rawResponse, updateTimeOffRequestResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllRequest.java index 90e409c6..8322b823 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllRequest.java @@ -7,14 +7,14 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -31,25 +31,25 @@ public class IssueTrackingCollectionTagsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -61,13 +61,13 @@ public class IssueTrackingCollectionTagsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -77,113 +77,99 @@ public class IssueTrackingCollectionTagsAllRequest { @JsonCreator public IssueTrackingCollectionTagsAllRequest( - String collectionId, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.collectionId = collectionId; - this.raw = raw; + @Nonnull String collectionId, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public IssueTrackingCollectionTagsAllRequest( - String collectionId) { - this(collectionId, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String collectionId) { + this(collectionId, null, null, + null, null, null, + null, null, null); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -194,18 +180,8 @@ public static Builder builder() { /** * The collection ID */ - public IssueTrackingCollectionTagsAllRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTagsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public IssueTrackingCollectionTagsAllRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } @@ -213,93 +189,44 @@ public IssueTrackingCollectionTagsAllRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTagsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTagsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTagsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTagsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTagsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTagsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTagsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTagsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTagsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTagsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTagsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public IssueTrackingCollectionTagsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public IssueTrackingCollectionTagsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public IssueTrackingCollectionTagsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public IssueTrackingCollectionTagsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -307,48 +234,29 @@ public IssueTrackingCollectionTagsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public IssueTrackingCollectionTagsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public IssueTrackingCollectionTagsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public IssueTrackingCollectionTagsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public IssueTrackingCollectionTagsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public IssueTrackingCollectionTagsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public IssueTrackingCollectionTagsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public IssueTrackingCollectionTagsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public IssueTrackingCollectionTagsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -398,196 +306,99 @@ public final static class Builder { private String collectionId; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public IssueTrackingCollectionTagsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new IssueTrackingCollectionTagsAllRequest( collectionId, raw, consumerId, appId, serviceId, cursor, @@ -595,16 +406,16 @@ public IssueTrackingCollectionTagsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllRequestBuilder.java index 69b8aaaf..7651e121 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class IssueTrackingCollectionTagsAllRequestBuilder { - - private IssueTrackingCollectionTagsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTagsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTagsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTagsAllRequestBuilder request(IssueTrackingCollectionTagsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTagsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTagsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTagsAllRequestBuilder request(@Nonnull IssueTrackingCollectionTagsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTagsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTagsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTagsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public IssueTrackingCollectionTagsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new IssueTrackingCollectionTagsAllOperation( - sdkConfiguration, - options); + IssueTrackingCollectionTagsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new IssueTrackingCollectionTagsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - IssueTrackingCollectionTagsAllRequest::withCursor, + IssueTrackingCollectionTagsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllResponse.java index 083d93ea..cf2b260b 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTagsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTagsAllResponse implements Response { /** * List Tags */ - private Optional getCollectionTagsResponse; + private GetCollectionTagsResponse getCollectionTagsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTagsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCollectionTagsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCollectionTagsResponse, "getCollectionTagsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCollectionTagsResponse getCollectionTagsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCollectionTagsResponse = getCollectionTagsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTagsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * List Tags */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCollectionTagsResponse() { - return (Optional) getCollectionTagsResponse; + return Optional.ofNullable(this.getCollectionTagsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTagsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTagsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTagsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTagsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * List Tags + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTagsAllResponse withGetCollectionTagsResponse(GetCollectionTagsResponse getCollectionTagsResponse) { - Utils.checkNotNull(getCollectionTagsResponse, "getCollectionTagsResponse"); - this.getCollectionTagsResponse = Optional.ofNullable(getCollectionTagsResponse); + public IssueTrackingCollectionTagsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTagsAllResponse withGetCollectionTagsResponse(GetC /** * List Tags */ - public IssueTrackingCollectionTagsAllResponse withGetCollectionTagsResponse(Optional getCollectionTagsResponse) { - Utils.checkNotNull(getCollectionTagsResponse, "getCollectionTagsResponse"); + public IssueTrackingCollectionTagsAllResponse withGetCollectionTagsResponse(@Nullable GetCollectionTagsResponse getCollectionTagsResponse) { this.getCollectionTagsResponse = getCollectionTagsResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTagsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTagsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTagsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCollectionTagsResponse = Optional.empty(); + private GetCollectionTagsResponse getCollectionTagsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * List Tags - */ - public Builder getCollectionTagsResponse(GetCollectionTagsResponse getCollectionTagsResponse) { - Utils.checkNotNull(getCollectionTagsResponse, "getCollectionTagsResponse"); - this.getCollectionTagsResponse = Optional.ofNullable(getCollectionTagsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * List Tags */ - public Builder getCollectionTagsResponse(Optional getCollectionTagsResponse) { - Utils.checkNotNull(getCollectionTagsResponse, "getCollectionTagsResponse"); + public Builder getCollectionTagsResponse(@Nullable GetCollectionTagsResponse getCollectionTagsResponse) { this.getCollectionTagsResponse = getCollectionTagsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTagsAllResponse build() { - return new IssueTrackingCollectionTagsAllResponse( contentType, statusCode, rawResponse, getCollectionTagsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddRequest.java index e68dc61e..ec66fae9 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class IssueTrackingCollectionTicketCommentsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The collection ID @@ -59,89 +60,79 @@ public class IssueTrackingCollectionTicketCommentsAddRequest { @JsonCreator public IssueTrackingCollectionTicketCommentsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - String collectionId, - String ticketId, - CollectionTicketCommentInput collectionTicketComment) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(ticketId, "ticketId"); - Utils.checkNotNull(collectionTicketComment, "collectionTicketComment"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull String collectionId, + @Nonnull String ticketId, + @Nonnull CollectionTicketCommentInput collectionTicketComment) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.collectionId = collectionId; - this.ticketId = ticketId; - this.collectionTicketComment = collectionTicketComment; + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.ticketId = Optional.ofNullable(ticketId) + .orElseThrow(() -> new IllegalArgumentException("ticketId cannot be null")); + this.collectionTicketComment = Optional.ofNullable(collectionTicketComment) + .orElseThrow(() -> new IllegalArgumentException("collectionTicketComment cannot be null")); } public IssueTrackingCollectionTicketCommentsAddRequest( - String collectionId, - String ticketId, - CollectionTicketCommentInput collectionTicketComment) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), collectionId, ticketId, + @Nonnull String collectionId, + @Nonnull String ticketId, + @Nonnull CollectionTicketCommentInput collectionTicketComment) { + this(null, null, null, + null, collectionId, ticketId, collectionTicketComment); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * ID of the ticket you are acting upon. */ - @JsonIgnore public String ticketId() { - return ticketId; + return this.ticketId; } - @JsonIgnore public CollectionTicketCommentInput collectionTicketComment() { - return collectionTicketComment; + return this.collectionTicketComment; } public static Builder builder() { @@ -152,103 +143,63 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTicketCommentsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTicketCommentsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTicketCommentsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTicketCommentsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTicketCommentsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTicketCommentsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTicketCommentsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTicketCommentsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTicketCommentsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTicketCommentsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTicketCommentsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTicketCommentsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The collection ID */ - public IssueTrackingCollectionTicketCommentsAddRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public IssueTrackingCollectionTicketCommentsAddRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } + /** * ID of the ticket you are acting upon. */ - public IssueTrackingCollectionTicketCommentsAddRequest withTicketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; + public IssueTrackingCollectionTicketCommentsAddRequest withTicketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } - public IssueTrackingCollectionTicketCommentsAddRequest withCollectionTicketComment(CollectionTicketCommentInput collectionTicketComment) { - Utils.checkNotNull(collectionTicketComment, "collectionTicketComment"); - this.collectionTicketComment = collectionTicketComment; + + public IssueTrackingCollectionTicketCommentsAddRequest withCollectionTicketComment(@Nonnull CollectionTicketCommentInput collectionTicketComment) { + this.collectionTicketComment = Utils.checkNotNull(collectionTicketComment, "collectionTicketComment"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -291,13 +242,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private String collectionId; @@ -309,114 +260,60 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** * ID of the ticket you are acting upon. */ - public Builder ticketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; + public Builder ticketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } - - public Builder collectionTicketComment(CollectionTicketCommentInput collectionTicketComment) { - Utils.checkNotNull(collectionTicketComment, "collectionTicketComment"); - this.collectionTicketComment = collectionTicketComment; + public Builder collectionTicketComment(@Nonnull CollectionTicketCommentInput collectionTicketComment) { + this.collectionTicketComment = Utils.checkNotNull(collectionTicketComment, "collectionTicketComment"); return this; } public IssueTrackingCollectionTicketCommentsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new IssueTrackingCollectionTicketCommentsAddRequest( raw, consumerId, appId, serviceId, collectionId, ticketId, @@ -424,10 +321,10 @@ public IssueTrackingCollectionTicketCommentsAddRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddRequestBuilder.java index 7abc4346..7792f765 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class IssueTrackingCollectionTicketCommentsAddRequestBuilder { - - private IssueTrackingCollectionTicketCommentsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTicketCommentsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTicketCommentsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTicketCommentsAddRequestBuilder request(IssueTrackingCollectionTicketCommentsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTicketCommentsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTicketCommentsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTicketCommentsAddRequestBuilder request(@Nonnull IssueTrackingCollectionTicketCommentsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTicketCommentsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTicketCommentsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTicketCommentsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddResponse.java index 6973cdfc..9a1e5de4 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTicketCommentsAddResponse implements Respons /** * Create a Comment */ - private Optional createCommentResponse; + private CreateCommentResponse createCommentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTicketCommentsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createCommentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createCommentResponse, "createCommentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateCommentResponse createCommentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createCommentResponse = createCommentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTicketCommentsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Create a Comment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createCommentResponse() { - return (Optional) createCommentResponse; + return Optional.ofNullable(this.createCommentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTicketCommentsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTicketCommentsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTicketCommentsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTicketCommentsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Create a Comment + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTicketCommentsAddResponse withCreateCommentResponse(CreateCommentResponse createCommentResponse) { - Utils.checkNotNull(createCommentResponse, "createCommentResponse"); - this.createCommentResponse = Optional.ofNullable(createCommentResponse); + public IssueTrackingCollectionTicketCommentsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTicketCommentsAddResponse withCreateCommentRespons /** * Create a Comment */ - public IssueTrackingCollectionTicketCommentsAddResponse withCreateCommentResponse(Optional createCommentResponse) { - Utils.checkNotNull(createCommentResponse, "createCommentResponse"); + public IssueTrackingCollectionTicketCommentsAddResponse withCreateCommentResponse(@Nullable CreateCommentResponse createCommentResponse) { this.createCommentResponse = createCommentResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTicketCommentsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTicketCommentsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTicketCommentsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createCommentResponse = Optional.empty(); + private CreateCommentResponse createCommentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Create a Comment - */ - public Builder createCommentResponse(CreateCommentResponse createCommentResponse) { - Utils.checkNotNull(createCommentResponse, "createCommentResponse"); - this.createCommentResponse = Optional.ofNullable(createCommentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Create a Comment */ - public Builder createCommentResponse(Optional createCommentResponse) { - Utils.checkNotNull(createCommentResponse, "createCommentResponse"); + public Builder createCommentResponse(@Nullable CreateCommentResponse createCommentResponse) { this.createCommentResponse = createCommentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTicketCommentsAddResponse build() { - return new IssueTrackingCollectionTicketCommentsAddResponse( contentType, statusCode, rawResponse, createCommentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllRequest.java index f21a0199..18b1c219 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllRequest.java @@ -8,14 +8,14 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,25 +26,25 @@ public class IssueTrackingCollectionTicketCommentsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -56,7 +56,7 @@ public class IssueTrackingCollectionTicketCommentsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * The collection ID @@ -74,13 +74,13 @@ public class IssueTrackingCollectionTicketCommentsAllRequest { * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private CommentsSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -90,138 +90,120 @@ public class IssueTrackingCollectionTicketCommentsAllRequest { @JsonCreator public IssueTrackingCollectionTicketCommentsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - String collectionId, - String ticketId, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(ticketId, "ticketId"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nonnull String collectionId, + @Nonnull String ticketId, + @Nullable CommentsSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; - this.collectionId = collectionId; - this.ticketId = ticketId; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.ticketId = Optional.ofNullable(ticketId) + .orElseThrow(() -> new IllegalArgumentException("ticketId cannot be null")); this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public IssueTrackingCollectionTicketCommentsAllRequest( - String collectionId, - String ticketId) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - collectionId, ticketId, Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + @Nonnull String collectionId, + @Nonnull String ticketId) { + this(null, null, null, + null, null, null, + collectionId, ticketId, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * ID of the ticket you are acting upon. */ - @JsonIgnore public String ticketId() { - return ticketId; + return this.ticketId; } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -232,103 +214,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTicketCommentsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTicketCommentsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTicketCommentsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTicketCommentsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTicketCommentsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTicketCommentsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTicketCommentsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTicketCommentsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTicketCommentsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTicketCommentsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTicketCommentsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTicketCommentsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public IssueTrackingCollectionTicketCommentsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public IssueTrackingCollectionTicketCommentsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public IssueTrackingCollectionTicketCommentsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public IssueTrackingCollectionTicketCommentsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -336,36 +259,26 @@ public IssueTrackingCollectionTicketCommentsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public IssueTrackingCollectionTicketCommentsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public IssueTrackingCollectionTicketCommentsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + /** * The collection ID */ - public IssueTrackingCollectionTicketCommentsAllRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public IssueTrackingCollectionTicketCommentsAllRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** - * ID of the ticket you are acting upon. - */ - public IssueTrackingCollectionTicketCommentsAllRequest withTicketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; - return this; - } /** - * Apply sorting + * ID of the ticket you are acting upon. */ - public IssueTrackingCollectionTicketCommentsAllRequest withSort(CommentsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); + public IssueTrackingCollectionTicketCommentsAllRequest withTicketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } @@ -373,48 +286,29 @@ public IssueTrackingCollectionTicketCommentsAllRequest withSort(CommentsSort sor /** * Apply sorting */ - public IssueTrackingCollectionTicketCommentsAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public IssueTrackingCollectionTicketCommentsAllRequest withSort(@Nullable CommentsSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public IssueTrackingCollectionTicketCommentsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public IssueTrackingCollectionTicketCommentsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public IssueTrackingCollectionTicketCommentsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public IssueTrackingCollectionTicketCommentsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public IssueTrackingCollectionTicketCommentsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public IssueTrackingCollectionTicketCommentsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -467,231 +361,121 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; private String collectionId; private String ticketId; - private Optional sort = Optional.empty(); + private CommentsSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** * ID of the ticket you are acting upon. */ - public Builder ticketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; - return this; - } - - - /** - * Apply sorting - */ - public Builder sort(CommentsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); + public Builder ticketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } /** * Apply sorting */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable CommentsSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public IssueTrackingCollectionTicketCommentsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new IssueTrackingCollectionTicketCommentsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -700,16 +484,16 @@ public IssueTrackingCollectionTicketCommentsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllRequestBuilder.java index 1d2b83e2..3bc9aafc 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class IssueTrackingCollectionTicketCommentsAllRequestBuilder { - - private IssueTrackingCollectionTicketCommentsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTicketCommentsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTicketCommentsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTicketCommentsAllRequestBuilder request(IssueTrackingCollectionTicketCommentsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTicketCommentsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTicketCommentsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTicketCommentsAllRequestBuilder request(@Nonnull IssueTrackingCollectionTicketCommentsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTicketCommentsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTicketCommentsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTicketCommentsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public IssueTrackingCollectionTicketCommentsAllResponse call() throws Exception * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new IssueTrackingCollectionTicketCommentsAllOperation( - sdkConfiguration, - options); + IssueTrackingCollectionTicketCommentsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new IssueTrackingCollectionTicketCommentsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - IssueTrackingCollectionTicketCommentsAllRequest::withCursor, + IssueTrackingCollectionTicketCommentsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllResponse.java index 28323aa6..bffef792 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTicketCommentsAllResponse implements Respons /** * List Comments */ - private Optional getCommentsResponse; + private GetCommentsResponse getCommentsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTicketCommentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCommentsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCommentsResponse, "getCommentsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCommentsResponse getCommentsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCommentsResponse = getCommentsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTicketCommentsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * List Comments */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCommentsResponse() { - return (Optional) getCommentsResponse; + return Optional.ofNullable(this.getCommentsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTicketCommentsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTicketCommentsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTicketCommentsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTicketCommentsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * List Comments + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTicketCommentsAllResponse withGetCommentsResponse(GetCommentsResponse getCommentsResponse) { - Utils.checkNotNull(getCommentsResponse, "getCommentsResponse"); - this.getCommentsResponse = Optional.ofNullable(getCommentsResponse); + public IssueTrackingCollectionTicketCommentsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTicketCommentsAllResponse withGetCommentsResponse( /** * List Comments */ - public IssueTrackingCollectionTicketCommentsAllResponse withGetCommentsResponse(Optional getCommentsResponse) { - Utils.checkNotNull(getCommentsResponse, "getCommentsResponse"); + public IssueTrackingCollectionTicketCommentsAllResponse withGetCommentsResponse(@Nullable GetCommentsResponse getCommentsResponse) { this.getCommentsResponse = getCommentsResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTicketCommentsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTicketCommentsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTicketCommentsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCommentsResponse = Optional.empty(); + private GetCommentsResponse getCommentsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * List Comments - */ - public Builder getCommentsResponse(GetCommentsResponse getCommentsResponse) { - Utils.checkNotNull(getCommentsResponse, "getCommentsResponse"); - this.getCommentsResponse = Optional.ofNullable(getCommentsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * List Comments */ - public Builder getCommentsResponse(Optional getCommentsResponse) { - Utils.checkNotNull(getCommentsResponse, "getCommentsResponse"); + public Builder getCommentsResponse(@Nullable GetCommentsResponse getCommentsResponse) { this.getCommentsResponse = getCommentsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTicketCommentsAllResponse build() { - return new IssueTrackingCollectionTicketCommentsAllResponse( contentType, statusCode, rawResponse, getCommentsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteRequest.java index c4c18e3c..f3321256 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,25 +27,25 @@ public class IssueTrackingCollectionTicketCommentsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The collection ID @@ -60,92 +61,82 @@ public class IssueTrackingCollectionTicketCommentsDeleteRequest { @JsonCreator public IssueTrackingCollectionTicketCommentsDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - String collectionId, - String ticketId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(ticketId, "ticketId"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull String collectionId, + @Nonnull String ticketId) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.collectionId = collectionId; - this.ticketId = ticketId; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.ticketId = Optional.ofNullable(ticketId) + .orElseThrow(() -> new IllegalArgumentException("ticketId cannot be null")); } public IssueTrackingCollectionTicketCommentsDeleteRequest( - String id, - String collectionId, - String ticketId) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), collectionId, + @Nonnull String id, + @Nonnull String collectionId, + @Nonnull String ticketId) { + this(id, null, null, + null, null, collectionId, ticketId); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * ID of the ticket you are acting upon. */ - @JsonIgnore public String ticketId() { - return ticketId; + return this.ticketId; } public static Builder builder() { @@ -156,18 +147,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public IssueTrackingCollectionTicketCommentsDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -175,87 +156,57 @@ public IssueTrackingCollectionTicketCommentsDeleteRequest withConsumerId(String /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTicketCommentsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTicketCommentsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTicketCommentsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTicketCommentsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The collection ID */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public IssueTrackingCollectionTicketCommentsDeleteRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } + /** * ID of the ticket you are acting upon. */ - public IssueTrackingCollectionTicketCommentsDeleteRequest withTicketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; + public IssueTrackingCollectionTicketCommentsDeleteRequest withTicketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -300,13 +251,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private String collectionId; @@ -316,117 +267,63 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** * ID of the ticket you are acting upon. */ - public Builder ticketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; + public Builder ticketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } public IssueTrackingCollectionTicketCommentsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new IssueTrackingCollectionTicketCommentsDeleteRequest( id, consumerId, appId, serviceId, raw, collectionId, @@ -434,10 +331,10 @@ public IssueTrackingCollectionTicketCommentsDeleteRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteRequestBuilder.java index ad6d6b12..c10c6577 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class IssueTrackingCollectionTicketCommentsDeleteRequestBuilder { - - private IssueTrackingCollectionTicketCommentsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTicketCommentsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTicketCommentsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTicketCommentsDeleteRequestBuilder request(IssueTrackingCollectionTicketCommentsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTicketCommentsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTicketCommentsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTicketCommentsDeleteRequestBuilder request(@Nonnull IssueTrackingCollectionTicketCommentsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTicketCommentsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTicketCommentsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTicketCommentsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteResponse.java index c3e43971..ebd10847 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTicketCommentsDeleteResponse implements Resp /** * Delete a Comment */ - private Optional deleteCommentResponse; + private DeleteCommentResponse deleteCommentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTicketCommentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteCommentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteCommentResponse, "deleteCommentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteCommentResponse deleteCommentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteCommentResponse = deleteCommentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTicketCommentsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Delete a Comment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteCommentResponse() { - return (Optional) deleteCommentResponse; + return Optional.ofNullable(this.deleteCommentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTicketCommentsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTicketCommentsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTicketCommentsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTicketCommentsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Delete a Comment + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTicketCommentsDeleteResponse withDeleteCommentResponse(DeleteCommentResponse deleteCommentResponse) { - Utils.checkNotNull(deleteCommentResponse, "deleteCommentResponse"); - this.deleteCommentResponse = Optional.ofNullable(deleteCommentResponse); + public IssueTrackingCollectionTicketCommentsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTicketCommentsDeleteResponse withDeleteCommentResp /** * Delete a Comment */ - public IssueTrackingCollectionTicketCommentsDeleteResponse withDeleteCommentResponse(Optional deleteCommentResponse) { - Utils.checkNotNull(deleteCommentResponse, "deleteCommentResponse"); + public IssueTrackingCollectionTicketCommentsDeleteResponse withDeleteCommentResponse(@Nullable DeleteCommentResponse deleteCommentResponse) { this.deleteCommentResponse = deleteCommentResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTicketCommentsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTicketCommentsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTicketCommentsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteCommentResponse = Optional.empty(); + private DeleteCommentResponse deleteCommentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Delete a Comment - */ - public Builder deleteCommentResponse(DeleteCommentResponse deleteCommentResponse) { - Utils.checkNotNull(deleteCommentResponse, "deleteCommentResponse"); - this.deleteCommentResponse = Optional.ofNullable(deleteCommentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Delete a Comment */ - public Builder deleteCommentResponse(Optional deleteCommentResponse) { - Utils.checkNotNull(deleteCommentResponse, "deleteCommentResponse"); + public Builder deleteCommentResponse(@Nullable DeleteCommentResponse deleteCommentResponse) { this.deleteCommentResponse = deleteCommentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTicketCommentsDeleteResponse build() { - return new IssueTrackingCollectionTicketCommentsDeleteResponse( contentType, statusCode, rawResponse, deleteCommentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneRequest.java index 553974a0..0f4dad1b 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; @@ -28,25 +29,25 @@ public class IssueTrackingCollectionTicketCommentsOneRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -58,7 +59,7 @@ public class IssueTrackingCollectionTicketCommentsOneRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * The collection ID @@ -80,126 +81,113 @@ public class IssueTrackingCollectionTicketCommentsOneRequest { @JsonCreator public IssueTrackingCollectionTicketCommentsOneRequest( - String id, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - String collectionId, - String ticketId, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(ticketId, "ticketId"); - Utils.checkNotNull(fields, "fields"); - this.id = id; - this.raw = raw; + @Nonnull String id, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nonnull String collectionId, + @Nonnull String ticketId, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; - this.collectionId = collectionId; - this.ticketId = ticketId; - this.fields = fields; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.ticketId = Optional.ofNullable(ticketId) + .orElseThrow(() -> new IllegalArgumentException("ticketId cannot be null")); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public IssueTrackingCollectionTicketCommentsOneRequest( - String id, - String collectionId, - String ticketId) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), collectionId, ticketId, - JsonNullable.undefined()); + @Nonnull String id, + @Nonnull String collectionId, + @Nonnull String ticketId) { + this(id, null, null, + null, null, null, + null, collectionId, ticketId, + null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * ID of the ticket you are acting upon. */ - @JsonIgnore public String ticketId() { - return ticketId; + return this.ticketId; } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -210,18 +198,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public IssueTrackingCollectionTicketCommentsOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTicketCommentsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public IssueTrackingCollectionTicketCommentsOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -229,93 +207,44 @@ public IssueTrackingCollectionTicketCommentsOneRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTicketCommentsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTicketCommentsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTicketCommentsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTicketCommentsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTicketCommentsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTicketCommentsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTicketCommentsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTicketCommentsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTicketCommentsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTicketCommentsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTicketCommentsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public IssueTrackingCollectionTicketCommentsOneRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public IssueTrackingCollectionTicketCommentsOneRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public IssueTrackingCollectionTicketCommentsOneRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public IssueTrackingCollectionTicketCommentsOneRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -323,47 +252,38 @@ public IssueTrackingCollectionTicketCommentsOneRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public IssueTrackingCollectionTicketCommentsOneRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public IssueTrackingCollectionTicketCommentsOneRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + /** * The collection ID */ - public IssueTrackingCollectionTicketCommentsOneRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public IssueTrackingCollectionTicketCommentsOneRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } + /** * ID of the ticket you are acting upon. */ - public IssueTrackingCollectionTicketCommentsOneRequest withTicketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; + public IssueTrackingCollectionTicketCommentsOneRequest withTicketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public IssueTrackingCollectionTicketCommentsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public IssueTrackingCollectionTicketCommentsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public IssueTrackingCollectionTicketCommentsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -416,199 +336,109 @@ public final static class Builder { private String id; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; private String collectionId; private String ticketId; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** * ID of the ticket you are acting upon. */ - public Builder ticketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; + public Builder ticketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public IssueTrackingCollectionTicketCommentsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new IssueTrackingCollectionTicketCommentsOneRequest( id, raw, consumerId, appId, serviceId, cursor, @@ -617,16 +447,16 @@ public IssueTrackingCollectionTicketCommentsOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneRequestBuilder.java index 6e453cfc..dd3b1432 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class IssueTrackingCollectionTicketCommentsOneRequestBuilder { - - private IssueTrackingCollectionTicketCommentsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTicketCommentsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTicketCommentsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTicketCommentsOneRequestBuilder request(IssueTrackingCollectionTicketCommentsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTicketCommentsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTicketCommentsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTicketCommentsOneRequestBuilder request(@Nonnull IssueTrackingCollectionTicketCommentsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTicketCommentsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTicketCommentsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTicketCommentsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public IssueTrackingCollectionTicketCommentsOneResponse call() throws Exception * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new IssueTrackingCollectionTicketCommentsOneOperation( - sdkConfiguration, - options); + IssueTrackingCollectionTicketCommentsOneRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new IssueTrackingCollectionTicketCommentsOneOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - IssueTrackingCollectionTicketCommentsOneRequest::withCursor, + IssueTrackingCollectionTicketCommentsOneRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneResponse.java index 825c7580..62aa894d 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTicketCommentsOneResponse implements Respons /** * Get a Comment */ - private Optional getCommentResponse; + private GetCommentResponse getCommentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTicketCommentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCommentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCommentResponse, "getCommentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCommentResponse getCommentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCommentResponse = getCommentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTicketCommentsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Get a Comment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCommentResponse() { - return (Optional) getCommentResponse; + return Optional.ofNullable(this.getCommentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTicketCommentsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTicketCommentsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTicketCommentsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTicketCommentsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Get a Comment + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTicketCommentsOneResponse withGetCommentResponse(GetCommentResponse getCommentResponse) { - Utils.checkNotNull(getCommentResponse, "getCommentResponse"); - this.getCommentResponse = Optional.ofNullable(getCommentResponse); + public IssueTrackingCollectionTicketCommentsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTicketCommentsOneResponse withGetCommentResponse(G /** * Get a Comment */ - public IssueTrackingCollectionTicketCommentsOneResponse withGetCommentResponse(Optional getCommentResponse) { - Utils.checkNotNull(getCommentResponse, "getCommentResponse"); + public IssueTrackingCollectionTicketCommentsOneResponse withGetCommentResponse(@Nullable GetCommentResponse getCommentResponse) { this.getCommentResponse = getCommentResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTicketCommentsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTicketCommentsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTicketCommentsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCommentResponse = Optional.empty(); + private GetCommentResponse getCommentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Get a Comment - */ - public Builder getCommentResponse(GetCommentResponse getCommentResponse) { - Utils.checkNotNull(getCommentResponse, "getCommentResponse"); - this.getCommentResponse = Optional.ofNullable(getCommentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Get a Comment */ - public Builder getCommentResponse(Optional getCommentResponse) { - Utils.checkNotNull(getCommentResponse, "getCommentResponse"); + public Builder getCommentResponse(@Nullable GetCommentResponse getCommentResponse) { this.getCommentResponse = getCommentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTicketCommentsOneResponse build() { - return new IssueTrackingCollectionTicketCommentsOneResponse( contentType, statusCode, rawResponse, getCommentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateRequest.java index d4358d2f..1ef66468 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class IssueTrackingCollectionTicketCommentsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The collection ID @@ -65,101 +66,90 @@ public class IssueTrackingCollectionTicketCommentsUpdateRequest { @JsonCreator public IssueTrackingCollectionTicketCommentsUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - String collectionId, - String ticketId, - CollectionTicketCommentInput collectionTicketComment) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(ticketId, "ticketId"); - Utils.checkNotNull(collectionTicketComment, "collectionTicketComment"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull String collectionId, + @Nonnull String ticketId, + @Nonnull CollectionTicketCommentInput collectionTicketComment) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.collectionId = collectionId; - this.ticketId = ticketId; - this.collectionTicketComment = collectionTicketComment; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.ticketId = Optional.ofNullable(ticketId) + .orElseThrow(() -> new IllegalArgumentException("ticketId cannot be null")); + this.collectionTicketComment = Optional.ofNullable(collectionTicketComment) + .orElseThrow(() -> new IllegalArgumentException("collectionTicketComment cannot be null")); } public IssueTrackingCollectionTicketCommentsUpdateRequest( - String id, - String collectionId, - String ticketId, - CollectionTicketCommentInput collectionTicketComment) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), collectionId, + @Nonnull String id, + @Nonnull String collectionId, + @Nonnull String ticketId, + @Nonnull CollectionTicketCommentInput collectionTicketComment) { + this(id, null, null, + null, null, collectionId, ticketId, collectionTicketComment); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * ID of the ticket you are acting upon. */ - @JsonIgnore public String ticketId() { - return ticketId; + return this.ticketId; } - @JsonIgnore public CollectionTicketCommentInput collectionTicketComment() { - return collectionTicketComment; + return this.collectionTicketComment; } public static Builder builder() { @@ -170,18 +160,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public IssueTrackingCollectionTicketCommentsUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -189,93 +169,63 @@ public IssueTrackingCollectionTicketCommentsUpdateRequest withConsumerId(String /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTicketCommentsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTicketCommentsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTicketCommentsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTicketCommentsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The collection ID */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public IssueTrackingCollectionTicketCommentsUpdateRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } + /** * ID of the ticket you are acting upon. */ - public IssueTrackingCollectionTicketCommentsUpdateRequest withTicketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; + public IssueTrackingCollectionTicketCommentsUpdateRequest withTicketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } - public IssueTrackingCollectionTicketCommentsUpdateRequest withCollectionTicketComment(CollectionTicketCommentInput collectionTicketComment) { - Utils.checkNotNull(collectionTicketComment, "collectionTicketComment"); - this.collectionTicketComment = collectionTicketComment; + + public IssueTrackingCollectionTicketCommentsUpdateRequest withCollectionTicketComment(@Nonnull CollectionTicketCommentInput collectionTicketComment) { + this.collectionTicketComment = Utils.checkNotNull(collectionTicketComment, "collectionTicketComment"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -322,13 +272,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private String collectionId; @@ -340,124 +290,68 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** * ID of the ticket you are acting upon. */ - public Builder ticketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; + public Builder ticketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } - - public Builder collectionTicketComment(CollectionTicketCommentInput collectionTicketComment) { - Utils.checkNotNull(collectionTicketComment, "collectionTicketComment"); - this.collectionTicketComment = collectionTicketComment; + public Builder collectionTicketComment(@Nonnull CollectionTicketCommentInput collectionTicketComment) { + this.collectionTicketComment = Utils.checkNotNull(collectionTicketComment, "collectionTicketComment"); return this; } public IssueTrackingCollectionTicketCommentsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new IssueTrackingCollectionTicketCommentsUpdateRequest( id, consumerId, appId, serviceId, raw, collectionId, @@ -465,10 +359,10 @@ public IssueTrackingCollectionTicketCommentsUpdateRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateRequestBuilder.java index 4c2676f5..18d9d02d 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class IssueTrackingCollectionTicketCommentsUpdateRequestBuilder { - - private IssueTrackingCollectionTicketCommentsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTicketCommentsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTicketCommentsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTicketCommentsUpdateRequestBuilder request(IssueTrackingCollectionTicketCommentsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTicketCommentsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTicketCommentsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTicketCommentsUpdateRequestBuilder request(@Nonnull IssueTrackingCollectionTicketCommentsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTicketCommentsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTicketCommentsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTicketCommentsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateResponse.java index e7130122..62dfd814 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketCommentsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTicketCommentsUpdateResponse implements Resp /** * Update a Comment */ - private Optional updateCommentResponse; + private UpdateCommentResponse updateCommentResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTicketCommentsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateCommentResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateCommentResponse, "updateCommentResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateCommentResponse updateCommentResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateCommentResponse = updateCommentResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTicketCommentsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Update a Comment */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateCommentResponse() { - return (Optional) updateCommentResponse; + return Optional.ofNullable(this.updateCommentResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTicketCommentsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTicketCommentsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTicketCommentsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTicketCommentsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Update a Comment + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTicketCommentsUpdateResponse withUpdateCommentResponse(UpdateCommentResponse updateCommentResponse) { - Utils.checkNotNull(updateCommentResponse, "updateCommentResponse"); - this.updateCommentResponse = Optional.ofNullable(updateCommentResponse); + public IssueTrackingCollectionTicketCommentsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTicketCommentsUpdateResponse withUpdateCommentResp /** * Update a Comment */ - public IssueTrackingCollectionTicketCommentsUpdateResponse withUpdateCommentResponse(Optional updateCommentResponse) { - Utils.checkNotNull(updateCommentResponse, "updateCommentResponse"); + public IssueTrackingCollectionTicketCommentsUpdateResponse withUpdateCommentResponse(@Nullable UpdateCommentResponse updateCommentResponse) { this.updateCommentResponse = updateCommentResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTicketCommentsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTicketCommentsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTicketCommentsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateCommentResponse = Optional.empty(); + private UpdateCommentResponse updateCommentResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Update a Comment - */ - public Builder updateCommentResponse(UpdateCommentResponse updateCommentResponse) { - Utils.checkNotNull(updateCommentResponse, "updateCommentResponse"); - this.updateCommentResponse = Optional.ofNullable(updateCommentResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Update a Comment */ - public Builder updateCommentResponse(Optional updateCommentResponse) { - Utils.checkNotNull(updateCommentResponse, "updateCommentResponse"); + public Builder updateCommentResponse(@Nullable UpdateCommentResponse updateCommentResponse) { this.updateCommentResponse = updateCommentResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTicketCommentsUpdateResponse build() { - return new IssueTrackingCollectionTicketCommentsUpdateResponse( contentType, statusCode, rawResponse, updateCommentResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddRequest.java index 3266cfb7..8b2f9967 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class IssueTrackingCollectionTicketsAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * The collection ID @@ -53,76 +54,67 @@ public class IssueTrackingCollectionTicketsAddRequest { @JsonCreator public IssueTrackingCollectionTicketsAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - String collectionId, - TicketInput ticket) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(ticket, "ticket"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull String collectionId, + @Nonnull TicketInput ticket) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.collectionId = collectionId; - this.ticket = ticket; + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.ticket = Optional.ofNullable(ticket) + .orElseThrow(() -> new IllegalArgumentException("ticket cannot be null")); } public IssueTrackingCollectionTicketsAddRequest( - String collectionId, - TicketInput ticket) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), collectionId, ticket); + @Nonnull String collectionId, + @Nonnull TicketInput ticket) { + this(null, null, null, + null, collectionId, ticket); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } - @JsonIgnore public TicketInput ticket() { - return ticket; + return this.ticket; } public static Builder builder() { @@ -133,94 +125,54 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTicketsAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTicketsAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTicketsAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTicketsAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTicketsAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTicketsAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTicketsAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTicketsAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTicketsAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTicketsAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTicketsAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTicketsAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } + /** * The collection ID */ - public IssueTrackingCollectionTicketsAddRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public IssueTrackingCollectionTicketsAddRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - public IssueTrackingCollectionTicketsAddRequest withTicket(TicketInput ticket) { - Utils.checkNotNull(ticket, "ticket"); - this.ticket = ticket; + + public IssueTrackingCollectionTicketsAddRequest withTicket(@Nonnull TicketInput ticket) { + this.ticket = Utils.checkNotNull(ticket, "ticket"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -260,13 +212,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private String collectionId; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - - public Builder ticket(TicketInput ticket) { - Utils.checkNotNull(ticket, "ticket"); - this.ticket = ticket; + public Builder ticket(@Nonnull TicketInput ticket) { + this.ticket = Utils.checkNotNull(ticket, "ticket"); return this; } public IssueTrackingCollectionTicketsAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new IssueTrackingCollectionTicketsAddRequest( raw, consumerId, appId, serviceId, collectionId, ticket); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddRequestBuilder.java index 1c85932c..bd187855 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class IssueTrackingCollectionTicketsAddRequestBuilder { - - private IssueTrackingCollectionTicketsAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTicketsAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTicketsAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTicketsAddRequestBuilder request(IssueTrackingCollectionTicketsAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTicketsAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTicketsAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTicketsAddRequestBuilder request(@Nonnull IssueTrackingCollectionTicketsAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTicketsAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTicketsAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTicketsAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddResponse.java index 00d2a5a9..5075c767 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTicketsAddResponse implements Response { /** * Create a Ticket */ - private Optional createTicketResponse; + private CreateTicketResponse createTicketResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTicketsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createTicketResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createTicketResponse, "createTicketResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateTicketResponse createTicketResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createTicketResponse = createTicketResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTicketsAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Create a Ticket */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createTicketResponse() { - return (Optional) createTicketResponse; + return Optional.ofNullable(this.createTicketResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTicketsAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTicketsAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTicketsAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTicketsAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Create a Ticket + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTicketsAddResponse withCreateTicketResponse(CreateTicketResponse createTicketResponse) { - Utils.checkNotNull(createTicketResponse, "createTicketResponse"); - this.createTicketResponse = Optional.ofNullable(createTicketResponse); + public IssueTrackingCollectionTicketsAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTicketsAddResponse withCreateTicketResponse(Create /** * Create a Ticket */ - public IssueTrackingCollectionTicketsAddResponse withCreateTicketResponse(Optional createTicketResponse) { - Utils.checkNotNull(createTicketResponse, "createTicketResponse"); + public IssueTrackingCollectionTicketsAddResponse withCreateTicketResponse(@Nullable CreateTicketResponse createTicketResponse) { this.createTicketResponse = createTicketResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTicketsAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTicketsAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTicketsAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createTicketResponse = Optional.empty(); + private CreateTicketResponse createTicketResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Create a Ticket - */ - public Builder createTicketResponse(CreateTicketResponse createTicketResponse) { - Utils.checkNotNull(createTicketResponse, "createTicketResponse"); - this.createTicketResponse = Optional.ofNullable(createTicketResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Create a Ticket */ - public Builder createTicketResponse(Optional createTicketResponse) { - Utils.checkNotNull(createTicketResponse, "createTicketResponse"); + public Builder createTicketResponse(@Nullable CreateTicketResponse createTicketResponse) { this.createTicketResponse = createTicketResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTicketsAddResponse build() { - return new IssueTrackingCollectionTicketsAddResponse( contentType, statusCode, rawResponse, createTicketResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllRequest.java index 33304550..7f2e0505 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllRequest.java @@ -9,14 +9,14 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,25 +27,25 @@ public class IssueTrackingCollectionTicketsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -57,7 +57,7 @@ public class IssueTrackingCollectionTicketsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * The collection ID @@ -69,19 +69,19 @@ public class IssueTrackingCollectionTicketsAllRequest { * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private TicketsSort sort; /** * Apply filters */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private IssuesFilter filter; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -91,138 +91,118 @@ public class IssueTrackingCollectionTicketsAllRequest { @JsonCreator public IssueTrackingCollectionTicketsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - String collectionId, - Optional sort, - Optional filter, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nonnull String collectionId, + @Nullable TicketsSort sort, + @Nullable IssuesFilter filter, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; - this.collectionId = collectionId; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); this.sort = sort; this.filter = filter; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public IssueTrackingCollectionTicketsAllRequest( - String collectionId) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - collectionId, Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined()); + @Nonnull String collectionId) { + this(null, null, null, + null, null, null, + collectionId, null, null, + null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Apply filters */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -233,103 +213,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTicketsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTicketsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTicketsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTicketsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTicketsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTicketsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTicketsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTicketsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTicketsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTicketsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTicketsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTicketsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public IssueTrackingCollectionTicketsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public IssueTrackingCollectionTicketsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public IssueTrackingCollectionTicketsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public IssueTrackingCollectionTicketsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -337,27 +258,17 @@ public IssueTrackingCollectionTicketsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public IssueTrackingCollectionTicketsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public IssueTrackingCollectionTicketsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * The collection ID - */ - public IssueTrackingCollectionTicketsAllRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; - return this; - } /** - * Apply sorting + * The collection ID */ - public IssueTrackingCollectionTicketsAllRequest withSort(TicketsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); + public IssueTrackingCollectionTicketsAllRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } @@ -365,67 +276,38 @@ public IssueTrackingCollectionTicketsAllRequest withSort(TicketsSort sort) { /** * Apply sorting */ - public IssueTrackingCollectionTicketsAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public IssueTrackingCollectionTicketsAllRequest withSort(@Nullable TicketsSort sort) { this.sort = sort; return this; } - /** - * Apply filters - */ - public IssueTrackingCollectionTicketsAllRequest withFilter(IssuesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public IssueTrackingCollectionTicketsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public IssueTrackingCollectionTicketsAllRequest withFilter(@Nullable IssuesFilter filter) { this.filter = filter; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public IssueTrackingCollectionTicketsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public IssueTrackingCollectionTicketsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public IssueTrackingCollectionTicketsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public IssueTrackingCollectionTicketsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public IssueTrackingCollectionTicketsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public IssueTrackingCollectionTicketsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -478,240 +360,121 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; private String collectionId; - private Optional sort = Optional.empty(); + private TicketsSort sort; - private Optional filter = Optional.empty(); + private IssuesFilter filter; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** * Apply sorting */ - public Builder sort(TicketsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - - /** - * Apply sorting - */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable TicketsSort sort) { this.sort = sort; return this; } - - /** - * Apply filters - */ - public Builder filter(IssuesFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Apply filters */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable IssuesFilter filter) { this.filter = filter; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public IssueTrackingCollectionTicketsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new IssueTrackingCollectionTicketsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -720,16 +483,16 @@ public IssueTrackingCollectionTicketsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllRequestBuilder.java index f2707827..74e5aaf6 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class IssueTrackingCollectionTicketsAllRequestBuilder { - - private IssueTrackingCollectionTicketsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTicketsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTicketsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTicketsAllRequestBuilder request(IssueTrackingCollectionTicketsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTicketsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTicketsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTicketsAllRequestBuilder request(@Nonnull IssueTrackingCollectionTicketsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTicketsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTicketsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTicketsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public IssueTrackingCollectionTicketsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new IssueTrackingCollectionTicketsAllOperation( - sdkConfiguration, - options); + IssueTrackingCollectionTicketsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new IssueTrackingCollectionTicketsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - IssueTrackingCollectionTicketsAllRequest::withCursor, + IssueTrackingCollectionTicketsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllResponse.java index 069ccdb9..c6b36a5e 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTicketsAllResponse implements Response { /** * List Tickets */ - private Optional getTicketsResponse; + private GetTicketsResponse getTicketsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTicketsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getTicketsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getTicketsResponse, "getTicketsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetTicketsResponse getTicketsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getTicketsResponse = getTicketsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTicketsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * List Tickets */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getTicketsResponse() { - return (Optional) getTicketsResponse; + return Optional.ofNullable(this.getTicketsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTicketsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTicketsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTicketsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTicketsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * List Tickets + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTicketsAllResponse withGetTicketsResponse(GetTicketsResponse getTicketsResponse) { - Utils.checkNotNull(getTicketsResponse, "getTicketsResponse"); - this.getTicketsResponse = Optional.ofNullable(getTicketsResponse); + public IssueTrackingCollectionTicketsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTicketsAllResponse withGetTicketsResponse(GetTicke /** * List Tickets */ - public IssueTrackingCollectionTicketsAllResponse withGetTicketsResponse(Optional getTicketsResponse) { - Utils.checkNotNull(getTicketsResponse, "getTicketsResponse"); + public IssueTrackingCollectionTicketsAllResponse withGetTicketsResponse(@Nullable GetTicketsResponse getTicketsResponse) { this.getTicketsResponse = getTicketsResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTicketsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTicketsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTicketsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getTicketsResponse = Optional.empty(); + private GetTicketsResponse getTicketsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * List Tickets - */ - public Builder getTicketsResponse(GetTicketsResponse getTicketsResponse) { - Utils.checkNotNull(getTicketsResponse, "getTicketsResponse"); - this.getTicketsResponse = Optional.ofNullable(getTicketsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * List Tickets */ - public Builder getTicketsResponse(Optional getTicketsResponse) { - Utils.checkNotNull(getTicketsResponse, "getTicketsResponse"); + public Builder getTicketsResponse(@Nullable GetTicketsResponse getTicketsResponse) { this.getTicketsResponse = getTicketsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTicketsAllResponse build() { - return new IssueTrackingCollectionTicketsAllResponse( contentType, statusCode, rawResponse, getTicketsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteRequest.java index 2568f2ea..4a1e9249 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,25 +27,25 @@ public class IssueTrackingCollectionTicketsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The collection ID @@ -54,79 +55,70 @@ public class IssueTrackingCollectionTicketsDeleteRequest { @JsonCreator public IssueTrackingCollectionTicketsDeleteRequest( - String ticketId, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - String collectionId) { - Utils.checkNotNull(ticketId, "ticketId"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(collectionId, "collectionId"); - this.ticketId = ticketId; + @Nonnull String ticketId, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull String collectionId) { + this.ticketId = Optional.ofNullable(ticketId) + .orElseThrow(() -> new IllegalArgumentException("ticketId cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.collectionId = collectionId; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); } public IssueTrackingCollectionTicketsDeleteRequest( - String ticketId, - String collectionId) { - this(ticketId, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), collectionId); + @Nonnull String ticketId, + @Nonnull String collectionId) { + this(ticketId, null, null, + null, null, collectionId); } /** * ID of the ticket you are acting upon. */ - @JsonIgnore public String ticketId() { - return ticketId; + return this.ticketId; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the ticket you are acting upon. */ - public IssueTrackingCollectionTicketsDeleteRequest withTicketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTicketsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public IssueTrackingCollectionTicketsDeleteRequest withTicketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } @@ -156,78 +138,48 @@ public IssueTrackingCollectionTicketsDeleteRequest withConsumerId(String consume /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTicketsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTicketsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTicketsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTicketsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTicketsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTicketsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTicketsDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTicketsDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTicketsDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTicketsDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTicketsDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The collection ID */ - public IssueTrackingCollectionTicketsDeleteRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public IssueTrackingCollectionTicketsDeleteRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -269,13 +221,13 @@ public final static class Builder { private String ticketId; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private String collectionId; @@ -283,117 +235,65 @@ private Builder() { // force use of static builder() method } - /** * ID of the ticket you are acting upon. */ - public Builder ticketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder ticketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } public IssueTrackingCollectionTicketsDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new IssueTrackingCollectionTicketsDeleteRequest( ticketId, consumerId, appId, serviceId, raw, collectionId); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteRequestBuilder.java index 163092ba..4f03caf3 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class IssueTrackingCollectionTicketsDeleteRequestBuilder { - - private IssueTrackingCollectionTicketsDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTicketsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTicketsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTicketsDeleteRequestBuilder request(IssueTrackingCollectionTicketsDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTicketsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTicketsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTicketsDeleteRequestBuilder request(@Nonnull IssueTrackingCollectionTicketsDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTicketsDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTicketsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTicketsDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteResponse.java index aaef3548..6697afb0 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTicketsDeleteResponse implements Response { /** * Delete a Ticket */ - private Optional deleteTicketResponse; + private DeleteTicketResponse deleteTicketResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTicketsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteTicketResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteTicketResponse, "deleteTicketResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteTicketResponse deleteTicketResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteTicketResponse = deleteTicketResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTicketsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Delete a Ticket */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteTicketResponse() { - return (Optional) deleteTicketResponse; + return Optional.ofNullable(this.deleteTicketResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTicketsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTicketsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTicketsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTicketsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Delete a Ticket + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTicketsDeleteResponse withDeleteTicketResponse(DeleteTicketResponse deleteTicketResponse) { - Utils.checkNotNull(deleteTicketResponse, "deleteTicketResponse"); - this.deleteTicketResponse = Optional.ofNullable(deleteTicketResponse); + public IssueTrackingCollectionTicketsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTicketsDeleteResponse withDeleteTicketResponse(Del /** * Delete a Ticket */ - public IssueTrackingCollectionTicketsDeleteResponse withDeleteTicketResponse(Optional deleteTicketResponse) { - Utils.checkNotNull(deleteTicketResponse, "deleteTicketResponse"); + public IssueTrackingCollectionTicketsDeleteResponse withDeleteTicketResponse(@Nullable DeleteTicketResponse deleteTicketResponse) { this.deleteTicketResponse = deleteTicketResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTicketsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTicketsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTicketsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteTicketResponse = Optional.empty(); + private DeleteTicketResponse deleteTicketResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Delete a Ticket - */ - public Builder deleteTicketResponse(DeleteTicketResponse deleteTicketResponse) { - Utils.checkNotNull(deleteTicketResponse, "deleteTicketResponse"); - this.deleteTicketResponse = Optional.ofNullable(deleteTicketResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Delete a Ticket */ - public Builder deleteTicketResponse(Optional deleteTicketResponse) { - Utils.checkNotNull(deleteTicketResponse, "deleteTicketResponse"); + public Builder deleteTicketResponse(@Nullable DeleteTicketResponse deleteTicketResponse) { this.deleteTicketResponse = deleteTicketResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTicketsDeleteResponse build() { - return new IssueTrackingCollectionTicketsDeleteResponse( contentType, statusCode, rawResponse, deleteTicketResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneRequest.java index 8196191f..8cf4ba1d 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class IssueTrackingCollectionTicketsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The collection ID @@ -61,91 +62,81 @@ public class IssueTrackingCollectionTicketsOneRequest { @JsonCreator public IssueTrackingCollectionTicketsOneRequest( - String ticketId, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - String collectionId, - JsonNullable fields) { - Utils.checkNotNull(ticketId, "ticketId"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(fields, "fields"); - this.ticketId = ticketId; + @Nonnull String ticketId, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull String collectionId, + @Nullable JsonNullable fields) { + this.ticketId = Optional.ofNullable(ticketId) + .orElseThrow(() -> new IllegalArgumentException("ticketId cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.collectionId = collectionId; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public IssueTrackingCollectionTicketsOneRequest( - String ticketId, - String collectionId) { - this(ticketId, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), collectionId, - JsonNullable.undefined()); + @Nonnull String ticketId, + @Nonnull String collectionId) { + this(ticketId, null, null, + null, null, collectionId, + null); } /** * ID of the ticket you are acting upon. */ - @JsonIgnore public String ticketId() { - return ticketId; + return this.ticketId; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -156,18 +147,8 @@ public static Builder builder() { /** * ID of the ticket you are acting upon. */ - public IssueTrackingCollectionTicketsOneRequest withTicketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTicketsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public IssueTrackingCollectionTicketsOneRequest withTicketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } @@ -175,95 +156,56 @@ public IssueTrackingCollectionTicketsOneRequest withConsumerId(String consumerId /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTicketsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTicketsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTicketsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTicketsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTicketsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTicketsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTicketsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTicketsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTicketsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTicketsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTicketsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The collection ID */ - public IssueTrackingCollectionTicketsOneRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public IssueTrackingCollectionTicketsOneRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public IssueTrackingCollectionTicketsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public IssueTrackingCollectionTicketsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public IssueTrackingCollectionTicketsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -309,142 +251,79 @@ public final static class Builder { private String ticketId; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private String collectionId; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the ticket you are acting upon. */ - public Builder ticketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder ticketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public IssueTrackingCollectionTicketsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new IssueTrackingCollectionTicketsOneRequest( ticketId, consumerId, appId, serviceId, raw, collectionId, @@ -452,10 +331,10 @@ public IssueTrackingCollectionTicketsOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneRequestBuilder.java index 56e89812..e2406439 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class IssueTrackingCollectionTicketsOneRequestBuilder { - - private IssueTrackingCollectionTicketsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTicketsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTicketsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTicketsOneRequestBuilder request(IssueTrackingCollectionTicketsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTicketsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTicketsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTicketsOneRequestBuilder request(@Nonnull IssueTrackingCollectionTicketsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTicketsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTicketsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTicketsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneResponse.java index 7963015f..3507cdf7 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTicketsOneResponse implements Response { /** * Get a Ticket */ - private Optional getTicketResponse; + private GetTicketResponse getTicketResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTicketsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getTicketResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getTicketResponse, "getTicketResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetTicketResponse getTicketResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getTicketResponse = getTicketResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTicketsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Get a Ticket */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getTicketResponse() { - return (Optional) getTicketResponse; + return Optional.ofNullable(this.getTicketResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTicketsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTicketsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTicketsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTicketsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Get a Ticket + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTicketsOneResponse withGetTicketResponse(GetTicketResponse getTicketResponse) { - Utils.checkNotNull(getTicketResponse, "getTicketResponse"); - this.getTicketResponse = Optional.ofNullable(getTicketResponse); + public IssueTrackingCollectionTicketsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTicketsOneResponse withGetTicketResponse(GetTicket /** * Get a Ticket */ - public IssueTrackingCollectionTicketsOneResponse withGetTicketResponse(Optional getTicketResponse) { - Utils.checkNotNull(getTicketResponse, "getTicketResponse"); + public IssueTrackingCollectionTicketsOneResponse withGetTicketResponse(@Nullable GetTicketResponse getTicketResponse) { this.getTicketResponse = getTicketResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTicketsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTicketsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTicketsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getTicketResponse = Optional.empty(); + private GetTicketResponse getTicketResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Get a Ticket - */ - public Builder getTicketResponse(GetTicketResponse getTicketResponse) { - Utils.checkNotNull(getTicketResponse, "getTicketResponse"); - this.getTicketResponse = Optional.ofNullable(getTicketResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Get a Ticket */ - public Builder getTicketResponse(Optional getTicketResponse) { - Utils.checkNotNull(getTicketResponse, "getTicketResponse"); + public Builder getTicketResponse(@Nullable GetTicketResponse getTicketResponse) { this.getTicketResponse = getTicketResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTicketsOneResponse build() { - return new IssueTrackingCollectionTicketsOneResponse( contentType, statusCode, rawResponse, getTicketResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateRequest.java index f2c1f0d3..2733d0be 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class IssueTrackingCollectionTicketsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The collection ID @@ -59,89 +60,79 @@ public class IssueTrackingCollectionTicketsUpdateRequest { @JsonCreator public IssueTrackingCollectionTicketsUpdateRequest( - String ticketId, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - String collectionId, - TicketInput ticket) { - Utils.checkNotNull(ticketId, "ticketId"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(ticket, "ticket"); - this.ticketId = ticketId; + @Nonnull String ticketId, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull String collectionId, + @Nonnull TicketInput ticket) { + this.ticketId = Optional.ofNullable(ticketId) + .orElseThrow(() -> new IllegalArgumentException("ticketId cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.collectionId = collectionId; - this.ticket = ticket; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.ticket = Optional.ofNullable(ticket) + .orElseThrow(() -> new IllegalArgumentException("ticket cannot be null")); } public IssueTrackingCollectionTicketsUpdateRequest( - String ticketId, - String collectionId, - TicketInput ticket) { - this(ticketId, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), collectionId, + @Nonnull String ticketId, + @Nonnull String collectionId, + @Nonnull TicketInput ticket) { + this(ticketId, null, null, + null, null, collectionId, ticket); } /** * ID of the ticket you are acting upon. */ - @JsonIgnore public String ticketId() { - return ticketId; + return this.ticketId; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } - @JsonIgnore public TicketInput ticket() { - return ticket; + return this.ticket; } public static Builder builder() { @@ -152,18 +143,8 @@ public static Builder builder() { /** * ID of the ticket you are acting upon. */ - public IssueTrackingCollectionTicketsUpdateRequest withTicketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionTicketsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public IssueTrackingCollectionTicketsUpdateRequest withTicketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } @@ -171,84 +152,54 @@ public IssueTrackingCollectionTicketsUpdateRequest withConsumerId(String consume /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionTicketsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionTicketsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionTicketsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionTicketsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionTicketsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionTicketsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionTicketsUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionTicketsUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionTicketsUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionTicketsUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionTicketsUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The collection ID */ - public IssueTrackingCollectionTicketsUpdateRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public IssueTrackingCollectionTicketsUpdateRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - public IssueTrackingCollectionTicketsUpdateRequest withTicket(TicketInput ticket) { - Utils.checkNotNull(ticket, "ticket"); - this.ticket = ticket; + + public IssueTrackingCollectionTicketsUpdateRequest withTicket(@Nonnull TicketInput ticket) { + this.ticket = Utils.checkNotNull(ticket, "ticket"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -293,13 +244,13 @@ public final static class Builder { private String ticketId; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private String collectionId; @@ -309,114 +260,60 @@ private Builder() { // force use of static builder() method } - /** * ID of the ticket you are acting upon. */ - public Builder ticketId(String ticketId) { - Utils.checkNotNull(ticketId, "ticketId"); - this.ticketId = ticketId; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder ticketId(@Nonnull String ticketId) { + this.ticketId = Utils.checkNotNull(ticketId, "ticketId"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - - public Builder ticket(TicketInput ticket) { - Utils.checkNotNull(ticket, "ticket"); - this.ticket = ticket; + public Builder ticket(@Nonnull TicketInput ticket) { + this.ticket = Utils.checkNotNull(ticket, "ticket"); return this; } public IssueTrackingCollectionTicketsUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new IssueTrackingCollectionTicketsUpdateRequest( ticketId, consumerId, appId, serviceId, raw, collectionId, @@ -424,10 +321,10 @@ public IssueTrackingCollectionTicketsUpdateRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateRequestBuilder.java index c830f28a..d92b8945 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class IssueTrackingCollectionTicketsUpdateRequestBuilder { - - private IssueTrackingCollectionTicketsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionTicketsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionTicketsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionTicketsUpdateRequestBuilder request(IssueTrackingCollectionTicketsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionTicketsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionTicketsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionTicketsUpdateRequestBuilder request(@Nonnull IssueTrackingCollectionTicketsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionTicketsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionTicketsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionTicketsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateResponse.java index 3bc0fad6..b21ac10c 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionTicketsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionTicketsUpdateResponse implements Response { /** * Update a Ticket */ - private Optional updateTicketResponse; + private UpdateTicketResponse updateTicketResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionTicketsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateTicketResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateTicketResponse, "updateTicketResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateTicketResponse updateTicketResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateTicketResponse = updateTicketResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionTicketsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Update a Ticket */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateTicketResponse() { - return (Optional) updateTicketResponse; + return Optional.ofNullable(this.updateTicketResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionTicketsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionTicketsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionTicketsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionTicketsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Update a Ticket + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionTicketsUpdateResponse withUpdateTicketResponse(UpdateTicketResponse updateTicketResponse) { - Utils.checkNotNull(updateTicketResponse, "updateTicketResponse"); - this.updateTicketResponse = Optional.ofNullable(updateTicketResponse); + public IssueTrackingCollectionTicketsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionTicketsUpdateResponse withUpdateTicketResponse(Upd /** * Update a Ticket */ - public IssueTrackingCollectionTicketsUpdateResponse withUpdateTicketResponse(Optional updateTicketResponse) { - Utils.checkNotNull(updateTicketResponse, "updateTicketResponse"); + public IssueTrackingCollectionTicketsUpdateResponse withUpdateTicketResponse(@Nullable UpdateTicketResponse updateTicketResponse) { this.updateTicketResponse = updateTicketResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionTicketsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionTicketsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionTicketsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateTicketResponse = Optional.empty(); + private UpdateTicketResponse updateTicketResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Update a Ticket - */ - public Builder updateTicketResponse(UpdateTicketResponse updateTicketResponse) { - Utils.checkNotNull(updateTicketResponse, "updateTicketResponse"); - this.updateTicketResponse = Optional.ofNullable(updateTicketResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Update a Ticket */ - public Builder updateTicketResponse(Optional updateTicketResponse) { - Utils.checkNotNull(updateTicketResponse, "updateTicketResponse"); + public Builder updateTicketResponse(@Nullable UpdateTicketResponse updateTicketResponse) { this.updateTicketResponse = updateTicketResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionTicketsUpdateResponse build() { - return new IssueTrackingCollectionTicketsUpdateResponse( contentType, statusCode, rawResponse, updateTicketResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllRequest.java index 9c0d63e4..8cc7b453 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllRequest.java @@ -7,14 +7,14 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -31,25 +31,25 @@ public class IssueTrackingCollectionUsersAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -61,13 +61,13 @@ public class IssueTrackingCollectionUsersAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -77,113 +77,99 @@ public class IssueTrackingCollectionUsersAllRequest { @JsonCreator public IssueTrackingCollectionUsersAllRequest( - String collectionId, - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.collectionId = collectionId; - this.raw = raw; + @Nonnull String collectionId, + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public IssueTrackingCollectionUsersAllRequest( - String collectionId) { - this(collectionId, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String collectionId) { + this(collectionId, null, null, + null, null, null, + null, null, null); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -194,18 +180,8 @@ public static Builder builder() { /** * The collection ID */ - public IssueTrackingCollectionUsersAllRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionUsersAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); + public IssueTrackingCollectionUsersAllRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } @@ -213,93 +189,44 @@ public IssueTrackingCollectionUsersAllRequest withRaw(boolean raw) { /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionUsersAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionUsersAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionUsersAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionUsersAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionUsersAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionUsersAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionUsersAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionUsersAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionUsersAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionUsersAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionUsersAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public IssueTrackingCollectionUsersAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public IssueTrackingCollectionUsersAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public IssueTrackingCollectionUsersAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public IssueTrackingCollectionUsersAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -307,48 +234,29 @@ public IssueTrackingCollectionUsersAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public IssueTrackingCollectionUsersAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public IssueTrackingCollectionUsersAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public IssueTrackingCollectionUsersAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public IssueTrackingCollectionUsersAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public IssueTrackingCollectionUsersAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public IssueTrackingCollectionUsersAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public IssueTrackingCollectionUsersAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public IssueTrackingCollectionUsersAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -398,196 +306,99 @@ public final static class Builder { private String collectionId; - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public IssueTrackingCollectionUsersAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new IssueTrackingCollectionUsersAllRequest( collectionId, raw, consumerId, appId, serviceId, cursor, @@ -595,16 +406,16 @@ public IssueTrackingCollectionUsersAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllRequestBuilder.java index 843777ca..8d004b19 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class IssueTrackingCollectionUsersAllRequestBuilder { - - private IssueTrackingCollectionUsersAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionUsersAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionUsersAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionUsersAllRequestBuilder request(IssueTrackingCollectionUsersAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionUsersAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionUsersAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionUsersAllRequestBuilder request(@Nonnull IssueTrackingCollectionUsersAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionUsersAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionUsersAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionUsersAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public IssueTrackingCollectionUsersAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new IssueTrackingCollectionUsersAllOperation( - sdkConfiguration, - options); + IssueTrackingCollectionUsersAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new IssueTrackingCollectionUsersAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - IssueTrackingCollectionUsersAllRequest::withCursor, + IssueTrackingCollectionUsersAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllResponse.java index b367404e..c9801d7c 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionUsersAllResponse implements Response { /** * Users */ - private Optional getCollectionUsersResponse; + private GetCollectionUsersResponse getCollectionUsersResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionUsersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCollectionUsersResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCollectionUsersResponse, "getCollectionUsersResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCollectionUsersResponse getCollectionUsersResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCollectionUsersResponse = getCollectionUsersResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionUsersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Users */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCollectionUsersResponse() { - return (Optional) getCollectionUsersResponse; + return Optional.ofNullable(this.getCollectionUsersResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionUsersAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionUsersAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionUsersAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionUsersAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Users + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionUsersAllResponse withGetCollectionUsersResponse(GetCollectionUsersResponse getCollectionUsersResponse) { - Utils.checkNotNull(getCollectionUsersResponse, "getCollectionUsersResponse"); - this.getCollectionUsersResponse = Optional.ofNullable(getCollectionUsersResponse); + public IssueTrackingCollectionUsersAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionUsersAllResponse withGetCollectionUsersResponse(Ge /** * Users */ - public IssueTrackingCollectionUsersAllResponse withGetCollectionUsersResponse(Optional getCollectionUsersResponse) { - Utils.checkNotNull(getCollectionUsersResponse, "getCollectionUsersResponse"); + public IssueTrackingCollectionUsersAllResponse withGetCollectionUsersResponse(@Nullable GetCollectionUsersResponse getCollectionUsersResponse) { this.getCollectionUsersResponse = getCollectionUsersResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionUsersAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionUsersAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionUsersAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCollectionUsersResponse = Optional.empty(); + private GetCollectionUsersResponse getCollectionUsersResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Users - */ - public Builder getCollectionUsersResponse(GetCollectionUsersResponse getCollectionUsersResponse) { - Utils.checkNotNull(getCollectionUsersResponse, "getCollectionUsersResponse"); - this.getCollectionUsersResponse = Optional.ofNullable(getCollectionUsersResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Users */ - public Builder getCollectionUsersResponse(Optional getCollectionUsersResponse) { - Utils.checkNotNull(getCollectionUsersResponse, "getCollectionUsersResponse"); + public Builder getCollectionUsersResponse(@Nullable GetCollectionUsersResponse getCollectionUsersResponse) { this.getCollectionUsersResponse = getCollectionUsersResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionUsersAllResponse build() { - return new IssueTrackingCollectionUsersAllResponse( contentType, statusCode, rawResponse, getCollectionUsersResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneRequest.java index 5e9c8d7c..29576b1f 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -33,25 +34,25 @@ public class IssueTrackingCollectionUsersOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -61,91 +62,81 @@ public class IssueTrackingCollectionUsersOneRequest { @JsonCreator public IssueTrackingCollectionUsersOneRequest( - String collectionId, - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.collectionId = collectionId; - this.id = id; + @Nonnull String collectionId, + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public IssueTrackingCollectionUsersOneRequest( - String collectionId, - String id) { - this(collectionId, id, Optional.empty(), - Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined()); + @Nonnull String collectionId, + @Nonnull String id) { + this(collectionId, id, null, + null, null, null, + null); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -156,27 +147,17 @@ public static Builder builder() { /** * The collection ID */ - public IssueTrackingCollectionUsersOneRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public IssueTrackingCollectionUsersOneRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** - * ID of the record you are acting upon. - */ - public IssueTrackingCollectionUsersOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } /** - * ID of the consumer which you want to get or push data from + * ID of the record you are acting upon. */ - public IssueTrackingCollectionUsersOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public IssueTrackingCollectionUsersOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -184,86 +165,47 @@ public IssueTrackingCollectionUsersOneRequest withConsumerId(String consumerId) /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionUsersOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionUsersOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionUsersOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionUsersOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionUsersOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionUsersOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionUsersOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionUsersOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionUsersOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionUsersOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionUsersOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public IssueTrackingCollectionUsersOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public IssueTrackingCollectionUsersOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public IssueTrackingCollectionUsersOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -311,140 +253,77 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public IssueTrackingCollectionUsersOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new IssueTrackingCollectionUsersOneRequest( collectionId, id, consumerId, appId, serviceId, raw, @@ -452,10 +331,10 @@ public IssueTrackingCollectionUsersOneRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneRequestBuilder.java index 005cb2ee..2fd51362 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class IssueTrackingCollectionUsersOneRequestBuilder { - - private IssueTrackingCollectionUsersOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionUsersOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionUsersOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionUsersOneRequestBuilder request(IssueTrackingCollectionUsersOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionUsersOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionUsersOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionUsersOneRequestBuilder request(@Nonnull IssueTrackingCollectionUsersOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionUsersOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionUsersOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionUsersOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneResponse.java index e3b6f0ec..3d330e2e 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionUsersOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionUsersOneResponse implements Response { /** * User */ - private Optional getCollectionUserResponse; + private GetCollectionUserResponse getCollectionUserResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionUsersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCollectionUserResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCollectionUserResponse, "getCollectionUserResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCollectionUserResponse getCollectionUserResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCollectionUserResponse = getCollectionUserResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionUsersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * User */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCollectionUserResponse() { - return (Optional) getCollectionUserResponse; + return Optional.ofNullable(this.getCollectionUserResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionUsersOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionUsersOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionUsersOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionUsersOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * User + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionUsersOneResponse withGetCollectionUserResponse(GetCollectionUserResponse getCollectionUserResponse) { - Utils.checkNotNull(getCollectionUserResponse, "getCollectionUserResponse"); - this.getCollectionUserResponse = Optional.ofNullable(getCollectionUserResponse); + public IssueTrackingCollectionUsersOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionUsersOneResponse withGetCollectionUserResponse(Get /** * User */ - public IssueTrackingCollectionUsersOneResponse withGetCollectionUserResponse(Optional getCollectionUserResponse) { - Utils.checkNotNull(getCollectionUserResponse, "getCollectionUserResponse"); + public IssueTrackingCollectionUsersOneResponse withGetCollectionUserResponse(@Nullable GetCollectionUserResponse getCollectionUserResponse) { this.getCollectionUserResponse = getCollectionUserResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionUsersOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionUsersOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionUsersOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCollectionUserResponse = Optional.empty(); + private GetCollectionUserResponse getCollectionUserResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * User - */ - public Builder getCollectionUserResponse(GetCollectionUserResponse getCollectionUserResponse) { - Utils.checkNotNull(getCollectionUserResponse, "getCollectionUserResponse"); - this.getCollectionUserResponse = Optional.ofNullable(getCollectionUserResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * User */ - public Builder getCollectionUserResponse(Optional getCollectionUserResponse) { - Utils.checkNotNull(getCollectionUserResponse, "getCollectionUserResponse"); + public Builder getCollectionUserResponse(@Nullable GetCollectionUserResponse getCollectionUserResponse) { this.getCollectionUserResponse = getCollectionUserResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionUsersOneResponse build() { - return new IssueTrackingCollectionUsersOneResponse( contentType, statusCode, rawResponse, getCollectionUserResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllRequest.java index c25400fd..63bdbc73 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllRequest.java @@ -8,14 +8,13 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Object; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Map; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -26,25 +25,25 @@ public class IssueTrackingCollectionsAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -56,19 +55,19 @@ public class IssueTrackingCollectionsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * Apply sorting */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=sort") - private Optional sort; + private CollectionsSort sort; /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=pass_through") - private Optional> passThrough; + private Map passThrough; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -78,113 +77,97 @@ public class IssueTrackingCollectionsAllRequest { @JsonCreator public IssueTrackingCollectionsAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - Optional sort, - Optional> passThrough, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(sort, "sort"); - Utils.checkNotNull(passThrough, "passThrough"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable CollectionsSort sort, + @Nullable Map passThrough, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); this.sort = sort; this.passThrough = passThrough; - this.fields = fields; + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public IssueTrackingCollectionsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null, null, null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * Apply sorting */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional sort() { - return (Optional) sort; + return Optional.ofNullable(this.sort); } /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional> passThrough() { - return (Optional>) passThrough; + return Optional.ofNullable(this.passThrough); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -195,103 +178,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionsAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionsAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionsAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionsAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionsAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public IssueTrackingCollectionsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public IssueTrackingCollectionsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public IssueTrackingCollectionsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public IssueTrackingCollectionsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -299,67 +223,38 @@ public IssueTrackingCollectionsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public IssueTrackingCollectionsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public IssueTrackingCollectionsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } - /** - * Apply sorting - */ - public IssueTrackingCollectionsAllRequest withSort(CollectionsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public IssueTrackingCollectionsAllRequest withSort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public IssueTrackingCollectionsAllRequest withSort(@Nullable CollectionsSort sort) { this.sort = sort; return this; } - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public IssueTrackingCollectionsAllRequest withPassThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public IssueTrackingCollectionsAllRequest withPassThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public IssueTrackingCollectionsAllRequest withPassThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public IssueTrackingCollectionsAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public IssueTrackingCollectionsAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public IssueTrackingCollectionsAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -407,207 +302,101 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private Optional sort = Optional.empty(); + private CollectionsSort sort; - private Optional> passThrough = Optional.empty(); + private Map passThrough; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - - /** - * Apply sorting - */ - public Builder sort(CollectionsSort sort) { - Utils.checkNotNull(sort, "sort"); - this.sort = Optional.ofNullable(sort); - return this; - } - /** * Apply sorting */ - public Builder sort(Optional sort) { - Utils.checkNotNull(sort, "sort"); + public Builder sort(@Nullable CollectionsSort sort) { this.sort = sort; return this; } - - /** - * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads - */ - public Builder passThrough(Map passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); - this.passThrough = Optional.ofNullable(passThrough); - return this; - } - /** * Optional unmapped key/values that will be passed through to downstream as query parameters. Ie: ?pass_through[search]=leads becomes ?search=leads */ - public Builder passThrough(Optional> passThrough) { - Utils.checkNotNull(passThrough, "passThrough"); + public Builder passThrough(@Nullable Map passThrough) { this.passThrough = passThrough; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public IssueTrackingCollectionsAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new IssueTrackingCollectionsAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -615,16 +404,16 @@ public IssueTrackingCollectionsAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllRequestBuilder.java index f11053d0..09258d16 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class IssueTrackingCollectionsAllRequestBuilder { - - private IssueTrackingCollectionsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionsAllRequestBuilder request(IssueTrackingCollectionsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionsAllRequestBuilder request(@Nonnull IssueTrackingCollectionsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public IssueTrackingCollectionsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new IssueTrackingCollectionsAllOperation( - sdkConfiguration, - options); + IssueTrackingCollectionsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new IssueTrackingCollectionsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - IssueTrackingCollectionsAllRequest::withCursor, + IssueTrackingCollectionsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllResponse.java index 9275b938..7ed93a66 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionsAllResponse implements Response { /** * List Collections */ - private Optional getCollectionsResponse; + private GetCollectionsResponse getCollectionsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCollectionsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCollectionsResponse, "getCollectionsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCollectionsResponse getCollectionsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCollectionsResponse = getCollectionsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * List Collections */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCollectionsResponse() { - return (Optional) getCollectionsResponse; + return Optional.ofNullable(this.getCollectionsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * List Collections + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionsAllResponse withGetCollectionsResponse(GetCollectionsResponse getCollectionsResponse) { - Utils.checkNotNull(getCollectionsResponse, "getCollectionsResponse"); - this.getCollectionsResponse = Optional.ofNullable(getCollectionsResponse); + public IssueTrackingCollectionsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionsAllResponse withGetCollectionsResponse(GetCollect /** * List Collections */ - public IssueTrackingCollectionsAllResponse withGetCollectionsResponse(Optional getCollectionsResponse) { - Utils.checkNotNull(getCollectionsResponse, "getCollectionsResponse"); + public IssueTrackingCollectionsAllResponse withGetCollectionsResponse(@Nullable GetCollectionsResponse getCollectionsResponse) { this.getCollectionsResponse = getCollectionsResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCollectionsResponse = Optional.empty(); + private GetCollectionsResponse getCollectionsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * List Collections - */ - public Builder getCollectionsResponse(GetCollectionsResponse getCollectionsResponse) { - Utils.checkNotNull(getCollectionsResponse, "getCollectionsResponse"); - this.getCollectionsResponse = Optional.ofNullable(getCollectionsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * List Collections */ - public Builder getCollectionsResponse(Optional getCollectionsResponse) { - Utils.checkNotNull(getCollectionsResponse, "getCollectionsResponse"); + public Builder getCollectionsResponse(@Nullable GetCollectionsResponse getCollectionsResponse) { this.getCollectionsResponse = getCollectionsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionsAllResponse build() { - return new IssueTrackingCollectionsAllResponse( contentType, statusCode, rawResponse, getCollectionsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneRequest.java index 7a543caf..896463f5 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class IssueTrackingCollectionsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class IssueTrackingCollectionsOneRequest { @JsonCreator public IssueTrackingCollectionsOneRequest( - String collectionId, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(collectionId, "collectionId"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.collectionId = collectionId; + @Nonnull String collectionId, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.collectionId = Optional.ofNullable(collectionId) + .orElseThrow(() -> new IllegalArgumentException("collectionId cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public IssueTrackingCollectionsOneRequest( - String collectionId) { - this(collectionId, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String collectionId) { + this(collectionId, null, null, + null, null, null); } /** * The collection ID */ - @JsonIgnore public String collectionId() { - return collectionId; + return this.collectionId; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * The collection ID */ - public IssueTrackingCollectionsOneRequest withCollectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public IssueTrackingCollectionsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public IssueTrackingCollectionsOneRequest withCollectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } @@ -156,86 +138,47 @@ public IssueTrackingCollectionsOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public IssueTrackingCollectionsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public IssueTrackingCollectionsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public IssueTrackingCollectionsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public IssueTrackingCollectionsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public IssueTrackingCollectionsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public IssueTrackingCollectionsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public IssueTrackingCollectionsOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public IssueTrackingCollectionsOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public IssueTrackingCollectionsOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public IssueTrackingCollectionsOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public IssueTrackingCollectionsOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public IssueTrackingCollectionsOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public IssueTrackingCollectionsOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public IssueTrackingCollectionsOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String collectionId; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * The collection ID */ - public Builder collectionId(String collectionId) { - Utils.checkNotNull(collectionId, "collectionId"); - this.collectionId = collectionId; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder collectionId(@Nonnull String collectionId) { + this.collectionId = Utils.checkNotNull(collectionId, "collectionId"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public IssueTrackingCollectionsOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new IssueTrackingCollectionsOneRequest( collectionId, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneRequestBuilder.java index 264dc892..259b5a89 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class IssueTrackingCollectionsOneRequestBuilder { - - private IssueTrackingCollectionsOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private IssueTrackingCollectionsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public IssueTrackingCollectionsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public IssueTrackingCollectionsOneRequestBuilder request(IssueTrackingCollectionsOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public IssueTrackingCollectionsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public IssueTrackingCollectionsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public IssueTrackingCollectionsOneRequestBuilder request(@Nonnull IssueTrackingCollectionsOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private IssueTrackingCollectionsOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public IssueTrackingCollectionsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new IssueTrackingCollectionsOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneResponse.java index d73931e2..30789031 100644 --- a/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/IssueTrackingCollectionsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class IssueTrackingCollectionsOneResponse implements Response { /** * Get a Collection */ - private Optional getCollectionResponse; + private GetCollectionResponse getCollectionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public IssueTrackingCollectionsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCollectionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCollectionResponse, "getCollectionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCollectionResponse getCollectionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCollectionResponse = getCollectionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public IssueTrackingCollectionsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Get a Collection */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCollectionResponse() { - return (Optional) getCollectionResponse; + return Optional.ofNullable(this.getCollectionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public IssueTrackingCollectionsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public IssueTrackingCollectionsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public IssueTrackingCollectionsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public IssueTrackingCollectionsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Get a Collection + * Raw HTTP response; suitable for custom response parsing */ - public IssueTrackingCollectionsOneResponse withGetCollectionResponse(GetCollectionResponse getCollectionResponse) { - Utils.checkNotNull(getCollectionResponse, "getCollectionResponse"); - this.getCollectionResponse = Optional.ofNullable(getCollectionResponse); + public IssueTrackingCollectionsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public IssueTrackingCollectionsOneResponse withGetCollectionResponse(GetCollecti /** * Get a Collection */ - public IssueTrackingCollectionsOneResponse withGetCollectionResponse(Optional getCollectionResponse) { - Utils.checkNotNull(getCollectionResponse, "getCollectionResponse"); + public IssueTrackingCollectionsOneResponse withGetCollectionResponse(@Nullable GetCollectionResponse getCollectionResponse) { this.getCollectionResponse = getCollectionResponse; return this; } - /** - * Unexpected error - */ - public IssueTrackingCollectionsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public IssueTrackingCollectionsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public IssueTrackingCollectionsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCollectionResponse = Optional.empty(); + private GetCollectionResponse getCollectionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Get a Collection - */ - public Builder getCollectionResponse(GetCollectionResponse getCollectionResponse) { - Utils.checkNotNull(getCollectionResponse, "getCollectionResponse"); - this.getCollectionResponse = Optional.ofNullable(getCollectionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Get a Collection */ - public Builder getCollectionResponse(Optional getCollectionResponse) { - Utils.checkNotNull(getCollectionResponse, "getCollectionResponse"); + public Builder getCollectionResponse(@Nullable GetCollectionResponse getCollectionResponse) { this.getCollectionResponse = getCollectionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public IssueTrackingCollectionsOneResponse build() { - return new IssueTrackingCollectionsOneResponse( contentType, statusCode, rawResponse, getCollectionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddRequest.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddRequest.java index 58118f0b..b8424c55 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -21,25 +22,25 @@ public class SmsMessagesAddRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -47,64 +48,56 @@ public class SmsMessagesAddRequest { @JsonCreator public SmsMessagesAddRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - MessageInput message) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(message, "message"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nonnull MessageInput message) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.message = message; + this.message = Optional.ofNullable(message) + .orElseThrow(() -> new IllegalArgumentException("message cannot be null")); } public SmsMessagesAddRequest( - MessageInput message) { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), message); + @Nonnull MessageInput message) { + this(null, null, null, + null, message); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } - @JsonIgnore public MessageInput message() { - return message; + return this.message; } public static Builder builder() { @@ -115,85 +108,45 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public SmsMessagesAddRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public SmsMessagesAddRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public SmsMessagesAddRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public SmsMessagesAddRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public SmsMessagesAddRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public SmsMessagesAddRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public SmsMessagesAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public SmsMessagesAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public SmsMessagesAddRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public SmsMessagesAddRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public SmsMessagesAddRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public SmsMessagesAddRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - public SmsMessagesAddRequest withMessage(MessageInput message) { - Utils.checkNotNull(message, "message"); - this.message = message; + + public SmsMessagesAddRequest withMessage(@Nonnull MessageInput message) { + this.message = Utils.checkNotNull(message, "message"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -231,13 +184,13 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; private MessageInput message; @@ -245,104 +198,54 @@ private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - public Builder message(MessageInput message) { - Utils.checkNotNull(message, "message"); - this.message = message; + public Builder message(@Nonnull MessageInput message) { + this.message = Utils.checkNotNull(message, "message"); return this; } public SmsMessagesAddRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new SmsMessagesAddRequest( raw, consumerId, appId, serviceId, message); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddRequestBuilder.java index e9a6a799..cf5f394f 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class SmsMessagesAddRequestBuilder { - - private SmsMessagesAddRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private SmsMessagesAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public SmsMessagesAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public SmsMessagesAddRequestBuilder request(SmsMessagesAddRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public SmsMessagesAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public SmsMessagesAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public SmsMessagesAddRequestBuilder request(@Nonnull SmsMessagesAddRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private SmsMessagesAddRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public SmsMessagesAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new SmsMessagesAddOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddResponse.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddResponse.java index 47ecf8ce..f88104b2 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class SmsMessagesAddResponse implements Response { /** * Messages */ - private Optional createMessageResponse; + private CreateMessageResponse createMessageResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public SmsMessagesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createMessageResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createMessageResponse, "createMessageResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateMessageResponse createMessageResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createMessageResponse = createMessageResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public SmsMessagesAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Messages */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createMessageResponse() { - return (Optional) createMessageResponse; + return Optional.ofNullable(this.createMessageResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public SmsMessagesAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public SmsMessagesAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public SmsMessagesAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public SmsMessagesAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Messages + * Raw HTTP response; suitable for custom response parsing */ - public SmsMessagesAddResponse withCreateMessageResponse(CreateMessageResponse createMessageResponse) { - Utils.checkNotNull(createMessageResponse, "createMessageResponse"); - this.createMessageResponse = Optional.ofNullable(createMessageResponse); + public SmsMessagesAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public SmsMessagesAddResponse withCreateMessageResponse(CreateMessageResponse cr /** * Messages */ - public SmsMessagesAddResponse withCreateMessageResponse(Optional createMessageResponse) { - Utils.checkNotNull(createMessageResponse, "createMessageResponse"); + public SmsMessagesAddResponse withCreateMessageResponse(@Nullable CreateMessageResponse createMessageResponse) { this.createMessageResponse = createMessageResponse; return this; } - /** - * Unexpected error - */ - public SmsMessagesAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public SmsMessagesAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public SmsMessagesAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createMessageResponse = Optional.empty(); + private CreateMessageResponse createMessageResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Messages - */ - public Builder createMessageResponse(CreateMessageResponse createMessageResponse) { - Utils.checkNotNull(createMessageResponse, "createMessageResponse"); - this.createMessageResponse = Optional.ofNullable(createMessageResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Messages */ - public Builder createMessageResponse(Optional createMessageResponse) { - Utils.checkNotNull(createMessageResponse, "createMessageResponse"); + public Builder createMessageResponse(@Nullable CreateMessageResponse createMessageResponse) { this.createMessageResponse = createMessageResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public SmsMessagesAddResponse build() { - return new SmsMessagesAddResponse( contentType, statusCode, rawResponse, createMessageResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllRequest.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllRequest.java index 78f0bd23..c7f5ecc1 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllRequest.java @@ -7,8 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Long; import java.lang.Override; @@ -22,25 +22,25 @@ public class SmsMessagesAllRequest { * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -52,7 +52,7 @@ public class SmsMessagesAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -62,89 +62,79 @@ public class SmsMessagesAllRequest { @JsonCreator public SmsMessagesAllRequest( - Optional raw, - Optional consumerId, - Optional appId, - Optional serviceId, - JsonNullable cursor, - Optional limit, - JsonNullable fields) { - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); - Utils.checkNotNull(fields, "fields"); - this.raw = raw; + @Nullable Boolean raw, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable JsonNullable cursor, + @Nullable Long limit, + @Nullable JsonNullable fields) { + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.cursor = cursor; - this.limit = limit; - this.fields = fields; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public SmsMessagesAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty(), JsonNullable.undefined(), Optional.empty(), - JsonNullable.undefined()); + this(null, null, null, + null, null, null, + null); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -155,103 +145,44 @@ public static Builder builder() { /** * Include raw response. Mostly used for debugging purposes */ - public SmsMessagesAllRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - - - /** - * Include raw response. Mostly used for debugging purposes - */ - public SmsMessagesAllRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public SmsMessagesAllRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public SmsMessagesAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public SmsMessagesAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public SmsMessagesAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public SmsMessagesAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public SmsMessagesAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public SmsMessagesAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public SmsMessagesAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public SmsMessagesAllRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public SmsMessagesAllRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public SmsMessagesAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public SmsMessagesAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public SmsMessagesAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public SmsMessagesAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -259,29 +190,20 @@ public SmsMessagesAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public SmsMessagesAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public SmsMessagesAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public SmsMessagesAllRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public SmsMessagesAllRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public SmsMessagesAllRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -325,165 +247,81 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional raw; + private Boolean raw; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public SmsMessagesAllRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new SmsMessagesAllRequest( raw, consumerId, appId, serviceId, cursor, limit, @@ -491,16 +329,16 @@ public SmsMessagesAllRequest build() { } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllRequestBuilder.java index de509066..2f2498d9 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class SmsMessagesAllRequestBuilder { - - private SmsMessagesAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private SmsMessagesAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public SmsMessagesAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public SmsMessagesAllRequestBuilder request(SmsMessagesAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public SmsMessagesAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public SmsMessagesAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public SmsMessagesAllRequestBuilder request(@Nonnull SmsMessagesAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private SmsMessagesAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public SmsMessagesAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new SmsMessagesAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public SmsMessagesAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new SmsMessagesAllOperation( - sdkConfiguration, - options); + SmsMessagesAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new SmsMessagesAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - SmsMessagesAllRequest::withCursor, + SmsMessagesAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllResponse.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllResponse.java index a617d4ac..448e6445 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class SmsMessagesAllResponse implements Response { /** * Messages */ - private Optional getMessagesResponse; + private GetMessagesResponse getMessagesResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public SmsMessagesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getMessagesResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getMessagesResponse, "getMessagesResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetMessagesResponse getMessagesResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getMessagesResponse = getMessagesResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public SmsMessagesAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Messages */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getMessagesResponse() { - return (Optional) getMessagesResponse; + return Optional.ofNullable(this.getMessagesResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public SmsMessagesAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public SmsMessagesAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public SmsMessagesAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public SmsMessagesAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Messages + * Raw HTTP response; suitable for custom response parsing */ - public SmsMessagesAllResponse withGetMessagesResponse(GetMessagesResponse getMessagesResponse) { - Utils.checkNotNull(getMessagesResponse, "getMessagesResponse"); - this.getMessagesResponse = Optional.ofNullable(getMessagesResponse); + public SmsMessagesAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public SmsMessagesAllResponse withGetMessagesResponse(GetMessagesResponse getMes /** * Messages */ - public SmsMessagesAllResponse withGetMessagesResponse(Optional getMessagesResponse) { - Utils.checkNotNull(getMessagesResponse, "getMessagesResponse"); + public SmsMessagesAllResponse withGetMessagesResponse(@Nullable GetMessagesResponse getMessagesResponse) { this.getMessagesResponse = getMessagesResponse; return this; } - /** - * Unexpected error - */ - public SmsMessagesAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public SmsMessagesAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public SmsMessagesAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getMessagesResponse = Optional.empty(); + private GetMessagesResponse getMessagesResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Messages - */ - public Builder getMessagesResponse(GetMessagesResponse getMessagesResponse) { - Utils.checkNotNull(getMessagesResponse, "getMessagesResponse"); - this.getMessagesResponse = Optional.ofNullable(getMessagesResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Messages */ - public Builder getMessagesResponse(Optional getMessagesResponse) { - Utils.checkNotNull(getMessagesResponse, "getMessagesResponse"); + public Builder getMessagesResponse(@Nullable GetMessagesResponse getMessagesResponse) { this.getMessagesResponse = getMessagesResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public SmsMessagesAllResponse build() { - return new SmsMessagesAllResponse( contentType, statusCode, rawResponse, getMessagesResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteRequest.java index 7783056f..bda939e7 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -26,89 +27,81 @@ public class SmsMessagesDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @JsonCreator public SmsMessagesDeleteRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); } public SmsMessagesDeleteRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty()); + @Nonnull String id) { + this(id, null, null, + null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } public static Builder builder() { @@ -119,18 +112,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public SmsMessagesDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public SmsMessagesDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public SmsMessagesDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -138,69 +121,39 @@ public SmsMessagesDeleteRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public SmsMessagesDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public SmsMessagesDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public SmsMessagesDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public SmsMessagesDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public SmsMessagesDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public SmsMessagesDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public SmsMessagesDeleteRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public SmsMessagesDeleteRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public SmsMessagesDeleteRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public SmsMessagesDeleteRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public SmsMessagesDeleteRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,119 +193,69 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } public SmsMessagesDeleteRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new SmsMessagesDeleteRequest( id, consumerId, appId, serviceId, raw); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteRequestBuilder.java index cb659348..fab83a18 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class SmsMessagesDeleteRequestBuilder { - - private SmsMessagesDeleteRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private SmsMessagesDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public SmsMessagesDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public SmsMessagesDeleteRequestBuilder request(SmsMessagesDeleteRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public SmsMessagesDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public SmsMessagesDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public SmsMessagesDeleteRequestBuilder request(@Nonnull SmsMessagesDeleteRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private SmsMessagesDeleteRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public SmsMessagesDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new SmsMessagesDeleteOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteResponse.java index fca8e3f0..cc3ce864 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class SmsMessagesDeleteResponse implements Response { /** * Messages */ - private Optional deleteMessageResponse; + private DeleteMessageResponse deleteMessageResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public SmsMessagesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteMessageResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteMessageResponse, "deleteMessageResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteMessageResponse deleteMessageResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteMessageResponse = deleteMessageResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public SmsMessagesDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Messages */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteMessageResponse() { - return (Optional) deleteMessageResponse; + return Optional.ofNullable(this.deleteMessageResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public SmsMessagesDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public SmsMessagesDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public SmsMessagesDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public SmsMessagesDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Messages + * Raw HTTP response; suitable for custom response parsing */ - public SmsMessagesDeleteResponse withDeleteMessageResponse(DeleteMessageResponse deleteMessageResponse) { - Utils.checkNotNull(deleteMessageResponse, "deleteMessageResponse"); - this.deleteMessageResponse = Optional.ofNullable(deleteMessageResponse); + public SmsMessagesDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public SmsMessagesDeleteResponse withDeleteMessageResponse(DeleteMessageResponse /** * Messages */ - public SmsMessagesDeleteResponse withDeleteMessageResponse(Optional deleteMessageResponse) { - Utils.checkNotNull(deleteMessageResponse, "deleteMessageResponse"); + public SmsMessagesDeleteResponse withDeleteMessageResponse(@Nullable DeleteMessageResponse deleteMessageResponse) { this.deleteMessageResponse = deleteMessageResponse; return this; } - /** - * Unexpected error - */ - public SmsMessagesDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public SmsMessagesDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public SmsMessagesDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteMessageResponse = Optional.empty(); + private DeleteMessageResponse deleteMessageResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Messages - */ - public Builder deleteMessageResponse(DeleteMessageResponse deleteMessageResponse) { - Utils.checkNotNull(deleteMessageResponse, "deleteMessageResponse"); - this.deleteMessageResponse = Optional.ofNullable(deleteMessageResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Messages */ - public Builder deleteMessageResponse(Optional deleteMessageResponse) { - Utils.checkNotNull(deleteMessageResponse, "deleteMessageResponse"); + public Builder deleteMessageResponse(@Nullable DeleteMessageResponse deleteMessageResponse) { this.deleteMessageResponse = deleteMessageResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public SmsMessagesDeleteResponse build() { - return new SmsMessagesDeleteResponse( contentType, statusCode, rawResponse, deleteMessageResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneRequest.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneRequest.java index 1612a4c2..2158fe27 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneRequest.java @@ -7,8 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class SmsMessagesOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. @@ -55,78 +56,69 @@ public class SmsMessagesOneRequest { @JsonCreator public SmsMessagesOneRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - JsonNullable fields) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(fields, "fields"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nullable JsonNullable fields) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.fields = fields; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.fields = Optional.ofNullable(fields) + .orElse(JsonNullable.undefined()); } public SmsMessagesOneRequest( - String id) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), JsonNullable.undefined()); + @Nonnull String id) { + this(id, null, null, + null, null, null); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - @JsonIgnore public JsonNullable fields() { - return fields; + return this.fields; } public static Builder builder() { @@ -137,18 +129,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public SmsMessagesOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public SmsMessagesOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public SmsMessagesOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -156,86 +138,47 @@ public SmsMessagesOneRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public SmsMessagesOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public SmsMessagesOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public SmsMessagesOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public SmsMessagesOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public SmsMessagesOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public SmsMessagesOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public SmsMessagesOneRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public SmsMessagesOneRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public SmsMessagesOneRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public SmsMessagesOneRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public SmsMessagesOneRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } + /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public SmsMessagesOneRequest withFields(String fields) { - Utils.checkNotNull(fields, "fields"); + public SmsMessagesOneRequest withFields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public SmsMessagesOneRequest withFields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -278,140 +221,79 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; - private JsonNullable fields = JsonNullable.undefined(); + private JsonNullable fields; private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - /** * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. */ - public Builder fields(String fields) { - Utils.checkNotNull(fields, "fields"); + public Builder fields(@Nullable String fields) { this.fields = JsonNullable.of(fields); return this; } - /** - * The 'fields' parameter allows API users to specify the fields they want to include in the API response. If this parameter is not present, the API will return all available fields. If this parameter is present, only the fields specified in the comma-separated string will be included in the response. Nested properties can also be requested by using a dot notation. <br /><br />Example: `fields=name,email,addresses.city`<br /><br />In the example above, the response will only include the fields "name", "email" and "addresses.city". If any other fields are available, they will be excluded. - */ - public Builder fields(JsonNullable fields) { - Utils.checkNotNull(fields, "fields"); - this.fields = fields; - return this; - } - public SmsMessagesOneRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new SmsMessagesOneRequest( id, consumerId, appId, serviceId, raw, fields); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneRequestBuilder.java index 92b392ad..fc96a38d 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class SmsMessagesOneRequestBuilder { - - private SmsMessagesOneRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private SmsMessagesOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public SmsMessagesOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public SmsMessagesOneRequestBuilder request(SmsMessagesOneRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public SmsMessagesOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public SmsMessagesOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public SmsMessagesOneRequestBuilder request(@Nonnull SmsMessagesOneRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private SmsMessagesOneRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public SmsMessagesOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new SmsMessagesOneOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneResponse.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneResponse.java index d5e074a4..6fc0ca10 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class SmsMessagesOneResponse implements Response { /** * Messages */ - private Optional getMessageResponse; + private GetMessageResponse getMessageResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public SmsMessagesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getMessageResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getMessageResponse, "getMessageResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetMessageResponse getMessageResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getMessageResponse = getMessageResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public SmsMessagesOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Messages */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getMessageResponse() { - return (Optional) getMessageResponse; + return Optional.ofNullable(this.getMessageResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public SmsMessagesOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public SmsMessagesOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public SmsMessagesOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public SmsMessagesOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Messages + * Raw HTTP response; suitable for custom response parsing */ - public SmsMessagesOneResponse withGetMessageResponse(GetMessageResponse getMessageResponse) { - Utils.checkNotNull(getMessageResponse, "getMessageResponse"); - this.getMessageResponse = Optional.ofNullable(getMessageResponse); + public SmsMessagesOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public SmsMessagesOneResponse withGetMessageResponse(GetMessageResponse getMessa /** * Messages */ - public SmsMessagesOneResponse withGetMessageResponse(Optional getMessageResponse) { - Utils.checkNotNull(getMessageResponse, "getMessageResponse"); + public SmsMessagesOneResponse withGetMessageResponse(@Nullable GetMessageResponse getMessageResponse) { this.getMessageResponse = getMessageResponse; return this; } - /** - * Unexpected error - */ - public SmsMessagesOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public SmsMessagesOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public SmsMessagesOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getMessageResponse = Optional.empty(); + private GetMessageResponse getMessageResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Messages - */ - public Builder getMessageResponse(GetMessageResponse getMessageResponse) { - Utils.checkNotNull(getMessageResponse, "getMessageResponse"); - this.getMessageResponse = Optional.ofNullable(getMessageResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Messages */ - public Builder getMessageResponse(Optional getMessageResponse) { - Utils.checkNotNull(getMessageResponse, "getMessageResponse"); + public Builder getMessageResponse(@Nullable GetMessageResponse getMessageResponse) { this.getMessageResponse = getMessageResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public SmsMessagesOneResponse build() { - return new SmsMessagesOneResponse( contentType, statusCode, rawResponse, getMessageResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateRequest.java index 52389145..4b621a64 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateRequest.java @@ -8,8 +8,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -27,25 +28,25 @@ public class SmsMessagesUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-service-id") - private Optional serviceId; + private String serviceId; /** * Include raw response. Mostly used for debugging purposes */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=raw") - private Optional raw; + private Boolean raw; @SpeakeasyMetadata("request:mediaType=application/json") @@ -53,76 +54,67 @@ public class SmsMessagesUpdateRequest { @JsonCreator public SmsMessagesUpdateRequest( - String id, - Optional consumerId, - Optional appId, - Optional serviceId, - Optional raw, - MessageInput message) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(raw, "raw"); - Utils.checkNotNull(message, "message"); - this.id = id; + @Nonnull String id, + @Nullable String consumerId, + @Nullable String appId, + @Nullable String serviceId, + @Nullable Boolean raw, + @Nonnull MessageInput message) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.consumerId = consumerId; this.appId = appId; this.serviceId = serviceId; - this.raw = raw; - this.message = message; + this.raw = Optional.ofNullable(raw) + .orElse(Builder._SINGLETON_VALUE_Raw.value()); + this.message = Optional.ofNullable(message) + .orElseThrow(() -> new IllegalArgumentException("message cannot be null")); } public SmsMessagesUpdateRequest( - String id, - MessageInput message) { - this(id, Optional.empty(), Optional.empty(), - Optional.empty(), Optional.empty(), message); + @Nonnull String id, + @Nonnull MessageInput message) { + this(id, null, null, + null, null, message); } /** * ID of the record you are acting upon. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - @JsonIgnore public Optional serviceId() { - return serviceId; + return Optional.ofNullable(this.serviceId); } /** * Include raw response. Mostly used for debugging purposes */ - @JsonIgnore public Optional raw() { - return raw; + return Optional.ofNullable(this.raw); } - @JsonIgnore public MessageInput message() { - return message; + return this.message; } public static Builder builder() { @@ -133,18 +125,8 @@ public static Builder builder() { /** * ID of the record you are acting upon. */ - public SmsMessagesUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public SmsMessagesUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public SmsMessagesUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -152,75 +134,45 @@ public SmsMessagesUpdateRequest withConsumerId(String consumerId) { /** * ID of the consumer which you want to get or push data from */ - public SmsMessagesUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public SmsMessagesUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public SmsMessagesUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public SmsMessagesUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public SmsMessagesUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public SmsMessagesUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public SmsMessagesUpdateRequest withServiceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public SmsMessagesUpdateRequest withServiceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - /** - * Include raw response. Mostly used for debugging purposes - */ - public SmsMessagesUpdateRequest withRaw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public SmsMessagesUpdateRequest withRaw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public SmsMessagesUpdateRequest withRaw(@Nullable Boolean raw) { this.raw = raw; return this; } - public SmsMessagesUpdateRequest withMessage(MessageInput message) { - Utils.checkNotNull(message, "message"); - this.message = message; + + public SmsMessagesUpdateRequest withMessage(@Nonnull MessageInput message) { + this.message = Utils.checkNotNull(message, "message"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -262,13 +214,13 @@ public final static class Builder { private String id; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional serviceId = Optional.empty(); + private String serviceId; - private Optional raw; + private Boolean raw; private MessageInput message; @@ -276,114 +228,62 @@ private Builder() { // force use of static builder() method } - /** * ID of the record you are acting upon. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = Optional.ofNullable(serviceId); - return this; - } - - /** - * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. - */ - public Builder serviceId(Optional serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); + public Builder serviceId(@Nullable String serviceId) { this.serviceId = serviceId; return this; } - - /** - * Include raw response. Mostly used for debugging purposes - */ - public Builder raw(boolean raw) { - Utils.checkNotNull(raw, "raw"); - this.raw = Optional.ofNullable(raw); - return this; - } - /** * Include raw response. Mostly used for debugging purposes */ - public Builder raw(Optional raw) { - Utils.checkNotNull(raw, "raw"); + public Builder raw(@Nullable Boolean raw) { this.raw = raw; return this; } - - public Builder message(MessageInput message) { - Utils.checkNotNull(message, "message"); - this.message = message; + public Builder message(@Nonnull MessageInput message) { + this.message = Utils.checkNotNull(message, "message"); return this; } public SmsMessagesUpdateRequest build() { - if (raw == null) { - raw = _SINGLETON_VALUE_Raw.value(); - } - return new SmsMessagesUpdateRequest( id, consumerId, appId, serviceId, raw, message); } - private static final LazySingletonValue> _SINGLETON_VALUE_Raw = + private static final LazySingletonValue _SINGLETON_VALUE_Raw = new LazySingletonValue<>( "raw", "false", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateRequestBuilder.java index e2072afa..97807867 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class SmsMessagesUpdateRequestBuilder { - - private SmsMessagesUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private SmsMessagesUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public SmsMessagesUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public SmsMessagesUpdateRequestBuilder request(SmsMessagesUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public SmsMessagesUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public SmsMessagesUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public SmsMessagesUpdateRequestBuilder request(@Nonnull SmsMessagesUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private SmsMessagesUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public SmsMessagesUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new SmsMessagesUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateResponse.java index 26436be0..d45bce09 100644 --- a/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/SmsMessagesUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class SmsMessagesUpdateResponse implements Response { /** * Messages */ - private Optional updateMessageResponse; + private UpdateMessageResponse updateMessageResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public SmsMessagesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateMessageResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateMessageResponse, "updateMessageResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateMessageResponse updateMessageResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateMessageResponse = updateMessageResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public SmsMessagesUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Messages */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateMessageResponse() { - return (Optional) updateMessageResponse; + return Optional.ofNullable(this.updateMessageResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public SmsMessagesUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public SmsMessagesUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public SmsMessagesUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public SmsMessagesUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Messages + * Raw HTTP response; suitable for custom response parsing */ - public SmsMessagesUpdateResponse withUpdateMessageResponse(UpdateMessageResponse updateMessageResponse) { - Utils.checkNotNull(updateMessageResponse, "updateMessageResponse"); - this.updateMessageResponse = Optional.ofNullable(updateMessageResponse); + public SmsMessagesUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public SmsMessagesUpdateResponse withUpdateMessageResponse(UpdateMessageResponse /** * Messages */ - public SmsMessagesUpdateResponse withUpdateMessageResponse(Optional updateMessageResponse) { - Utils.checkNotNull(updateMessageResponse, "updateMessageResponse"); + public SmsMessagesUpdateResponse withUpdateMessageResponse(@Nullable UpdateMessageResponse updateMessageResponse) { this.updateMessageResponse = updateMessageResponse; return this; } - /** - * Unexpected error - */ - public SmsMessagesUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public SmsMessagesUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public SmsMessagesUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateMessageResponse = Optional.empty(); + private UpdateMessageResponse updateMessageResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Messages - */ - public Builder updateMessageResponse(UpdateMessageResponse updateMessageResponse) { - Utils.checkNotNull(updateMessageResponse, "updateMessageResponse"); - this.updateMessageResponse = Optional.ofNullable(updateMessageResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Messages */ - public Builder updateMessageResponse(Optional updateMessageResponse) { - Utils.checkNotNull(updateMessageResponse, "updateMessageResponse"); + public Builder updateMessageResponse(@Nullable UpdateMessageResponse updateMessageResponse) { this.updateMessageResponse = updateMessageResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public SmsMessagesUpdateResponse build() { - return new SmsMessagesUpdateResponse( contentType, statusCode, rawResponse, updateMessageResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllRequest.java index c4b36f3d..df38dd04 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,13 +18,13 @@ public class VaultConnectionCustomMappingsAllRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Unified API @@ -47,84 +48,75 @@ public class VaultConnectionCustomMappingsAllRequest { * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=resource_id") - private Optional resourceId; + private String resourceId; @JsonCreator public VaultConnectionCustomMappingsAllRequest( - Optional consumerId, - Optional appId, - String unifiedApi, - String serviceId, - String resource, - Optional resourceId) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(resourceId, "resourceId"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String unifiedApi, + @Nonnull String serviceId, + @Nonnull String resource, + @Nullable String resourceId) { this.consumerId = consumerId; this.appId = appId; - this.unifiedApi = unifiedApi; - this.serviceId = serviceId; - this.resource = resource; + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); this.resourceId = resourceId; } public VaultConnectionCustomMappingsAllRequest( - String unifiedApi, - String serviceId, - String resource) { - this(Optional.empty(), Optional.empty(), unifiedApi, - serviceId, resource, Optional.empty()); + @Nonnull String unifiedApi, + @Nonnull String serviceId, + @Nonnull String resource) { + this(null, null, unifiedApi, + serviceId, resource, null); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Name of the resource (plural) */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. */ - @JsonIgnore public Optional resourceId() { - return resourceId; + return Optional.ofNullable(this.resourceId); } public static Builder builder() { @@ -135,74 +127,44 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultConnectionCustomMappingsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultConnectionCustomMappingsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultConnectionCustomMappingsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultConnectionCustomMappingsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultConnectionCustomMappingsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConnectionCustomMappingsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Unified API */ - public VaultConnectionCustomMappingsAllRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultConnectionCustomMappingsAllRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + /** * Service ID of the resource to return */ - public VaultConnectionCustomMappingsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultConnectionCustomMappingsAllRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** - * Name of the resource (plural) - */ - public VaultConnectionCustomMappingsAllRequest withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; - return this; - } /** - * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. + * Name of the resource (plural) */ - public VaultConnectionCustomMappingsAllRequest withResourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = Optional.ofNullable(resourceId); + public VaultConnectionCustomMappingsAllRequest withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } @@ -210,12 +172,12 @@ public VaultConnectionCustomMappingsAllRequest withResourceId(String resourceId) /** * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. */ - public VaultConnectionCustomMappingsAllRequest withResourceId(Optional resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); + public VaultConnectionCustomMappingsAllRequest withResourceId(@Nullable String resourceId) { this.resourceId = resourceId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -255,9 +217,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String unifiedApi; @@ -265,101 +227,61 @@ public final static class Builder { private String resource; - private Optional resourceId = Optional.empty(); + private String resourceId; private Builder() { // force use of static builder() method } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Name of the resource (plural) */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; - return this; - } - - - /** - * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. - */ - public Builder resourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = Optional.ofNullable(resourceId); + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } /** * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. */ - public Builder resourceId(Optional resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); + public Builder resourceId(@Nullable String resourceId) { this.resourceId = resourceId; return this; } public VaultConnectionCustomMappingsAllRequest build() { - return new VaultConnectionCustomMappingsAllRequest( consumerId, appId, unifiedApi, serviceId, resource, resourceId); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllRequestBuilder.java index 74508b77..ecde29b0 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class VaultConnectionCustomMappingsAllRequestBuilder { - - private VaultConnectionCustomMappingsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private VaultConnectionCustomMappingsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConnectionCustomMappingsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public VaultConnectionCustomMappingsAllRequestBuilder request(VaultConnectionCustomMappingsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public VaultConnectionCustomMappingsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultConnectionCustomMappingsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConnectionCustomMappingsAllRequestBuilder request(@Nonnull VaultConnectionCustomMappingsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private VaultConnectionCustomMappingsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConnectionCustomMappingsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConnectionCustomMappingsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllResponse.java index 657fbf24..317c7fa1 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionCustomMappingsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConnectionCustomMappingsAllResponse implements Response { /** * Custom mapping */ - private Optional getCustomMappingsResponse; + private GetCustomMappingsResponse getCustomMappingsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConnectionCustomMappingsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCustomMappingsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCustomMappingsResponse, "getCustomMappingsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCustomMappingsResponse getCustomMappingsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCustomMappingsResponse = getCustomMappingsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConnectionCustomMappingsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom mapping */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCustomMappingsResponse() { - return (Optional) getCustomMappingsResponse; + return Optional.ofNullable(this.getCustomMappingsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConnectionCustomMappingsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConnectionCustomMappingsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConnectionCustomMappingsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConnectionCustomMappingsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom mapping + * Raw HTTP response; suitable for custom response parsing */ - public VaultConnectionCustomMappingsAllResponse withGetCustomMappingsResponse(GetCustomMappingsResponse getCustomMappingsResponse) { - Utils.checkNotNull(getCustomMappingsResponse, "getCustomMappingsResponse"); - this.getCustomMappingsResponse = Optional.ofNullable(getCustomMappingsResponse); + public VaultConnectionCustomMappingsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConnectionCustomMappingsAllResponse withGetCustomMappingsResponse(Ge /** * Custom mapping */ - public VaultConnectionCustomMappingsAllResponse withGetCustomMappingsResponse(Optional getCustomMappingsResponse) { - Utils.checkNotNull(getCustomMappingsResponse, "getCustomMappingsResponse"); + public VaultConnectionCustomMappingsAllResponse withGetCustomMappingsResponse(@Nullable GetCustomMappingsResponse getCustomMappingsResponse) { this.getCustomMappingsResponse = getCustomMappingsResponse; return this; } - /** - * Unexpected error - */ - public VaultConnectionCustomMappingsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConnectionCustomMappingsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConnectionCustomMappingsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCustomMappingsResponse = Optional.empty(); + private GetCustomMappingsResponse getCustomMappingsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom mapping - */ - public Builder getCustomMappingsResponse(GetCustomMappingsResponse getCustomMappingsResponse) { - Utils.checkNotNull(getCustomMappingsResponse, "getCustomMappingsResponse"); - this.getCustomMappingsResponse = Optional.ofNullable(getCustomMappingsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom mapping */ - public Builder getCustomMappingsResponse(Optional getCustomMappingsResponse) { - Utils.checkNotNull(getCustomMappingsResponse, "getCustomMappingsResponse"); + public Builder getCustomMappingsResponse(@Nullable GetCustomMappingsResponse getCustomMappingsResponse) { this.getCustomMappingsResponse = getCustomMappingsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConnectionCustomMappingsAllResponse build() { - return new VaultConnectionCustomMappingsAllResponse( contentType, statusCode, rawResponse, getCustomMappingsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllRequest.java index d34f217d..1c01a7da 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,13 +18,13 @@ public class VaultConnectionSettingsAllRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Unified API @@ -45,69 +46,62 @@ public class VaultConnectionSettingsAllRequest { @JsonCreator public VaultConnectionSettingsAllRequest( - Optional consumerId, - Optional appId, - String unifiedApi, - String serviceId, - String resource) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(resource, "resource"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String unifiedApi, + @Nonnull String serviceId, + @Nonnull String resource) { this.consumerId = consumerId; this.appId = appId; - this.unifiedApi = unifiedApi; - this.serviceId = serviceId; - this.resource = resource; + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); } public VaultConnectionSettingsAllRequest( - String unifiedApi, - String serviceId, - String resource) { - this(Optional.empty(), Optional.empty(), unifiedApi, + @Nonnull String unifiedApi, + @Nonnull String serviceId, + @Nonnull String resource) { + this(null, null, unifiedApi, serviceId, resource); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Name of the resource (plural) */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } public static Builder builder() { @@ -118,68 +112,48 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultConnectionSettingsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultConnectionSettingsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultConnectionSettingsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultConnectionSettingsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultConnectionSettingsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConnectionSettingsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Unified API */ - public VaultConnectionSettingsAllRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultConnectionSettingsAllRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + /** * Service ID of the resource to return */ - public VaultConnectionSettingsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultConnectionSettingsAllRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } + /** * Name of the resource (plural) */ - public VaultConnectionSettingsAllRequest withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public VaultConnectionSettingsAllRequest withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,9 +191,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String unifiedApi; @@ -231,76 +205,47 @@ private Builder() { // force use of static builder() method } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Name of the resource (plural) */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } public VaultConnectionSettingsAllRequest build() { - return new VaultConnectionSettingsAllRequest( consumerId, appId, unifiedApi, serviceId, resource); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllRequestBuilder.java index 6e7258d0..211b1538 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class VaultConnectionSettingsAllRequestBuilder { - - private VaultConnectionSettingsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private VaultConnectionSettingsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConnectionSettingsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public VaultConnectionSettingsAllRequestBuilder request(VaultConnectionSettingsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public VaultConnectionSettingsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultConnectionSettingsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConnectionSettingsAllRequestBuilder request(@Nonnull VaultConnectionSettingsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private VaultConnectionSettingsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConnectionSettingsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConnectionSettingsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllResponse.java index 5b49b53c..ecd6d176 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConnectionSettingsAllResponse implements Response { /** * Connection */ - private Optional getConnectionResponse; + private GetConnectionResponse getConnectionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConnectionSettingsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getConnectionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetConnectionResponse getConnectionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getConnectionResponse = getConnectionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConnectionSettingsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connection */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getConnectionResponse() { - return (Optional) getConnectionResponse; + return Optional.ofNullable(this.getConnectionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConnectionSettingsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConnectionSettingsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConnectionSettingsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConnectionSettingsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connection + * Raw HTTP response; suitable for custom response parsing */ - public VaultConnectionSettingsAllResponse withGetConnectionResponse(GetConnectionResponse getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); - this.getConnectionResponse = Optional.ofNullable(getConnectionResponse); + public VaultConnectionSettingsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConnectionSettingsAllResponse withGetConnectionResponse(GetConnectio /** * Connection */ - public VaultConnectionSettingsAllResponse withGetConnectionResponse(Optional getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); + public VaultConnectionSettingsAllResponse withGetConnectionResponse(@Nullable GetConnectionResponse getConnectionResponse) { this.getConnectionResponse = getConnectionResponse; return this; } - /** - * Unexpected error - */ - public VaultConnectionSettingsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConnectionSettingsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConnectionSettingsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getConnectionResponse = Optional.empty(); + private GetConnectionResponse getConnectionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connection - */ - public Builder getConnectionResponse(GetConnectionResponse getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); - this.getConnectionResponse = Optional.ofNullable(getConnectionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connection */ - public Builder getConnectionResponse(Optional getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); + public Builder getConnectionResponse(@Nullable GetConnectionResponse getConnectionResponse) { this.getConnectionResponse = getConnectionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConnectionSettingsAllResponse build() { - return new VaultConnectionSettingsAllResponse( contentType, statusCode, rawResponse, getConnectionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateRequest.java index 28b3e8f8..f0df5df7 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateRequest.java @@ -7,7 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,13 +19,13 @@ public class VaultConnectionSettingsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Service ID of the resource to return @@ -52,81 +53,73 @@ public class VaultConnectionSettingsUpdateRequest { @JsonCreator public VaultConnectionSettingsUpdateRequest( - Optional consumerId, - Optional appId, - String serviceId, - String unifiedApi, - String resource, - ConnectionInput connection) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(connection, "connection"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nonnull String resource, + @Nonnull ConnectionInput connection) { this.consumerId = consumerId; this.appId = appId; - this.serviceId = serviceId; - this.unifiedApi = unifiedApi; - this.resource = resource; - this.connection = connection; + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); + this.connection = Optional.ofNullable(connection) + .orElseThrow(() -> new IllegalArgumentException("connection cannot be null")); } public VaultConnectionSettingsUpdateRequest( - String serviceId, - String unifiedApi, - String resource, - ConnectionInput connection) { - this(Optional.empty(), Optional.empty(), serviceId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nonnull String resource, + @Nonnull ConnectionInput connection) { + this(null, null, serviceId, unifiedApi, resource, connection); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } /** * Name of the resource (plural) */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * Fields that need to be updated on the resource */ - @JsonIgnore public ConnectionInput connection() { - return connection; + return this.connection; } public static Builder builder() { @@ -137,77 +130,57 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultConnectionSettingsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultConnectionSettingsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultConnectionSettingsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultConnectionSettingsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultConnectionSettingsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConnectionSettingsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Service ID of the resource to return */ - public VaultConnectionSettingsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultConnectionSettingsUpdateRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } + /** * Unified API */ - public VaultConnectionSettingsUpdateRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultConnectionSettingsUpdateRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + /** * Name of the resource (plural) */ - public VaultConnectionSettingsUpdateRequest withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public VaultConnectionSettingsUpdateRequest withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } + /** * Fields that need to be updated on the resource */ - public VaultConnectionSettingsUpdateRequest withConnection(ConnectionInput connection) { - Utils.checkNotNull(connection, "connection"); - this.connection = connection; + public VaultConnectionSettingsUpdateRequest withConnection(@Nonnull ConnectionInput connection) { + this.connection = Utils.checkNotNull(connection, "connection"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -247,9 +220,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String serviceId; @@ -263,86 +236,55 @@ private Builder() { // force use of static builder() method } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** * Name of the resource (plural) */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } - /** * Fields that need to be updated on the resource */ - public Builder connection(ConnectionInput connection) { - Utils.checkNotNull(connection, "connection"); - this.connection = connection; + public Builder connection(@Nonnull ConnectionInput connection) { + this.connection = Utils.checkNotNull(connection, "connection"); return this; } public VaultConnectionSettingsUpdateRequest build() { - return new VaultConnectionSettingsUpdateRequest( consumerId, appId, serviceId, unifiedApi, resource, connection); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateRequestBuilder.java index b534f5d7..bd06d4b7 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class VaultConnectionSettingsUpdateRequestBuilder { - - private VaultConnectionSettingsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private VaultConnectionSettingsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConnectionSettingsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public VaultConnectionSettingsUpdateRequestBuilder request(VaultConnectionSettingsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public VaultConnectionSettingsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultConnectionSettingsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConnectionSettingsUpdateRequestBuilder request(@Nonnull VaultConnectionSettingsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private VaultConnectionSettingsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConnectionSettingsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConnectionSettingsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateResponse.java index 02570725..b6db0055 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionSettingsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConnectionSettingsUpdateResponse implements Response { /** * Connection updated */ - private Optional updateConnectionResponse; + private UpdateConnectionResponse updateConnectionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConnectionSettingsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateConnectionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateConnectionResponse, "updateConnectionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateConnectionResponse updateConnectionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateConnectionResponse = updateConnectionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConnectionSettingsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connection updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateConnectionResponse() { - return (Optional) updateConnectionResponse; + return Optional.ofNullable(this.updateConnectionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConnectionSettingsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConnectionSettingsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConnectionSettingsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConnectionSettingsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connection updated + * Raw HTTP response; suitable for custom response parsing */ - public VaultConnectionSettingsUpdateResponse withUpdateConnectionResponse(UpdateConnectionResponse updateConnectionResponse) { - Utils.checkNotNull(updateConnectionResponse, "updateConnectionResponse"); - this.updateConnectionResponse = Optional.ofNullable(updateConnectionResponse); + public VaultConnectionSettingsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConnectionSettingsUpdateResponse withUpdateConnectionResponse(Update /** * Connection updated */ - public VaultConnectionSettingsUpdateResponse withUpdateConnectionResponse(Optional updateConnectionResponse) { - Utils.checkNotNull(updateConnectionResponse, "updateConnectionResponse"); + public VaultConnectionSettingsUpdateResponse withUpdateConnectionResponse(@Nullable UpdateConnectionResponse updateConnectionResponse) { this.updateConnectionResponse = updateConnectionResponse; return this; } - /** - * Unexpected error - */ - public VaultConnectionSettingsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConnectionSettingsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConnectionSettingsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateConnectionResponse = Optional.empty(); + private UpdateConnectionResponse updateConnectionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connection updated - */ - public Builder updateConnectionResponse(UpdateConnectionResponse updateConnectionResponse) { - Utils.checkNotNull(updateConnectionResponse, "updateConnectionResponse"); - this.updateConnectionResponse = Optional.ofNullable(updateConnectionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connection updated */ - public Builder updateConnectionResponse(Optional updateConnectionResponse) { - Utils.checkNotNull(updateConnectionResponse, "updateConnectionResponse"); + public Builder updateConnectionResponse(@Nullable UpdateConnectionResponse updateConnectionResponse) { this.updateConnectionResponse = updateConnectionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConnectionSettingsUpdateResponse build() { - return new VaultConnectionSettingsUpdateResponse( contentType, statusCode, rawResponse, updateConnectionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllRequest.java index c8a75422..91aafbbd 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllRequest.java @@ -6,7 +6,7 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Override; import java.lang.String; @@ -18,36 +18,32 @@ public class VaultConnectionsAllRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Scope results to Unified API */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=api") - private Optional api; + private String api; /** * Scopes results to connections that have been configured or not */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=configured") - private Optional configured; + private Boolean configured; @JsonCreator public VaultConnectionsAllRequest( - Optional consumerId, - Optional appId, - Optional api, - Optional configured) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(api, "api"); - Utils.checkNotNull(configured, "configured"); + @Nullable String consumerId, + @Nullable String appId, + @Nullable String api, + @Nullable Boolean configured) { this.consumerId = consumerId; this.appId = appId; this.api = api; @@ -55,40 +51,36 @@ public VaultConnectionsAllRequest( } public VaultConnectionsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - Optional.empty()); + this(null, null, null, + null); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Scope results to Unified API */ - @JsonIgnore public Optional api() { - return api; + return Optional.ofNullable(this.api); } /** * Scopes results to connections that have been configured or not */ - @JsonIgnore public Optional configured() { - return configured; + return Optional.ofNullable(this.configured); } public static Builder builder() { @@ -99,79 +91,39 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultConnectionsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultConnectionsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultConnectionsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultConnectionsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultConnectionsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConnectionsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Scope results to Unified API - */ - public VaultConnectionsAllRequest withApi(String api) { - Utils.checkNotNull(api, "api"); - this.api = Optional.ofNullable(api); - return this; - } - /** * Scope results to Unified API */ - public VaultConnectionsAllRequest withApi(Optional api) { - Utils.checkNotNull(api, "api"); + public VaultConnectionsAllRequest withApi(@Nullable String api) { this.api = api; return this; } - /** - * Scopes results to connections that have been configured or not - */ - public VaultConnectionsAllRequest withConfigured(boolean configured) { - Utils.checkNotNull(configured, "configured"); - this.configured = Optional.ofNullable(configured); - return this; - } - /** * Scopes results to connections that have been configured or not */ - public VaultConnectionsAllRequest withConfigured(Optional configured) { - Utils.checkNotNull(configured, "configured"); + public VaultConnectionsAllRequest withConfigured(@Nullable Boolean configured) { this.configured = configured; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -207,96 +159,51 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional api = Optional.empty(); + private String api; - private Optional configured = Optional.empty(); + private Boolean configured; private Builder() { // force use of static builder() method } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Scope results to Unified API */ - public Builder api(String api) { - Utils.checkNotNull(api, "api"); - this.api = Optional.ofNullable(api); - return this; - } - - /** - * Scope results to Unified API - */ - public Builder api(Optional api) { - Utils.checkNotNull(api, "api"); + public Builder api(@Nullable String api) { this.api = api; return this; } - /** * Scopes results to connections that have been configured or not */ - public Builder configured(boolean configured) { - Utils.checkNotNull(configured, "configured"); - this.configured = Optional.ofNullable(configured); - return this; - } - - /** - * Scopes results to connections that have been configured or not - */ - public Builder configured(Optional configured) { - Utils.checkNotNull(configured, "configured"); + public Builder configured(@Nullable Boolean configured) { this.configured = configured; return this; } public VaultConnectionsAllRequest build() { - return new VaultConnectionsAllRequest( consumerId, appId, api, configured); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllRequestBuilder.java index 7309763e..9a77c2e1 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllRequestBuilder.java @@ -9,107 +9,71 @@ import com.apideck.unify.operations.VaultConnectionsAllOperation; import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; -import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nullable; import java.lang.Boolean; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class VaultConnectionsAllRequestBuilder { - - private Optional consumerId = Optional.empty(); - private Optional appId = Optional.empty(); - private Optional api = Optional.empty(); - private Optional configured = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultConnectionsAllRequest.Builder pojoBuilder; + private VaultConnectionsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConnectionsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultConnectionsAllRequestBuilder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.of(consumerId); - return this; + this.pojoBuilder = VaultConnectionsAllRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultConnectionsAllRequestBuilder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - public VaultConnectionsAllRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); + public VaultConnectionsAllRequestBuilder consumerId(@Nullable String consumerId) { + this.pojoBuilder.consumerId(consumerId); + this._setterCalled = true; return this; } - public VaultConnectionsAllRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; - return this; - } - - public VaultConnectionsAllRequestBuilder api(String api) { - Utils.checkNotNull(api, "api"); - this.api = Optional.of(api); + public VaultConnectionsAllRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultConnectionsAllRequestBuilder api(Optional api) { - Utils.checkNotNull(api, "api"); - this.api = api; - return this; - } - - public VaultConnectionsAllRequestBuilder configured(boolean configured) { - Utils.checkNotNull(configured, "configured"); - this.configured = Optional.of(configured); + public VaultConnectionsAllRequestBuilder api(@Nullable String api) { + this.pojoBuilder.api(api); + this._setterCalled = true; return this; } - public VaultConnectionsAllRequestBuilder configured(Optional configured) { - Utils.checkNotNull(configured, "configured"); - this.configured = configured; + public VaultConnectionsAllRequestBuilder configured(@Nullable Boolean configured) { + this.pojoBuilder.configured(configured); + this._setterCalled = true; return this; } - + public VaultConnectionsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultConnectionsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; - return this; + private VaultConnectionsAllRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - - - private VaultConnectionsAllRequest buildRequest() { - - VaultConnectionsAllRequest request = new VaultConnectionsAllRequest(consumerId, - appId, - api, - configured); - - return request; - } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConnectionsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConnectionsAllOperation( sdkConfiguration, options); - VaultConnectionsAllRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllResponse.java index e087f33a..1f6279e5 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConnectionsAllResponse implements Response { /** * Connections */ - private Optional getConnectionsResponse; + private GetConnectionsResponse getConnectionsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConnectionsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getConnectionsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getConnectionsResponse, "getConnectionsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetConnectionsResponse getConnectionsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getConnectionsResponse = getConnectionsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConnectionsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connections */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getConnectionsResponse() { - return (Optional) getConnectionsResponse; + return Optional.ofNullable(this.getConnectionsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConnectionsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConnectionsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConnectionsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConnectionsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connections + * Raw HTTP response; suitable for custom response parsing */ - public VaultConnectionsAllResponse withGetConnectionsResponse(GetConnectionsResponse getConnectionsResponse) { - Utils.checkNotNull(getConnectionsResponse, "getConnectionsResponse"); - this.getConnectionsResponse = Optional.ofNullable(getConnectionsResponse); + public VaultConnectionsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConnectionsAllResponse withGetConnectionsResponse(GetConnectionsResp /** * Connections */ - public VaultConnectionsAllResponse withGetConnectionsResponse(Optional getConnectionsResponse) { - Utils.checkNotNull(getConnectionsResponse, "getConnectionsResponse"); + public VaultConnectionsAllResponse withGetConnectionsResponse(@Nullable GetConnectionsResponse getConnectionsResponse) { this.getConnectionsResponse = getConnectionsResponse; return this; } - /** - * Unexpected error - */ - public VaultConnectionsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConnectionsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConnectionsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getConnectionsResponse = Optional.empty(); + private GetConnectionsResponse getConnectionsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connections - */ - public Builder getConnectionsResponse(GetConnectionsResponse getConnectionsResponse) { - Utils.checkNotNull(getConnectionsResponse, "getConnectionsResponse"); - this.getConnectionsResponse = Optional.ofNullable(getConnectionsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connections */ - public Builder getConnectionsResponse(Optional getConnectionsResponse) { - Utils.checkNotNull(getConnectionsResponse, "getConnectionsResponse"); + public Builder getConnectionsResponse(@Nullable GetConnectionsResponse getConnectionsResponse) { this.getConnectionsResponse = getConnectionsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConnectionsAllResponse build() { - return new VaultConnectionsAllResponse( contentType, statusCode, rawResponse, getConnectionsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteRequest.java index 200258f1..ac5ff0a5 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,13 +18,13 @@ public class VaultConnectionsDeleteRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Service ID of the resource to return @@ -39,57 +40,51 @@ public class VaultConnectionsDeleteRequest { @JsonCreator public VaultConnectionsDeleteRequest( - Optional consumerId, - Optional appId, - String serviceId, - String unifiedApi) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String serviceId, + @Nonnull String unifiedApi) { this.consumerId = consumerId; this.appId = appId; - this.serviceId = serviceId; - this.unifiedApi = unifiedApi; + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); } public VaultConnectionsDeleteRequest( - String serviceId, - String unifiedApi) { - this(Optional.empty(), Optional.empty(), serviceId, + @Nonnull String serviceId, + @Nonnull String unifiedApi) { + this(null, null, serviceId, unifiedApi); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } public static Builder builder() { @@ -100,59 +95,39 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultConnectionsDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultConnectionsDeleteRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultConnectionsDeleteRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultConnectionsDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultConnectionsDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConnectionsDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Service ID of the resource to return */ - public VaultConnectionsDeleteRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultConnectionsDeleteRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } + /** * Unified API */ - public VaultConnectionsDeleteRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultConnectionsDeleteRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -188,9 +163,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String serviceId; @@ -200,66 +175,39 @@ private Builder() { // force use of static builder() method } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } public VaultConnectionsDeleteRequest build() { - return new VaultConnectionsDeleteRequest( consumerId, appId, serviceId, unifiedApi); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteRequestBuilder.java index 47b34f34..4bbe0f09 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteRequestBuilder.java @@ -10,93 +10,71 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class VaultConnectionsDeleteRequestBuilder { - - private Optional consumerId = Optional.empty(); - private Optional appId = Optional.empty(); - private String serviceId; - private String unifiedApi; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultConnectionsDeleteRequest.Builder pojoBuilder; + private VaultConnectionsDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConnectionsDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultConnectionsDeleteRequestBuilder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.of(consumerId); - return this; + this.pojoBuilder = VaultConnectionsDeleteRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultConnectionsDeleteRequestBuilder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - public VaultConnectionsDeleteRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); + public VaultConnectionsDeleteRequestBuilder consumerId(@Nullable String consumerId) { + this.pojoBuilder.consumerId(consumerId); + this._setterCalled = true; return this; } - public VaultConnectionsDeleteRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public VaultConnectionsDeleteRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultConnectionsDeleteRequestBuilder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultConnectionsDeleteRequestBuilder serviceId(@Nonnull String serviceId) { + this.pojoBuilder.serviceId(serviceId); + this._setterCalled = true; return this; } - public VaultConnectionsDeleteRequestBuilder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; - return this; - } - - public VaultConnectionsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public VaultConnectionsDeleteRequestBuilder unifiedApi(@Nonnull String unifiedApi) { + this.pojoBuilder.unifiedApi(unifiedApi); + this._setterCalled = true; return this; } - public VaultConnectionsDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConnectionsDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private VaultConnectionsDeleteRequest buildRequest() { - - VaultConnectionsDeleteRequest request = new VaultConnectionsDeleteRequest(consumerId, - appId, - serviceId, - unifiedApi); - - return request; + private VaultConnectionsDeleteRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConnectionsDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConnectionsDeleteOperation( sdkConfiguration, options); - VaultConnectionsDeleteRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteResponse.java index 69df1656..07e5e700 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsDeleteResponse.java @@ -7,12 +7,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -36,63 +35,56 @@ public class VaultConnectionsDeleteResponse implements Response { /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConnectionsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConnectionsDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty()); + null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -103,36 +95,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConnectionsDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConnectionsDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConnectionsDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConnectionsDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Unexpected error + * Raw HTTP response; suitable for custom response parsing */ - public VaultConnectionsDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + public VaultConnectionsDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -140,12 +122,12 @@ public VaultConnectionsDeleteResponse withUnexpectedErrorResponse(UnexpectedErro /** * Unexpected error */ - public VaultConnectionsDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConnectionsDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -183,67 +165,49 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConnectionsDeleteResponse build() { - return new VaultConnectionsDeleteResponse( contentType, statusCode, rawResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportRequest.java index a2cc5b85..8335bcfc 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportRequest.java @@ -7,7 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,13 +19,13 @@ public class VaultConnectionsImportRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Service ID of the resource to return @@ -46,69 +47,62 @@ public class VaultConnectionsImportRequest { @JsonCreator public VaultConnectionsImportRequest( - Optional consumerId, - Optional appId, - String serviceId, - String unifiedApi, - ConnectionImportData connectionImportData) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(connectionImportData, "connectionImportData"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nonnull ConnectionImportData connectionImportData) { this.consumerId = consumerId; this.appId = appId; - this.serviceId = serviceId; - this.unifiedApi = unifiedApi; - this.connectionImportData = connectionImportData; + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); + this.connectionImportData = Optional.ofNullable(connectionImportData) + .orElseThrow(() -> new IllegalArgumentException("connectionImportData cannot be null")); } public VaultConnectionsImportRequest( - String serviceId, - String unifiedApi, - ConnectionImportData connectionImportData) { - this(Optional.empty(), Optional.empty(), serviceId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nonnull ConnectionImportData connectionImportData) { + this(null, null, serviceId, unifiedApi, connectionImportData); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } /** * Fields that need to be persisted on the resource */ - @JsonIgnore public ConnectionImportData connectionImportData() { - return connectionImportData; + return this.connectionImportData; } public static Builder builder() { @@ -119,68 +113,48 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultConnectionsImportRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultConnectionsImportRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultConnectionsImportRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultConnectionsImportRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultConnectionsImportRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConnectionsImportRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Service ID of the resource to return */ - public VaultConnectionsImportRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultConnectionsImportRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } + /** * Unified API */ - public VaultConnectionsImportRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultConnectionsImportRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + /** * Fields that need to be persisted on the resource */ - public VaultConnectionsImportRequest withConnectionImportData(ConnectionImportData connectionImportData) { - Utils.checkNotNull(connectionImportData, "connectionImportData"); - this.connectionImportData = connectionImportData; + public VaultConnectionsImportRequest withConnectionImportData(@Nonnull ConnectionImportData connectionImportData) { + this.connectionImportData = Utils.checkNotNull(connectionImportData, "connectionImportData"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -218,9 +192,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String serviceId; @@ -232,76 +206,47 @@ private Builder() { // force use of static builder() method } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** * Fields that need to be persisted on the resource */ - public Builder connectionImportData(ConnectionImportData connectionImportData) { - Utils.checkNotNull(connectionImportData, "connectionImportData"); - this.connectionImportData = connectionImportData; + public Builder connectionImportData(@Nonnull ConnectionImportData connectionImportData) { + this.connectionImportData = Utils.checkNotNull(connectionImportData, "connectionImportData"); return this; } public VaultConnectionsImportRequest build() { - return new VaultConnectionsImportRequest( consumerId, appId, serviceId, unifiedApi, connectionImportData); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportRequestBuilder.java index 3ba881aa..ec90d1d6 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class VaultConnectionsImportRequestBuilder { - - private VaultConnectionsImportRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private VaultConnectionsImportRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConnectionsImportRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public VaultConnectionsImportRequestBuilder request(VaultConnectionsImportRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public VaultConnectionsImportRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultConnectionsImportRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConnectionsImportRequestBuilder request(@Nonnull VaultConnectionsImportRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private VaultConnectionsImportRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConnectionsImportResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConnectionsImportOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportResponse.java index 7227a6ca..7413b569 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsImportResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConnectionsImportResponse implements Response { /** * Connection created */ - private Optional createConnectionResponse; + private CreateConnectionResponse createConnectionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConnectionsImportResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createConnectionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createConnectionResponse, "createConnectionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateConnectionResponse createConnectionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createConnectionResponse = createConnectionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConnectionsImportResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connection created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createConnectionResponse() { - return (Optional) createConnectionResponse; + return Optional.ofNullable(this.createConnectionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConnectionsImportResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConnectionsImportResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConnectionsImportResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConnectionsImportResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connection created + * Raw HTTP response; suitable for custom response parsing */ - public VaultConnectionsImportResponse withCreateConnectionResponse(CreateConnectionResponse createConnectionResponse) { - Utils.checkNotNull(createConnectionResponse, "createConnectionResponse"); - this.createConnectionResponse = Optional.ofNullable(createConnectionResponse); + public VaultConnectionsImportResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConnectionsImportResponse withCreateConnectionResponse(CreateConnect /** * Connection created */ - public VaultConnectionsImportResponse withCreateConnectionResponse(Optional createConnectionResponse) { - Utils.checkNotNull(createConnectionResponse, "createConnectionResponse"); + public VaultConnectionsImportResponse withCreateConnectionResponse(@Nullable CreateConnectionResponse createConnectionResponse) { this.createConnectionResponse = createConnectionResponse; return this; } - /** - * Unexpected error - */ - public VaultConnectionsImportResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConnectionsImportResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConnectionsImportResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createConnectionResponse = Optional.empty(); + private CreateConnectionResponse createConnectionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connection created - */ - public Builder createConnectionResponse(CreateConnectionResponse createConnectionResponse) { - Utils.checkNotNull(createConnectionResponse, "createConnectionResponse"); - this.createConnectionResponse = Optional.ofNullable(createConnectionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connection created */ - public Builder createConnectionResponse(Optional createConnectionResponse) { - Utils.checkNotNull(createConnectionResponse, "createConnectionResponse"); + public Builder createConnectionResponse(@Nullable CreateConnectionResponse createConnectionResponse) { this.createConnectionResponse = createConnectionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConnectionsImportResponse build() { - return new VaultConnectionsImportResponse( contentType, statusCode, rawResponse, createConnectionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneRequest.java index d0be8acd..bfcb4ccb 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,13 +18,13 @@ public class VaultConnectionsOneRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Service ID of the resource to return @@ -39,57 +40,51 @@ public class VaultConnectionsOneRequest { @JsonCreator public VaultConnectionsOneRequest( - Optional consumerId, - Optional appId, - String serviceId, - String unifiedApi) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String serviceId, + @Nonnull String unifiedApi) { this.consumerId = consumerId; this.appId = appId; - this.serviceId = serviceId; - this.unifiedApi = unifiedApi; + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); } public VaultConnectionsOneRequest( - String serviceId, - String unifiedApi) { - this(Optional.empty(), Optional.empty(), serviceId, + @Nonnull String serviceId, + @Nonnull String unifiedApi) { + this(null, null, serviceId, unifiedApi); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } public static Builder builder() { @@ -100,59 +95,39 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultConnectionsOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultConnectionsOneRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultConnectionsOneRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultConnectionsOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultConnectionsOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConnectionsOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Service ID of the resource to return */ - public VaultConnectionsOneRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultConnectionsOneRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } + /** * Unified API */ - public VaultConnectionsOneRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultConnectionsOneRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -188,9 +163,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String serviceId; @@ -200,66 +175,39 @@ private Builder() { // force use of static builder() method } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } public VaultConnectionsOneRequest build() { - return new VaultConnectionsOneRequest( consumerId, appId, serviceId, unifiedApi); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneRequestBuilder.java index e1fd90e9..3725242d 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneRequestBuilder.java @@ -10,93 +10,71 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class VaultConnectionsOneRequestBuilder { - - private Optional consumerId = Optional.empty(); - private Optional appId = Optional.empty(); - private String serviceId; - private String unifiedApi; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultConnectionsOneRequest.Builder pojoBuilder; + private VaultConnectionsOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConnectionsOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultConnectionsOneRequestBuilder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.of(consumerId); - return this; + this.pojoBuilder = VaultConnectionsOneRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultConnectionsOneRequestBuilder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - public VaultConnectionsOneRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); + public VaultConnectionsOneRequestBuilder consumerId(@Nullable String consumerId) { + this.pojoBuilder.consumerId(consumerId); + this._setterCalled = true; return this; } - public VaultConnectionsOneRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public VaultConnectionsOneRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultConnectionsOneRequestBuilder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultConnectionsOneRequestBuilder serviceId(@Nonnull String serviceId) { + this.pojoBuilder.serviceId(serviceId); + this._setterCalled = true; return this; } - public VaultConnectionsOneRequestBuilder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; - return this; - } - - public VaultConnectionsOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public VaultConnectionsOneRequestBuilder unifiedApi(@Nonnull String unifiedApi) { + this.pojoBuilder.unifiedApi(unifiedApi); + this._setterCalled = true; return this; } - public VaultConnectionsOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConnectionsOneRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private VaultConnectionsOneRequest buildRequest() { - - VaultConnectionsOneRequest request = new VaultConnectionsOneRequest(consumerId, - appId, - serviceId, - unifiedApi); - - return request; + private VaultConnectionsOneRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConnectionsOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConnectionsOneOperation( sdkConfiguration, options); - VaultConnectionsOneRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneResponse.java index 898f0d57..111ff672 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConnectionsOneResponse implements Response { /** * Connection */ - private Optional getConnectionResponse; + private GetConnectionResponse getConnectionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConnectionsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getConnectionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetConnectionResponse getConnectionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getConnectionResponse = getConnectionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConnectionsOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connection */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getConnectionResponse() { - return (Optional) getConnectionResponse; + return Optional.ofNullable(this.getConnectionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConnectionsOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConnectionsOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConnectionsOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConnectionsOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connection + * Raw HTTP response; suitable for custom response parsing */ - public VaultConnectionsOneResponse withGetConnectionResponse(GetConnectionResponse getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); - this.getConnectionResponse = Optional.ofNullable(getConnectionResponse); + public VaultConnectionsOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConnectionsOneResponse withGetConnectionResponse(GetConnectionRespon /** * Connection */ - public VaultConnectionsOneResponse withGetConnectionResponse(Optional getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); + public VaultConnectionsOneResponse withGetConnectionResponse(@Nullable GetConnectionResponse getConnectionResponse) { this.getConnectionResponse = getConnectionResponse; return this; } - /** - * Unexpected error - */ - public VaultConnectionsOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConnectionsOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConnectionsOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getConnectionResponse = Optional.empty(); + private GetConnectionResponse getConnectionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connection - */ - public Builder getConnectionResponse(GetConnectionResponse getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); - this.getConnectionResponse = Optional.ofNullable(getConnectionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connection */ - public Builder getConnectionResponse(Optional getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); + public Builder getConnectionResponse(@Nullable GetConnectionResponse getConnectionResponse) { this.getConnectionResponse = getConnectionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConnectionsOneResponse build() { - return new VaultConnectionsOneResponse( contentType, statusCode, rawResponse, getConnectionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequest.java index 88de6c51..3a1f505f 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequest.java @@ -6,10 +6,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -18,13 +18,13 @@ public class VaultConnectionsTokenRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Service ID of the resource to return @@ -40,70 +40,61 @@ public class VaultConnectionsTokenRequest { @SpeakeasyMetadata("request:mediaType=application/json") - private Optional requestBody; + private VaultConnectionsTokenRequestBody requestBody; @JsonCreator public VaultConnectionsTokenRequest( - Optional consumerId, - Optional appId, - String serviceId, - String unifiedApi, - Optional requestBody) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(requestBody, "requestBody"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nullable VaultConnectionsTokenRequestBody requestBody) { this.consumerId = consumerId; this.appId = appId; - this.serviceId = serviceId; - this.unifiedApi = unifiedApi; + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); this.requestBody = requestBody; } public VaultConnectionsTokenRequest( - String serviceId, - String unifiedApi) { - this(Optional.empty(), Optional.empty(), serviceId, - unifiedApi, Optional.empty()); + @Nonnull String serviceId, + @Nonnull String unifiedApi) { + this(null, null, serviceId, + unifiedApi, null); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional requestBody() { - return (Optional) requestBody; + return Optional.ofNullable(this.requestBody); } public static Builder builder() { @@ -114,72 +105,45 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultConnectionsTokenRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultConnectionsTokenRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultConnectionsTokenRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultConnectionsTokenRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultConnectionsTokenRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConnectionsTokenRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Service ID of the resource to return */ - public VaultConnectionsTokenRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultConnectionsTokenRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } + /** * Unified API */ - public VaultConnectionsTokenRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; - return this; - } - - public VaultConnectionsTokenRequest withRequestBody(VaultConnectionsTokenRequestBody requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = Optional.ofNullable(requestBody); + public VaultConnectionsTokenRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - public VaultConnectionsTokenRequest withRequestBody(Optional requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); + public VaultConnectionsTokenRequest withRequestBody(@Nullable VaultConnectionsTokenRequestBody requestBody) { this.requestBody = requestBody; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,93 +181,58 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String serviceId; private String unifiedApi; - private Optional requestBody = Optional.empty(); + private VaultConnectionsTokenRequestBody requestBody; private Builder() { // force use of static builder() method } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - - public Builder requestBody(VaultConnectionsTokenRequestBody requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = Optional.ofNullable(requestBody); - return this; - } - - public Builder requestBody(Optional requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); + public Builder requestBody(@Nullable VaultConnectionsTokenRequestBody requestBody) { this.requestBody = requestBody; return this; } public VaultConnectionsTokenRequest build() { - return new VaultConnectionsTokenRequest( consumerId, appId, serviceId, unifiedApi, requestBody); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequestBody.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequestBody.java index e4e12033..62732091 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequestBody.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequestBody.java @@ -49,7 +49,6 @@ private Builder() { } public VaultConnectionsTokenRequestBody build() { - return new VaultConnectionsTokenRequestBody( ); } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequestBuilder.java index a8642442..793594df 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class VaultConnectionsTokenRequestBuilder { - - private VaultConnectionsTokenRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private VaultConnectionsTokenRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConnectionsTokenRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public VaultConnectionsTokenRequestBuilder request(VaultConnectionsTokenRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public VaultConnectionsTokenRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultConnectionsTokenRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConnectionsTokenRequestBuilder request(@Nonnull VaultConnectionsTokenRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private VaultConnectionsTokenRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConnectionsTokenResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConnectionsTokenOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenResponse.java index 0af9ef52..85ce0d06 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsTokenResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConnectionsTokenResponse implements Response { /** * Connection */ - private Optional getConnectionResponse; + private GetConnectionResponse getConnectionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConnectionsTokenResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getConnectionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetConnectionResponse getConnectionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getConnectionResponse = getConnectionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConnectionsTokenResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connection */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getConnectionResponse() { - return (Optional) getConnectionResponse; + return Optional.ofNullable(this.getConnectionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConnectionsTokenResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConnectionsTokenResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConnectionsTokenResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConnectionsTokenResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connection + * Raw HTTP response; suitable for custom response parsing */ - public VaultConnectionsTokenResponse withGetConnectionResponse(GetConnectionResponse getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); - this.getConnectionResponse = Optional.ofNullable(getConnectionResponse); + public VaultConnectionsTokenResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConnectionsTokenResponse withGetConnectionResponse(GetConnectionResp /** * Connection */ - public VaultConnectionsTokenResponse withGetConnectionResponse(Optional getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); + public VaultConnectionsTokenResponse withGetConnectionResponse(@Nullable GetConnectionResponse getConnectionResponse) { this.getConnectionResponse = getConnectionResponse; return this; } - /** - * Unexpected error - */ - public VaultConnectionsTokenResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConnectionsTokenResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConnectionsTokenResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getConnectionResponse = Optional.empty(); + private GetConnectionResponse getConnectionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connection - */ - public Builder getConnectionResponse(GetConnectionResponse getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); - this.getConnectionResponse = Optional.ofNullable(getConnectionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connection */ - public Builder getConnectionResponse(Optional getConnectionResponse) { - Utils.checkNotNull(getConnectionResponse, "getConnectionResponse"); + public Builder getConnectionResponse(@Nullable GetConnectionResponse getConnectionResponse) { this.getConnectionResponse = getConnectionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConnectionsTokenResponse build() { - return new VaultConnectionsTokenResponse( contentType, statusCode, rawResponse, getConnectionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateRequest.java index 91ae6b64..0dc5fbc8 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateRequest.java @@ -7,7 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,13 +19,13 @@ public class VaultConnectionsUpdateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Service ID of the resource to return @@ -46,69 +47,62 @@ public class VaultConnectionsUpdateRequest { @JsonCreator public VaultConnectionsUpdateRequest( - Optional consumerId, - Optional appId, - String serviceId, - String unifiedApi, - ConnectionInput connection) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(connection, "connection"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nonnull ConnectionInput connection) { this.consumerId = consumerId; this.appId = appId; - this.serviceId = serviceId; - this.unifiedApi = unifiedApi; - this.connection = connection; + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); + this.connection = Optional.ofNullable(connection) + .orElseThrow(() -> new IllegalArgumentException("connection cannot be null")); } public VaultConnectionsUpdateRequest( - String serviceId, - String unifiedApi, - ConnectionInput connection) { - this(Optional.empty(), Optional.empty(), serviceId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nonnull ConnectionInput connection) { + this(null, null, serviceId, unifiedApi, connection); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } /** * Fields that need to be updated on the resource */ - @JsonIgnore public ConnectionInput connection() { - return connection; + return this.connection; } public static Builder builder() { @@ -119,68 +113,48 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultConnectionsUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultConnectionsUpdateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultConnectionsUpdateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultConnectionsUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultConnectionsUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConnectionsUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Service ID of the resource to return */ - public VaultConnectionsUpdateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultConnectionsUpdateRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } + /** * Unified API */ - public VaultConnectionsUpdateRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultConnectionsUpdateRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + /** * Fields that need to be updated on the resource */ - public VaultConnectionsUpdateRequest withConnection(ConnectionInput connection) { - Utils.checkNotNull(connection, "connection"); - this.connection = connection; + public VaultConnectionsUpdateRequest withConnection(@Nonnull ConnectionInput connection) { + this.connection = Utils.checkNotNull(connection, "connection"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -218,9 +192,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String serviceId; @@ -232,76 +206,47 @@ private Builder() { // force use of static builder() method } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** * Fields that need to be updated on the resource */ - public Builder connection(ConnectionInput connection) { - Utils.checkNotNull(connection, "connection"); - this.connection = connection; + public Builder connection(@Nonnull ConnectionInput connection) { + this.connection = Utils.checkNotNull(connection, "connection"); return this; } public VaultConnectionsUpdateRequest build() { - return new VaultConnectionsUpdateRequest( consumerId, appId, serviceId, unifiedApi, connection); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateRequestBuilder.java index aa63cb52..5fa39ca5 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class VaultConnectionsUpdateRequestBuilder { - - private VaultConnectionsUpdateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private VaultConnectionsUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConnectionsUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public VaultConnectionsUpdateRequestBuilder request(VaultConnectionsUpdateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public VaultConnectionsUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultConnectionsUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConnectionsUpdateRequestBuilder request(@Nonnull VaultConnectionsUpdateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private VaultConnectionsUpdateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConnectionsUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConnectionsUpdateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateResponse.java index a56bdcf0..e4318093 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConnectionsUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConnectionsUpdateResponse implements Response { /** * Connection updated */ - private Optional updateConnectionResponse; + private UpdateConnectionResponse updateConnectionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConnectionsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateConnectionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateConnectionResponse, "updateConnectionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateConnectionResponse updateConnectionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateConnectionResponse = updateConnectionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConnectionsUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connection updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateConnectionResponse() { - return (Optional) updateConnectionResponse; + return Optional.ofNullable(this.updateConnectionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConnectionsUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConnectionsUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConnectionsUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConnectionsUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connection updated + * Raw HTTP response; suitable for custom response parsing */ - public VaultConnectionsUpdateResponse withUpdateConnectionResponse(UpdateConnectionResponse updateConnectionResponse) { - Utils.checkNotNull(updateConnectionResponse, "updateConnectionResponse"); - this.updateConnectionResponse = Optional.ofNullable(updateConnectionResponse); + public VaultConnectionsUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConnectionsUpdateResponse withUpdateConnectionResponse(UpdateConnect /** * Connection updated */ - public VaultConnectionsUpdateResponse withUpdateConnectionResponse(Optional updateConnectionResponse) { - Utils.checkNotNull(updateConnectionResponse, "updateConnectionResponse"); + public VaultConnectionsUpdateResponse withUpdateConnectionResponse(@Nullable UpdateConnectionResponse updateConnectionResponse) { this.updateConnectionResponse = updateConnectionResponse; return this; } - /** - * Unexpected error - */ - public VaultConnectionsUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConnectionsUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConnectionsUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateConnectionResponse = Optional.empty(); + private UpdateConnectionResponse updateConnectionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connection updated - */ - public Builder updateConnectionResponse(UpdateConnectionResponse updateConnectionResponse) { - Utils.checkNotNull(updateConnectionResponse, "updateConnectionResponse"); - this.updateConnectionResponse = Optional.ofNullable(updateConnectionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connection updated */ - public Builder updateConnectionResponse(Optional updateConnectionResponse) { - Utils.checkNotNull(updateConnectionResponse, "updateConnectionResponse"); + public Builder updateConnectionResponse(@Nullable UpdateConnectionResponse updateConnectionResponse) { this.updateConnectionResponse = updateConnectionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConnectionsUpdateResponse build() { - return new VaultConnectionsUpdateResponse( contentType, statusCode, rawResponse, updateConnectionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllRequest.java index 86c883e7..206c9cbd 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,7 +18,7 @@ public class VaultConsumerRequestCountsAllRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the consumer to return @@ -39,58 +40,53 @@ public class VaultConsumerRequestCountsAllRequest { @JsonCreator public VaultConsumerRequestCountsAllRequest( - Optional appId, - String consumerId, - String startDatetime, - String endDatetime) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(startDatetime, "startDatetime"); - Utils.checkNotNull(endDatetime, "endDatetime"); + @Nullable String appId, + @Nonnull String consumerId, + @Nonnull String startDatetime, + @Nonnull String endDatetime) { this.appId = appId; - this.consumerId = consumerId; - this.startDatetime = startDatetime; - this.endDatetime = endDatetime; + this.consumerId = Optional.ofNullable(consumerId) + .orElseThrow(() -> new IllegalArgumentException("consumerId cannot be null")); + this.startDatetime = Optional.ofNullable(startDatetime) + .orElseThrow(() -> new IllegalArgumentException("startDatetime cannot be null")); + this.endDatetime = Optional.ofNullable(endDatetime) + .orElseThrow(() -> new IllegalArgumentException("endDatetime cannot be null")); } public VaultConsumerRequestCountsAllRequest( - String consumerId, - String startDatetime, - String endDatetime) { - this(Optional.empty(), consumerId, startDatetime, + @Nonnull String consumerId, + @Nonnull String startDatetime, + @Nonnull String endDatetime) { + this(null, consumerId, startDatetime, endDatetime); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the consumer to return */ - @JsonIgnore public String consumerId() { - return consumerId; + return this.consumerId; } /** * Scopes results to requests that happened after datetime */ - @JsonIgnore public String startDatetime() { - return startDatetime; + return this.startDatetime; } /** * Scopes results to requests that happened before datetime */ - @JsonIgnore public String endDatetime() { - return endDatetime; + return this.endDatetime; } public static Builder builder() { @@ -101,49 +97,39 @@ public static Builder builder() { /** * The ID of your Unify application */ - public VaultConsumerRequestCountsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public VaultConsumerRequestCountsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConsumerRequestCountsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * ID of the consumer to return */ - public VaultConsumerRequestCountsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public VaultConsumerRequestCountsAllRequest withConsumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } + /** * Scopes results to requests that happened after datetime */ - public VaultConsumerRequestCountsAllRequest withStartDatetime(String startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); - this.startDatetime = startDatetime; + public VaultConsumerRequestCountsAllRequest withStartDatetime(@Nonnull String startDatetime) { + this.startDatetime = Utils.checkNotNull(startDatetime, "startDatetime"); return this; } + /** * Scopes results to requests that happened before datetime */ - public VaultConsumerRequestCountsAllRequest withEndDatetime(String endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); - this.endDatetime = endDatetime; + public VaultConsumerRequestCountsAllRequest withEndDatetime(@Nonnull String endDatetime) { + this.endDatetime = Utils.checkNotNull(endDatetime, "endDatetime"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -179,7 +165,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private String consumerId; @@ -191,57 +177,39 @@ private Builder() { // force use of static builder() method } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * ID of the consumer to return */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public Builder consumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } - /** * Scopes results to requests that happened after datetime */ - public Builder startDatetime(String startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); - this.startDatetime = startDatetime; + public Builder startDatetime(@Nonnull String startDatetime) { + this.startDatetime = Utils.checkNotNull(startDatetime, "startDatetime"); return this; } - /** * Scopes results to requests that happened before datetime */ - public Builder endDatetime(String endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); - this.endDatetime = endDatetime; + public Builder endDatetime(@Nonnull String endDatetime) { + this.endDatetime = Utils.checkNotNull(endDatetime, "endDatetime"); return this; } public VaultConsumerRequestCountsAllRequest build() { - return new VaultConsumerRequestCountsAllRequest( appId, consumerId, startDatetime, endDatetime); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllRequestBuilder.java index b7caca49..e01c4760 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllRequestBuilder.java @@ -10,87 +10,71 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class VaultConsumerRequestCountsAllRequestBuilder { - - private Optional appId = Optional.empty(); - private String consumerId; - private String startDatetime; - private String endDatetime; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultConsumerRequestCountsAllRequest.Builder pojoBuilder; + private VaultConsumerRequestCountsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConsumerRequestCountsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultConsumerRequestCountsAllRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = VaultConsumerRequestCountsAllRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultConsumerRequestCountsAllRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public VaultConsumerRequestCountsAllRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultConsumerRequestCountsAllRequestBuilder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public VaultConsumerRequestCountsAllRequestBuilder consumerId(@Nonnull String consumerId) { + this.pojoBuilder.consumerId(consumerId); + this._setterCalled = true; return this; } - public VaultConsumerRequestCountsAllRequestBuilder startDatetime(String startDatetime) { - Utils.checkNotNull(startDatetime, "startDatetime"); - this.startDatetime = startDatetime; + public VaultConsumerRequestCountsAllRequestBuilder startDatetime(@Nonnull String startDatetime) { + this.pojoBuilder.startDatetime(startDatetime); + this._setterCalled = true; return this; } - public VaultConsumerRequestCountsAllRequestBuilder endDatetime(String endDatetime) { - Utils.checkNotNull(endDatetime, "endDatetime"); - this.endDatetime = endDatetime; - return this; - } - - public VaultConsumerRequestCountsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public VaultConsumerRequestCountsAllRequestBuilder endDatetime(@Nonnull String endDatetime) { + this.pojoBuilder.endDatetime(endDatetime); + this._setterCalled = true; return this; } - public VaultConsumerRequestCountsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConsumerRequestCountsAllRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private VaultConsumerRequestCountsAllRequest buildRequest() { - - VaultConsumerRequestCountsAllRequest request = new VaultConsumerRequestCountsAllRequest(appId, - consumerId, - startDatetime, - endDatetime); - - return request; + private VaultConsumerRequestCountsAllRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConsumerRequestCountsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConsumerRequestCountsAllOperation( sdkConfiguration, options); - VaultConsumerRequestCountsAllRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllResponse.java index 598796ae..df1bad5d 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumerRequestCountsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConsumerRequestCountsAllResponse implements Response { /** * Consumers Request Counts within Date Range */ - private Optional consumerRequestCountsInDateRangeResponse; + private ConsumerRequestCountsInDateRangeResponse consumerRequestCountsInDateRangeResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConsumerRequestCountsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional consumerRequestCountsInDateRangeResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(consumerRequestCountsInDateRangeResponse, "consumerRequestCountsInDateRangeResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable ConsumerRequestCountsInDateRangeResponse consumerRequestCountsInDateRangeResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.consumerRequestCountsInDateRangeResponse = consumerRequestCountsInDateRangeResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConsumerRequestCountsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Consumers Request Counts within Date Range */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional consumerRequestCountsInDateRangeResponse() { - return (Optional) consumerRequestCountsInDateRangeResponse; + return Optional.ofNullable(this.consumerRequestCountsInDateRangeResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConsumerRequestCountsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConsumerRequestCountsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConsumerRequestCountsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConsumerRequestCountsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Consumers Request Counts within Date Range + * Raw HTTP response; suitable for custom response parsing */ - public VaultConsumerRequestCountsAllResponse withConsumerRequestCountsInDateRangeResponse(ConsumerRequestCountsInDateRangeResponse consumerRequestCountsInDateRangeResponse) { - Utils.checkNotNull(consumerRequestCountsInDateRangeResponse, "consumerRequestCountsInDateRangeResponse"); - this.consumerRequestCountsInDateRangeResponse = Optional.ofNullable(consumerRequestCountsInDateRangeResponse); + public VaultConsumerRequestCountsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConsumerRequestCountsAllResponse withConsumerRequestCountsInDateRang /** * Consumers Request Counts within Date Range */ - public VaultConsumerRequestCountsAllResponse withConsumerRequestCountsInDateRangeResponse(Optional consumerRequestCountsInDateRangeResponse) { - Utils.checkNotNull(consumerRequestCountsInDateRangeResponse, "consumerRequestCountsInDateRangeResponse"); + public VaultConsumerRequestCountsAllResponse withConsumerRequestCountsInDateRangeResponse(@Nullable ConsumerRequestCountsInDateRangeResponse consumerRequestCountsInDateRangeResponse) { this.consumerRequestCountsInDateRangeResponse = consumerRequestCountsInDateRangeResponse; return this; } - /** - * Unexpected error - */ - public VaultConsumerRequestCountsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConsumerRequestCountsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConsumerRequestCountsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional consumerRequestCountsInDateRangeResponse = Optional.empty(); + private ConsumerRequestCountsInDateRangeResponse consumerRequestCountsInDateRangeResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Consumers Request Counts within Date Range - */ - public Builder consumerRequestCountsInDateRangeResponse(ConsumerRequestCountsInDateRangeResponse consumerRequestCountsInDateRangeResponse) { - Utils.checkNotNull(consumerRequestCountsInDateRangeResponse, "consumerRequestCountsInDateRangeResponse"); - this.consumerRequestCountsInDateRangeResponse = Optional.ofNullable(consumerRequestCountsInDateRangeResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Consumers Request Counts within Date Range */ - public Builder consumerRequestCountsInDateRangeResponse(Optional consumerRequestCountsInDateRangeResponse) { - Utils.checkNotNull(consumerRequestCountsInDateRangeResponse, "consumerRequestCountsInDateRangeResponse"); + public Builder consumerRequestCountsInDateRangeResponse(@Nullable ConsumerRequestCountsInDateRangeResponse consumerRequestCountsInDateRangeResponse) { this.consumerRequestCountsInDateRangeResponse = consumerRequestCountsInDateRangeResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConsumerRequestCountsAllResponse build() { - return new VaultConsumerRequestCountsAllResponse( contentType, statusCode, rawResponse, consumerRequestCountsInDateRangeResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddRequest.java index 5f1e93c6..bd13ada5 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddRequest.java @@ -7,7 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,7 +19,7 @@ public class VaultConsumersAddRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -26,30 +27,27 @@ public class VaultConsumersAddRequest { @JsonCreator public VaultConsumersAddRequest( - Optional appId, - ConsumerInput consumer) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(consumer, "consumer"); + @Nullable String appId, + @Nonnull ConsumerInput consumer) { this.appId = appId; - this.consumer = consumer; + this.consumer = Optional.ofNullable(consumer) + .orElseThrow(() -> new IllegalArgumentException("consumer cannot be null")); } public VaultConsumersAddRequest( - ConsumerInput consumer) { - this(Optional.empty(), consumer); + @Nonnull ConsumerInput consumer) { + this(null, consumer); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } - @JsonIgnore public ConsumerInput consumer() { - return consumer; + return this.consumer; } public static Builder builder() { @@ -60,27 +58,17 @@ public static Builder builder() { /** * The ID of your Unify application */ - public VaultConsumersAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); + public VaultConsumersAddRequest withAppId(@Nullable String appId) { + this.appId = appId; return this; } - /** - * The ID of your Unify application - */ - public VaultConsumersAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public VaultConsumersAddRequest withConsumer(@Nonnull ConsumerInput consumer) { + this.consumer = Utils.checkNotNull(consumer, "consumer"); return this; } - public VaultConsumersAddRequest withConsumer(ConsumerInput consumer) { - Utils.checkNotNull(consumer, "consumer"); - this.consumer = consumer; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -112,7 +100,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private ConsumerInput consumer; @@ -120,34 +108,20 @@ private Builder() { // force use of static builder() method } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - public Builder consumer(ConsumerInput consumer) { - Utils.checkNotNull(consumer, "consumer"); - this.consumer = consumer; + public Builder consumer(@Nonnull ConsumerInput consumer) { + this.consumer = Utils.checkNotNull(consumer, "consumer"); return this; } public VaultConsumersAddRequest build() { - return new VaultConsumersAddRequest( appId, consumer); } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddRequestBuilder.java index 4a244c43..36ec9e40 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddRequestBuilder.java @@ -11,71 +11,59 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class VaultConsumersAddRequestBuilder { - - private Optional appId = Optional.empty(); - private ConsumerInput consumer; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultConsumersAddRequest.Builder pojoBuilder; + private VaultConsumersAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConsumersAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultConsumersAddRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = VaultConsumersAddRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultConsumersAddRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public VaultConsumersAddRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultConsumersAddRequestBuilder consumer(ConsumerInput consumer) { - Utils.checkNotNull(consumer, "consumer"); - this.consumer = consumer; - return this; - } - - public VaultConsumersAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public VaultConsumersAddRequestBuilder consumer(@Nonnull ConsumerInput consumer) { + this.pojoBuilder.consumer(consumer); + this._setterCalled = true; return this; } - public VaultConsumersAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConsumersAddRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private VaultConsumersAddRequest buildRequest() { - - VaultConsumersAddRequest request = new VaultConsumersAddRequest(appId, - consumer); - - return request; + private VaultConsumersAddRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConsumersAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConsumersAddOperation( sdkConfiguration, options); - VaultConsumersAddRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddResponse.java index 03cd309b..220df984 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConsumersAddResponse implements Response { /** * Consumer created */ - private Optional createConsumerResponse; + private CreateConsumerResponse createConsumerResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConsumersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createConsumerResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createConsumerResponse, "createConsumerResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateConsumerResponse createConsumerResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createConsumerResponse = createConsumerResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConsumersAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Consumer created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createConsumerResponse() { - return (Optional) createConsumerResponse; + return Optional.ofNullable(this.createConsumerResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConsumersAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConsumersAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConsumersAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConsumersAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Consumer created + * Raw HTTP response; suitable for custom response parsing */ - public VaultConsumersAddResponse withCreateConsumerResponse(CreateConsumerResponse createConsumerResponse) { - Utils.checkNotNull(createConsumerResponse, "createConsumerResponse"); - this.createConsumerResponse = Optional.ofNullable(createConsumerResponse); + public VaultConsumersAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConsumersAddResponse withCreateConsumerResponse(CreateConsumerRespon /** * Consumer created */ - public VaultConsumersAddResponse withCreateConsumerResponse(Optional createConsumerResponse) { - Utils.checkNotNull(createConsumerResponse, "createConsumerResponse"); + public VaultConsumersAddResponse withCreateConsumerResponse(@Nullable CreateConsumerResponse createConsumerResponse) { this.createConsumerResponse = createConsumerResponse; return this; } - /** - * Unexpected error - */ - public VaultConsumersAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConsumersAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConsumersAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createConsumerResponse = Optional.empty(); + private CreateConsumerResponse createConsumerResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Consumer created - */ - public Builder createConsumerResponse(CreateConsumerResponse createConsumerResponse) { - Utils.checkNotNull(createConsumerResponse, "createConsumerResponse"); - this.createConsumerResponse = Optional.ofNullable(createConsumerResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Consumer created */ - public Builder createConsumerResponse(Optional createConsumerResponse) { - Utils.checkNotNull(createConsumerResponse, "createConsumerResponse"); + public Builder createConsumerResponse(@Nullable CreateConsumerResponse createConsumerResponse) { this.createConsumerResponse = createConsumerResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConsumersAddResponse build() { - return new VaultConsumersAddResponse( contentType, statusCode, rawResponse, createConsumerResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllRequest.java index 1c536975..406810d1 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllRequest.java @@ -7,8 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; @@ -21,7 +21,7 @@ public class VaultConsumersAllRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -33,47 +33,43 @@ public class VaultConsumersAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; @JsonCreator public VaultConsumersAllRequest( - Optional appId, - JsonNullable cursor, - Optional limit) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); + @Nullable String appId, + @Nullable JsonNullable cursor, + @Nullable Long limit) { this.appId = appId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); } public VaultConsumersAllRequest() { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } public static Builder builder() { @@ -84,46 +80,17 @@ public static Builder builder() { /** * The ID of your Unify application */ - public VaultConsumersAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public VaultConsumersAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConsumersAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public VaultConsumersAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public VaultConsumersAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public VaultConsumersAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public VaultConsumersAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -131,12 +98,12 @@ public VaultConsumersAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public VaultConsumersAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public VaultConsumersAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -169,87 +136,50 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; private Builder() { // force use of static builder() method } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } public VaultConsumersAllRequest build() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new VaultConsumersAllRequest( appId, cursor, limit); } - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllRequestBuilder.java index c73e99c0..95aed2ad 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllRequestBuilder.java @@ -10,13 +10,11 @@ import com.apideck.unify.SDKConfiguration; import com.apideck.unify.operations.VaultConsumersAllOperation; -import com.apideck.unify.utils.LazySingletonValue; import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; -import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; -import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; @@ -24,100 +22,66 @@ import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; import org.openapitools.jackson.nullable.JsonNullable; public class VaultConsumersAllRequestBuilder { - - private Optional appId = Optional.empty(); - private JsonNullable cursor = JsonNullable.undefined(); - private Optional limit = Utils.readDefaultOrConstValue( - "limit", - "20", - new TypeReference>() {}); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultConsumersAllRequest.Builder pojoBuilder; + private VaultConsumersAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConsumersAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultConsumersAllRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = VaultConsumersAllRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultConsumersAllRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public VaultConsumersAllRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultConsumersAllRequestBuilder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); + public VaultConsumersAllRequestBuilder cursor(@Nullable String cursor) { + this.pojoBuilder.cursor(cursor); + this._setterCalled = true; return this; } - public VaultConsumersAllRequestBuilder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - public VaultConsumersAllRequestBuilder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.of(limit); + public VaultConsumersAllRequestBuilder limit(@Nullable Long limit) { + this.pojoBuilder.limit(limit); + this._setterCalled = true; return this; } - public VaultConsumersAllRequestBuilder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = limit; - return this; - } - public VaultConsumersAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultConsumersAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; - return this; - } - - - private VaultConsumersAllRequest buildRequest() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); + private VaultConsumersAllRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); } - - VaultConsumersAllRequest request = new VaultConsumersAllRequest(appId, - cursor, - limit); - - return request; + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConsumersAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConsumersAllOperation( sdkConfiguration, options); - VaultConsumersAllRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -132,36 +96,27 @@ public VaultConsumersAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new VaultConsumersAllOperation( - sdkConfiguration, - options); - VaultConsumersAllRequest request = buildRequest(); + VaultConsumersAllRequest request = pojoBuilder.build(); + Options options = optionsBuilder.build(); + RequestOperation operation = + new VaultConsumersAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - VaultConsumersAllRequest::withCursor, + VaultConsumersAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - - - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = - new LazySingletonValue<>( - "limit", - "20", - new TypeReference>() {}); } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllResponse.java index be9edf59..736dc11b 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConsumersAllResponse implements Response { /** * Consumers */ - private Optional getConsumersResponse; + private GetConsumersResponse getConsumersResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConsumersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getConsumersResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getConsumersResponse, "getConsumersResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetConsumersResponse getConsumersResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getConsumersResponse = getConsumersResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConsumersAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Consumers */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getConsumersResponse() { - return (Optional) getConsumersResponse; + return Optional.ofNullable(this.getConsumersResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConsumersAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConsumersAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConsumersAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConsumersAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Consumers + * Raw HTTP response; suitable for custom response parsing */ - public VaultConsumersAllResponse withGetConsumersResponse(GetConsumersResponse getConsumersResponse) { - Utils.checkNotNull(getConsumersResponse, "getConsumersResponse"); - this.getConsumersResponse = Optional.ofNullable(getConsumersResponse); + public VaultConsumersAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConsumersAllResponse withGetConsumersResponse(GetConsumersResponse g /** * Consumers */ - public VaultConsumersAllResponse withGetConsumersResponse(Optional getConsumersResponse) { - Utils.checkNotNull(getConsumersResponse, "getConsumersResponse"); + public VaultConsumersAllResponse withGetConsumersResponse(@Nullable GetConsumersResponse getConsumersResponse) { this.getConsumersResponse = getConsumersResponse; return this; } - /** - * Unexpected error - */ - public VaultConsumersAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConsumersAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConsumersAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getConsumersResponse = Optional.empty(); + private GetConsumersResponse getConsumersResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Consumers - */ - public Builder getConsumersResponse(GetConsumersResponse getConsumersResponse) { - Utils.checkNotNull(getConsumersResponse, "getConsumersResponse"); - this.getConsumersResponse = Optional.ofNullable(getConsumersResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Consumers */ - public Builder getConsumersResponse(Optional getConsumersResponse) { - Utils.checkNotNull(getConsumersResponse, "getConsumersResponse"); + public Builder getConsumersResponse(@Nullable GetConsumersResponse getConsumersResponse) { this.getConsumersResponse = getConsumersResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConsumersAllResponse build() { - return new VaultConsumersAllResponse( contentType, statusCode, rawResponse, getConsumersResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteRequest.java index 1827ebad..55266972 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,7 +18,7 @@ public class VaultConsumersDeleteRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the consumer to return @@ -27,33 +28,30 @@ public class VaultConsumersDeleteRequest { @JsonCreator public VaultConsumersDeleteRequest( - Optional appId, - String consumerId) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(consumerId, "consumerId"); + @Nullable String appId, + @Nonnull String consumerId) { this.appId = appId; - this.consumerId = consumerId; + this.consumerId = Optional.ofNullable(consumerId) + .orElseThrow(() -> new IllegalArgumentException("consumerId cannot be null")); } public VaultConsumersDeleteRequest( - String consumerId) { - this(Optional.empty(), consumerId); + @Nonnull String consumerId) { + this(null, consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the consumer to return */ - @JsonIgnore public String consumerId() { - return consumerId; + return this.consumerId; } public static Builder builder() { @@ -64,31 +62,21 @@ public static Builder builder() { /** * The ID of your Unify application */ - public VaultConsumersDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public VaultConsumersDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConsumersDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * ID of the consumer to return */ - public VaultConsumersDeleteRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public VaultConsumersDeleteRequest withConsumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -119,7 +107,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private String consumerId; @@ -127,37 +115,23 @@ private Builder() { // force use of static builder() method } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * ID of the consumer to return */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public Builder consumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } public VaultConsumersDeleteRequest build() { - return new VaultConsumersDeleteRequest( appId, consumerId); } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteRequestBuilder.java index f1981331..a0dcf0e2 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteRequestBuilder.java @@ -10,71 +10,59 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class VaultConsumersDeleteRequestBuilder { - - private Optional appId = Optional.empty(); - private String consumerId; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultConsumersDeleteRequest.Builder pojoBuilder; + private VaultConsumersDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConsumersDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultConsumersDeleteRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = VaultConsumersDeleteRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultConsumersDeleteRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public VaultConsumersDeleteRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultConsumersDeleteRequestBuilder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - public VaultConsumersDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public VaultConsumersDeleteRequestBuilder consumerId(@Nonnull String consumerId) { + this.pojoBuilder.consumerId(consumerId); + this._setterCalled = true; return this; } - public VaultConsumersDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConsumersDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private VaultConsumersDeleteRequest buildRequest() { - - VaultConsumersDeleteRequest request = new VaultConsumersDeleteRequest(appId, - consumerId); - - return request; + private VaultConsumersDeleteRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConsumersDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConsumersDeleteOperation( sdkConfiguration, options); - VaultConsumersDeleteRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteResponse.java index fd4dcbc6..16c98752 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConsumersDeleteResponse implements Response { /** * Consumer deleted */ - private Optional deleteConsumerResponse; + private DeleteConsumerResponse deleteConsumerResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConsumersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteConsumerResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteConsumerResponse, "deleteConsumerResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteConsumerResponse deleteConsumerResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteConsumerResponse = deleteConsumerResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConsumersDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Consumer deleted */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteConsumerResponse() { - return (Optional) deleteConsumerResponse; + return Optional.ofNullable(this.deleteConsumerResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConsumersDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConsumersDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConsumersDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConsumersDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Consumer deleted + * Raw HTTP response; suitable for custom response parsing */ - public VaultConsumersDeleteResponse withDeleteConsumerResponse(DeleteConsumerResponse deleteConsumerResponse) { - Utils.checkNotNull(deleteConsumerResponse, "deleteConsumerResponse"); - this.deleteConsumerResponse = Optional.ofNullable(deleteConsumerResponse); + public VaultConsumersDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConsumersDeleteResponse withDeleteConsumerResponse(DeleteConsumerRes /** * Consumer deleted */ - public VaultConsumersDeleteResponse withDeleteConsumerResponse(Optional deleteConsumerResponse) { - Utils.checkNotNull(deleteConsumerResponse, "deleteConsumerResponse"); + public VaultConsumersDeleteResponse withDeleteConsumerResponse(@Nullable DeleteConsumerResponse deleteConsumerResponse) { this.deleteConsumerResponse = deleteConsumerResponse; return this; } - /** - * Unexpected error - */ - public VaultConsumersDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConsumersDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConsumersDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteConsumerResponse = Optional.empty(); + private DeleteConsumerResponse deleteConsumerResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Consumer deleted - */ - public Builder deleteConsumerResponse(DeleteConsumerResponse deleteConsumerResponse) { - Utils.checkNotNull(deleteConsumerResponse, "deleteConsumerResponse"); - this.deleteConsumerResponse = Optional.ofNullable(deleteConsumerResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Consumer deleted */ - public Builder deleteConsumerResponse(Optional deleteConsumerResponse) { - Utils.checkNotNull(deleteConsumerResponse, "deleteConsumerResponse"); + public Builder deleteConsumerResponse(@Nullable DeleteConsumerResponse deleteConsumerResponse) { this.deleteConsumerResponse = deleteConsumerResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConsumersDeleteResponse build() { - return new VaultConsumersDeleteResponse( contentType, statusCode, rawResponse, deleteConsumerResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneRequest.java index a2b158cc..c7a58ec7 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,7 +18,7 @@ public class VaultConsumersOneRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the consumer to return @@ -27,33 +28,30 @@ public class VaultConsumersOneRequest { @JsonCreator public VaultConsumersOneRequest( - Optional appId, - String consumerId) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(consumerId, "consumerId"); + @Nullable String appId, + @Nonnull String consumerId) { this.appId = appId; - this.consumerId = consumerId; + this.consumerId = Optional.ofNullable(consumerId) + .orElseThrow(() -> new IllegalArgumentException("consumerId cannot be null")); } public VaultConsumersOneRequest( - String consumerId) { - this(Optional.empty(), consumerId); + @Nonnull String consumerId) { + this(null, consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the consumer to return */ - @JsonIgnore public String consumerId() { - return consumerId; + return this.consumerId; } public static Builder builder() { @@ -64,31 +62,21 @@ public static Builder builder() { /** * The ID of your Unify application */ - public VaultConsumersOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public VaultConsumersOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConsumersOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * ID of the consumer to return */ - public VaultConsumersOneRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public VaultConsumersOneRequest withConsumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -119,7 +107,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private String consumerId; @@ -127,37 +115,23 @@ private Builder() { // force use of static builder() method } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * ID of the consumer to return */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public Builder consumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } public VaultConsumersOneRequest build() { - return new VaultConsumersOneRequest( appId, consumerId); } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneRequestBuilder.java index 93ec9a2f..d8476dc9 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneRequestBuilder.java @@ -10,71 +10,59 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class VaultConsumersOneRequestBuilder { - - private Optional appId = Optional.empty(); - private String consumerId; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultConsumersOneRequest.Builder pojoBuilder; + private VaultConsumersOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConsumersOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultConsumersOneRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = VaultConsumersOneRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultConsumersOneRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public VaultConsumersOneRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultConsumersOneRequestBuilder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - public VaultConsumersOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public VaultConsumersOneRequestBuilder consumerId(@Nonnull String consumerId) { + this.pojoBuilder.consumerId(consumerId); + this._setterCalled = true; return this; } - public VaultConsumersOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConsumersOneRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private VaultConsumersOneRequest buildRequest() { - - VaultConsumersOneRequest request = new VaultConsumersOneRequest(appId, - consumerId); - - return request; + private VaultConsumersOneRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConsumersOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConsumersOneOperation( sdkConfiguration, options); - VaultConsumersOneRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneResponse.java index 791ee950..6ac2da9e 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConsumersOneResponse implements Response { /** * Consumer */ - private Optional getConsumerResponse; + private GetConsumerResponse getConsumerResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConsumersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getConsumerResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getConsumerResponse, "getConsumerResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetConsumerResponse getConsumerResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getConsumerResponse = getConsumerResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConsumersOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Consumer */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getConsumerResponse() { - return (Optional) getConsumerResponse; + return Optional.ofNullable(this.getConsumerResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConsumersOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConsumersOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConsumersOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConsumersOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Consumer + * Raw HTTP response; suitable for custom response parsing */ - public VaultConsumersOneResponse withGetConsumerResponse(GetConsumerResponse getConsumerResponse) { - Utils.checkNotNull(getConsumerResponse, "getConsumerResponse"); - this.getConsumerResponse = Optional.ofNullable(getConsumerResponse); + public VaultConsumersOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConsumersOneResponse withGetConsumerResponse(GetConsumerResponse get /** * Consumer */ - public VaultConsumersOneResponse withGetConsumerResponse(Optional getConsumerResponse) { - Utils.checkNotNull(getConsumerResponse, "getConsumerResponse"); + public VaultConsumersOneResponse withGetConsumerResponse(@Nullable GetConsumerResponse getConsumerResponse) { this.getConsumerResponse = getConsumerResponse; return this; } - /** - * Unexpected error - */ - public VaultConsumersOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConsumersOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConsumersOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getConsumerResponse = Optional.empty(); + private GetConsumerResponse getConsumerResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Consumer - */ - public Builder getConsumerResponse(GetConsumerResponse getConsumerResponse) { - Utils.checkNotNull(getConsumerResponse, "getConsumerResponse"); - this.getConsumerResponse = Optional.ofNullable(getConsumerResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Consumer */ - public Builder getConsumerResponse(Optional getConsumerResponse) { - Utils.checkNotNull(getConsumerResponse, "getConsumerResponse"); + public Builder getConsumerResponse(@Nullable GetConsumerResponse getConsumerResponse) { this.getConsumerResponse = getConsumerResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConsumersOneResponse build() { - return new VaultConsumersOneResponse( contentType, statusCode, rawResponse, getConsumerResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateRequest.java index 7dfb8b77..89937c84 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateRequest.java @@ -7,7 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,7 +19,7 @@ public class VaultConsumersUpdateRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the consumer to return @@ -32,42 +33,38 @@ public class VaultConsumersUpdateRequest { @JsonCreator public VaultConsumersUpdateRequest( - Optional appId, - String consumerId, - UpdateConsumerRequest updateConsumerRequest) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(updateConsumerRequest, "updateConsumerRequest"); + @Nullable String appId, + @Nonnull String consumerId, + @Nonnull UpdateConsumerRequest updateConsumerRequest) { this.appId = appId; - this.consumerId = consumerId; - this.updateConsumerRequest = updateConsumerRequest; + this.consumerId = Optional.ofNullable(consumerId) + .orElseThrow(() -> new IllegalArgumentException("consumerId cannot be null")); + this.updateConsumerRequest = Optional.ofNullable(updateConsumerRequest) + .orElseThrow(() -> new IllegalArgumentException("updateConsumerRequest cannot be null")); } public VaultConsumersUpdateRequest( - String consumerId, - UpdateConsumerRequest updateConsumerRequest) { - this(Optional.empty(), consumerId, updateConsumerRequest); + @Nonnull String consumerId, + @Nonnull UpdateConsumerRequest updateConsumerRequest) { + this(null, consumerId, updateConsumerRequest); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the consumer to return */ - @JsonIgnore public String consumerId() { - return consumerId; + return this.consumerId; } - @JsonIgnore public UpdateConsumerRequest updateConsumerRequest() { - return updateConsumerRequest; + return this.updateConsumerRequest; } public static Builder builder() { @@ -78,37 +75,27 @@ public static Builder builder() { /** * The ID of your Unify application */ - public VaultConsumersUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public VaultConsumersUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultConsumersUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * ID of the consumer to return */ - public VaultConsumersUpdateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public VaultConsumersUpdateRequest withConsumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } - public VaultConsumersUpdateRequest withUpdateConsumerRequest(UpdateConsumerRequest updateConsumerRequest) { - Utils.checkNotNull(updateConsumerRequest, "updateConsumerRequest"); - this.updateConsumerRequest = updateConsumerRequest; + + public VaultConsumersUpdateRequest withUpdateConsumerRequest(@Nonnull UpdateConsumerRequest updateConsumerRequest) { + this.updateConsumerRequest = Utils.checkNotNull(updateConsumerRequest, "updateConsumerRequest"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -141,7 +128,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private String consumerId; @@ -151,44 +138,28 @@ private Builder() { // force use of static builder() method } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * ID of the consumer to return */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public Builder consumerId(@Nonnull String consumerId) { + this.consumerId = Utils.checkNotNull(consumerId, "consumerId"); return this; } - - public Builder updateConsumerRequest(UpdateConsumerRequest updateConsumerRequest) { - Utils.checkNotNull(updateConsumerRequest, "updateConsumerRequest"); - this.updateConsumerRequest = updateConsumerRequest; + public Builder updateConsumerRequest(@Nonnull UpdateConsumerRequest updateConsumerRequest) { + this.updateConsumerRequest = Utils.checkNotNull(updateConsumerRequest, "updateConsumerRequest"); return this; } public VaultConsumersUpdateRequest build() { - return new VaultConsumersUpdateRequest( appId, consumerId, updateConsumerRequest); } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateRequestBuilder.java index 357752bc..59fbd8d9 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateRequestBuilder.java @@ -11,79 +11,65 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class VaultConsumersUpdateRequestBuilder { - - private Optional appId = Optional.empty(); - private String consumerId; - private UpdateConsumerRequest updateConsumerRequest; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultConsumersUpdateRequest.Builder pojoBuilder; + private VaultConsumersUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultConsumersUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultConsumersUpdateRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = VaultConsumersUpdateRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultConsumersUpdateRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public VaultConsumersUpdateRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultConsumersUpdateRequestBuilder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; + public VaultConsumersUpdateRequestBuilder consumerId(@Nonnull String consumerId) { + this.pojoBuilder.consumerId(consumerId); + this._setterCalled = true; return this; } - public VaultConsumersUpdateRequestBuilder updateConsumerRequest(UpdateConsumerRequest updateConsumerRequest) { - Utils.checkNotNull(updateConsumerRequest, "updateConsumerRequest"); - this.updateConsumerRequest = updateConsumerRequest; - return this; - } - - public VaultConsumersUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public VaultConsumersUpdateRequestBuilder updateConsumerRequest(@Nonnull UpdateConsumerRequest updateConsumerRequest) { + this.pojoBuilder.updateConsumerRequest(updateConsumerRequest); + this._setterCalled = true; return this; } - public VaultConsumersUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultConsumersUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private VaultConsumersUpdateRequest buildRequest() { - - VaultConsumersUpdateRequest request = new VaultConsumersUpdateRequest(appId, - consumerId, - updateConsumerRequest); - - return request; + private VaultConsumersUpdateRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultConsumersUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultConsumersUpdateOperation( sdkConfiguration, options); - VaultConsumersUpdateRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateResponse.java index 15e12271..030f8b82 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultConsumersUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultConsumersUpdateResponse implements Response { /** * Consumer updated */ - private Optional updateConsumerResponse; + private UpdateConsumerResponse updateConsumerResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultConsumersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateConsumerResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateConsumerResponse, "updateConsumerResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateConsumerResponse updateConsumerResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateConsumerResponse = updateConsumerResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultConsumersUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Consumer updated */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateConsumerResponse() { - return (Optional) updateConsumerResponse; + return Optional.ofNullable(this.updateConsumerResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultConsumersUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultConsumersUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultConsumersUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultConsumersUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Consumer updated + * Raw HTTP response; suitable for custom response parsing */ - public VaultConsumersUpdateResponse withUpdateConsumerResponse(UpdateConsumerResponse updateConsumerResponse) { - Utils.checkNotNull(updateConsumerResponse, "updateConsumerResponse"); - this.updateConsumerResponse = Optional.ofNullable(updateConsumerResponse); + public VaultConsumersUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultConsumersUpdateResponse withUpdateConsumerResponse(UpdateConsumerRes /** * Consumer updated */ - public VaultConsumersUpdateResponse withUpdateConsumerResponse(Optional updateConsumerResponse) { - Utils.checkNotNull(updateConsumerResponse, "updateConsumerResponse"); + public VaultConsumersUpdateResponse withUpdateConsumerResponse(@Nullable UpdateConsumerResponse updateConsumerResponse) { this.updateConsumerResponse = updateConsumerResponse; return this; } - /** - * Unexpected error - */ - public VaultConsumersUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultConsumersUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultConsumersUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateConsumerResponse = Optional.empty(); + private UpdateConsumerResponse updateConsumerResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Consumer updated - */ - public Builder updateConsumerResponse(UpdateConsumerResponse updateConsumerResponse) { - Utils.checkNotNull(updateConsumerResponse, "updateConsumerResponse"); - this.updateConsumerResponse = Optional.ofNullable(updateConsumerResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Consumer updated */ - public Builder updateConsumerResponse(Optional updateConsumerResponse) { - Utils.checkNotNull(updateConsumerResponse, "updateConsumerResponse"); + public Builder updateConsumerResponse(@Nullable UpdateConsumerResponse updateConsumerResponse) { this.updateConsumerResponse = updateConsumerResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultConsumersUpdateResponse build() { - return new VaultConsumersUpdateResponse( contentType, statusCode, rawResponse, updateConsumerResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateRequest.java index 284914c0..558353c6 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateRequest.java @@ -7,7 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,13 +19,13 @@ public class VaultCreateCallbackStateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Service ID of the resource to return @@ -46,69 +47,62 @@ public class VaultCreateCallbackStateRequest { @JsonCreator public VaultCreateCallbackStateRequest( - Optional consumerId, - Optional appId, - String serviceId, - String unifiedApi, - CreateCallbackState createCallbackState) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(createCallbackState, "createCallbackState"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nonnull CreateCallbackState createCallbackState) { this.consumerId = consumerId; this.appId = appId; - this.serviceId = serviceId; - this.unifiedApi = unifiedApi; - this.createCallbackState = createCallbackState; + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); + this.createCallbackState = Optional.ofNullable(createCallbackState) + .orElseThrow(() -> new IllegalArgumentException("createCallbackState cannot be null")); } public VaultCreateCallbackStateRequest( - String serviceId, - String unifiedApi, - CreateCallbackState createCallbackState) { - this(Optional.empty(), Optional.empty(), serviceId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nonnull CreateCallbackState createCallbackState) { + this(null, null, serviceId, unifiedApi, createCallbackState); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } /** * Callback state data */ - @JsonIgnore public CreateCallbackState createCallbackState() { - return createCallbackState; + return this.createCallbackState; } public static Builder builder() { @@ -119,68 +113,48 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultCreateCallbackStateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultCreateCallbackStateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultCreateCallbackStateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultCreateCallbackStateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultCreateCallbackStateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultCreateCallbackStateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Service ID of the resource to return */ - public VaultCreateCallbackStateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultCreateCallbackStateRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } + /** * Unified API */ - public VaultCreateCallbackStateRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultCreateCallbackStateRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + /** * Callback state data */ - public VaultCreateCallbackStateRequest withCreateCallbackState(CreateCallbackState createCallbackState) { - Utils.checkNotNull(createCallbackState, "createCallbackState"); - this.createCallbackState = createCallbackState; + public VaultCreateCallbackStateRequest withCreateCallbackState(@Nonnull CreateCallbackState createCallbackState) { + this.createCallbackState = Utils.checkNotNull(createCallbackState, "createCallbackState"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -218,9 +192,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String serviceId; @@ -232,76 +206,47 @@ private Builder() { // force use of static builder() method } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** * Callback state data */ - public Builder createCallbackState(CreateCallbackState createCallbackState) { - Utils.checkNotNull(createCallbackState, "createCallbackState"); - this.createCallbackState = createCallbackState; + public Builder createCallbackState(@Nonnull CreateCallbackState createCallbackState) { + this.createCallbackState = Utils.checkNotNull(createCallbackState, "createCallbackState"); return this; } public VaultCreateCallbackStateRequest build() { - return new VaultCreateCallbackStateRequest( consumerId, appId, serviceId, unifiedApi, createCallbackState); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateRequestBuilder.java index 9f6a4749..8b2e70a3 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class VaultCreateCallbackStateRequestBuilder { - - private VaultCreateCallbackStateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private VaultCreateCallbackStateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultCreateCallbackStateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public VaultCreateCallbackStateRequestBuilder request(VaultCreateCallbackStateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public VaultCreateCallbackStateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultCreateCallbackStateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultCreateCallbackStateRequestBuilder request(@Nonnull VaultCreateCallbackStateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private VaultCreateCallbackStateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultCreateCallbackStateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultCreateCallbackStateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateResponse.java index af81c3d4..a2c33d53 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultCreateCallbackStateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultCreateCallbackStateResponse implements Response { /** * Callback state created */ - private Optional createCallbackStateResponse; + private CreateCallbackStateResponse createCallbackStateResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultCreateCallbackStateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createCallbackStateResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createCallbackStateResponse, "createCallbackStateResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateCallbackStateResponse createCallbackStateResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createCallbackStateResponse = createCallbackStateResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultCreateCallbackStateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Callback state created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createCallbackStateResponse() { - return (Optional) createCallbackStateResponse; + return Optional.ofNullable(this.createCallbackStateResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultCreateCallbackStateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultCreateCallbackStateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultCreateCallbackStateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultCreateCallbackStateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Callback state created + * Raw HTTP response; suitable for custom response parsing */ - public VaultCreateCallbackStateResponse withCreateCallbackStateResponse(CreateCallbackStateResponse createCallbackStateResponse) { - Utils.checkNotNull(createCallbackStateResponse, "createCallbackStateResponse"); - this.createCallbackStateResponse = Optional.ofNullable(createCallbackStateResponse); + public VaultCreateCallbackStateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultCreateCallbackStateResponse withCreateCallbackStateResponse(CreateCa /** * Callback state created */ - public VaultCreateCallbackStateResponse withCreateCallbackStateResponse(Optional createCallbackStateResponse) { - Utils.checkNotNull(createCallbackStateResponse, "createCallbackStateResponse"); + public VaultCreateCallbackStateResponse withCreateCallbackStateResponse(@Nullable CreateCallbackStateResponse createCallbackStateResponse) { this.createCallbackStateResponse = createCallbackStateResponse; return this; } - /** - * Unexpected error - */ - public VaultCreateCallbackStateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultCreateCallbackStateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultCreateCallbackStateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createCallbackStateResponse = Optional.empty(); + private CreateCallbackStateResponse createCallbackStateResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Callback state created - */ - public Builder createCallbackStateResponse(CreateCallbackStateResponse createCallbackStateResponse) { - Utils.checkNotNull(createCallbackStateResponse, "createCallbackStateResponse"); - this.createCallbackStateResponse = Optional.ofNullable(createCallbackStateResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Callback state created */ - public Builder createCallbackStateResponse(Optional createCallbackStateResponse) { - Utils.checkNotNull(createCallbackStateResponse, "createCallbackStateResponse"); + public Builder createCallbackStateResponse(@Nullable CreateCallbackStateResponse createCallbackStateResponse) { this.createCallbackStateResponse = createCallbackStateResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultCreateCallbackStateResponse build() { - return new VaultCreateCallbackStateResponse( contentType, statusCode, rawResponse, createCallbackStateResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllRequest.java index 56398516..f5c37d8f 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,13 +18,13 @@ public class VaultCustomFieldsAllRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Unified API @@ -47,84 +48,75 @@ public class VaultCustomFieldsAllRequest { * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=resource_id") - private Optional resourceId; + private String resourceId; @JsonCreator public VaultCustomFieldsAllRequest( - Optional consumerId, - Optional appId, - String unifiedApi, - String serviceId, - String resource, - Optional resourceId) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(resource, "resource"); - Utils.checkNotNull(resourceId, "resourceId"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String unifiedApi, + @Nonnull String serviceId, + @Nonnull String resource, + @Nullable String resourceId) { this.consumerId = consumerId; this.appId = appId; - this.unifiedApi = unifiedApi; - this.serviceId = serviceId; - this.resource = resource; + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.resource = Optional.ofNullable(resource) + .orElseThrow(() -> new IllegalArgumentException("resource cannot be null")); this.resourceId = resourceId; } public VaultCustomFieldsAllRequest( - String unifiedApi, - String serviceId, - String resource) { - this(Optional.empty(), Optional.empty(), unifiedApi, - serviceId, resource, Optional.empty()); + @Nonnull String unifiedApi, + @Nonnull String serviceId, + @Nonnull String resource) { + this(null, null, unifiedApi, + serviceId, resource, null); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Name of the resource (plural) */ - @JsonIgnore public String resource() { - return resource; + return this.resource; } /** * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. */ - @JsonIgnore public Optional resourceId() { - return resourceId; + return Optional.ofNullable(this.resourceId); } public static Builder builder() { @@ -135,74 +127,44 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultCustomFieldsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultCustomFieldsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultCustomFieldsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultCustomFieldsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultCustomFieldsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultCustomFieldsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Unified API */ - public VaultCustomFieldsAllRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultCustomFieldsAllRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + /** * Service ID of the resource to return */ - public VaultCustomFieldsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultCustomFieldsAllRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** - * Name of the resource (plural) - */ - public VaultCustomFieldsAllRequest withResource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; - return this; - } /** - * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. + * Name of the resource (plural) */ - public VaultCustomFieldsAllRequest withResourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = Optional.ofNullable(resourceId); + public VaultCustomFieldsAllRequest withResource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } @@ -210,12 +172,12 @@ public VaultCustomFieldsAllRequest withResourceId(String resourceId) { /** * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. */ - public VaultCustomFieldsAllRequest withResourceId(Optional resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); + public VaultCustomFieldsAllRequest withResourceId(@Nullable String resourceId) { this.resourceId = resourceId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -255,9 +217,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String unifiedApi; @@ -265,101 +227,61 @@ public final static class Builder { private String resource; - private Optional resourceId = Optional.empty(); + private String resourceId; private Builder() { // force use of static builder() method } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Name of the resource (plural) */ - public Builder resource(String resource) { - Utils.checkNotNull(resource, "resource"); - this.resource = resource; - return this; - } - - - /** - * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. - */ - public Builder resourceId(String resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); - this.resourceId = Optional.ofNullable(resourceId); + public Builder resource(@Nonnull String resource) { + this.resource = Utils.checkNotNull(resource, "resource"); return this; } /** * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. */ - public Builder resourceId(Optional resourceId) { - Utils.checkNotNull(resourceId, "resourceId"); + public Builder resourceId(@Nullable String resourceId) { this.resourceId = resourceId; return this; } public VaultCustomFieldsAllRequest build() { - return new VaultCustomFieldsAllRequest( consumerId, appId, unifiedApi, serviceId, resource, resourceId); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllRequestBuilder.java index 2b6e4890..4a37ba48 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class VaultCustomFieldsAllRequestBuilder { - - private VaultCustomFieldsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private VaultCustomFieldsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultCustomFieldsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public VaultCustomFieldsAllRequestBuilder request(VaultCustomFieldsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public VaultCustomFieldsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultCustomFieldsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultCustomFieldsAllRequestBuilder request(@Nonnull VaultCustomFieldsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private VaultCustomFieldsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultCustomFieldsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultCustomFieldsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllResponse.java index 8d4e982c..b0d4ac2a 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultCustomFieldsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultCustomFieldsAllResponse implements Response { /** * Custom mapping */ - private Optional getCustomFieldsResponse; + private GetCustomFieldsResponse getCustomFieldsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultCustomFieldsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCustomFieldsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCustomFieldsResponse, "getCustomFieldsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCustomFieldsResponse getCustomFieldsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCustomFieldsResponse = getCustomFieldsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultCustomFieldsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom mapping */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCustomFieldsResponse() { - return (Optional) getCustomFieldsResponse; + return Optional.ofNullable(this.getCustomFieldsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultCustomFieldsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultCustomFieldsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultCustomFieldsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultCustomFieldsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom mapping + * Raw HTTP response; suitable for custom response parsing */ - public VaultCustomFieldsAllResponse withGetCustomFieldsResponse(GetCustomFieldsResponse getCustomFieldsResponse) { - Utils.checkNotNull(getCustomFieldsResponse, "getCustomFieldsResponse"); - this.getCustomFieldsResponse = Optional.ofNullable(getCustomFieldsResponse); + public VaultCustomFieldsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultCustomFieldsAllResponse withGetCustomFieldsResponse(GetCustomFieldsR /** * Custom mapping */ - public VaultCustomFieldsAllResponse withGetCustomFieldsResponse(Optional getCustomFieldsResponse) { - Utils.checkNotNull(getCustomFieldsResponse, "getCustomFieldsResponse"); + public VaultCustomFieldsAllResponse withGetCustomFieldsResponse(@Nullable GetCustomFieldsResponse getCustomFieldsResponse) { this.getCustomFieldsResponse = getCustomFieldsResponse; return this; } - /** - * Unexpected error - */ - public VaultCustomFieldsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultCustomFieldsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultCustomFieldsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCustomFieldsResponse = Optional.empty(); + private GetCustomFieldsResponse getCustomFieldsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom mapping - */ - public Builder getCustomFieldsResponse(GetCustomFieldsResponse getCustomFieldsResponse) { - Utils.checkNotNull(getCustomFieldsResponse, "getCustomFieldsResponse"); - this.getCustomFieldsResponse = Optional.ofNullable(getCustomFieldsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom mapping */ - public Builder getCustomFieldsResponse(Optional getCustomFieldsResponse) { - Utils.checkNotNull(getCustomFieldsResponse, "getCustomFieldsResponse"); + public Builder getCustomFieldsResponse(@Nullable GetCustomFieldsResponse getCustomFieldsResponse) { this.getCustomFieldsResponse = getCustomFieldsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultCustomFieldsAllResponse build() { - return new VaultCustomFieldsAllResponse( contentType, statusCode, rawResponse, getCustomFieldsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllRequest.java index 8f9ff53a..f0b7cb94 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -17,13 +18,13 @@ public class VaultCustomMappingsAllRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Unified API @@ -39,57 +40,51 @@ public class VaultCustomMappingsAllRequest { @JsonCreator public VaultCustomMappingsAllRequest( - Optional consumerId, - Optional appId, - String unifiedApi, - String serviceId) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(serviceId, "serviceId"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String unifiedApi, + @Nonnull String serviceId) { this.consumerId = consumerId; this.appId = appId; - this.unifiedApi = unifiedApi; - this.serviceId = serviceId; + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); } public VaultCustomMappingsAllRequest( - String unifiedApi, - String serviceId) { - this(Optional.empty(), Optional.empty(), unifiedApi, + @Nonnull String unifiedApi, + @Nonnull String serviceId) { + this(null, null, unifiedApi, serviceId); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } public static Builder builder() { @@ -100,59 +95,39 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultCustomMappingsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultCustomMappingsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultCustomMappingsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultCustomMappingsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultCustomMappingsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultCustomMappingsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Unified API */ - public VaultCustomMappingsAllRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultCustomMappingsAllRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } + /** * Service ID of the resource to return */ - public VaultCustomMappingsAllRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultCustomMappingsAllRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -188,9 +163,9 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String unifiedApi; @@ -200,66 +175,39 @@ private Builder() { // force use of static builder() method } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } public VaultCustomMappingsAllRequest build() { - return new VaultCustomMappingsAllRequest( consumerId, appId, unifiedApi, serviceId); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllRequestBuilder.java index e92a616a..32bb8981 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllRequestBuilder.java @@ -10,93 +10,71 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class VaultCustomMappingsAllRequestBuilder { - - private Optional consumerId = Optional.empty(); - private Optional appId = Optional.empty(); - private String unifiedApi; - private String serviceId; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultCustomMappingsAllRequest.Builder pojoBuilder; + private VaultCustomMappingsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultCustomMappingsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultCustomMappingsAllRequestBuilder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.of(consumerId); - return this; + this.pojoBuilder = VaultCustomMappingsAllRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultCustomMappingsAllRequestBuilder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - public VaultCustomMappingsAllRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); + public VaultCustomMappingsAllRequestBuilder consumerId(@Nullable String consumerId) { + this.pojoBuilder.consumerId(consumerId); + this._setterCalled = true; return this; } - public VaultCustomMappingsAllRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public VaultCustomMappingsAllRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultCustomMappingsAllRequestBuilder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public VaultCustomMappingsAllRequestBuilder unifiedApi(@Nonnull String unifiedApi) { + this.pojoBuilder.unifiedApi(unifiedApi); + this._setterCalled = true; return this; } - public VaultCustomMappingsAllRequestBuilder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; - return this; - } - - public VaultCustomMappingsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public VaultCustomMappingsAllRequestBuilder serviceId(@Nonnull String serviceId) { + this.pojoBuilder.serviceId(serviceId); + this._setterCalled = true; return this; } - public VaultCustomMappingsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultCustomMappingsAllRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private VaultCustomMappingsAllRequest buildRequest() { - - VaultCustomMappingsAllRequest request = new VaultCustomMappingsAllRequest(consumerId, - appId, - unifiedApi, - serviceId); - - return request; + private VaultCustomMappingsAllRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultCustomMappingsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultCustomMappingsAllOperation( sdkConfiguration, options); - VaultCustomMappingsAllRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllResponse.java index 1668ec25..4bd2a6ef 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultCustomMappingsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultCustomMappingsAllResponse implements Response { /** * Custom mapping */ - private Optional getCustomMappingsResponse; + private GetCustomMappingsResponse getCustomMappingsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultCustomMappingsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getCustomMappingsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getCustomMappingsResponse, "getCustomMappingsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetCustomMappingsResponse getCustomMappingsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getCustomMappingsResponse = getCustomMappingsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultCustomMappingsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Custom mapping */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getCustomMappingsResponse() { - return (Optional) getCustomMappingsResponse; + return Optional.ofNullable(this.getCustomMappingsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultCustomMappingsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultCustomMappingsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultCustomMappingsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultCustomMappingsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Custom mapping + * Raw HTTP response; suitable for custom response parsing */ - public VaultCustomMappingsAllResponse withGetCustomMappingsResponse(GetCustomMappingsResponse getCustomMappingsResponse) { - Utils.checkNotNull(getCustomMappingsResponse, "getCustomMappingsResponse"); - this.getCustomMappingsResponse = Optional.ofNullable(getCustomMappingsResponse); + public VaultCustomMappingsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultCustomMappingsAllResponse withGetCustomMappingsResponse(GetCustomMap /** * Custom mapping */ - public VaultCustomMappingsAllResponse withGetCustomMappingsResponse(Optional getCustomMappingsResponse) { - Utils.checkNotNull(getCustomMappingsResponse, "getCustomMappingsResponse"); + public VaultCustomMappingsAllResponse withGetCustomMappingsResponse(@Nullable GetCustomMappingsResponse getCustomMappingsResponse) { this.getCustomMappingsResponse = getCustomMappingsResponse; return this; } - /** - * Unexpected error - */ - public VaultCustomMappingsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultCustomMappingsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultCustomMappingsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getCustomMappingsResponse = Optional.empty(); + private GetCustomMappingsResponse getCustomMappingsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Custom mapping - */ - public Builder getCustomMappingsResponse(GetCustomMappingsResponse getCustomMappingsResponse) { - Utils.checkNotNull(getCustomMappingsResponse, "getCustomMappingsResponse"); - this.getCustomMappingsResponse = Optional.ofNullable(getCustomMappingsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Custom mapping */ - public Builder getCustomMappingsResponse(Optional getCustomMappingsResponse) { - Utils.checkNotNull(getCustomMappingsResponse, "getCustomMappingsResponse"); + public Builder getCustomMappingsResponse(@Nullable GetCustomMappingsResponse getCustomMappingsResponse) { this.getCustomMappingsResponse = getCustomMappingsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultCustomMappingsAllResponse build() { - return new VaultCustomMappingsAllResponse( contentType, statusCode, rawResponse, getCustomMappingsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultLogsAllRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultLogsAllRequest.java index b8693260..e54cc103 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultLogsAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultLogsAllRequest.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -23,19 +22,19 @@ public class VaultLogsAllRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * Filter results */ @SpeakeasyMetadata("queryParam:style=deepObject,explode=true,name=filter") - private Optional filter; + private LogsFilter filter; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -47,71 +46,62 @@ public class VaultLogsAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; @JsonCreator public VaultLogsAllRequest( - Optional appId, - Optional consumerId, - Optional filter, - JsonNullable cursor, - Optional limit) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(filter, "filter"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); + @Nullable String appId, + @Nullable String consumerId, + @Nullable LogsFilter filter, + @Nullable JsonNullable cursor, + @Nullable Long limit) { this.appId = appId; this.consumerId = consumerId; this.filter = filter; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); } public VaultLogsAllRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty(), - JsonNullable.undefined(), Optional.empty()); + this(null, null, null, + null, null); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * Filter results */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional filter() { - return (Optional) filter; + return Optional.ofNullable(this.filter); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } public static Builder builder() { @@ -122,84 +112,35 @@ public static Builder builder() { /** * The ID of your Unify application */ - public VaultLogsAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public VaultLogsAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultLogsAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * ID of the consumer which you want to get or push data from - */ - public VaultLogsAllRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public VaultLogsAllRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultLogsAllRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * Filter results - */ - public VaultLogsAllRequest withFilter(LogsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - /** * Filter results */ - public VaultLogsAllRequest withFilter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public VaultLogsAllRequest withFilter(@Nullable LogsFilter filter) { this.filter = filter; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public VaultLogsAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public VaultLogsAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public VaultLogsAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public VaultLogsAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -207,12 +148,12 @@ public VaultLogsAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public VaultLogsAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public VaultLogsAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -250,130 +191,71 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional filter = Optional.empty(); + private LogsFilter filter; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; private Builder() { // force use of static builder() method } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * Filter results */ - public Builder filter(LogsFilter filter) { - Utils.checkNotNull(filter, "filter"); - this.filter = Optional.ofNullable(filter); - return this; - } - - /** - * Filter results - */ - public Builder filter(Optional filter) { - Utils.checkNotNull(filter, "filter"); + public Builder filter(@Nullable LogsFilter filter) { this.filter = filter; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } public VaultLogsAllRequest build() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new VaultLogsAllRequest( appId, consumerId, filter, cursor, limit); } - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultLogsAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultLogsAllRequestBuilder.java index 32d60518..cb864da3 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultLogsAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultLogsAllRequestBuilder.java @@ -15,56 +15,55 @@ import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; public class VaultLogsAllRequestBuilder { - - private VaultLogsAllRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private VaultLogsAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultLogsAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public VaultLogsAllRequestBuilder request(VaultLogsAllRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public VaultLogsAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultLogsAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultLogsAllRequestBuilder request(@Nonnull VaultLogsAllRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private VaultLogsAllRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultLogsAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultLogsAllOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -79,29 +78,27 @@ public VaultLogsAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new VaultLogsAllOperation( - sdkConfiguration, - options); + VaultLogsAllRequest request = this.request; + Options options = optionsBuilder.build(); + RequestOperation operation = + new VaultLogsAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - VaultLogsAllRequest::withCursor, + VaultLogsAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultLogsAllResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultLogsAllResponse.java index 2a990d6f..6857ff16 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultLogsAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultLogsAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultLogsAllResponse implements Response { /** * Logs */ - private Optional getLogsResponse; + private GetLogsResponse getLogsResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultLogsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getLogsResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getLogsResponse, "getLogsResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetLogsResponse getLogsResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getLogsResponse = getLogsResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultLogsAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Logs */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getLogsResponse() { - return (Optional) getLogsResponse; + return Optional.ofNullable(this.getLogsResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultLogsAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultLogsAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultLogsAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultLogsAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Logs + * Raw HTTP response; suitable for custom response parsing */ - public VaultLogsAllResponse withGetLogsResponse(GetLogsResponse getLogsResponse) { - Utils.checkNotNull(getLogsResponse, "getLogsResponse"); - this.getLogsResponse = Optional.ofNullable(getLogsResponse); + public VaultLogsAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultLogsAllResponse withGetLogsResponse(GetLogsResponse getLogsResponse) /** * Logs */ - public VaultLogsAllResponse withGetLogsResponse(Optional getLogsResponse) { - Utils.checkNotNull(getLogsResponse, "getLogsResponse"); + public VaultLogsAllResponse withGetLogsResponse(@Nullable GetLogsResponse getLogsResponse) { this.getLogsResponse = getLogsResponse; return this; } - /** - * Unexpected error - */ - public VaultLogsAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultLogsAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultLogsAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getLogsResponse = Optional.empty(); + private GetLogsResponse getLogsResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Logs - */ - public Builder getLogsResponse(GetLogsResponse getLogsResponse) { - Utils.checkNotNull(getLogsResponse, "getLogsResponse"); - this.getLogsResponse = Optional.ofNullable(getLogsResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Logs */ - public Builder getLogsResponse(Optional getLogsResponse) { - Utils.checkNotNull(getLogsResponse, "getLogsResponse"); + public Builder getLogsResponse(@Nullable GetLogsResponse getLogsResponse) { this.getLogsResponse = getLogsResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultLogsAllResponse build() { - return new VaultLogsAllResponse( contentType, statusCode, rawResponse, getLogsResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateRequest.java index 8afc348d..e9a1ac1e 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateRequest.java @@ -7,10 +7,9 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -19,60 +18,53 @@ public class VaultSessionsCreateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Additional redirect uri and/or consumer metadata */ @SpeakeasyMetadata("request:mediaType=application/json") - private Optional session; + private Session session; @JsonCreator public VaultSessionsCreateRequest( - Optional consumerId, - Optional appId, - Optional session) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(session, "session"); + @Nullable String consumerId, + @Nullable String appId, + @Nullable Session session) { this.consumerId = consumerId; this.appId = appId; this.session = session; } public VaultSessionsCreateRequest() { - this(Optional.empty(), Optional.empty(), Optional.empty()); + this(null, null, null); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Additional redirect uri and/or consumer metadata */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional session() { - return (Optional) session; + return Optional.ofNullable(this.session); } public static Builder builder() { @@ -83,60 +75,30 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultSessionsCreateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultSessionsCreateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultSessionsCreateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultSessionsCreateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultSessionsCreateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultSessionsCreateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Additional redirect uri and/or consumer metadata - */ - public VaultSessionsCreateRequest withSession(Session session) { - Utils.checkNotNull(session, "session"); - this.session = Optional.ofNullable(session); - return this; - } - /** * Additional redirect uri and/or consumer metadata */ - public VaultSessionsCreateRequest withSession(Optional session) { - Utils.checkNotNull(session, "session"); + public VaultSessionsCreateRequest withSession(@Nullable Session session) { this.session = session; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -169,75 +131,41 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; - private Optional session = Optional.empty(); + private Session session; private Builder() { // force use of static builder() method } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - /** - * Additional redirect uri and/or consumer metadata - */ - public Builder session(Session session) { - Utils.checkNotNull(session, "session"); - this.session = Optional.ofNullable(session); - return this; - } - /** * Additional redirect uri and/or consumer metadata */ - public Builder session(Optional session) { - Utils.checkNotNull(session, "session"); + public Builder session(@Nullable Session session) { this.session = session; return this; } public VaultSessionsCreateRequest build() { - return new VaultSessionsCreateRequest( consumerId, appId, session); } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateRequestBuilder.java index a3c4de26..7c85559e 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateRequestBuilder.java @@ -10,92 +10,64 @@ import com.apideck.unify.operations.VaultSessionsCreateOperation; import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; -import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class VaultSessionsCreateRequestBuilder { - - private Optional consumerId = Optional.empty(); - private Optional appId = Optional.empty(); - private Optional session = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final VaultSessionsCreateRequest.Builder pojoBuilder; + private VaultSessionsCreateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultSessionsCreateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public VaultSessionsCreateRequestBuilder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.of(consumerId); - return this; + this.pojoBuilder = VaultSessionsCreateRequest.builder(); + this.optionsBuilder = Options.builder(); } - public VaultSessionsCreateRequestBuilder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = consumerId; - return this; - } - - public VaultSessionsCreateRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); + public VaultSessionsCreateRequestBuilder consumerId(@Nullable String consumerId) { + this.pojoBuilder.consumerId(consumerId); + this._setterCalled = true; return this; } - public VaultSessionsCreateRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; - return this; - } - - public VaultSessionsCreateRequestBuilder session(Session session) { - Utils.checkNotNull(session, "session"); - this.session = Optional.of(session); + public VaultSessionsCreateRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public VaultSessionsCreateRequestBuilder session(Optional session) { - Utils.checkNotNull(session, "session"); - this.session = session; - return this; - } - - public VaultSessionsCreateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public VaultSessionsCreateRequestBuilder session(@Nullable Session session) { + this.pojoBuilder.session(session); + this._setterCalled = true; return this; } - public VaultSessionsCreateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultSessionsCreateRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private VaultSessionsCreateRequest buildRequest() { - - VaultSessionsCreateRequest request = new VaultSessionsCreateRequest(consumerId, - appId, - session); - - return request; + private VaultSessionsCreateRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultSessionsCreateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultSessionsCreateOperation( sdkConfiguration, options); - VaultSessionsCreateRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateResponse.java index 171b9536..5d66c292 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultSessionsCreateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultSessionsCreateResponse implements Response { /** * Session created */ - private Optional createSessionResponse; + private CreateSessionResponse createSessionResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultSessionsCreateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createSessionResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createSessionResponse, "createSessionResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateSessionResponse createSessionResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createSessionResponse = createSessionResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultSessionsCreateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Session created */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createSessionResponse() { - return (Optional) createSessionResponse; + return Optional.ofNullable(this.createSessionResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultSessionsCreateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultSessionsCreateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultSessionsCreateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultSessionsCreateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Session created + * Raw HTTP response; suitable for custom response parsing */ - public VaultSessionsCreateResponse withCreateSessionResponse(CreateSessionResponse createSessionResponse) { - Utils.checkNotNull(createSessionResponse, "createSessionResponse"); - this.createSessionResponse = Optional.ofNullable(createSessionResponse); + public VaultSessionsCreateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultSessionsCreateResponse withCreateSessionResponse(CreateSessionRespon /** * Session created */ - public VaultSessionsCreateResponse withCreateSessionResponse(Optional createSessionResponse) { - Utils.checkNotNull(createSessionResponse, "createSessionResponse"); + public VaultSessionsCreateResponse withCreateSessionResponse(@Nullable CreateSessionResponse createSessionResponse) { this.createSessionResponse = createSessionResponse; return this; } - /** - * Unexpected error - */ - public VaultSessionsCreateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultSessionsCreateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultSessionsCreateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createSessionResponse = Optional.empty(); + private CreateSessionResponse createSessionResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Session created - */ - public Builder createSessionResponse(CreateSessionResponse createSessionResponse) { - Utils.checkNotNull(createSessionResponse, "createSessionResponse"); - this.createSessionResponse = Optional.ofNullable(createSessionResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Session created */ - public Builder createSessionResponse(Optional createSessionResponse) { - Utils.checkNotNull(createSessionResponse, "createSessionResponse"); + public Builder createSessionResponse(@Nullable CreateSessionResponse createSessionResponse) { this.createSessionResponse = createSessionResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultSessionsCreateResponse build() { - return new VaultSessionsCreateResponse( contentType, statusCode, rawResponse, createSessionResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequest.java b/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequest.java index 78a623ea..80bf89d5 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequest.java @@ -6,10 +6,10 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.util.Optional; @@ -18,13 +18,13 @@ public class VaultValidateConnectionStateRequest { * ID of the consumer which you want to get or push data from */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-consumer-id") - private Optional consumerId; + private String consumerId; /** * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Service ID of the resource to return @@ -40,70 +40,61 @@ public class VaultValidateConnectionStateRequest { @SpeakeasyMetadata("request:mediaType=application/json") - private Optional requestBody; + private VaultValidateConnectionStateRequestBody requestBody; @JsonCreator public VaultValidateConnectionStateRequest( - Optional consumerId, - Optional appId, - String serviceId, - String unifiedApi, - Optional requestBody) { - Utils.checkNotNull(consumerId, "consumerId"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(serviceId, "serviceId"); - Utils.checkNotNull(unifiedApi, "unifiedApi"); - Utils.checkNotNull(requestBody, "requestBody"); + @Nullable String consumerId, + @Nullable String appId, + @Nonnull String serviceId, + @Nonnull String unifiedApi, + @Nullable VaultValidateConnectionStateRequestBody requestBody) { this.consumerId = consumerId; this.appId = appId; - this.serviceId = serviceId; - this.unifiedApi = unifiedApi; + this.serviceId = Optional.ofNullable(serviceId) + .orElseThrow(() -> new IllegalArgumentException("serviceId cannot be null")); + this.unifiedApi = Optional.ofNullable(unifiedApi) + .orElseThrow(() -> new IllegalArgumentException("unifiedApi cannot be null")); this.requestBody = requestBody; } public VaultValidateConnectionStateRequest( - String serviceId, - String unifiedApi) { - this(Optional.empty(), Optional.empty(), serviceId, - unifiedApi, Optional.empty()); + @Nonnull String serviceId, + @Nonnull String unifiedApi) { + this(null, null, serviceId, + unifiedApi, null); } /** * ID of the consumer which you want to get or push data from */ - @JsonIgnore public Optional consumerId() { - return consumerId; + return Optional.ofNullable(this.consumerId); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Service ID of the resource to return */ - @JsonIgnore public String serviceId() { - return serviceId; + return this.serviceId; } /** * Unified API */ - @JsonIgnore public String unifiedApi() { - return unifiedApi; + return this.unifiedApi; } - @SuppressWarnings("unchecked") - @JsonIgnore public Optional requestBody() { - return (Optional) requestBody; + return Optional.ofNullable(this.requestBody); } public static Builder builder() { @@ -114,72 +105,45 @@ public static Builder builder() { /** * ID of the consumer which you want to get or push data from */ - public VaultValidateConnectionStateRequest withConsumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - - - /** - * ID of the consumer which you want to get or push data from - */ - public VaultValidateConnectionStateRequest withConsumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public VaultValidateConnectionStateRequest withConsumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - /** - * The ID of your Unify application - */ - public VaultValidateConnectionStateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public VaultValidateConnectionStateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public VaultValidateConnectionStateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + /** * Service ID of the resource to return */ - public VaultValidateConnectionStateRequest withServiceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public VaultValidateConnectionStateRequest withServiceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } + /** * Unified API */ - public VaultValidateConnectionStateRequest withUnifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; - return this; - } - - public VaultValidateConnectionStateRequest withRequestBody(VaultValidateConnectionStateRequestBody requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = Optional.ofNullable(requestBody); + public VaultValidateConnectionStateRequest withUnifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - public VaultValidateConnectionStateRequest withRequestBody(Optional requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); + public VaultValidateConnectionStateRequest withRequestBody(@Nullable VaultValidateConnectionStateRequestBody requestBody) { this.requestBody = requestBody; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,93 +181,58 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional consumerId = Optional.empty(); + private String consumerId; - private Optional appId = Optional.empty(); + private String appId; private String serviceId; private String unifiedApi; - private Optional requestBody = Optional.empty(); + private VaultValidateConnectionStateRequestBody requestBody; private Builder() { // force use of static builder() method } - - /** - * ID of the consumer which you want to get or push data from - */ - public Builder consumerId(String consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); - this.consumerId = Optional.ofNullable(consumerId); - return this; - } - /** * ID of the consumer which you want to get or push data from */ - public Builder consumerId(Optional consumerId) { - Utils.checkNotNull(consumerId, "consumerId"); + public Builder consumerId(@Nullable String consumerId) { this.consumerId = consumerId; return this; } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Service ID of the resource to return */ - public Builder serviceId(String serviceId) { - Utils.checkNotNull(serviceId, "serviceId"); - this.serviceId = serviceId; + public Builder serviceId(@Nonnull String serviceId) { + this.serviceId = Utils.checkNotNull(serviceId, "serviceId"); return this; } - /** * Unified API */ - public Builder unifiedApi(String unifiedApi) { - Utils.checkNotNull(unifiedApi, "unifiedApi"); - this.unifiedApi = unifiedApi; + public Builder unifiedApi(@Nonnull String unifiedApi) { + this.unifiedApi = Utils.checkNotNull(unifiedApi, "unifiedApi"); return this; } - - public Builder requestBody(VaultValidateConnectionStateRequestBody requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); - this.requestBody = Optional.ofNullable(requestBody); - return this; - } - - public Builder requestBody(Optional requestBody) { - Utils.checkNotNull(requestBody, "requestBody"); + public Builder requestBody(@Nullable VaultValidateConnectionStateRequestBody requestBody) { this.requestBody = requestBody; return this; } public VaultValidateConnectionStateRequest build() { - return new VaultValidateConnectionStateRequest( consumerId, appId, serviceId, unifiedApi, requestBody); diff --git a/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequestBody.java b/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequestBody.java index 40129c8a..49b5e350 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequestBody.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequestBody.java @@ -49,7 +49,6 @@ private Builder() { } public VaultValidateConnectionStateRequestBody build() { - return new VaultValidateConnectionStateRequestBody( ); } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequestBuilder.java index 80d14c71..9715367a 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateRequestBuilder.java @@ -10,47 +10,46 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; -import java.util.Optional; public class VaultValidateConnectionStateRequestBuilder { - - private VaultValidateConnectionStateRequest request; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private VaultValidateConnectionStateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public VaultValidateConnectionStateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.optionsBuilder = Options.builder(); } - public VaultValidateConnectionStateRequestBuilder request(VaultValidateConnectionStateRequest request) { - Utils.checkNotNull(request, "request"); - this.request = request; - return this; - } - public VaultValidateConnectionStateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public VaultValidateConnectionStateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public VaultValidateConnectionStateRequestBuilder request(@Nonnull VaultValidateConnectionStateRequest request) { + this.request = Utils.checkNotNull(request, "request"); return this; } + private VaultValidateConnectionStateRequest _buildRequest() { + return this.request; + } + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public VaultValidateConnectionStateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new VaultValidateConnectionStateOperation( sdkConfiguration, options); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateResponse.java b/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateResponse.java index 3a5e296b..d4ad458f 100644 --- a/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/VaultValidateConnectionStateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class VaultValidateConnectionStateResponse implements Response { /** * Connection access token refreshed */ - private Optional validateConnectionStateResponse; + private ValidateConnectionStateResponse validateConnectionStateResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public VaultValidateConnectionStateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional validateConnectionStateResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(validateConnectionStateResponse, "validateConnectionStateResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable ValidateConnectionStateResponse validateConnectionStateResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.validateConnectionStateResponse = validateConnectionStateResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public VaultValidateConnectionStateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Connection access token refreshed */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional validateConnectionStateResponse() { - return (Optional) validateConnectionStateResponse; + return Optional.ofNullable(this.validateConnectionStateResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public VaultValidateConnectionStateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public VaultValidateConnectionStateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public VaultValidateConnectionStateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public VaultValidateConnectionStateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Connection access token refreshed + * Raw HTTP response; suitable for custom response parsing */ - public VaultValidateConnectionStateResponse withValidateConnectionStateResponse(ValidateConnectionStateResponse validateConnectionStateResponse) { - Utils.checkNotNull(validateConnectionStateResponse, "validateConnectionStateResponse"); - this.validateConnectionStateResponse = Optional.ofNullable(validateConnectionStateResponse); + public VaultValidateConnectionStateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public VaultValidateConnectionStateResponse withValidateConnectionStateResponse( /** * Connection access token refreshed */ - public VaultValidateConnectionStateResponse withValidateConnectionStateResponse(Optional validateConnectionStateResponse) { - Utils.checkNotNull(validateConnectionStateResponse, "validateConnectionStateResponse"); + public VaultValidateConnectionStateResponse withValidateConnectionStateResponse(@Nullable ValidateConnectionStateResponse validateConnectionStateResponse) { this.validateConnectionStateResponse = validateConnectionStateResponse; return this; } - /** - * Unexpected error - */ - public VaultValidateConnectionStateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public VaultValidateConnectionStateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public VaultValidateConnectionStateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional validateConnectionStateResponse = Optional.empty(); + private ValidateConnectionStateResponse validateConnectionStateResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Connection access token refreshed - */ - public Builder validateConnectionStateResponse(ValidateConnectionStateResponse validateConnectionStateResponse) { - Utils.checkNotNull(validateConnectionStateResponse, "validateConnectionStateResponse"); - this.validateConnectionStateResponse = Optional.ofNullable(validateConnectionStateResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Connection access token refreshed */ - public Builder validateConnectionStateResponse(Optional validateConnectionStateResponse) { - Utils.checkNotNull(validateConnectionStateResponse, "validateConnectionStateResponse"); + public Builder validateConnectionStateResponse(@Nullable ValidateConnectionStateResponse validateConnectionStateResponse) { this.validateConnectionStateResponse = validateConnectionStateResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public VaultValidateConnectionStateResponse build() { - return new VaultValidateConnectionStateResponse( contentType, statusCode, rawResponse, validateConnectionStateResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddRequest.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddRequest.java index 8314d3a3..86cb5582 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddRequest.java @@ -7,7 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -18,7 +19,7 @@ public class WebhookWebhooksAddRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -26,30 +27,27 @@ public class WebhookWebhooksAddRequest { @JsonCreator public WebhookWebhooksAddRequest( - Optional appId, - CreateWebhookRequest createWebhookRequest) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(createWebhookRequest, "createWebhookRequest"); + @Nullable String appId, + @Nonnull CreateWebhookRequest createWebhookRequest) { this.appId = appId; - this.createWebhookRequest = createWebhookRequest; + this.createWebhookRequest = Optional.ofNullable(createWebhookRequest) + .orElseThrow(() -> new IllegalArgumentException("createWebhookRequest cannot be null")); } public WebhookWebhooksAddRequest( - CreateWebhookRequest createWebhookRequest) { - this(Optional.empty(), createWebhookRequest); + @Nonnull CreateWebhookRequest createWebhookRequest) { + this(null, createWebhookRequest); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } - @JsonIgnore public CreateWebhookRequest createWebhookRequest() { - return createWebhookRequest; + return this.createWebhookRequest; } public static Builder builder() { @@ -60,27 +58,17 @@ public static Builder builder() { /** * The ID of your Unify application */ - public WebhookWebhooksAddRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); + public WebhookWebhooksAddRequest withAppId(@Nullable String appId) { + this.appId = appId; return this; } - /** - * The ID of your Unify application - */ - public WebhookWebhooksAddRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public WebhookWebhooksAddRequest withCreateWebhookRequest(@Nonnull CreateWebhookRequest createWebhookRequest) { + this.createWebhookRequest = Utils.checkNotNull(createWebhookRequest, "createWebhookRequest"); return this; } - public WebhookWebhooksAddRequest withCreateWebhookRequest(CreateWebhookRequest createWebhookRequest) { - Utils.checkNotNull(createWebhookRequest, "createWebhookRequest"); - this.createWebhookRequest = createWebhookRequest; - return this; - } @Override public boolean equals(java.lang.Object o) { @@ -112,7 +100,7 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; private CreateWebhookRequest createWebhookRequest; @@ -120,34 +108,20 @@ private Builder() { // force use of static builder() method } - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - public Builder createWebhookRequest(CreateWebhookRequest createWebhookRequest) { - Utils.checkNotNull(createWebhookRequest, "createWebhookRequest"); - this.createWebhookRequest = createWebhookRequest; + public Builder createWebhookRequest(@Nonnull CreateWebhookRequest createWebhookRequest) { + this.createWebhookRequest = Utils.checkNotNull(createWebhookRequest, "createWebhookRequest"); return this; } public WebhookWebhooksAddRequest build() { - return new WebhookWebhooksAddRequest( appId, createWebhookRequest); } diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddRequestBuilder.java index eda970b9..fcce3450 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddRequestBuilder.java @@ -11,71 +11,59 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class WebhookWebhooksAddRequestBuilder { - - private Optional appId = Optional.empty(); - private CreateWebhookRequest createWebhookRequest; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final WebhookWebhooksAddRequest.Builder pojoBuilder; + private WebhookWebhooksAddRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public WebhookWebhooksAddRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public WebhookWebhooksAddRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = WebhookWebhooksAddRequest.builder(); + this.optionsBuilder = Options.builder(); } - public WebhookWebhooksAddRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public WebhookWebhooksAddRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public WebhookWebhooksAddRequestBuilder createWebhookRequest(CreateWebhookRequest createWebhookRequest) { - Utils.checkNotNull(createWebhookRequest, "createWebhookRequest"); - this.createWebhookRequest = createWebhookRequest; - return this; - } - - public WebhookWebhooksAddRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public WebhookWebhooksAddRequestBuilder createWebhookRequest(@Nonnull CreateWebhookRequest createWebhookRequest) { + this.pojoBuilder.createWebhookRequest(createWebhookRequest); + this._setterCalled = true; return this; } - public WebhookWebhooksAddRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public WebhookWebhooksAddRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private WebhookWebhooksAddRequest buildRequest() { - - WebhookWebhooksAddRequest request = new WebhookWebhooksAddRequest(appId, - createWebhookRequest); - - return request; + private WebhookWebhooksAddRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public WebhookWebhooksAddResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new WebhookWebhooksAddOperation( sdkConfiguration, options); - WebhookWebhooksAddRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddResponse.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddResponse.java index 64abbe1f..1c213308 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAddResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class WebhookWebhooksAddResponse implements Response { /** * Webhooks */ - private Optional createWebhookResponse; + private CreateWebhookResponse createWebhookResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public WebhookWebhooksAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional createWebhookResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(createWebhookResponse, "createWebhookResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable CreateWebhookResponse createWebhookResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.createWebhookResponse = createWebhookResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public WebhookWebhooksAddResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Webhooks */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional createWebhookResponse() { - return (Optional) createWebhookResponse; + return Optional.ofNullable(this.createWebhookResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public WebhookWebhooksAddResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public WebhookWebhooksAddResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public WebhookWebhooksAddResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public WebhookWebhooksAddResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Webhooks + * Raw HTTP response; suitable for custom response parsing */ - public WebhookWebhooksAddResponse withCreateWebhookResponse(CreateWebhookResponse createWebhookResponse) { - Utils.checkNotNull(createWebhookResponse, "createWebhookResponse"); - this.createWebhookResponse = Optional.ofNullable(createWebhookResponse); + public WebhookWebhooksAddResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public WebhookWebhooksAddResponse withCreateWebhookResponse(CreateWebhookRespons /** * Webhooks */ - public WebhookWebhooksAddResponse withCreateWebhookResponse(Optional createWebhookResponse) { - Utils.checkNotNull(createWebhookResponse, "createWebhookResponse"); + public WebhookWebhooksAddResponse withCreateWebhookResponse(@Nullable CreateWebhookResponse createWebhookResponse) { this.createWebhookResponse = createWebhookResponse; return this; } - /** - * Unexpected error - */ - public WebhookWebhooksAddResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public WebhookWebhooksAddResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public WebhookWebhooksAddResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional createWebhookResponse = Optional.empty(); + private CreateWebhookResponse createWebhookResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Webhooks - */ - public Builder createWebhookResponse(CreateWebhookResponse createWebhookResponse) { - Utils.checkNotNull(createWebhookResponse, "createWebhookResponse"); - this.createWebhookResponse = Optional.ofNullable(createWebhookResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Webhooks */ - public Builder createWebhookResponse(Optional createWebhookResponse) { - Utils.checkNotNull(createWebhookResponse, "createWebhookResponse"); + public Builder createWebhookResponse(@Nullable CreateWebhookResponse createWebhookResponse) { this.createWebhookResponse = createWebhookResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public WebhookWebhooksAddResponse build() { - return new WebhookWebhooksAddResponse( contentType, statusCode, rawResponse, createWebhookResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllRequest.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllRequest.java index c60391dd..e4e70b9b 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllRequest.java @@ -7,8 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.lang.Long; import java.lang.Override; import java.lang.String; @@ -21,7 +21,7 @@ public class WebhookWebhooksAllRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. @@ -33,47 +33,43 @@ public class WebhookWebhooksAllRequest { * Number of results to return. Minimum 1, Maximum 200, Default 20 */ @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") - private Optional limit; + private Long limit; @JsonCreator public WebhookWebhooksAllRequest( - Optional appId, - JsonNullable cursor, - Optional limit) { - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(cursor, "cursor"); - Utils.checkNotNull(limit, "limit"); + @Nullable String appId, + @Nullable JsonNullable cursor, + @Nullable Long limit) { this.appId = appId; - this.cursor = cursor; - this.limit = limit; + this.cursor = Optional.ofNullable(cursor) + .orElse(JsonNullable.undefined()); + this.limit = Optional.ofNullable(limit) + .orElse(Builder._SINGLETON_VALUE_Limit.value()); } public WebhookWebhooksAllRequest() { - this(Optional.empty(), JsonNullable.undefined(), Optional.empty()); + this(null, null, null); } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - @JsonIgnore public JsonNullable cursor() { - return cursor; + return this.cursor; } /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - @JsonIgnore public Optional limit() { - return limit; + return Optional.ofNullable(this.limit); } public static Builder builder() { @@ -84,46 +80,17 @@ public static Builder builder() { /** * The ID of your Unify application */ - public WebhookWebhooksAllRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - - /** - * The ID of your Unify application - */ - public WebhookWebhooksAllRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public WebhookWebhooksAllRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public WebhookWebhooksAllRequest withCursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public WebhookWebhooksAllRequest withCursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public WebhookWebhooksAllRequest withLimit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); + public WebhookWebhooksAllRequest withCursor(@Nullable String cursor) { + this.cursor = JsonNullable.of(cursor); return this; } @@ -131,12 +98,12 @@ public WebhookWebhooksAllRequest withLimit(long limit) { /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public WebhookWebhooksAllRequest withLimit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public WebhookWebhooksAllRequest withLimit(@Nullable Long limit) { this.limit = limit; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -169,87 +136,50 @@ public String toString() { @SuppressWarnings("UnusedReturnValue") public final static class Builder { - private Optional appId = Optional.empty(); + private String appId; - private JsonNullable cursor = JsonNullable.undefined(); + private JsonNullable cursor; - private Optional limit; + private Long limit; private Builder() { // force use of static builder() method } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - /** * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. */ - public Builder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); + public Builder cursor(@Nullable String cursor) { this.cursor = JsonNullable.of(cursor); return this; } - /** - * Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. - */ - public Builder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - /** * Number of results to return. Minimum 1, Maximum 200, Default 20 */ - public Builder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.ofNullable(limit); - return this; - } - - /** - * Number of results to return. Minimum 1, Maximum 200, Default 20 - */ - public Builder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); + public Builder limit(@Nullable Long limit) { this.limit = limit; return this; } public WebhookWebhooksAllRequest build() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - return new WebhookWebhooksAllRequest( appId, cursor, limit); } - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = + private static final LazySingletonValue _SINGLETON_VALUE_Limit = new LazySingletonValue<>( "limit", "20", - new TypeReference>() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllRequestBuilder.java index 216887b8..156060f3 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllRequestBuilder.java @@ -10,13 +10,11 @@ import com.apideck.unify.SDKConfiguration; import com.apideck.unify.operations.WebhookWebhooksAllOperation; -import com.apideck.unify.utils.LazySingletonValue; import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; -import com.apideck.unify.utils.Utils; import com.apideck.unify.utils.pagination.CursorTracker; import com.apideck.unify.utils.pagination.Paginator; -import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Iterable; @@ -24,100 +22,66 @@ import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; -import java.util.Optional; import java.util.stream.Stream; import org.openapitools.jackson.nullable.JsonNullable; public class WebhookWebhooksAllRequestBuilder { - - private Optional appId = Optional.empty(); - private JsonNullable cursor = JsonNullable.undefined(); - private Optional limit = Utils.readDefaultOrConstValue( - "limit", - "20", - new TypeReference>() {}); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final WebhookWebhooksAllRequest.Builder pojoBuilder; + private WebhookWebhooksAllRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public WebhookWebhooksAllRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; - } - - public WebhookWebhooksAllRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); - return this; + this.pojoBuilder = WebhookWebhooksAllRequest.builder(); + this.optionsBuilder = Options.builder(); } - public WebhookWebhooksAllRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public WebhookWebhooksAllRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public WebhookWebhooksAllRequestBuilder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); + public WebhookWebhooksAllRequestBuilder cursor(@Nullable String cursor) { + this.pojoBuilder.cursor(cursor); + this._setterCalled = true; return this; } - public WebhookWebhooksAllRequestBuilder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - public WebhookWebhooksAllRequestBuilder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.of(limit); + public WebhookWebhooksAllRequestBuilder limit(@Nullable Long limit) { + this.pojoBuilder.limit(limit); + this._setterCalled = true; return this; } - public WebhookWebhooksAllRequestBuilder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = limit; - return this; - } - public WebhookWebhooksAllRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + this.optionsBuilder.retryConfig(retryConfig); return this; } - public WebhookWebhooksAllRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; - return this; - } - - - private WebhookWebhooksAllRequest buildRequest() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); + private WebhookWebhooksAllRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); } - - WebhookWebhooksAllRequest request = new WebhookWebhooksAllRequest(appId, - cursor, - limit); - - return request; + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public WebhookWebhooksAllResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new WebhookWebhooksAllOperation( sdkConfiguration, options); - WebhookWebhooksAllRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } - + /** * Returns an iterable that performs next page calls till no more pages * are returned. @@ -132,36 +96,27 @@ public WebhookWebhooksAllResponse call() throws Exception { * @return An iterable that can be used to iterate through all pages */ public Iterable callAsIterable() { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - - RequestOperation operation - = new WebhookWebhooksAllOperation( - sdkConfiguration, - options); - WebhookWebhooksAllRequest request = buildRequest(); + WebhookWebhooksAllRequest request = pojoBuilder.build(); + Options options = optionsBuilder.build(); + RequestOperation operation = + new WebhookWebhooksAllOperation( + sdkConfiguration, + options); + Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.meta.cursors.next", String.class), - WebhookWebhooksAllRequest::withCursor, + WebhookWebhooksAllRequest::withCursor, nextRequest -> unchecked(() -> operation.doRequest(request)).get()); - + return () -> transform(iterator, operation::handleResponse); } /** - * Returns a stream that performs next page calls till no more pages - * are returned. - **/ + * Returns a stream that performs next page calls till no more pages + * are returned. + **/ public Stream callAsStream() { return toStream(callAsIterable()); } - - - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = - new LazySingletonValue<>( - "limit", - "20", - new TypeReference>() {}); } diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllResponse.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllResponse.java index 12835b7d..db7f2d1e 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksAllResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class WebhookWebhooksAllResponse implements Response { /** * Webhooks */ - private Optional getWebhooksResponse; + private GetWebhooksResponse getWebhooksResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public WebhookWebhooksAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getWebhooksResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getWebhooksResponse, "getWebhooksResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetWebhooksResponse getWebhooksResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getWebhooksResponse = getWebhooksResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public WebhookWebhooksAllResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Webhooks */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getWebhooksResponse() { - return (Optional) getWebhooksResponse; + return Optional.ofNullable(this.getWebhooksResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public WebhookWebhooksAllResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public WebhookWebhooksAllResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public WebhookWebhooksAllResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public WebhookWebhooksAllResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Webhooks + * Raw HTTP response; suitable for custom response parsing */ - public WebhookWebhooksAllResponse withGetWebhooksResponse(GetWebhooksResponse getWebhooksResponse) { - Utils.checkNotNull(getWebhooksResponse, "getWebhooksResponse"); - this.getWebhooksResponse = Optional.ofNullable(getWebhooksResponse); + public WebhookWebhooksAllResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public WebhookWebhooksAllResponse withGetWebhooksResponse(GetWebhooksResponse ge /** * Webhooks */ - public WebhookWebhooksAllResponse withGetWebhooksResponse(Optional getWebhooksResponse) { - Utils.checkNotNull(getWebhooksResponse, "getWebhooksResponse"); + public WebhookWebhooksAllResponse withGetWebhooksResponse(@Nullable GetWebhooksResponse getWebhooksResponse) { this.getWebhooksResponse = getWebhooksResponse; return this; } - /** - * Unexpected error - */ - public WebhookWebhooksAllResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public WebhookWebhooksAllResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public WebhookWebhooksAllResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getWebhooksResponse = Optional.empty(); + private GetWebhooksResponse getWebhooksResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Webhooks - */ - public Builder getWebhooksResponse(GetWebhooksResponse getWebhooksResponse) { - Utils.checkNotNull(getWebhooksResponse, "getWebhooksResponse"); - this.getWebhooksResponse = Optional.ofNullable(getWebhooksResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Webhooks */ - public Builder getWebhooksResponse(Optional getWebhooksResponse) { - Utils.checkNotNull(getWebhooksResponse, "getWebhooksResponse"); + public Builder getWebhooksResponse(@Nullable GetWebhooksResponse getWebhooksResponse) { this.getWebhooksResponse = getWebhooksResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public WebhookWebhooksAllResponse build() { - return new WebhookWebhooksAllResponse( contentType, statusCode, rawResponse, getWebhooksResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteRequest.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteRequest.java index faca6f41..bf7e4d81 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -23,37 +24,34 @@ public class WebhookWebhooksDeleteRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; @JsonCreator public WebhookWebhooksDeleteRequest( - String id, - Optional appId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(appId, "appId"); - this.id = id; + @Nonnull String id, + @Nullable String appId) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.appId = appId; } public WebhookWebhooksDeleteRequest( - String id) { - this(id, Optional.empty()); + @Nonnull String id) { + this(id, null); } /** * JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } public static Builder builder() { @@ -64,18 +62,8 @@ public static Builder builder() { /** * JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. */ - public WebhookWebhooksDeleteRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * The ID of your Unify application - */ - public WebhookWebhooksDeleteRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); + public WebhookWebhooksDeleteRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -83,12 +71,12 @@ public WebhookWebhooksDeleteRequest withAppId(String appId) { /** * The ID of your Unify application */ - public WebhookWebhooksDeleteRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public WebhookWebhooksDeleteRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,43 +109,29 @@ public final static class Builder { private String id; - private Optional appId = Optional.empty(); + private String appId; private Builder() { // force use of static builder() method } - /** * JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } public WebhookWebhooksDeleteRequest build() { - return new WebhookWebhooksDeleteRequest( id, appId); } diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteRequestBuilder.java index 1ed4b289..51898dee 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteRequestBuilder.java @@ -10,71 +10,59 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class WebhookWebhooksDeleteRequestBuilder { - - private String id; - private Optional appId = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final WebhookWebhooksDeleteRequest.Builder pojoBuilder; + private WebhookWebhooksDeleteRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public WebhookWebhooksDeleteRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.pojoBuilder = WebhookWebhooksDeleteRequest.builder(); + this.optionsBuilder = Options.builder(); } - public WebhookWebhooksDeleteRequestBuilder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - public WebhookWebhooksDeleteRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); + public WebhookWebhooksDeleteRequestBuilder id(@Nonnull String id) { + this.pojoBuilder.id(id); + this._setterCalled = true; return this; } - public WebhookWebhooksDeleteRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; - return this; - } - - public WebhookWebhooksDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public WebhookWebhooksDeleteRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public WebhookWebhooksDeleteRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public WebhookWebhooksDeleteRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private WebhookWebhooksDeleteRequest buildRequest() { - - WebhookWebhooksDeleteRequest request = new WebhookWebhooksDeleteRequest(id, - appId); - - return request; + private WebhookWebhooksDeleteRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public WebhookWebhooksDeleteResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new WebhookWebhooksDeleteOperation( sdkConfiguration, options); - WebhookWebhooksDeleteRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteResponse.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteResponse.java index 7b434d47..954eddbd 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksDeleteResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class WebhookWebhooksDeleteResponse implements Response { /** * Webhooks */ - private Optional deleteWebhookResponse; + private DeleteWebhookResponse deleteWebhookResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public WebhookWebhooksDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional deleteWebhookResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(deleteWebhookResponse, "deleteWebhookResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable DeleteWebhookResponse deleteWebhookResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.deleteWebhookResponse = deleteWebhookResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public WebhookWebhooksDeleteResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Webhooks */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional deleteWebhookResponse() { - return (Optional) deleteWebhookResponse; + return Optional.ofNullable(this.deleteWebhookResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public WebhookWebhooksDeleteResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public WebhookWebhooksDeleteResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public WebhookWebhooksDeleteResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public WebhookWebhooksDeleteResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Webhooks + * Raw HTTP response; suitable for custom response parsing */ - public WebhookWebhooksDeleteResponse withDeleteWebhookResponse(DeleteWebhookResponse deleteWebhookResponse) { - Utils.checkNotNull(deleteWebhookResponse, "deleteWebhookResponse"); - this.deleteWebhookResponse = Optional.ofNullable(deleteWebhookResponse); + public WebhookWebhooksDeleteResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public WebhookWebhooksDeleteResponse withDeleteWebhookResponse(DeleteWebhookResp /** * Webhooks */ - public WebhookWebhooksDeleteResponse withDeleteWebhookResponse(Optional deleteWebhookResponse) { - Utils.checkNotNull(deleteWebhookResponse, "deleteWebhookResponse"); + public WebhookWebhooksDeleteResponse withDeleteWebhookResponse(@Nullable DeleteWebhookResponse deleteWebhookResponse) { this.deleteWebhookResponse = deleteWebhookResponse; return this; } - /** - * Unexpected error - */ - public WebhookWebhooksDeleteResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public WebhookWebhooksDeleteResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public WebhookWebhooksDeleteResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional deleteWebhookResponse = Optional.empty(); + private DeleteWebhookResponse deleteWebhookResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Webhooks - */ - public Builder deleteWebhookResponse(DeleteWebhookResponse deleteWebhookResponse) { - Utils.checkNotNull(deleteWebhookResponse, "deleteWebhookResponse"); - this.deleteWebhookResponse = Optional.ofNullable(deleteWebhookResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Webhooks */ - public Builder deleteWebhookResponse(Optional deleteWebhookResponse) { - Utils.checkNotNull(deleteWebhookResponse, "deleteWebhookResponse"); + public Builder deleteWebhookResponse(@Nullable DeleteWebhookResponse deleteWebhookResponse) { this.deleteWebhookResponse = deleteWebhookResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public WebhookWebhooksDeleteResponse build() { - return new WebhookWebhooksDeleteResponse( contentType, statusCode, rawResponse, deleteWebhookResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneRequest.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneRequest.java index 9d460ddb..f77766a0 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneRequest.java @@ -6,7 +6,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -23,37 +24,34 @@ public class WebhookWebhooksOneRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; @JsonCreator public WebhookWebhooksOneRequest( - String id, - Optional appId) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(appId, "appId"); - this.id = id; + @Nonnull String id, + @Nullable String appId) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.appId = appId; } public WebhookWebhooksOneRequest( - String id) { - this(id, Optional.empty()); + @Nonnull String id) { + this(id, null); } /** * JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } public static Builder builder() { @@ -64,18 +62,8 @@ public static Builder builder() { /** * JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. */ - public WebhookWebhooksOneRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * The ID of your Unify application - */ - public WebhookWebhooksOneRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); + public WebhookWebhooksOneRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -83,12 +71,12 @@ public WebhookWebhooksOneRequest withAppId(String appId) { /** * The ID of your Unify application */ - public WebhookWebhooksOneRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public WebhookWebhooksOneRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,43 +109,29 @@ public final static class Builder { private String id; - private Optional appId = Optional.empty(); + private String appId; private Builder() { // force use of static builder() method } - /** * JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - - /** - * The ID of your Unify application - */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } /** * The ID of your Unify application */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } public WebhookWebhooksOneRequest build() { - return new WebhookWebhooksOneRequest( id, appId); } diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneRequestBuilder.java index 9257660d..91a4dfa6 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneRequestBuilder.java @@ -10,71 +10,59 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class WebhookWebhooksOneRequestBuilder { - - private String id; - private Optional appId = Optional.empty(); - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final WebhookWebhooksOneRequest.Builder pojoBuilder; + private WebhookWebhooksOneRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public WebhookWebhooksOneRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.pojoBuilder = WebhookWebhooksOneRequest.builder(); + this.optionsBuilder = Options.builder(); } - public WebhookWebhooksOneRequestBuilder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - public WebhookWebhooksOneRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); + public WebhookWebhooksOneRequestBuilder id(@Nonnull String id) { + this.pojoBuilder.id(id); + this._setterCalled = true; return this; } - public WebhookWebhooksOneRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; - return this; - } - - public WebhookWebhooksOneRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public WebhookWebhooksOneRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public WebhookWebhooksOneRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public WebhookWebhooksOneRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private WebhookWebhooksOneRequest buildRequest() { - - WebhookWebhooksOneRequest request = new WebhookWebhooksOneRequest(id, - appId); - - return request; + private WebhookWebhooksOneRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public WebhookWebhooksOneResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new WebhookWebhooksOneOperation( sdkConfiguration, options); - WebhookWebhooksOneRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneResponse.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneResponse.java index ef0a2dc2..3b08cbf7 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksOneResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class WebhookWebhooksOneResponse implements Response { /** * Webhooks */ - private Optional getWebhookResponse; + private GetWebhookResponse getWebhookResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public WebhookWebhooksOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional getWebhookResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(getWebhookResponse, "getWebhookResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable GetWebhookResponse getWebhookResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.getWebhookResponse = getWebhookResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public WebhookWebhooksOneResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Webhooks */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional getWebhookResponse() { - return (Optional) getWebhookResponse; + return Optional.ofNullable(this.getWebhookResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public WebhookWebhooksOneResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public WebhookWebhooksOneResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public WebhookWebhooksOneResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public WebhookWebhooksOneResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Webhooks + * Raw HTTP response; suitable for custom response parsing */ - public WebhookWebhooksOneResponse withGetWebhookResponse(GetWebhookResponse getWebhookResponse) { - Utils.checkNotNull(getWebhookResponse, "getWebhookResponse"); - this.getWebhookResponse = Optional.ofNullable(getWebhookResponse); + public WebhookWebhooksOneResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public WebhookWebhooksOneResponse withGetWebhookResponse(GetWebhookResponse getW /** * Webhooks */ - public WebhookWebhooksOneResponse withGetWebhookResponse(Optional getWebhookResponse) { - Utils.checkNotNull(getWebhookResponse, "getWebhookResponse"); + public WebhookWebhooksOneResponse withGetWebhookResponse(@Nullable GetWebhookResponse getWebhookResponse) { this.getWebhookResponse = getWebhookResponse; return this; } - /** - * Unexpected error - */ - public WebhookWebhooksOneResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public WebhookWebhooksOneResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public WebhookWebhooksOneResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional getWebhookResponse = Optional.empty(); + private GetWebhookResponse getWebhookResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Webhooks - */ - public Builder getWebhookResponse(GetWebhookResponse getWebhookResponse) { - Utils.checkNotNull(getWebhookResponse, "getWebhookResponse"); - this.getWebhookResponse = Optional.ofNullable(getWebhookResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Webhooks */ - public Builder getWebhookResponse(Optional getWebhookResponse) { - Utils.checkNotNull(getWebhookResponse, "getWebhookResponse"); + public Builder getWebhookResponse(@Nullable GetWebhookResponse getWebhookResponse) { this.getWebhookResponse = getWebhookResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public WebhookWebhooksOneResponse build() { - return new WebhookWebhooksOneResponse( contentType, statusCode, rawResponse, getWebhookResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateRequest.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateRequest.java index f2f20c6a..706ebe7a 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateRequest.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateRequest.java @@ -7,7 +7,8 @@ import com.apideck.unify.utils.SpeakeasyMetadata; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Override; import java.lang.String; import java.util.Optional; @@ -24,7 +25,7 @@ public class WebhookWebhooksUpdateRequest { * The ID of your Unify application */ @SpeakeasyMetadata("header:style=simple,explode=false,name=x-apideck-app-id") - private Optional appId; + private String appId; @SpeakeasyMetadata("request:mediaType=application/json") @@ -32,42 +33,38 @@ public class WebhookWebhooksUpdateRequest { @JsonCreator public WebhookWebhooksUpdateRequest( - String id, - Optional appId, - UpdateWebhookRequest updateWebhookRequest) { - Utils.checkNotNull(id, "id"); - Utils.checkNotNull(appId, "appId"); - Utils.checkNotNull(updateWebhookRequest, "updateWebhookRequest"); - this.id = id; + @Nonnull String id, + @Nullable String appId, + @Nonnull UpdateWebhookRequest updateWebhookRequest) { + this.id = Optional.ofNullable(id) + .orElseThrow(() -> new IllegalArgumentException("id cannot be null")); this.appId = appId; - this.updateWebhookRequest = updateWebhookRequest; + this.updateWebhookRequest = Optional.ofNullable(updateWebhookRequest) + .orElseThrow(() -> new IllegalArgumentException("updateWebhookRequest cannot be null")); } public WebhookWebhooksUpdateRequest( - String id, - UpdateWebhookRequest updateWebhookRequest) { - this(id, Optional.empty(), updateWebhookRequest); + @Nonnull String id, + @Nonnull UpdateWebhookRequest updateWebhookRequest) { + this(id, null, updateWebhookRequest); } /** * JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. */ - @JsonIgnore public String id() { - return id; + return this.id; } /** * The ID of your Unify application */ - @JsonIgnore public Optional appId() { - return appId; + return Optional.ofNullable(this.appId); } - @JsonIgnore public UpdateWebhookRequest updateWebhookRequest() { - return updateWebhookRequest; + return this.updateWebhookRequest; } public static Builder builder() { @@ -78,18 +75,8 @@ public static Builder builder() { /** * JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. */ - public WebhookWebhooksUpdateRequest withId(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - /** - * The ID of your Unify application - */ - public WebhookWebhooksUpdateRequest withAppId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); + public WebhookWebhooksUpdateRequest withId(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } @@ -97,18 +84,18 @@ public WebhookWebhooksUpdateRequest withAppId(String appId) { /** * The ID of your Unify application */ - public WebhookWebhooksUpdateRequest withAppId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public WebhookWebhooksUpdateRequest withAppId(@Nullable String appId) { this.appId = appId; return this; } - public WebhookWebhooksUpdateRequest withUpdateWebhookRequest(UpdateWebhookRequest updateWebhookRequest) { - Utils.checkNotNull(updateWebhookRequest, "updateWebhookRequest"); - this.updateWebhookRequest = updateWebhookRequest; + + public WebhookWebhooksUpdateRequest withUpdateWebhookRequest(@Nonnull UpdateWebhookRequest updateWebhookRequest) { + this.updateWebhookRequest = Utils.checkNotNull(updateWebhookRequest, "updateWebhookRequest"); return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -143,7 +130,7 @@ public final static class Builder { private String id; - private Optional appId = Optional.empty(); + private String appId; private UpdateWebhookRequest updateWebhookRequest; @@ -151,44 +138,28 @@ private Builder() { // force use of static builder() method } - /** * JWT Webhook token that represents the unifiedApi and applicationId associated to the event source. */ - public Builder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; + public Builder id(@Nonnull String id) { + this.id = Utils.checkNotNull(id, "id"); return this; } - /** * The ID of your Unify application */ - public Builder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.ofNullable(appId); - return this; - } - - /** - * The ID of your Unify application - */ - public Builder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); + public Builder appId(@Nullable String appId) { this.appId = appId; return this; } - - public Builder updateWebhookRequest(UpdateWebhookRequest updateWebhookRequest) { - Utils.checkNotNull(updateWebhookRequest, "updateWebhookRequest"); - this.updateWebhookRequest = updateWebhookRequest; + public Builder updateWebhookRequest(@Nonnull UpdateWebhookRequest updateWebhookRequest) { + this.updateWebhookRequest = Utils.checkNotNull(updateWebhookRequest, "updateWebhookRequest"); return this; } public WebhookWebhooksUpdateRequest build() { - return new WebhookWebhooksUpdateRequest( id, appId, updateWebhookRequest); } diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateRequestBuilder.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateRequestBuilder.java index 3aca955a..e7519bb3 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateRequestBuilder.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateRequestBuilder.java @@ -11,79 +11,65 @@ import com.apideck.unify.utils.Options; import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.lang.Exception; import java.lang.String; -import java.util.Optional; public class WebhookWebhooksUpdateRequestBuilder { - - private String id; - private Optional appId = Optional.empty(); - private UpdateWebhookRequest updateWebhookRequest; - private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; + private final WebhookWebhooksUpdateRequest.Builder pojoBuilder; + private WebhookWebhooksUpdateRequest request; + private final Options.Builder optionsBuilder; + private boolean _setterCalled; public WebhookWebhooksUpdateRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; + this.pojoBuilder = WebhookWebhooksUpdateRequest.builder(); + this.optionsBuilder = Options.builder(); } - public WebhookWebhooksUpdateRequestBuilder id(String id) { - Utils.checkNotNull(id, "id"); - this.id = id; - return this; - } - - public WebhookWebhooksUpdateRequestBuilder appId(String appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = Optional.of(appId); + public WebhookWebhooksUpdateRequestBuilder id(@Nonnull String id) { + this.pojoBuilder.id(id); + this._setterCalled = true; return this; } - public WebhookWebhooksUpdateRequestBuilder appId(Optional appId) { - Utils.checkNotNull(appId, "appId"); - this.appId = appId; + public WebhookWebhooksUpdateRequestBuilder appId(@Nullable String appId) { + this.pojoBuilder.appId(appId); + this._setterCalled = true; return this; } - public WebhookWebhooksUpdateRequestBuilder updateWebhookRequest(UpdateWebhookRequest updateWebhookRequest) { - Utils.checkNotNull(updateWebhookRequest, "updateWebhookRequest"); - this.updateWebhookRequest = updateWebhookRequest; - return this; - } - - public WebhookWebhooksUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = Optional.of(retryConfig); + public WebhookWebhooksUpdateRequestBuilder updateWebhookRequest(@Nonnull UpdateWebhookRequest updateWebhookRequest) { + this.pojoBuilder.updateWebhookRequest(updateWebhookRequest); + this._setterCalled = true; return this; } - public WebhookWebhooksUpdateRequestBuilder retryConfig(Optional retryConfig) { - Utils.checkNotNull(retryConfig, "retryConfig"); - this.retryConfig = retryConfig; + public WebhookWebhooksUpdateRequestBuilder retryConfig(RetryConfig retryConfig) { + this.optionsBuilder.retryConfig(retryConfig); return this; } - - private WebhookWebhooksUpdateRequest buildRequest() { - - WebhookWebhooksUpdateRequest request = new WebhookWebhooksUpdateRequest(id, - appId, - updateWebhookRequest); - - return request; + private WebhookWebhooksUpdateRequest _buildRequest() { + if (this._setterCalled) { + this.request = this.pojoBuilder.build(); + } + return this.request; } - + /** + * Executes the request and returns the response. + * + * @return The response from the server. + */ public WebhookWebhooksUpdateResponse call() throws Exception { - Optional options = Optional.of(Options.builder() - .retryConfig(retryConfig) - .build()); - + Options options = optionsBuilder.build(); RequestOperation operation = new WebhookWebhooksUpdateOperation( sdkConfiguration, options); - WebhookWebhooksUpdateRequest request = buildRequest(); - return operation.handleResponse(operation.doRequest(request)); + return operation.handleResponse(operation.doRequest(this._buildRequest())); } } diff --git a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateResponse.java b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateResponse.java index ae5b31f6..459163c2 100644 --- a/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateResponse.java +++ b/src/main/java/com/apideck/unify/models/operations/WebhookWebhooksUpdateResponse.java @@ -8,12 +8,11 @@ import com.apideck.unify.utils.Response; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; -import java.lang.Integer; import java.lang.Override; import java.lang.String; -import java.lang.SuppressWarnings; import java.net.http.HttpResponse; import java.util.Optional; @@ -37,80 +36,70 @@ public class WebhookWebhooksUpdateResponse implements Response { /** * Webhooks */ - private Optional updateWebhookResponse; + private UpdateWebhookResponse updateWebhookResponse; /** * Unexpected error */ - private Optional unexpectedErrorResponse; + private UnexpectedErrorResponse unexpectedErrorResponse; @JsonCreator public WebhookWebhooksUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse, - Optional updateWebhookResponse, - Optional unexpectedErrorResponse) { - Utils.checkNotNull(contentType, "contentType"); - Utils.checkNotNull(statusCode, "statusCode"); - Utils.checkNotNull(rawResponse, "rawResponse"); - Utils.checkNotNull(updateWebhookResponse, "updateWebhookResponse"); - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.contentType = contentType; + @Nonnull HttpResponse rawResponse, + @Nullable UpdateWebhookResponse updateWebhookResponse, + @Nullable UnexpectedErrorResponse unexpectedErrorResponse) { + this.contentType = Optional.ofNullable(contentType) + .orElseThrow(() -> new IllegalArgumentException("contentType cannot be null")); this.statusCode = statusCode; - this.rawResponse = rawResponse; + this.rawResponse = Optional.ofNullable(rawResponse) + .orElseThrow(() -> new IllegalArgumentException("rawResponse cannot be null")); this.updateWebhookResponse = updateWebhookResponse; this.unexpectedErrorResponse = unexpectedErrorResponse; } public WebhookWebhooksUpdateResponse( - String contentType, + @Nonnull String contentType, int statusCode, - HttpResponse rawResponse) { + @Nonnull HttpResponse rawResponse) { this(contentType, statusCode, rawResponse, - Optional.empty(), Optional.empty()); + null, null); } /** * HTTP response content type for this operation */ - @JsonIgnore public String contentType() { - return contentType; + return this.contentType; } /** * HTTP response status code for this operation */ - @JsonIgnore public int statusCode() { - return statusCode; + return this.statusCode; } /** * Raw HTTP response; suitable for custom response parsing */ - @JsonIgnore public HttpResponse rawResponse() { - return rawResponse; + return this.rawResponse; } /** * Webhooks */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional updateWebhookResponse() { - return (Optional) updateWebhookResponse; + return Optional.ofNullable(this.updateWebhookResponse); } /** * Unexpected error */ - @SuppressWarnings("unchecked") - @JsonIgnore public Optional unexpectedErrorResponse() { - return (Optional) unexpectedErrorResponse; + return Optional.ofNullable(this.unexpectedErrorResponse); } public static Builder builder() { @@ -121,36 +110,26 @@ public static Builder builder() { /** * HTTP response content type for this operation */ - public WebhookWebhooksUpdateResponse withContentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public WebhookWebhooksUpdateResponse withContentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } + /** * HTTP response status code for this operation */ public WebhookWebhooksUpdateResponse withStatusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** - * Raw HTTP response; suitable for custom response parsing - */ - public WebhookWebhooksUpdateResponse withRawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } /** - * Webhooks + * Raw HTTP response; suitable for custom response parsing */ - public WebhookWebhooksUpdateResponse withUpdateWebhookResponse(UpdateWebhookResponse updateWebhookResponse) { - Utils.checkNotNull(updateWebhookResponse, "updateWebhookResponse"); - this.updateWebhookResponse = Optional.ofNullable(updateWebhookResponse); + public WebhookWebhooksUpdateResponse withRawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } @@ -158,31 +137,21 @@ public WebhookWebhooksUpdateResponse withUpdateWebhookResponse(UpdateWebhookResp /** * Webhooks */ - public WebhookWebhooksUpdateResponse withUpdateWebhookResponse(Optional updateWebhookResponse) { - Utils.checkNotNull(updateWebhookResponse, "updateWebhookResponse"); + public WebhookWebhooksUpdateResponse withUpdateWebhookResponse(@Nullable UpdateWebhookResponse updateWebhookResponse) { this.updateWebhookResponse = updateWebhookResponse; return this; } - /** - * Unexpected error - */ - public WebhookWebhooksUpdateResponse withUnexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public WebhookWebhooksUpdateResponse withUnexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public WebhookWebhooksUpdateResponse withUnexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -222,88 +191,59 @@ public final static class Builder { private String contentType; - private Integer statusCode; + private int statusCode; private HttpResponse rawResponse; - private Optional updateWebhookResponse = Optional.empty(); + private UpdateWebhookResponse updateWebhookResponse; - private Optional unexpectedErrorResponse = Optional.empty(); + private UnexpectedErrorResponse unexpectedErrorResponse; private Builder() { // force use of static builder() method } - /** * HTTP response content type for this operation */ - public Builder contentType(String contentType) { - Utils.checkNotNull(contentType, "contentType"); - this.contentType = contentType; + public Builder contentType(@Nonnull String contentType) { + this.contentType = Utils.checkNotNull(contentType, "contentType"); return this; } - /** * HTTP response status code for this operation */ public Builder statusCode(int statusCode) { - Utils.checkNotNull(statusCode, "statusCode"); this.statusCode = statusCode; return this; } - /** * Raw HTTP response; suitable for custom response parsing */ - public Builder rawResponse(HttpResponse rawResponse) { - Utils.checkNotNull(rawResponse, "rawResponse"); - this.rawResponse = rawResponse; - return this; - } - - - /** - * Webhooks - */ - public Builder updateWebhookResponse(UpdateWebhookResponse updateWebhookResponse) { - Utils.checkNotNull(updateWebhookResponse, "updateWebhookResponse"); - this.updateWebhookResponse = Optional.ofNullable(updateWebhookResponse); + public Builder rawResponse(@Nonnull HttpResponse rawResponse) { + this.rawResponse = Utils.checkNotNull(rawResponse, "rawResponse"); return this; } /** * Webhooks */ - public Builder updateWebhookResponse(Optional updateWebhookResponse) { - Utils.checkNotNull(updateWebhookResponse, "updateWebhookResponse"); + public Builder updateWebhookResponse(@Nullable UpdateWebhookResponse updateWebhookResponse) { this.updateWebhookResponse = updateWebhookResponse; return this; } - - /** - * Unexpected error - */ - public Builder unexpectedErrorResponse(UnexpectedErrorResponse unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); - this.unexpectedErrorResponse = Optional.ofNullable(unexpectedErrorResponse); - return this; - } - /** * Unexpected error */ - public Builder unexpectedErrorResponse(Optional unexpectedErrorResponse) { - Utils.checkNotNull(unexpectedErrorResponse, "unexpectedErrorResponse"); + public Builder unexpectedErrorResponse(@Nullable UnexpectedErrorResponse unexpectedErrorResponse) { this.unexpectedErrorResponse = unexpectedErrorResponse; return this; } public WebhookWebhooksUpdateResponse build() { - return new WebhookWebhooksUpdateResponse( contentType, statusCode, rawResponse, updateWebhookResponse, unexpectedErrorResponse); diff --git a/src/main/java/com/apideck/unify/operations/AccountingAgedCreditorsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingAgedCreditorsOneOperation.java index 5d3dd6ba..8fd26f21 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingAgedCreditorsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingAgedCreditorsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingAgedCreditorsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingAgedCreditorsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingAgedCreditorsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingAgedCreditorsOneRequest req this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingAgedDebtorsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingAgedDebtorsOneOperation.java index 20918368..b16a427d 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingAgedDebtorsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingAgedDebtorsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingAgedDebtorsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingAgedDebtorsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingAgedDebtorsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingAgedDebtorsOneRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingAttachmentsAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingAttachmentsAllOperation.java index 6e6acb12..2ccda6b2 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingAttachmentsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingAttachmentsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingAttachmentsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingAttachmentsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingAttachmentsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingAttachmentsAllRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingAttachmentsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingAttachmentsDeleteOperation.java index c5a5c9b3..8cb3ecd6 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingAttachmentsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingAttachmentsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingAttachmentsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingAttachmentsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingAttachmentsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingAttachmentsDeleteRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingAttachmentsDownloadOperation.java b/src/main/java/com/apideck/unify/operations/AccountingAttachmentsDownloadOperation.java index ad1a502c..47a66412 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingAttachmentsDownloadOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingAttachmentsDownloadOperation.java @@ -28,6 +28,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -42,18 +44,18 @@ public class AccountingAttachmentsDownloadOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingAttachmentsDownloadOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingAttachmentsDownloadRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -78,7 +80,7 @@ public HttpResponse doRequest(AccountingAttachmentsDownloadRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingAttachmentsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingAttachmentsOneOperation.java index 28057fd3..df972a58 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingAttachmentsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingAttachmentsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingAttachmentsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingAttachmentsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingAttachmentsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingAttachmentsOneRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingAttachmentsUploadOperation.java b/src/main/java/com/apideck/unify/operations/AccountingAttachmentsUploadOperation.java index 1f35ebbf..5f53d84e 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingAttachmentsUploadOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingAttachmentsUploadOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -54,13 +56,13 @@ public class AccountingAttachmentsUploadOperation implements RequestOperation serverURL; - private final Optional options; + private final String serverURL; + private final Options options; public AccountingAttachmentsUploadOperation( - SDKConfiguration sdkConfiguration, - Optional serverURL, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable String serverURL, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.serverURL = serverURL; this.options = options; @@ -68,9 +70,9 @@ public AccountingAttachmentsUploadOperation( @Override public HttpResponse doRequest(AccountingAttachmentsUploadRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); - String baseUrl = serverURL + String baseUrl = Optional.ofNullable(serverURL) .filter(u -> !u.isBlank()) .orElse(Utils.templateUrl( ACCOUNTING_ATTACHMENTS_UPLOAD_SERVERS[0], @@ -110,7 +112,7 @@ public HttpResponse doRequest(AccountingAttachmentsUploadRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBalanceSheetOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBalanceSheetOneOperation.java index b2613927..0e0a48f9 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBalanceSheetOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBalanceSheetOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBalanceSheetOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBalanceSheetOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBalanceSheetOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingBalanceSheetOneRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsAddOperation.java index 0a931971..ae15000f 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingBankFeedAccountsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBankFeedAccountsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBankFeedAccountsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingBankFeedAccountsAddRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsAllOperation.java index d0a1798d..775de157 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBankFeedAccountsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBankFeedAccountsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBankFeedAccountsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingBankFeedAccountsAllRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsDeleteOperation.java index 215c00f5..0d9b6676 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBankFeedAccountsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBankFeedAccountsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBankFeedAccountsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingBankFeedAccountsDeleteReque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsOneOperation.java index 22671e47..49073354 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBankFeedAccountsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBankFeedAccountsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBankFeedAccountsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingBankFeedAccountsOneRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsUpdateOperation.java index 662505a0..29f02eaa 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBankFeedAccountsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingBankFeedAccountsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBankFeedAccountsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBankFeedAccountsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingBankFeedAccountsUpdateReque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsAddOperation.java index 96569ee5..516195f6 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingBankFeedStatementsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBankFeedStatementsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBankFeedStatementsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingBankFeedStatementsAddReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsAllOperation.java index c262f50b..6c6fb83b 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBankFeedStatementsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBankFeedStatementsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBankFeedStatementsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingBankFeedStatementsAllReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsDeleteOperation.java index 96a13db8..d835e2cf 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBankFeedStatementsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBankFeedStatementsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBankFeedStatementsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingBankFeedStatementsDeleteReq this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsOneOperation.java index 2029bb3f..02d3528c 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBankFeedStatementsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBankFeedStatementsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBankFeedStatementsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingBankFeedStatementsOneReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsUpdateOperation.java index 0c18c12c..b77c4a67 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBankFeedStatementsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingBankFeedStatementsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBankFeedStatementsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBankFeedStatementsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingBankFeedStatementsUpdateReq this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsAddOperation.java index cde72db0..9af0cdbe 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingBillPaymentsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBillPaymentsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBillPaymentsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingBillPaymentsAddRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsAllOperation.java index a31f353f..2f00e4e9 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBillPaymentsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBillPaymentsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBillPaymentsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingBillPaymentsAllRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsDeleteOperation.java index fa331f20..126e4a62 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBillPaymentsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBillPaymentsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBillPaymentsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingBillPaymentsDeleteRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsOneOperation.java index 812a6cb0..b9e8a5f2 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBillPaymentsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBillPaymentsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBillPaymentsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingBillPaymentsOneRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsUpdateOperation.java index ca0e9d86..b1b46419 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBillPaymentsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingBillPaymentsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBillPaymentsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBillPaymentsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingBillPaymentsUpdateRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBillsAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBillsAddOperation.java index fd0414d0..08388ffa 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBillsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBillsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingBillsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBillsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBillsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingBillsAddRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBillsAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBillsAllOperation.java index 640d982e..9f3e2ba4 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBillsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBillsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBillsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBillsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBillsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingBillsAllRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBillsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBillsDeleteOperation.java index dcaef57a..b984867e 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBillsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBillsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBillsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBillsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBillsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingBillsDeleteRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBillsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBillsOneOperation.java index e4973ec8..816c2729 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBillsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBillsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingBillsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBillsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBillsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingBillsOneRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingBillsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingBillsUpdateOperation.java index ed6fb8f4..04934af8 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingBillsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingBillsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingBillsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingBillsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingBillsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingBillsUpdateRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCategoriesAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCategoriesAllOperation.java index 26e85ec0..e452e593 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCategoriesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCategoriesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingCategoriesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCategoriesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCategoriesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingCategoriesAllRequest reques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCategoriesOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCategoriesOneOperation.java index 570c6569..6b8f9df2 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCategoriesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCategoriesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingCategoriesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCategoriesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCategoriesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingCategoriesOneRequest reques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCompanyInfoOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCompanyInfoOneOperation.java index 69c6dd9c..5dd291cf 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCompanyInfoOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCompanyInfoOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingCompanyInfoOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCompanyInfoOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCompanyInfoOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingCompanyInfoOneRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCreditNotesAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCreditNotesAddOperation.java index a275ddf4..c11779ab 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCreditNotesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCreditNotesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingCreditNotesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCreditNotesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCreditNotesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingCreditNotesAddRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCreditNotesAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCreditNotesAllOperation.java index b9ebf3e8..4e82edcd 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCreditNotesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCreditNotesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingCreditNotesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCreditNotesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCreditNotesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingCreditNotesAllRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCreditNotesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCreditNotesDeleteOperation.java index 8bd43ff7..9eac940c 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCreditNotesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCreditNotesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingCreditNotesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCreditNotesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCreditNotesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingCreditNotesDeleteRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCreditNotesOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCreditNotesOneOperation.java index b8939789..4aaa02ef 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCreditNotesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCreditNotesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingCreditNotesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCreditNotesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCreditNotesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingCreditNotesOneRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCreditNotesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCreditNotesUpdateOperation.java index f7985ab0..2e041461 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCreditNotesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCreditNotesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingCreditNotesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCreditNotesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCreditNotesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingCreditNotesUpdateRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCustomersAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCustomersAddOperation.java index 1eeec293..dd613bde 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCustomersAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCustomersAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingCustomersAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCustomersAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCustomersAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingCustomersAddRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCustomersAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCustomersAllOperation.java index 9ad2122e..4e3ccfba 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCustomersAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCustomersAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingCustomersAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCustomersAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCustomersAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingCustomersAllRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCustomersDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCustomersDeleteOperation.java index cc7023a2..44d428dc 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCustomersDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCustomersDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingCustomersDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCustomersDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCustomersDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingCustomersDeleteRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCustomersOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCustomersOneOperation.java index bea80d7e..510242a7 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCustomersOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCustomersOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingCustomersOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCustomersOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCustomersOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingCustomersOneRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingCustomersUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingCustomersUpdateOperation.java index 9a86a248..88ae1e3f 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingCustomersUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingCustomersUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingCustomersUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingCustomersUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingCustomersUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingCustomersUpdateRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingDepartmentsAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingDepartmentsAddOperation.java index 4a4bf9c3..00a9bfaf 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingDepartmentsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingDepartmentsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingDepartmentsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingDepartmentsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingDepartmentsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingDepartmentsAddRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingDepartmentsAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingDepartmentsAllOperation.java index 5a8e1172..008d5401 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingDepartmentsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingDepartmentsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingDepartmentsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingDepartmentsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingDepartmentsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingDepartmentsAllRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingDepartmentsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingDepartmentsDeleteOperation.java index c5c51f18..7f58e70c 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingDepartmentsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingDepartmentsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingDepartmentsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingDepartmentsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingDepartmentsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingDepartmentsDeleteRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingDepartmentsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingDepartmentsOneOperation.java index cf103a45..de4afa7e 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingDepartmentsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingDepartmentsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingDepartmentsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingDepartmentsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingDepartmentsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingDepartmentsOneRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingDepartmentsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingDepartmentsUpdateOperation.java index 20e5abc8..2a942ff3 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingDepartmentsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingDepartmentsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingDepartmentsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingDepartmentsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingDepartmentsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingDepartmentsUpdateRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpensesAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingExpensesAddOperation.java index a06a43b3..652aceba 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingExpensesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingExpensesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingExpensesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingExpensesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingExpensesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingExpensesAddRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpensesAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingExpensesAllOperation.java index c7fd6463..d4370c29 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingExpensesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingExpensesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingExpensesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingExpensesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingExpensesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingExpensesAllRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpensesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingExpensesDeleteOperation.java index f9716826..9798cb99 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingExpensesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingExpensesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingExpensesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingExpensesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingExpensesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingExpensesDeleteRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpensesOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingExpensesOneOperation.java index 8614a2de..31b6f695 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingExpensesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingExpensesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingExpensesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingExpensesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingExpensesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingExpensesOneRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingExpensesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingExpensesUpdateOperation.java index d5e46f96..2e6df164 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingExpensesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingExpensesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingExpensesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingExpensesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingExpensesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingExpensesUpdateRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsAddOperation.java index 04b73ca3..7fc03a6c 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingInvoiceItemsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingInvoiceItemsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingInvoiceItemsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingInvoiceItemsAddRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsAllOperation.java index 5716ffcd..675f49cd 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingInvoiceItemsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingInvoiceItemsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingInvoiceItemsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingInvoiceItemsAllRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsDeleteOperation.java index bd9b0615..61baacf1 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingInvoiceItemsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingInvoiceItemsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingInvoiceItemsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingInvoiceItemsDeleteRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsOneOperation.java index 87e6ed09..772155a8 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingInvoiceItemsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingInvoiceItemsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingInvoiceItemsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingInvoiceItemsOneRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsUpdateOperation.java index 5273aaa5..cf5a21f9 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingInvoiceItemsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingInvoiceItemsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingInvoiceItemsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingInvoiceItemsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingInvoiceItemsUpdateRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingInvoicesAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingInvoicesAddOperation.java index 6fbb3aa7..58c0ee19 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingInvoicesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingInvoicesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingInvoicesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingInvoicesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingInvoicesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingInvoicesAddRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingInvoicesAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingInvoicesAllOperation.java index 68dd49e9..09a35d50 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingInvoicesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingInvoicesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingInvoicesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingInvoicesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingInvoicesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingInvoicesAllRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingInvoicesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingInvoicesDeleteOperation.java index f62e5874..11854fba 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingInvoicesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingInvoicesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingInvoicesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingInvoicesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingInvoicesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingInvoicesDeleteRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingInvoicesOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingInvoicesOneOperation.java index 41705411..2d3716df 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingInvoicesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingInvoicesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingInvoicesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingInvoicesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingInvoicesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingInvoicesOneRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingInvoicesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingInvoicesUpdateOperation.java index 9acad973..fa1cb93c 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingInvoicesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingInvoicesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingInvoicesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingInvoicesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingInvoicesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingInvoicesUpdateRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesAddOperation.java index 4f3ebe8f..0ad0576d 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingJournalEntriesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingJournalEntriesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingJournalEntriesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingJournalEntriesAddRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesAllOperation.java index 01e23964..a5187c7f 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingJournalEntriesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingJournalEntriesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingJournalEntriesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingJournalEntriesAllRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesDeleteOperation.java index 883661b3..35f48085 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingJournalEntriesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingJournalEntriesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingJournalEntriesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingJournalEntriesDeleteRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesOneOperation.java index 6a3a920e..3f825138 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingJournalEntriesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingJournalEntriesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingJournalEntriesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingJournalEntriesOneRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesUpdateOperation.java index e9c6ed5c..43d611ef 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingJournalEntriesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingJournalEntriesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingJournalEntriesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingJournalEntriesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingJournalEntriesUpdateRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsAddOperation.java index 85106e9c..d945b2cb 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingLedgerAccountsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingLedgerAccountsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingLedgerAccountsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingLedgerAccountsAddRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsAllOperation.java index 6825bb4e..81acbabd 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingLedgerAccountsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingLedgerAccountsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingLedgerAccountsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingLedgerAccountsAllRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsDeleteOperation.java index bd7677bb..07fbea91 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingLedgerAccountsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingLedgerAccountsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingLedgerAccountsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingLedgerAccountsDeleteRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsOneOperation.java index 392b5f0e..09209127 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingLedgerAccountsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingLedgerAccountsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingLedgerAccountsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingLedgerAccountsOneRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsUpdateOperation.java index a09a338d..13bf7381 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingLedgerAccountsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingLedgerAccountsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingLedgerAccountsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingLedgerAccountsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingLedgerAccountsUpdateRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingLocationsAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingLocationsAddOperation.java index bc0031df..80471027 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingLocationsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingLocationsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingLocationsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingLocationsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingLocationsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingLocationsAddRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingLocationsAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingLocationsAllOperation.java index 309d266d..9ec8268e 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingLocationsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingLocationsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingLocationsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingLocationsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingLocationsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingLocationsAllRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingLocationsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingLocationsDeleteOperation.java index 2fb0cdf9..11ac923c 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingLocationsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingLocationsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingLocationsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingLocationsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingLocationsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingLocationsDeleteRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingLocationsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingLocationsOneOperation.java index 973a0bb8..b4bd8ea5 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingLocationsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingLocationsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingLocationsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingLocationsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingLocationsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingLocationsOneRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingLocationsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingLocationsUpdateOperation.java index f10a564f..5de994f3 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingLocationsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingLocationsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingLocationsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingLocationsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingLocationsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingLocationsUpdateRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingPaymentsAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingPaymentsAddOperation.java index 549d44d8..557546bb 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingPaymentsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingPaymentsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingPaymentsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingPaymentsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingPaymentsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingPaymentsAddRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingPaymentsAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingPaymentsAllOperation.java index 382d4cab..ad5083cc 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingPaymentsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingPaymentsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingPaymentsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingPaymentsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingPaymentsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingPaymentsAllRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingPaymentsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingPaymentsDeleteOperation.java index c6b470e1..428dddbf 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingPaymentsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingPaymentsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingPaymentsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingPaymentsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingPaymentsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingPaymentsDeleteRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingPaymentsOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingPaymentsOneOperation.java index 1a293c75..d665a8de 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingPaymentsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingPaymentsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingPaymentsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingPaymentsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingPaymentsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingPaymentsOneRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingPaymentsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingPaymentsUpdateOperation.java index b3993b7b..78678b97 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingPaymentsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingPaymentsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingPaymentsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingPaymentsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingPaymentsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingPaymentsUpdateRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingProfitAndLossOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingProfitAndLossOneOperation.java index 942d0d0d..c03c9c92 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingProfitAndLossOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingProfitAndLossOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingProfitAndLossOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingProfitAndLossOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingProfitAndLossOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingProfitAndLossOneRequest req this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersAddOperation.java index 7a13f780..4be79966 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingPurchaseOrdersAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingPurchaseOrdersAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingPurchaseOrdersAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingPurchaseOrdersAddRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersAllOperation.java index 015088a6..61e4d443 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingPurchaseOrdersAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingPurchaseOrdersAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingPurchaseOrdersAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingPurchaseOrdersAllRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersDeleteOperation.java index d74e94fe..d0ea812b 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingPurchaseOrdersDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingPurchaseOrdersDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingPurchaseOrdersDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingPurchaseOrdersDeleteRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersOneOperation.java index 15095cbd..bfc076d3 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingPurchaseOrdersOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingPurchaseOrdersOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingPurchaseOrdersOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingPurchaseOrdersOneRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersUpdateOperation.java index e63d0f3a..7a493fcb 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingPurchaseOrdersUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingPurchaseOrdersUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingPurchaseOrdersUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingPurchaseOrdersUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingPurchaseOrdersUpdateRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesAddOperation.java index afa7b2e5..8f81b2ad 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingSubsidiariesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingSubsidiariesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingSubsidiariesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingSubsidiariesAddRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesAllOperation.java index 0520c17f..e9db8a70 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingSubsidiariesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingSubsidiariesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingSubsidiariesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingSubsidiariesAllRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesDeleteOperation.java index 0912c175..47e1fed5 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingSubsidiariesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingSubsidiariesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingSubsidiariesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingSubsidiariesDeleteRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesOneOperation.java index 57ee0358..c0f11ece 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingSubsidiariesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingSubsidiariesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingSubsidiariesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingSubsidiariesOneRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesUpdateOperation.java index d50931aa..215435e3 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingSubsidiariesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingSubsidiariesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingSubsidiariesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingSubsidiariesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingSubsidiariesUpdateRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingSuppliersAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingSuppliersAddOperation.java index 1ffed384..0f2eaec0 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingSuppliersAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingSuppliersAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingSuppliersAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingSuppliersAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingSuppliersAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingSuppliersAddRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingSuppliersAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingSuppliersAllOperation.java index b72d73e7..8395ca04 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingSuppliersAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingSuppliersAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingSuppliersAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingSuppliersAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingSuppliersAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingSuppliersAllRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingSuppliersDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingSuppliersDeleteOperation.java index 1497f476..5692e749 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingSuppliersDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingSuppliersDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingSuppliersDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingSuppliersDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingSuppliersDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingSuppliersDeleteRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingSuppliersOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingSuppliersOneOperation.java index 0811e5b3..d89c8a20 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingSuppliersOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingSuppliersOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingSuppliersOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingSuppliersOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingSuppliersOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingSuppliersOneRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingSuppliersUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingSuppliersUpdateOperation.java index 6071ab09..2f75f641 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingSuppliersUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingSuppliersUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingSuppliersUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingSuppliersUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingSuppliersUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingSuppliersUpdateRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingTaxRatesAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingTaxRatesAddOperation.java index 4ec31ba0..60898487 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingTaxRatesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingTaxRatesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingTaxRatesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingTaxRatesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingTaxRatesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingTaxRatesAddRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingTaxRatesAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingTaxRatesAllOperation.java index aee68e4d..f15e3b10 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingTaxRatesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingTaxRatesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingTaxRatesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingTaxRatesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingTaxRatesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingTaxRatesAllRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingTaxRatesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingTaxRatesDeleteOperation.java index c8ddff98..f68243ae 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingTaxRatesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingTaxRatesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingTaxRatesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingTaxRatesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingTaxRatesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingTaxRatesDeleteRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingTaxRatesOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingTaxRatesOneOperation.java index 51839c62..8c81e17f 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingTaxRatesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingTaxRatesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingTaxRatesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingTaxRatesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingTaxRatesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingTaxRatesOneRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingTaxRatesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingTaxRatesUpdateOperation.java index a5bb9bf5..06631f24 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingTaxRatesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingTaxRatesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingTaxRatesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingTaxRatesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingTaxRatesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingTaxRatesUpdateRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesAddOperation.java b/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesAddOperation.java index cb586a61..97330eb1 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingTrackingCategoriesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingTrackingCategoriesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingTrackingCategoriesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AccountingTrackingCategoriesAddReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesAllOperation.java b/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesAllOperation.java index dbea746c..1f7fe23e 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingTrackingCategoriesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingTrackingCategoriesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingTrackingCategoriesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AccountingTrackingCategoriesAllReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesDeleteOperation.java index 93d0e8f3..3867ea95 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingTrackingCategoriesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingTrackingCategoriesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingTrackingCategoriesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingTrackingCategoriesDeleteReq this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesOneOperation.java b/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesOneOperation.java index 6c4daf00..479abd16 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AccountingTrackingCategoriesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingTrackingCategoriesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingTrackingCategoriesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AccountingTrackingCategoriesOneReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesUpdateOperation.java index fbb1624e..56d87c5c 100644 --- a/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AccountingTrackingCategoriesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AccountingTrackingCategoriesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AccountingTrackingCategoriesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AccountingTrackingCategoriesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AccountingTrackingCategoriesUpdateReq this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsApplicantsAddOperation.java b/src/main/java/com/apideck/unify/operations/AtsApplicantsAddOperation.java index 3777a60c..b7e896b2 100644 --- a/src/main/java/com/apideck/unify/operations/AtsApplicantsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsApplicantsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AtsApplicantsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsApplicantsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsApplicantsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AtsApplicantsAddRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsApplicantsAllOperation.java b/src/main/java/com/apideck/unify/operations/AtsApplicantsAllOperation.java index 305ad074..3a74920e 100644 --- a/src/main/java/com/apideck/unify/operations/AtsApplicantsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsApplicantsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AtsApplicantsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsApplicantsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsApplicantsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AtsApplicantsAllRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsApplicantsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AtsApplicantsDeleteOperation.java index 6d5d8378..d35b071d 100644 --- a/src/main/java/com/apideck/unify/operations/AtsApplicantsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsApplicantsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AtsApplicantsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsApplicantsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsApplicantsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AtsApplicantsDeleteRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsApplicantsOneOperation.java b/src/main/java/com/apideck/unify/operations/AtsApplicantsOneOperation.java index 21c3c912..655bfbf1 100644 --- a/src/main/java/com/apideck/unify/operations/AtsApplicantsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsApplicantsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AtsApplicantsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsApplicantsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsApplicantsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AtsApplicantsOneRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsApplicantsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AtsApplicantsUpdateOperation.java index 8651b514..40432331 100644 --- a/src/main/java/com/apideck/unify/operations/AtsApplicantsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsApplicantsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AtsApplicantsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsApplicantsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsApplicantsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AtsApplicantsUpdateRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsApplicationsAddOperation.java b/src/main/java/com/apideck/unify/operations/AtsApplicationsAddOperation.java index 6339c7b8..4f23d94f 100644 --- a/src/main/java/com/apideck/unify/operations/AtsApplicationsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsApplicationsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AtsApplicationsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsApplicationsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsApplicationsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(AtsApplicationsAddRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsApplicationsAllOperation.java b/src/main/java/com/apideck/unify/operations/AtsApplicationsAllOperation.java index db21d0b2..c7779440 100644 --- a/src/main/java/com/apideck/unify/operations/AtsApplicationsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsApplicationsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AtsApplicationsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsApplicationsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsApplicationsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AtsApplicationsAllRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsApplicationsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/AtsApplicationsDeleteOperation.java index 48320b49..1acc288b 100644 --- a/src/main/java/com/apideck/unify/operations/AtsApplicationsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsApplicationsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AtsApplicationsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsApplicationsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsApplicationsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AtsApplicationsDeleteRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsApplicationsOneOperation.java b/src/main/java/com/apideck/unify/operations/AtsApplicationsOneOperation.java index 1b908d74..ad28ddc3 100644 --- a/src/main/java/com/apideck/unify/operations/AtsApplicationsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsApplicationsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AtsApplicationsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsApplicationsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsApplicationsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AtsApplicationsOneRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsApplicationsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/AtsApplicationsUpdateOperation.java index 54400d5e..d74e7b6b 100644 --- a/src/main/java/com/apideck/unify/operations/AtsApplicationsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsApplicationsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class AtsApplicationsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsApplicationsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsApplicationsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(AtsApplicationsUpdateRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsJobsAllOperation.java b/src/main/java/com/apideck/unify/operations/AtsJobsAllOperation.java index 8cff2611..d1943b0b 100644 --- a/src/main/java/com/apideck/unify/operations/AtsJobsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsJobsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AtsJobsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsJobsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsJobsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(AtsJobsAllRequest request) throws Exc this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/AtsJobsOneOperation.java b/src/main/java/com/apideck/unify/operations/AtsJobsOneOperation.java index 52da5b2b..edc206d1 100644 --- a/src/main/java/com/apideck/unify/operations/AtsJobsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/AtsJobsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class AtsJobsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public AtsJobsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(AtsJobsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(AtsJobsOneRequest request) throws Exc this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/ConnectorApiResourceCoverageOneOperation.java b/src/main/java/com/apideck/unify/operations/ConnectorApiResourceCoverageOneOperation.java index a7a9b79f..a535916e 100644 --- a/src/main/java/com/apideck/unify/operations/ConnectorApiResourceCoverageOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/ConnectorApiResourceCoverageOneOperation.java @@ -27,6 +27,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -41,18 +43,18 @@ public class ConnectorApiResourceCoverageOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public ConnectorApiResourceCoverageOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(ConnectorApiResourceCoverageOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -72,7 +74,7 @@ public HttpResponse doRequest(ConnectorApiResourceCoverageOneReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/ConnectorApiResourcesOneOperation.java b/src/main/java/com/apideck/unify/operations/ConnectorApiResourcesOneOperation.java index 3e7becd1..9b7e53f0 100644 --- a/src/main/java/com/apideck/unify/operations/ConnectorApiResourcesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/ConnectorApiResourcesOneOperation.java @@ -27,6 +27,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -41,18 +43,18 @@ public class ConnectorApiResourcesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public ConnectorApiResourcesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(ConnectorApiResourcesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -72,7 +74,7 @@ public HttpResponse doRequest(ConnectorApiResourcesOneRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/ConnectorApisAllOperation.java b/src/main/java/com/apideck/unify/operations/ConnectorApisAllOperation.java index c3bcae6c..0bfa73ce 100644 --- a/src/main/java/com/apideck/unify/operations/ConnectorApisAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/ConnectorApisAllOperation.java @@ -27,6 +27,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -41,18 +43,18 @@ public class ConnectorApisAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public ConnectorApisAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(ConnectorApisAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -75,7 +77,7 @@ public HttpResponse doRequest(ConnectorApisAllRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/ConnectorApisOneOperation.java b/src/main/java/com/apideck/unify/operations/ConnectorApisOneOperation.java index a65d8d45..f83d942b 100644 --- a/src/main/java/com/apideck/unify/operations/ConnectorApisOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/ConnectorApisOneOperation.java @@ -27,6 +27,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -41,18 +43,18 @@ public class ConnectorApisOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public ConnectorApisOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(ConnectorApisOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -72,7 +74,7 @@ public HttpResponse doRequest(ConnectorApisOneRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/ConnectorConnectorDocsOneOperation.java b/src/main/java/com/apideck/unify/operations/ConnectorConnectorDocsOneOperation.java index 534776cb..c4edc313 100644 --- a/src/main/java/com/apideck/unify/operations/ConnectorConnectorDocsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/ConnectorConnectorDocsOneOperation.java @@ -26,6 +26,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -40,18 +42,18 @@ public class ConnectorConnectorDocsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public ConnectorConnectorDocsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(ConnectorConnectorDocsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -71,7 +73,7 @@ public HttpResponse doRequest(ConnectorConnectorDocsOneRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/ConnectorConnectorResourcesOneOperation.java b/src/main/java/com/apideck/unify/operations/ConnectorConnectorResourcesOneOperation.java index 03127cc6..23ba731c 100644 --- a/src/main/java/com/apideck/unify/operations/ConnectorConnectorResourcesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/ConnectorConnectorResourcesOneOperation.java @@ -27,6 +27,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -41,18 +43,18 @@ public class ConnectorConnectorResourcesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public ConnectorConnectorResourcesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(ConnectorConnectorResourcesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(ConnectorConnectorResourcesOneRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/ConnectorConnectorsAllOperation.java b/src/main/java/com/apideck/unify/operations/ConnectorConnectorsAllOperation.java index 2df53b1a..a62cb106 100644 --- a/src/main/java/com/apideck/unify/operations/ConnectorConnectorsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/ConnectorConnectorsAllOperation.java @@ -27,6 +27,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -41,18 +43,18 @@ public class ConnectorConnectorsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public ConnectorConnectorsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(ConnectorConnectorsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -75,7 +77,7 @@ public HttpResponse doRequest(ConnectorConnectorsAllRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/ConnectorConnectorsOneOperation.java b/src/main/java/com/apideck/unify/operations/ConnectorConnectorsOneOperation.java index ac292b04..94c6a65b 100644 --- a/src/main/java/com/apideck/unify/operations/ConnectorConnectorsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/ConnectorConnectorsOneOperation.java @@ -27,6 +27,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -41,18 +43,18 @@ public class ConnectorConnectorsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public ConnectorConnectorsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(ConnectorConnectorsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -72,7 +74,7 @@ public HttpResponse doRequest(ConnectorConnectorsOneRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmActivitiesAddOperation.java b/src/main/java/com/apideck/unify/operations/CrmActivitiesAddOperation.java index 16786976..8fc44428 100644 --- a/src/main/java/com/apideck/unify/operations/CrmActivitiesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmActivitiesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmActivitiesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmActivitiesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmActivitiesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(CrmActivitiesAddRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmActivitiesAllOperation.java b/src/main/java/com/apideck/unify/operations/CrmActivitiesAllOperation.java index 507f4080..fa088230 100644 --- a/src/main/java/com/apideck/unify/operations/CrmActivitiesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmActivitiesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmActivitiesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmActivitiesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmActivitiesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(CrmActivitiesAllRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmActivitiesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/CrmActivitiesDeleteOperation.java index 37fbc110..d5b76498 100644 --- a/src/main/java/com/apideck/unify/operations/CrmActivitiesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmActivitiesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmActivitiesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmActivitiesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmActivitiesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmActivitiesDeleteRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmActivitiesOneOperation.java b/src/main/java/com/apideck/unify/operations/CrmActivitiesOneOperation.java index f97a180f..843fb5a5 100644 --- a/src/main/java/com/apideck/unify/operations/CrmActivitiesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmActivitiesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmActivitiesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmActivitiesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmActivitiesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmActivitiesOneRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmActivitiesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/CrmActivitiesUpdateOperation.java index fab9fabd..d15ef12e 100644 --- a/src/main/java/com/apideck/unify/operations/CrmActivitiesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmActivitiesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmActivitiesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmActivitiesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmActivitiesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmActivitiesUpdateRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCompaniesAddOperation.java b/src/main/java/com/apideck/unify/operations/CrmCompaniesAddOperation.java index 87be5a04..3d0c5991 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCompaniesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCompaniesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmCompaniesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCompaniesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCompaniesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(CrmCompaniesAddRequest request) throw this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCompaniesAllOperation.java b/src/main/java/com/apideck/unify/operations/CrmCompaniesAllOperation.java index 39061baf..5a338571 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCompaniesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCompaniesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmCompaniesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCompaniesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCompaniesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(CrmCompaniesAllRequest request) throw this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCompaniesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/CrmCompaniesDeleteOperation.java index 655ada3d..32f4d237 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCompaniesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCompaniesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmCompaniesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCompaniesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCompaniesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmCompaniesDeleteRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCompaniesOneOperation.java b/src/main/java/com/apideck/unify/operations/CrmCompaniesOneOperation.java index 84c91ba2..90d09a84 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCompaniesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCompaniesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmCompaniesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCompaniesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCompaniesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmCompaniesOneRequest request) throw this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCompaniesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/CrmCompaniesUpdateOperation.java index 886f14bd..315797db 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCompaniesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCompaniesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmCompaniesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCompaniesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCompaniesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmCompaniesUpdateRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmContactsAddOperation.java b/src/main/java/com/apideck/unify/operations/CrmContactsAddOperation.java index 1796a901..0709e626 100644 --- a/src/main/java/com/apideck/unify/operations/CrmContactsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmContactsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmContactsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmContactsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmContactsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(CrmContactsAddRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmContactsAllOperation.java b/src/main/java/com/apideck/unify/operations/CrmContactsAllOperation.java index 7820c635..8449fcbf 100644 --- a/src/main/java/com/apideck/unify/operations/CrmContactsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmContactsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmContactsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmContactsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmContactsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(CrmContactsAllRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmContactsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/CrmContactsDeleteOperation.java index 7e00dbd7..87ecc2ff 100644 --- a/src/main/java/com/apideck/unify/operations/CrmContactsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmContactsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmContactsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmContactsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmContactsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmContactsDeleteRequest request) thr this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmContactsOneOperation.java b/src/main/java/com/apideck/unify/operations/CrmContactsOneOperation.java index 1b5e7970..1b73c266 100644 --- a/src/main/java/com/apideck/unify/operations/CrmContactsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmContactsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmContactsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmContactsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmContactsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmContactsOneRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmContactsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/CrmContactsUpdateOperation.java index bf3a2a20..0a28feef 100644 --- a/src/main/java/com/apideck/unify/operations/CrmContactsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmContactsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmContactsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmContactsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmContactsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmContactsUpdateRequest request) thr this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasAddOperation.java b/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasAddOperation.java index fe223409..0ba003b0 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmCustomObjectSchemasAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCustomObjectSchemasAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCustomObjectSchemasAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(CrmCustomObjectSchemasAddRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasAllOperation.java b/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasAllOperation.java index 126c7d39..6899d812 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmCustomObjectSchemasAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCustomObjectSchemasAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCustomObjectSchemasAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(CrmCustomObjectSchemasAllRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasDeleteOperation.java b/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasDeleteOperation.java index d1945f8f..78aa8262 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmCustomObjectSchemasDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCustomObjectSchemasDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCustomObjectSchemasDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmCustomObjectSchemasDeleteRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasOneOperation.java b/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasOneOperation.java index 40b2fd41..f789b9f1 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmCustomObjectSchemasOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCustomObjectSchemasOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCustomObjectSchemasOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmCustomObjectSchemasOneRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasUpdateOperation.java b/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasUpdateOperation.java index 0092d628..e2ee8da5 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCustomObjectSchemasUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmCustomObjectSchemasUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCustomObjectSchemasUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCustomObjectSchemasUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmCustomObjectSchemasUpdateRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCustomObjectsAddOperation.java b/src/main/java/com/apideck/unify/operations/CrmCustomObjectsAddOperation.java index 6e40ece6..8bca060f 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCustomObjectsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCustomObjectsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmCustomObjectsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCustomObjectsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCustomObjectsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmCustomObjectsAddRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCustomObjectsAllOperation.java b/src/main/java/com/apideck/unify/operations/CrmCustomObjectsAllOperation.java index e81f794b..8beb24c2 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCustomObjectsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCustomObjectsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmCustomObjectsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCustomObjectsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCustomObjectsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmCustomObjectsAllRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCustomObjectsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/CrmCustomObjectsDeleteOperation.java index 1e1ded9b..99c01877 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCustomObjectsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCustomObjectsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmCustomObjectsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCustomObjectsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCustomObjectsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmCustomObjectsDeleteRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCustomObjectsOneOperation.java b/src/main/java/com/apideck/unify/operations/CrmCustomObjectsOneOperation.java index 7d1b4103..c0324599 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCustomObjectsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCustomObjectsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmCustomObjectsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCustomObjectsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCustomObjectsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmCustomObjectsOneRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmCustomObjectsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/CrmCustomObjectsUpdateOperation.java index fd82b517..01732463 100644 --- a/src/main/java/com/apideck/unify/operations/CrmCustomObjectsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmCustomObjectsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmCustomObjectsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmCustomObjectsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmCustomObjectsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmCustomObjectsUpdateRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmLeadsAddOperation.java b/src/main/java/com/apideck/unify/operations/CrmLeadsAddOperation.java index 9cbf58fe..868b5d37 100644 --- a/src/main/java/com/apideck/unify/operations/CrmLeadsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmLeadsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmLeadsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmLeadsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmLeadsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(CrmLeadsAddRequest request) throws Ex this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmLeadsAllOperation.java b/src/main/java/com/apideck/unify/operations/CrmLeadsAllOperation.java index 42abb1d9..7f37e487 100644 --- a/src/main/java/com/apideck/unify/operations/CrmLeadsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmLeadsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmLeadsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmLeadsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmLeadsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(CrmLeadsAllRequest request) throws Ex this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmLeadsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/CrmLeadsDeleteOperation.java index 648e5547..cd52e62a 100644 --- a/src/main/java/com/apideck/unify/operations/CrmLeadsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmLeadsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmLeadsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmLeadsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmLeadsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmLeadsDeleteRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmLeadsOneOperation.java b/src/main/java/com/apideck/unify/operations/CrmLeadsOneOperation.java index 3596a300..0f621b45 100644 --- a/src/main/java/com/apideck/unify/operations/CrmLeadsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmLeadsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmLeadsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmLeadsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmLeadsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmLeadsOneRequest request) throws Ex this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmLeadsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/CrmLeadsUpdateOperation.java index e5d71b9e..8acc04da 100644 --- a/src/main/java/com/apideck/unify/operations/CrmLeadsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmLeadsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmLeadsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmLeadsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmLeadsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmLeadsUpdateRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmNotesAddOperation.java b/src/main/java/com/apideck/unify/operations/CrmNotesAddOperation.java index 0d246da6..016adb2f 100644 --- a/src/main/java/com/apideck/unify/operations/CrmNotesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmNotesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmNotesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmNotesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmNotesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(CrmNotesAddRequest request) throws Ex this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmNotesAllOperation.java b/src/main/java/com/apideck/unify/operations/CrmNotesAllOperation.java index 0d55863d..ce616edd 100644 --- a/src/main/java/com/apideck/unify/operations/CrmNotesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmNotesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmNotesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmNotesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmNotesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(CrmNotesAllRequest request) throws Ex this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmNotesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/CrmNotesDeleteOperation.java index a8c01496..88ba65c0 100644 --- a/src/main/java/com/apideck/unify/operations/CrmNotesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmNotesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmNotesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmNotesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmNotesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmNotesDeleteRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmNotesOneOperation.java b/src/main/java/com/apideck/unify/operations/CrmNotesOneOperation.java index 5ac5fbcd..dfe186f8 100644 --- a/src/main/java/com/apideck/unify/operations/CrmNotesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmNotesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmNotesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmNotesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmNotesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmNotesOneRequest request) throws Ex this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmNotesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/CrmNotesUpdateOperation.java index b153d548..583131ca 100644 --- a/src/main/java/com/apideck/unify/operations/CrmNotesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmNotesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmNotesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmNotesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmNotesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmNotesUpdateRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmOpportunitiesAddOperation.java b/src/main/java/com/apideck/unify/operations/CrmOpportunitiesAddOperation.java index e6877b83..7d1a556c 100644 --- a/src/main/java/com/apideck/unify/operations/CrmOpportunitiesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmOpportunitiesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmOpportunitiesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmOpportunitiesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmOpportunitiesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(CrmOpportunitiesAddRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmOpportunitiesAllOperation.java b/src/main/java/com/apideck/unify/operations/CrmOpportunitiesAllOperation.java index b8b850f1..25caa6bd 100644 --- a/src/main/java/com/apideck/unify/operations/CrmOpportunitiesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmOpportunitiesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmOpportunitiesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmOpportunitiesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmOpportunitiesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(CrmOpportunitiesAllRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmOpportunitiesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/CrmOpportunitiesDeleteOperation.java index d709413a..e3020e43 100644 --- a/src/main/java/com/apideck/unify/operations/CrmOpportunitiesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmOpportunitiesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmOpportunitiesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmOpportunitiesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmOpportunitiesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmOpportunitiesDeleteRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmOpportunitiesOneOperation.java b/src/main/java/com/apideck/unify/operations/CrmOpportunitiesOneOperation.java index 6cb5b212..dd9b3b74 100644 --- a/src/main/java/com/apideck/unify/operations/CrmOpportunitiesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmOpportunitiesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmOpportunitiesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmOpportunitiesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmOpportunitiesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmOpportunitiesOneRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmOpportunitiesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/CrmOpportunitiesUpdateOperation.java index a0dce9e9..82ccb0a8 100644 --- a/src/main/java/com/apideck/unify/operations/CrmOpportunitiesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmOpportunitiesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmOpportunitiesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmOpportunitiesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmOpportunitiesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmOpportunitiesUpdateRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmPipelinesAddOperation.java b/src/main/java/com/apideck/unify/operations/CrmPipelinesAddOperation.java index 30193cb9..ae89bb45 100644 --- a/src/main/java/com/apideck/unify/operations/CrmPipelinesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmPipelinesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmPipelinesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmPipelinesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmPipelinesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(CrmPipelinesAddRequest request) throw this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmPipelinesAllOperation.java b/src/main/java/com/apideck/unify/operations/CrmPipelinesAllOperation.java index 3c14e458..259a22f2 100644 --- a/src/main/java/com/apideck/unify/operations/CrmPipelinesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmPipelinesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmPipelinesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmPipelinesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmPipelinesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(CrmPipelinesAllRequest request) throw this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmPipelinesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/CrmPipelinesDeleteOperation.java index 5729fe2d..10de8721 100644 --- a/src/main/java/com/apideck/unify/operations/CrmPipelinesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmPipelinesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmPipelinesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmPipelinesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmPipelinesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmPipelinesDeleteRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmPipelinesOneOperation.java b/src/main/java/com/apideck/unify/operations/CrmPipelinesOneOperation.java index c0a0670b..8061d103 100644 --- a/src/main/java/com/apideck/unify/operations/CrmPipelinesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmPipelinesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmPipelinesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmPipelinesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmPipelinesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmPipelinesOneRequest request) throw this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmPipelinesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/CrmPipelinesUpdateOperation.java index 8bb1bdc0..e20140b8 100644 --- a/src/main/java/com/apideck/unify/operations/CrmPipelinesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmPipelinesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmPipelinesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmPipelinesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmPipelinesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmPipelinesUpdateRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmUsersAddOperation.java b/src/main/java/com/apideck/unify/operations/CrmUsersAddOperation.java index 4eac6f8c..93957280 100644 --- a/src/main/java/com/apideck/unify/operations/CrmUsersAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmUsersAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmUsersAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmUsersAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmUsersAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(CrmUsersAddRequest request) throws Ex this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmUsersAllOperation.java b/src/main/java/com/apideck/unify/operations/CrmUsersAllOperation.java index 1711dbf7..92029f35 100644 --- a/src/main/java/com/apideck/unify/operations/CrmUsersAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmUsersAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmUsersAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmUsersAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmUsersAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(CrmUsersAllRequest request) throws Ex this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmUsersDeleteOperation.java b/src/main/java/com/apideck/unify/operations/CrmUsersDeleteOperation.java index c2b00a1d..dde67ddd 100644 --- a/src/main/java/com/apideck/unify/operations/CrmUsersDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmUsersDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmUsersDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmUsersDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmUsersDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmUsersDeleteRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmUsersOneOperation.java b/src/main/java/com/apideck/unify/operations/CrmUsersOneOperation.java index d7a51e6d..5795f552 100644 --- a/src/main/java/com/apideck/unify/operations/CrmUsersOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmUsersOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class CrmUsersOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmUsersOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmUsersOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(CrmUsersOneRequest request) throws Ex this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/CrmUsersUpdateOperation.java b/src/main/java/com/apideck/unify/operations/CrmUsersUpdateOperation.java index 2cffa751..ef7525e3 100644 --- a/src/main/java/com/apideck/unify/operations/CrmUsersUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/CrmUsersUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class CrmUsersUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public CrmUsersUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(CrmUsersUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(CrmUsersUpdateRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/EcommerceCustomersAllOperation.java b/src/main/java/com/apideck/unify/operations/EcommerceCustomersAllOperation.java index 9dc71765..9e521f58 100644 --- a/src/main/java/com/apideck/unify/operations/EcommerceCustomersAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/EcommerceCustomersAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class EcommerceCustomersAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public EcommerceCustomersAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(EcommerceCustomersAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(EcommerceCustomersAllRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/EcommerceCustomersOneOperation.java b/src/main/java/com/apideck/unify/operations/EcommerceCustomersOneOperation.java index 5042f721..df6c08c1 100644 --- a/src/main/java/com/apideck/unify/operations/EcommerceCustomersOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/EcommerceCustomersOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class EcommerceCustomersOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public EcommerceCustomersOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(EcommerceCustomersOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(EcommerceCustomersOneRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/EcommerceOrdersAllOperation.java b/src/main/java/com/apideck/unify/operations/EcommerceOrdersAllOperation.java index bbae912b..6b3dd92b 100644 --- a/src/main/java/com/apideck/unify/operations/EcommerceOrdersAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/EcommerceOrdersAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class EcommerceOrdersAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public EcommerceOrdersAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(EcommerceOrdersAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(EcommerceOrdersAllRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/EcommerceOrdersOneOperation.java b/src/main/java/com/apideck/unify/operations/EcommerceOrdersOneOperation.java index 42f75ddd..b1cd6806 100644 --- a/src/main/java/com/apideck/unify/operations/EcommerceOrdersOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/EcommerceOrdersOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class EcommerceOrdersOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public EcommerceOrdersOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(EcommerceOrdersOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(EcommerceOrdersOneRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/EcommerceProductsAllOperation.java b/src/main/java/com/apideck/unify/operations/EcommerceProductsAllOperation.java index 42680d97..d95a1409 100644 --- a/src/main/java/com/apideck/unify/operations/EcommerceProductsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/EcommerceProductsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class EcommerceProductsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public EcommerceProductsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(EcommerceProductsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(EcommerceProductsAllRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/EcommerceProductsOneOperation.java b/src/main/java/com/apideck/unify/operations/EcommerceProductsOneOperation.java index 06078787..0ff5527c 100644 --- a/src/main/java/com/apideck/unify/operations/EcommerceProductsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/EcommerceProductsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class EcommerceProductsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public EcommerceProductsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(EcommerceProductsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(EcommerceProductsOneRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/EcommerceStoresOneOperation.java b/src/main/java/com/apideck/unify/operations/EcommerceStoresOneOperation.java index 7a8639e2..d1fa80ea 100644 --- a/src/main/java/com/apideck/unify/operations/EcommerceStoresOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/EcommerceStoresOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class EcommerceStoresOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public EcommerceStoresOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(EcommerceStoresOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(EcommerceStoresOneRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsAddOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsAddOperation.java index 119a3ad7..f52eee04 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageDriveGroupsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageDriveGroupsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageDriveGroupsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(FileStorageDriveGroupsAddRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsAllOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsAllOperation.java index 09cf861f..c2030c7f 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageDriveGroupsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageDriveGroupsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageDriveGroupsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(FileStorageDriveGroupsAllRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsDeleteOperation.java index ea470cd6..303a459f 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageDriveGroupsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageDriveGroupsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageDriveGroupsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageDriveGroupsDeleteRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsOneOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsOneOperation.java index 20e34a49..60ca15a7 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageDriveGroupsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageDriveGroupsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageDriveGroupsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageDriveGroupsOneRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsUpdateOperation.java index 4526d588..530020f8 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageDriveGroupsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageDriveGroupsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageDriveGroupsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageDriveGroupsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(FileStorageDriveGroupsUpdateRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageDrivesAddOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageDrivesAddOperation.java index 9aad47e6..b4877433 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageDrivesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageDrivesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageDrivesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageDrivesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageDrivesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(FileStorageDrivesAddRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageDrivesAllOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageDrivesAllOperation.java index b8397d77..f35f2480 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageDrivesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageDrivesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageDrivesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageDrivesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageDrivesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(FileStorageDrivesAllRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageDrivesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageDrivesDeleteOperation.java index 163821a4..71e978ab 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageDrivesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageDrivesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageDrivesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageDrivesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageDrivesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageDrivesDeleteRequest reques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageDrivesOneOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageDrivesOneOperation.java index a4b283f6..6995cc57 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageDrivesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageDrivesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageDrivesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageDrivesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageDrivesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageDrivesOneRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageDrivesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageDrivesUpdateOperation.java index 350c8011..d0cdc8f4 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageDrivesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageDrivesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageDrivesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageDrivesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageDrivesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(FileStorageDrivesUpdateRequest reques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFilesAllOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFilesAllOperation.java index b0ec5517..384dc657 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFilesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFilesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageFilesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFilesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFilesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(FileStorageFilesAllRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFilesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFilesDeleteOperation.java index a67bfe2e..073d3877 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFilesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFilesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageFilesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFilesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFilesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageFilesDeleteRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFilesDownloadOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFilesDownloadOperation.java index d7ced49d..4d76d1f9 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFilesDownloadOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFilesDownloadOperation.java @@ -28,6 +28,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -42,18 +44,18 @@ public class FileStorageFilesDownloadOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFilesDownloadOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFilesDownloadRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -78,7 +80,7 @@ public HttpResponse doRequest(FileStorageFilesDownloadRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFilesExportOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFilesExportOperation.java index 56d0f36b..35f987b1 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFilesExportOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFilesExportOperation.java @@ -28,6 +28,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -42,18 +44,18 @@ public class FileStorageFilesExportOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFilesExportOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFilesExportRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -78,7 +80,7 @@ public HttpResponse doRequest(FileStorageFilesExportRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFilesOneOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFilesOneOperation.java index 2f2ead2a..a1134ade 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFilesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFilesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageFilesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFilesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFilesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageFilesOneRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFilesSearchOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFilesSearchOperation.java index f10996e3..ffff640d 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFilesSearchOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFilesSearchOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageFilesSearchOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFilesSearchOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFilesSearchRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(FileStorageFilesSearchRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFilesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFilesUpdateOperation.java index ceb310b9..5f7ddded 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFilesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFilesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageFilesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFilesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFilesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(FileStorageFilesUpdateRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFoldersAddOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFoldersAddOperation.java index ee285be9..ae43a64b 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFoldersAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFoldersAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageFoldersAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFoldersAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFoldersAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(FileStorageFoldersAddRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFoldersCopyOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFoldersCopyOperation.java index 4f55cac9..6b9cf600 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFoldersCopyOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFoldersCopyOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageFoldersCopyOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFoldersCopyOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFoldersCopyRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(FileStorageFoldersCopyRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFoldersDeleteOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFoldersDeleteOperation.java index cf92b640..1a9cf697 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFoldersDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFoldersDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageFoldersDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFoldersDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFoldersDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageFoldersDeleteRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFoldersOneOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFoldersOneOperation.java index 6a163aac..a2c05380 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFoldersOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFoldersOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageFoldersOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFoldersOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFoldersOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageFoldersOneRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageFoldersUpdateOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageFoldersUpdateOperation.java index 6b2f311a..95921512 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageFoldersUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageFoldersUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageFoldersUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageFoldersUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageFoldersUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(FileStorageFoldersUpdateRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksAddOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksAddOperation.java index 41e0928e..05b2406f 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageSharedLinksAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageSharedLinksAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageSharedLinksAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(FileStorageSharedLinksAddRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksAllOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksAllOperation.java index 5682ab1e..661ccc75 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageSharedLinksAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageSharedLinksAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageSharedLinksAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(FileStorageSharedLinksAllRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksDeleteOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksDeleteOperation.java index e76d8caf..5c702239 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageSharedLinksDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageSharedLinksDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageSharedLinksDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageSharedLinksDeleteRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksOneOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksOneOperation.java index a4978a73..a683d6d1 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageSharedLinksOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageSharedLinksOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageSharedLinksOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageSharedLinksOneRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksUpdateOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksUpdateOperation.java index 6dd949b3..14b475bc 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageSharedLinksUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class FileStorageSharedLinksUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageSharedLinksUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageSharedLinksUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(FileStorageSharedLinksUpdateRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsAddOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsAddOperation.java index e6daa32e..9b748627 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -54,13 +56,13 @@ public class FileStorageUploadSessionsAddOperation implements RequestOperation serverURL; - private final Optional options; + private final String serverURL; + private final Options options; public FileStorageUploadSessionsAddOperation( - SDKConfiguration sdkConfiguration, - Optional serverURL, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable String serverURL, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.serverURL = serverURL; this.options = options; @@ -68,9 +70,9 @@ public FileStorageUploadSessionsAddOperation( @Override public HttpResponse doRequest(FileStorageUploadSessionsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); - String baseUrl = serverURL + String baseUrl = Optional.ofNullable(serverURL) .filter(u -> !u.isBlank()) .orElse(Utils.templateUrl( FILE_STORAGE_UPLOAD_SESSIONS_ADD_SERVERS[0], @@ -108,7 +110,7 @@ public HttpResponse doRequest(FileStorageUploadSessionsAddRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsDeleteOperation.java index e58ac264..821450d5 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class FileStorageUploadSessionsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public FileStorageUploadSessionsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(FileStorageUploadSessionsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(FileStorageUploadSessionsDeleteReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsFinishOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsFinishOperation.java index eb135718..79b4df8d 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsFinishOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsFinishOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -54,13 +56,13 @@ public class FileStorageUploadSessionsFinishOperation implements RequestOperatio }; private final SDKConfiguration sdkConfiguration; - private final Optional serverURL; - private final Optional options; + private final String serverURL; + private final Options options; public FileStorageUploadSessionsFinishOperation( - SDKConfiguration sdkConfiguration, - Optional serverURL, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable String serverURL, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.serverURL = serverURL; this.options = options; @@ -68,9 +70,9 @@ public FileStorageUploadSessionsFinishOperation( @Override public HttpResponse doRequest(FileStorageUploadSessionsFinishRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); - String baseUrl = serverURL + String baseUrl = Optional.ofNullable(serverURL) .filter(u -> !u.isBlank()) .orElse(Utils.templateUrl( FILE_STORAGE_UPLOAD_SESSIONS_FINISH_SERVERS[0], @@ -107,7 +109,7 @@ public HttpResponse doRequest(FileStorageUploadSessionsFinishReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsOneOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsOneOperation.java index 2fef6ae0..f34c16f2 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -51,13 +53,13 @@ public class FileStorageUploadSessionsOneOperation implements RequestOperation serverURL; - private final Optional options; + private final String serverURL; + private final Options options; public FileStorageUploadSessionsOneOperation( - SDKConfiguration sdkConfiguration, - Optional serverURL, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable String serverURL, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.serverURL = serverURL; this.options = options; @@ -65,9 +67,9 @@ public FileStorageUploadSessionsOneOperation( @Override public HttpResponse doRequest(FileStorageUploadSessionsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); - String baseUrl = serverURL + String baseUrl = Optional.ofNullable(serverURL) .filter(u -> !u.isBlank()) .orElse(Utils.templateUrl( FILE_STORAGE_UPLOAD_SESSIONS_ONE_SERVERS[0], @@ -94,7 +96,7 @@ public HttpResponse doRequest(FileStorageUploadSessionsOneRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsUploadOperation.java b/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsUploadOperation.java index e664b02e..79fab0b6 100644 --- a/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsUploadOperation.java +++ b/src/main/java/com/apideck/unify/operations/FileStorageUploadSessionsUploadOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -54,13 +56,13 @@ public class FileStorageUploadSessionsUploadOperation implements RequestOperatio }; private final SDKConfiguration sdkConfiguration; - private final Optional serverURL; - private final Optional options; + private final String serverURL; + private final Options options; public FileStorageUploadSessionsUploadOperation( - SDKConfiguration sdkConfiguration, - Optional serverURL, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable String serverURL, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.serverURL = serverURL; this.options = options; @@ -68,9 +70,9 @@ public FileStorageUploadSessionsUploadOperation( @Override public HttpResponse doRequest(FileStorageUploadSessionsUploadRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); - String baseUrl = serverURL + String baseUrl = Optional.ofNullable(serverURL) .filter(u -> !u.isBlank()) .orElse(Utils.templateUrl( FILE_STORAGE_UPLOAD_SESSIONS_UPLOAD_SERVERS[0], @@ -110,7 +112,7 @@ public HttpResponse doRequest(FileStorageUploadSessionsUploadReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisCompaniesAddOperation.java b/src/main/java/com/apideck/unify/operations/HrisCompaniesAddOperation.java index 60fd2bca..ea57779f 100644 --- a/src/main/java/com/apideck/unify/operations/HrisCompaniesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisCompaniesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class HrisCompaniesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisCompaniesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisCompaniesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(HrisCompaniesAddRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisCompaniesAllOperation.java b/src/main/java/com/apideck/unify/operations/HrisCompaniesAllOperation.java index c3b41b76..0d9b37bf 100644 --- a/src/main/java/com/apideck/unify/operations/HrisCompaniesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisCompaniesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisCompaniesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisCompaniesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisCompaniesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(HrisCompaniesAllRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisCompaniesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/HrisCompaniesDeleteOperation.java index 5abb36df..1fbe0201 100644 --- a/src/main/java/com/apideck/unify/operations/HrisCompaniesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisCompaniesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisCompaniesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisCompaniesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisCompaniesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisCompaniesDeleteRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisCompaniesOneOperation.java b/src/main/java/com/apideck/unify/operations/HrisCompaniesOneOperation.java index f2da3dd1..8e0bf740 100644 --- a/src/main/java/com/apideck/unify/operations/HrisCompaniesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisCompaniesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisCompaniesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisCompaniesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisCompaniesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisCompaniesOneRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisCompaniesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/HrisCompaniesUpdateOperation.java index 4193730f..4328f641 100644 --- a/src/main/java/com/apideck/unify/operations/HrisCompaniesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisCompaniesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class HrisCompaniesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisCompaniesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisCompaniesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(HrisCompaniesUpdateRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisDepartmentsAddOperation.java b/src/main/java/com/apideck/unify/operations/HrisDepartmentsAddOperation.java index acb018db..33eda0ec 100644 --- a/src/main/java/com/apideck/unify/operations/HrisDepartmentsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisDepartmentsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class HrisDepartmentsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisDepartmentsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisDepartmentsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(HrisDepartmentsAddRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisDepartmentsAllOperation.java b/src/main/java/com/apideck/unify/operations/HrisDepartmentsAllOperation.java index 6f372211..866b34b7 100644 --- a/src/main/java/com/apideck/unify/operations/HrisDepartmentsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisDepartmentsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisDepartmentsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisDepartmentsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisDepartmentsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(HrisDepartmentsAllRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisDepartmentsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/HrisDepartmentsDeleteOperation.java index 3da1bc79..64fb9eda 100644 --- a/src/main/java/com/apideck/unify/operations/HrisDepartmentsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisDepartmentsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisDepartmentsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisDepartmentsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisDepartmentsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisDepartmentsDeleteRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisDepartmentsOneOperation.java b/src/main/java/com/apideck/unify/operations/HrisDepartmentsOneOperation.java index fae520ac..6f3fecc0 100644 --- a/src/main/java/com/apideck/unify/operations/HrisDepartmentsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisDepartmentsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisDepartmentsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisDepartmentsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisDepartmentsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisDepartmentsOneRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisDepartmentsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/HrisDepartmentsUpdateOperation.java index 3bab0514..2aef83a4 100644 --- a/src/main/java/com/apideck/unify/operations/HrisDepartmentsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisDepartmentsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class HrisDepartmentsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisDepartmentsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisDepartmentsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(HrisDepartmentsUpdateRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisEmployeePayrollsAllOperation.java b/src/main/java/com/apideck/unify/operations/HrisEmployeePayrollsAllOperation.java index 101b131f..f5ed1622 100644 --- a/src/main/java/com/apideck/unify/operations/HrisEmployeePayrollsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisEmployeePayrollsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisEmployeePayrollsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisEmployeePayrollsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisEmployeePayrollsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisEmployeePayrollsAllRequest reques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisEmployeePayrollsOneOperation.java b/src/main/java/com/apideck/unify/operations/HrisEmployeePayrollsOneOperation.java index 83e974f6..0e497cf3 100644 --- a/src/main/java/com/apideck/unify/operations/HrisEmployeePayrollsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisEmployeePayrollsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisEmployeePayrollsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisEmployeePayrollsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisEmployeePayrollsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisEmployeePayrollsOneRequest reques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisEmployeeSchedulesAllOperation.java b/src/main/java/com/apideck/unify/operations/HrisEmployeeSchedulesAllOperation.java index 3556a29d..01792071 100644 --- a/src/main/java/com/apideck/unify/operations/HrisEmployeeSchedulesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisEmployeeSchedulesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisEmployeeSchedulesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisEmployeeSchedulesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisEmployeeSchedulesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisEmployeeSchedulesAllRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisEmployeesAddOperation.java b/src/main/java/com/apideck/unify/operations/HrisEmployeesAddOperation.java index b9436211..6c7fef57 100644 --- a/src/main/java/com/apideck/unify/operations/HrisEmployeesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisEmployeesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class HrisEmployeesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisEmployeesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisEmployeesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(HrisEmployeesAddRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisEmployeesAllOperation.java b/src/main/java/com/apideck/unify/operations/HrisEmployeesAllOperation.java index 90bcc8f7..b0765f6d 100644 --- a/src/main/java/com/apideck/unify/operations/HrisEmployeesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisEmployeesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisEmployeesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisEmployeesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisEmployeesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(HrisEmployeesAllRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisEmployeesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/HrisEmployeesDeleteOperation.java index 576db136..4d87f420 100644 --- a/src/main/java/com/apideck/unify/operations/HrisEmployeesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisEmployeesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisEmployeesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisEmployeesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisEmployeesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisEmployeesDeleteRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisEmployeesOneOperation.java b/src/main/java/com/apideck/unify/operations/HrisEmployeesOneOperation.java index 182309fd..6d9c704f 100644 --- a/src/main/java/com/apideck/unify/operations/HrisEmployeesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisEmployeesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisEmployeesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisEmployeesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisEmployeesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisEmployeesOneRequest request) thro this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisEmployeesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/HrisEmployeesUpdateOperation.java index 7deb3726..adce12f2 100644 --- a/src/main/java/com/apideck/unify/operations/HrisEmployeesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisEmployeesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class HrisEmployeesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisEmployeesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisEmployeesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(HrisEmployeesUpdateRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisPayrollsAllOperation.java b/src/main/java/com/apideck/unify/operations/HrisPayrollsAllOperation.java index ff1fdd5c..d213bf5d 100644 --- a/src/main/java/com/apideck/unify/operations/HrisPayrollsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisPayrollsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisPayrollsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisPayrollsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisPayrollsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(HrisPayrollsAllRequest request) throw this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisPayrollsOneOperation.java b/src/main/java/com/apideck/unify/operations/HrisPayrollsOneOperation.java index 4322b381..70e337df 100644 --- a/src/main/java/com/apideck/unify/operations/HrisPayrollsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisPayrollsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisPayrollsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisPayrollsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisPayrollsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisPayrollsOneRequest request) throw this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsAddOperation.java b/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsAddOperation.java index c32db350..8a83bed1 100644 --- a/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class HrisTimeOffRequestsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisTimeOffRequestsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisTimeOffRequestsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(HrisTimeOffRequestsAddRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsAllOperation.java b/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsAllOperation.java index 8ac23645..7787ba88 100644 --- a/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisTimeOffRequestsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisTimeOffRequestsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisTimeOffRequestsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(HrisTimeOffRequestsAllRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsDeleteOperation.java index 31717e9a..0b45daa6 100644 --- a/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisTimeOffRequestsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisTimeOffRequestsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisTimeOffRequestsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisTimeOffRequestsDeleteRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsOneOperation.java b/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsOneOperation.java index 90b4f859..c67b8492 100644 --- a/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class HrisTimeOffRequestsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisTimeOffRequestsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisTimeOffRequestsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(HrisTimeOffRequestsOneRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsUpdateOperation.java index 1104c7a3..37d28fbe 100644 --- a/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/HrisTimeOffRequestsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class HrisTimeOffRequestsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public HrisTimeOffRequestsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(HrisTimeOffRequestsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(HrisTimeOffRequestsUpdateRequest requ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTagsAllOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTagsAllOperation.java index 8631e5df..f84b0780 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTagsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTagsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionTagsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTagsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTagsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTagsAllRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsAddOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsAddOperation.java index 26a67556..661a1cab 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class IssueTrackingCollectionTicketCommentsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTicketCommentsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTicketCommentsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTicketComments this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsAllOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsAllOperation.java index 3bfceda2..986a5bf8 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionTicketCommentsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTicketCommentsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTicketCommentsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTicketComments this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsDeleteOperation.java index 9791c2e7..92b7d5be 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionTicketCommentsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTicketCommentsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTicketCommentsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTicketComments this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsOneOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsOneOperation.java index 9bfd2b1d..afd1f2b1 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionTicketCommentsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTicketCommentsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTicketCommentsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTicketComments this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsUpdateOperation.java index c51f5a5b..51a88932 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketCommentsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class IssueTrackingCollectionTicketCommentsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTicketCommentsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTicketCommentsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTicketComments this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsAddOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsAddOperation.java index 2a9fd635..ba9bccd8 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class IssueTrackingCollectionTicketsAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTicketsAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTicketsAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTicketsAddRequ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsAllOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsAllOperation.java index d3721acb..573708b2 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionTicketsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTicketsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTicketsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTicketsAllRequ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsDeleteOperation.java index 13ca2b44..b5b9800a 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionTicketsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTicketsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTicketsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTicketsDeleteR this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsOneOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsOneOperation.java index d1ca8f70..d227cebc 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionTicketsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTicketsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTicketsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTicketsOneRequ this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsUpdateOperation.java index c0904d52..e7b63ac4 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionTicketsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class IssueTrackingCollectionTicketsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionTicketsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionTicketsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(IssueTrackingCollectionTicketsUpdateR this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionUsersAllOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionUsersAllOperation.java index 8ef0986c..6899c2e8 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionUsersAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionUsersAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionUsersAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionUsersAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionUsersAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(IssueTrackingCollectionUsersAllReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionUsersOneOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionUsersOneOperation.java index fdca1905..e962eb0d 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionUsersOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionUsersOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionUsersOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionUsersOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionUsersOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(IssueTrackingCollectionUsersOneReques this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionsAllOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionsAllOperation.java index 3ff15a2a..5c7330ec 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(IssueTrackingCollectionsAllRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionsOneOperation.java b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionsOneOperation.java index 85282c45..1d991d1f 100644 --- a/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/IssueTrackingCollectionsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class IssueTrackingCollectionsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public IssueTrackingCollectionsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(IssueTrackingCollectionsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(IssueTrackingCollectionsOneRequest re this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/SmsMessagesAddOperation.java b/src/main/java/com/apideck/unify/operations/SmsMessagesAddOperation.java index 8cc669de..900109ce 100644 --- a/src/main/java/com/apideck/unify/operations/SmsMessagesAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/SmsMessagesAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class SmsMessagesAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public SmsMessagesAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(SmsMessagesAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -93,7 +95,7 @@ public HttpResponse doRequest(SmsMessagesAddRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/SmsMessagesAllOperation.java b/src/main/java/com/apideck/unify/operations/SmsMessagesAllOperation.java index 7eaf4274..f4d31907 100644 --- a/src/main/java/com/apideck/unify/operations/SmsMessagesAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/SmsMessagesAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class SmsMessagesAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public SmsMessagesAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(SmsMessagesAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(SmsMessagesAllRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/SmsMessagesDeleteOperation.java b/src/main/java/com/apideck/unify/operations/SmsMessagesDeleteOperation.java index abd64035..b35bfa5e 100644 --- a/src/main/java/com/apideck/unify/operations/SmsMessagesDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/SmsMessagesDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class SmsMessagesDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public SmsMessagesDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(SmsMessagesDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(SmsMessagesDeleteRequest request) thr this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/SmsMessagesOneOperation.java b/src/main/java/com/apideck/unify/operations/SmsMessagesOneOperation.java index f222b133..954501a3 100644 --- a/src/main/java/com/apideck/unify/operations/SmsMessagesOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/SmsMessagesOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class SmsMessagesOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public SmsMessagesOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(SmsMessagesOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(SmsMessagesOneRequest request) throws this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/SmsMessagesUpdateOperation.java b/src/main/java/com/apideck/unify/operations/SmsMessagesUpdateOperation.java index 2ee57ac6..5268fec2 100644 --- a/src/main/java/com/apideck/unify/operations/SmsMessagesUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/SmsMessagesUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class SmsMessagesUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public SmsMessagesUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(SmsMessagesUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -95,7 +97,7 @@ public HttpResponse doRequest(SmsMessagesUpdateRequest request) thr this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConnectionCustomMappingsAllOperation.java b/src/main/java/com/apideck/unify/operations/VaultConnectionCustomMappingsAllOperation.java index b6ca3c31..de301aa6 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConnectionCustomMappingsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConnectionCustomMappingsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultConnectionCustomMappingsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConnectionCustomMappingsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConnectionCustomMappingsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(VaultConnectionCustomMappingsAllReque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConnectionSettingsAllOperation.java b/src/main/java/com/apideck/unify/operations/VaultConnectionSettingsAllOperation.java index 7ace31b8..c03f45d1 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConnectionSettingsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConnectionSettingsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultConnectionSettingsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConnectionSettingsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConnectionSettingsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -74,7 +76,7 @@ public HttpResponse doRequest(VaultConnectionSettingsAllRequest req this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConnectionSettingsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/VaultConnectionSettingsUpdateOperation.java index b613c783..869fbca6 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConnectionSettingsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConnectionSettingsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class VaultConnectionSettingsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConnectionSettingsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConnectionSettingsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -90,7 +92,7 @@ public HttpResponse doRequest(VaultConnectionSettingsUpdateRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConnectionsAllOperation.java b/src/main/java/com/apideck/unify/operations/VaultConnectionsAllOperation.java index e898c6ca..fb8e820b 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConnectionsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConnectionsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultConnectionsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConnectionsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConnectionsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(VaultConnectionsAllRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConnectionsDeleteOperation.java b/src/main/java/com/apideck/unify/operations/VaultConnectionsDeleteOperation.java index e7bc43c1..ce94cb57 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConnectionsDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConnectionsDeleteOperation.java @@ -28,6 +28,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -42,18 +44,18 @@ public class VaultConnectionsDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConnectionsDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConnectionsDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -73,7 +75,7 @@ public HttpResponse doRequest(VaultConnectionsDeleteRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConnectionsImportOperation.java b/src/main/java/com/apideck/unify/operations/VaultConnectionsImportOperation.java index 2d52b9db..a8c8b278 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConnectionsImportOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConnectionsImportOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class VaultConnectionsImportOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConnectionsImportOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConnectionsImportRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -90,7 +92,7 @@ public HttpResponse doRequest(VaultConnectionsImportRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConnectionsOneOperation.java b/src/main/java/com/apideck/unify/operations/VaultConnectionsOneOperation.java index 42044eef..dae9c21b 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConnectionsOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConnectionsOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultConnectionsOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConnectionsOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConnectionsOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -74,7 +76,7 @@ public HttpResponse doRequest(VaultConnectionsOneRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConnectionsTokenOperation.java b/src/main/java/com/apideck/unify/operations/VaultConnectionsTokenOperation.java index 725cb397..b66b33c9 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConnectionsTokenOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConnectionsTokenOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class VaultConnectionsTokenOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConnectionsTokenOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConnectionsTokenRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -87,7 +89,7 @@ public HttpResponse doRequest(VaultConnectionsTokenRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConnectionsUpdateOperation.java b/src/main/java/com/apideck/unify/operations/VaultConnectionsUpdateOperation.java index 1a83aa1c..b3aed923 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConnectionsUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConnectionsUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class VaultConnectionsUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConnectionsUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConnectionsUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -90,7 +92,7 @@ public HttpResponse doRequest(VaultConnectionsUpdateRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConsumerRequestCountsAllOperation.java b/src/main/java/com/apideck/unify/operations/VaultConsumerRequestCountsAllOperation.java index 37b4ab6c..41183ced 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConsumerRequestCountsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConsumerRequestCountsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultConsumerRequestCountsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConsumerRequestCountsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConsumerRequestCountsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(VaultConsumerRequestCountsAllRequest this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConsumersAddOperation.java b/src/main/java/com/apideck/unify/operations/VaultConsumersAddOperation.java index 2e3bd5ca..13042a8b 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConsumersAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConsumersAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class VaultConsumersAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConsumersAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConsumersAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -88,7 +90,7 @@ public HttpResponse doRequest(VaultConsumersAddRequest request) thr this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConsumersAllOperation.java b/src/main/java/com/apideck/unify/operations/VaultConsumersAllOperation.java index 1221c0f4..a97b58f2 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConsumersAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConsumersAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultConsumersAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConsumersAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConsumersAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(VaultConsumersAllRequest request) thr this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConsumersDeleteOperation.java b/src/main/java/com/apideck/unify/operations/VaultConsumersDeleteOperation.java index fc9b46cf..fdf8d5a9 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConsumersDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConsumersDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultConsumersDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConsumersDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConsumersDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -74,7 +76,7 @@ public HttpResponse doRequest(VaultConsumersDeleteRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConsumersOneOperation.java b/src/main/java/com/apideck/unify/operations/VaultConsumersOneOperation.java index dec93bee..04cfff2b 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConsumersOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConsumersOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultConsumersOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConsumersOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConsumersOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -74,7 +76,7 @@ public HttpResponse doRequest(VaultConsumersOneRequest request) thr this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultConsumersUpdateOperation.java b/src/main/java/com/apideck/unify/operations/VaultConsumersUpdateOperation.java index f7e9922a..518fb26b 100644 --- a/src/main/java/com/apideck/unify/operations/VaultConsumersUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultConsumersUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class VaultConsumersUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultConsumersUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultConsumersUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -90,7 +92,7 @@ public HttpResponse doRequest(VaultConsumersUpdateRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultCreateCallbackStateOperation.java b/src/main/java/com/apideck/unify/operations/VaultCreateCallbackStateOperation.java index 30eb47a1..20afa0d9 100644 --- a/src/main/java/com/apideck/unify/operations/VaultCreateCallbackStateOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultCreateCallbackStateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class VaultCreateCallbackStateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultCreateCallbackStateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultCreateCallbackStateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -90,7 +92,7 @@ public HttpResponse doRequest(VaultCreateCallbackStateRequest reque this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultCustomFieldsAllOperation.java b/src/main/java/com/apideck/unify/operations/VaultCustomFieldsAllOperation.java index 9ba81031..e6ffe6ce 100644 --- a/src/main/java/com/apideck/unify/operations/VaultCustomFieldsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultCustomFieldsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultCustomFieldsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultCustomFieldsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultCustomFieldsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -79,7 +81,7 @@ public HttpResponse doRequest(VaultCustomFieldsAllRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultCustomMappingsAllOperation.java b/src/main/java/com/apideck/unify/operations/VaultCustomMappingsAllOperation.java index bc5db942..8552e987 100644 --- a/src/main/java/com/apideck/unify/operations/VaultCustomMappingsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultCustomMappingsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultCustomMappingsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultCustomMappingsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultCustomMappingsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -74,7 +76,7 @@ public HttpResponse doRequest(VaultCustomMappingsAllRequest request this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultLogsAllOperation.java b/src/main/java/com/apideck/unify/operations/VaultLogsAllOperation.java index 54689928..91bf3d65 100644 --- a/src/main/java/com/apideck/unify/operations/VaultLogsAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultLogsAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class VaultLogsAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultLogsAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultLogsAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(VaultLogsAllRequest request) throws E this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultSessionsCreateOperation.java b/src/main/java/com/apideck/unify/operations/VaultSessionsCreateOperation.java index ee1b51ab..acaff9d8 100644 --- a/src/main/java/com/apideck/unify/operations/VaultSessionsCreateOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultSessionsCreateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class VaultSessionsCreateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultSessionsCreateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultSessionsCreateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -85,7 +87,7 @@ public HttpResponse doRequest(VaultSessionsCreateRequest request) t this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/VaultValidateConnectionStateOperation.java b/src/main/java/com/apideck/unify/operations/VaultValidateConnectionStateOperation.java index 3429028a..aebdcae5 100644 --- a/src/main/java/com/apideck/unify/operations/VaultValidateConnectionStateOperation.java +++ b/src/main/java/com/apideck/unify/operations/VaultValidateConnectionStateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class VaultValidateConnectionStateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public VaultValidateConnectionStateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(VaultValidateConnectionStateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -87,7 +89,7 @@ public HttpResponse doRequest(VaultValidateConnectionStateRequest r this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/WebhookWebhooksAddOperation.java b/src/main/java/com/apideck/unify/operations/WebhookWebhooksAddOperation.java index d98655ea..4008db17 100644 --- a/src/main/java/com/apideck/unify/operations/WebhookWebhooksAddOperation.java +++ b/src/main/java/com/apideck/unify/operations/WebhookWebhooksAddOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class WebhookWebhooksAddOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public WebhookWebhooksAddOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(WebhookWebhooksAddRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -88,7 +90,7 @@ public HttpResponse doRequest(WebhookWebhooksAddRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/WebhookWebhooksAllOperation.java b/src/main/java/com/apideck/unify/operations/WebhookWebhooksAllOperation.java index 770da954..374ad6f8 100644 --- a/src/main/java/com/apideck/unify/operations/WebhookWebhooksAllOperation.java +++ b/src/main/java/com/apideck/unify/operations/WebhookWebhooksAllOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class WebhookWebhooksAllOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public WebhookWebhooksAllOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(WebhookWebhooksAllRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -77,7 +79,7 @@ public HttpResponse doRequest(WebhookWebhooksAllRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/WebhookWebhooksDeleteOperation.java b/src/main/java/com/apideck/unify/operations/WebhookWebhooksDeleteOperation.java index 326d4bf2..e3b9bbc2 100644 --- a/src/main/java/com/apideck/unify/operations/WebhookWebhooksDeleteOperation.java +++ b/src/main/java/com/apideck/unify/operations/WebhookWebhooksDeleteOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class WebhookWebhooksDeleteOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public WebhookWebhooksDeleteOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(WebhookWebhooksDeleteRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -74,7 +76,7 @@ public HttpResponse doRequest(WebhookWebhooksDeleteRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/WebhookWebhooksOneOperation.java b/src/main/java/com/apideck/unify/operations/WebhookWebhooksOneOperation.java index 8dd161cb..4703d220 100644 --- a/src/main/java/com/apideck/unify/operations/WebhookWebhooksOneOperation.java +++ b/src/main/java/com/apideck/unify/operations/WebhookWebhooksOneOperation.java @@ -29,6 +29,8 @@ import com.apideck.unify.utils.RetryConfig; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.String; @@ -43,18 +45,18 @@ public class WebhookWebhooksOneOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public WebhookWebhooksOneOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(WebhookWebhooksOneRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -74,7 +76,7 @@ public HttpResponse doRequest(WebhookWebhooksOneRequest request) th this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder() diff --git a/src/main/java/com/apideck/unify/operations/WebhookWebhooksUpdateOperation.java b/src/main/java/com/apideck/unify/operations/WebhookWebhooksUpdateOperation.java index 8fcabf3f..99afa608 100644 --- a/src/main/java/com/apideck/unify/operations/WebhookWebhooksUpdateOperation.java +++ b/src/main/java/com/apideck/unify/operations/WebhookWebhooksUpdateOperation.java @@ -31,6 +31,8 @@ import com.apideck.unify.utils.Utils.JsonShape; import com.apideck.unify.utils.Utils; import com.fasterxml.jackson.core.type.TypeReference; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import java.io.InputStream; import java.lang.Exception; import java.lang.Object; @@ -46,18 +48,18 @@ public class WebhookWebhooksUpdateOperation implements RequestOperation { private final SDKConfiguration sdkConfiguration; - private final Optional options; + private final Options options; public WebhookWebhooksUpdateOperation( - SDKConfiguration sdkConfiguration, - Optional options) { + @Nonnull SDKConfiguration sdkConfiguration, + @Nullable Options options) { this.sdkConfiguration = sdkConfiguration; this.options = options; } @Override public HttpResponse doRequest(WebhookWebhooksUpdateRequest request) throws Exception { - options + Optional.ofNullable(options) .ifPresent(o -> o.validate(List.of(Options.Option.RETRY_CONFIG))); String baseUrl = this.sdkConfiguration.serverUrl(); String url = Utils.generateURL( @@ -90,7 +92,7 @@ public HttpResponse doRequest(WebhookWebhooksUpdateRequest request) this.sdkConfiguration.securitySource().getSecurity()); HTTPClient client = this.sdkConfiguration.client(); HTTPRequest finalReq = req; - RetryConfig retryConfig = options + RetryConfig retryConfig = Optional.ofNullable(options) .flatMap(Options::retryConfig) .or(this.sdkConfiguration::retryConfig) .orElse(RetryConfig.builder()